/* GuildHub web — styled after the GuildHub reference mockup: a dark stone
   frame with a round faction crest, stone nav buttons (blue when active), a
   parchment content area, dark section header bars with gold titles and red
   buttons. Everything is CSS; icons and dungeon art come from Wowhead's CDN.
   No Blizzard art files are shipped with GuildHub. */

:root {
  --gold: #f5c542;
  --ink: #2b1d0f;
  --ink-soft: #5b4528;
  --name: #1d4fb0;
  --line: rgba(110, 82, 40, 0.45);
  --ok: #2e7d1f;
  --wait: #9a6200;
  --warn: #a31c10;
  --bar-a: #4a95f0;
  --bar-b: #1a56b8;
  --stone-1: #2b2e35;
  --stone-2: #17191d;
  --font: "Friz Quadrata TT", "Friz Quadrata Std", "Palatino Linotype", "Book Antiqua", Palatino, Georgia, serif;
  --noise: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.35  0 0 0 0 0.25  0 0 0 0 0.12  0 0 0 0.55 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  --stone-noise: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.6' numOctaves='4' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.6  0 0 0 0 0.62  0 0 0 0 0.68  0 0 0 0.12 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { background: #07080b; }
body {
  margin: 0; padding: 24px 16px 32px; min-height: 100vh;
  color: var(--ink); font: 15px/1.35 var(--font);
  background:
    radial-gradient(ellipse at 30% 0%, rgba(120, 90, 40, 0.35), transparent 55%),
    radial-gradient(ellipse at 80% 100%, rgba(30, 50, 90, 0.45), transparent 60%),
    #07080b;
}
a { color: inherit; text-decoration: none; }
code { font-family: Consolas, ui-monospace, monospace; font-size: 13px; color: #6b2a0c; }

/* ---- stone frame -------------------------------------------------------- */
.frame {
  position: relative; max-width: 1080px; margin: 52px auto 0; padding: 0 12px 12px;
  background: var(--stone-noise), linear-gradient(180deg, var(--stone-1), var(--stone-2));
  border: 2px solid #050506; border-radius: 10px;
  box-shadow:
    inset 0 0 0 1px #4d515b,
    inset 0 0 0 3px #0c0d10,
    inset 0 0 0 4px rgba(201, 162, 74, 0.35),
    0 20px 60px rgba(0, 0, 0, 0.85);
}
.frame::before, .frame::after { /* corner rivets */
  content: ""; position: absolute; bottom: 6px; width: 10px; height: 10px; border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #c9a24a, #5a4214); box-shadow: 0 0 0 1px #000;
}
.frame::before { left: 6px; } .frame::after { right: 6px; }

.titlebar {
  position: relative; height: 62px; display: flex; align-items: center; justify-content: flex-start;
  margin: 0 -12px; padding: 0 60px 0 142px;
  background: linear-gradient(180deg, #33363e, #1a1c21 60%, #111215);
  border-bottom: 2px solid #050506; border-radius: 8px 8px 0 0;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 1px 0 rgba(201, 162, 74, 0.35);
}
.identity { min-width: 0; line-height: 1.1; }
.titlebar h1 {
  margin: 0; font-size: 26px; font-weight: normal; letter-spacing: 0.3px; color: var(--gold);
  text-shadow: 0 2px 0 #000, 0 0 12px rgba(0, 0, 0, 0.9);
}
.identity .guild { margin-top: 3px; font-size: 15px; color: #f0e8d4; text-shadow: 0 1px 0 #000; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.identity .realm { color: #a59c86; }
.crest {
  position: absolute; left: 8px; top: -34px; width: 112px; height: 112px; border-radius: 50%; z-index: 3;
  border: 4px solid #0b0c0f;
  box-shadow: 0 0 0 3px #c9a24a, 0 0 0 5px #3a2a0c, 0 0 0 7px #0b0c0f, 0 6px 16px rgba(0, 0, 0, 0.9);
  background: #0d1a3a;
}
.close {
  position: absolute; right: 14px; top: 16px; width: 30px; height: 30px; display: grid; place-items: center;
  font: bold 17px Arial, sans-serif; color: #ffd76a; text-shadow: 0 1px 0 #000;
  background: linear-gradient(180deg, #b3241a, #6d0d08); border: 2px solid #c9a24a; border-radius: 4px;
  box-shadow: 0 0 0 1px #000, inset 0 1px 0 rgba(255, 200, 150, 0.4);
}
.close:hover { filter: brightness(1.25); }

.body { display: flex; gap: 12px; padding-top: 12px; min-height: 620px; }

/* ---- stone nav ---------------------------------------------------------- */
.nav {
  flex: 0 0 132px; display: flex; flex-direction: column; gap: 5px; padding: 22px 6px 10px;
  background: linear-gradient(180deg, #121317, #0c0d10); border: 1px solid #000; border-radius: 4px;
  box-shadow: inset 0 0 0 1px #2c2f36;
}
.nav a {
  display: flex; align-items: center; height: 44px; padding: 0 14px; font-size: 15px; color: #e8e2d4;
  text-shadow: 0 1px 0 #000; white-space: nowrap;
  background: var(--stone-noise), linear-gradient(180deg, #3a3d45, #22242a 55%, #1a1b20);
  border: 1px solid #000; border-radius: 3px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14), inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}
.nav a:hover { color: #fff; filter: brightness(1.18); }
.nav a.active {
  color: #fff; background: linear-gradient(180deg, #2c5a9c, #1a3d72 55%, #142f5a);
  border-color: #081631; box-shadow: 0 0 0 1px #5d8fcc, inset 0 1px 0 rgba(255, 255, 255, 0.22), inset 3px 0 0 #ffd76a;
}

/* ---- parchment ---------------------------------------------------------- */
.parchment {
  flex: 1; min-width: 0; display: flex; flex-direction: column; padding: 14px 14px 10px;
  background:
    var(--noise),
    radial-gradient(ellipse at 50% 40%, #e7d4a8 0%, #d8bf8f 55%, #b99a66 100%);
  border: 2px solid #1a120a; border-radius: 3px;
  box-shadow: inset 0 0 0 1px rgba(255, 240, 200, 0.35), inset 0 0 40px rgba(90, 55, 15, 0.55);
}

/* ---- panels: dark header bar + bordered body ---------------------------- */
.panel { min-width: 0; display: flex; flex-direction: column; }
.panel h2 {
  display: flex; align-items: center; gap: 10px; height: 36px; margin: 0; padding: 0 12px 0 6px;
  font-size: 19px; font-weight: normal; color: var(--gold); text-shadow: 0 2px 0 #000; white-space: nowrap; overflow: hidden;
  background: var(--stone-noise), linear-gradient(180deg, #3a2f22, #1d1610 60%, #120d09);
  border: 1px solid #000; border-radius: 4px 4px 0 0;
  box-shadow: inset 0 1px 0 rgba(255, 220, 150, 0.25), inset 0 0 0 1px rgba(201, 162, 74, 0.35);
}
.panel h2 .right { margin-left: auto; font-size: 13px; color: #e6d6ad; text-shadow: 0 1px 0 #000; }
.panel.tertiary h2 { height: 30px; font-size: 16px; }
.panel.tertiary h2 .hicon { width: 20px; height: 20px; }
.panel.tertiary .row { min-height: 40px; }
.panel.tertiary .icon { width: 30px; height: 30px; }
.hicon { width: 24px; height: 24px; border-radius: 3px; border: 1px solid #000; box-shadow: 0 0 0 1px rgba(201, 162, 74, 0.5); }
.pbody {
  flex: 1; padding: 8px 12px 10px; border: 1px solid rgba(80, 55, 20, 0.55); border-top: 0; border-radius: 0 0 4px 4px;
  background: rgba(255, 245, 220, 0.18); box-shadow: inset 0 0 18px rgba(90, 55, 15, 0.18);
}
.empty { color: var(--ink-soft); margin: 10px 2px; line-height: 1.5; font-style: italic; }
.meta, .rel, .later, .hint, .sub { color: var(--ink-soft); font-size: 13px; }
.who { color: var(--name); }
.desc { color: var(--ink); font-size: 14px; margin: 8px 0; }

/* ---- items -------------------------------------------------------------- */
.item { display: inline-flex; align-items: center; gap: 12px; min-width: 0; max-width: 100%; color: var(--ink); }
.item .name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item:hover .name { text-decoration: underline; }
.icon {
  width: 40px; height: 40px; flex: none; border-radius: 4px; border: 1px solid #000;
  box-shadow: 0 0 0 1px #6b5a3a, 0 2px 3px rgba(0, 0, 0, 0.45);
}
/* item quality shows on the icon border; names stay readable on parchment */
.ql2 .icon { box-shadow: 0 0 0 2px #1eb400, 0 2px 3px rgba(0, 0, 0, 0.45); }
.ql3 .icon { box-shadow: 0 0 0 2px #0070dd, 0 2px 3px rgba(0, 0, 0, 0.45); }
.ql4 .icon { box-shadow: 0 0 0 2px #a335ee, 0 2px 3px rgba(0, 0, 0, 0.45); }
.ql5 .icon { box-shadow: 0 0 0 2px #ff8000, 0 2px 3px rgba(0, 0, 0, 0.45); }
.ql2 .name { color: #136b00; } .ql3 .name { color: #0052a3; } .ql4 .name { color: #6d1fa8; } .ql5 .name { color: #a34f00; }

/* ---- status bar (bank solid, pledged lighter) --------------------------- */
.bar {
  position: relative; display: flex; height: 14px; overflow: hidden;
  background: linear-gradient(180deg, #4a4339, #6a6156); border: 1px solid #14100b; border-radius: 2px;
  box-shadow: 0 1px 0 rgba(255, 240, 200, 0.35), inset 0 1px 2px rgba(0, 0, 0, 0.6);
}
.seg { height: 100%; background: linear-gradient(180deg, #8cc2ff 0%, var(--bar-a) 30%, var(--bar-b) 100%); box-shadow: inset -1px 0 0 rgba(0, 0, 0, 0.4); }
.seg.pledge { /* promised, not in the bank: pale and hatched */
  background: repeating-linear-gradient(-45deg, rgba(140, 194, 255, 0.85) 0 4px, rgba(74, 149, 240, 0.35) 4px 8px);
  box-shadow: inset 1px 0 0 rgba(0, 0, 0, 0.5);
}

/* ---- rows --------------------------------------------------------------- */
.row { display: flex; align-items: center; gap: 12px; min-height: 46px; padding: 3px 2px; border-bottom: 1px solid var(--line); }
.row:last-child { border-bottom: 0; }
.row .value { margin-left: auto; white-space: nowrap; font-size: 16px; }
.row .name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
a.row:hover, .inv tbody tr:hover { background: rgba(255, 250, 230, 0.35); }

/* ---- dashboard (reference layout) --------------------------------------- */
.dash {
  display: grid; gap: 12px 14px;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  grid-template-areas: "needs event" "projects projects" "inventory activity";
}
.needs { grid-area: needs; } .event { grid-area: event; } .projects { grid-area: projects; }
.inventory { grid-area: inventory; } .activity { grid-area: activity; }

.need { display: flex; align-items: center; gap: 12px; padding: 6px 2px; border-bottom: 1px solid var(--line); }
.need:last-child { border-bottom: 0; }
.need .value { flex: none; width: 96px; text-align: right; font-size: 16px; white-space: nowrap; }
.need-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 5px; }

.event-card { display: flex; gap: 14px; align-items: flex-start; }
.event-art {
  flex: none; width: 116px; height: 138px; border: 2px solid #1a120a; border-radius: 3px;
  background-color: #2a120a; background-repeat: no-repeat; background-size: 374px 187px; background-position: -70px 0;
  box-shadow: 0 0 0 1px #8a6c3a, 0 3px 6px rgba(0, 0, 0, 0.5);
}
.event-art.icon-art { display: grid; place-items: center; background: #1a1410; }
.event-art.icon-art img { width: 64px; height: 64px; border: 1px solid #000; }
.event-text { min-width: 0; }
.event-title { font-size: 24px; color: var(--ink); line-height: 1.15; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.when { display: flex; align-items: center; gap: 8px; margin-top: 8px; font-size: 16px; }
.micon { width: 18px; height: 18px; border: 1px solid #000; border-radius: 2px; }
.rel { margin: 4px 0 0 26px; }

.scanned { margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--line); color: var(--ink-soft); font-size: 13px; }
.act .icon { width: 34px; height: 34px; }
.act .text { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.act .text a { text-decoration: underline; text-decoration-color: rgba(43, 29, 15, 0.35); }
.act .time { margin-left: auto; color: var(--ink-soft); font-size: 14px; white-space: nowrap; }

.project-row { display: grid; grid-template-columns: 40px minmax(140px, 1fr) minmax(120px, 1.4fr) 64px; gap: 14px; }
.project-row .icon { width: 34px; height: 34px; }
.project-row .value { margin: 0; text-align: right; }

.buttons { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 14px; margin-top: 12px; }

/* ---- projects page ------------------------------------------------------ */
.split { display: grid; grid-template-columns: 290px minmax(0, 1fr); gap: 14px; align-items: start; }
.list .project-row { grid-template-columns: 34px minmax(0, 1fr) auto; gap: 10px; padding-right: 8px; }
.list .project-row .value { padding-left: 16px; }
.project-row.selected { background: linear-gradient(90deg, rgba(44, 90, 156, 0.32), rgba(44, 90, 156, 0.08)); box-shadow: inset 4px 0 0 #ffd76a, inset 0 0 0 1px rgba(44, 90, 156, 0.45); }
.detail .meta { margin: 2px 0 6px; }
.req { padding: 10px 2px; border-bottom: 1px solid var(--line); }
.req:last-child { border-bottom: 0; }
.req-head { display: flex; align-items: center; gap: 12px; }
.req .item { font-size: 17px; }
.req .done { color: var(--ok); font-size: 14px; white-space: nowrap; }
.facts { display: grid; grid-template-columns: max-content max-content; gap: 2px 28px; margin: 6px 0 8px 52px; }
.facts div { display: contents; }
.facts dt { color: var(--ink-soft); }
.facts dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
.facts div[title] dt { text-decoration: underline dotted rgba(91, 69, 40, 0.5); cursor: help; }
.req .bar { margin: 0 0 6px 52px; }
.pledges { margin: 4px 0 0 52px; font-size: 13px; color: var(--ink-soft); }
.detail-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; padding-bottom: 6px; border-bottom: 1px solid var(--line); }
.detail-head .meta { margin: 0; line-height: 1.5; }
.complete-count { font-size: 17px; white-space: nowrap; }

/* ---- inventory page ----------------------------------------------------- */
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; margin: 4px 0 10px; }
.toolbar input, .toolbar select {
  font: inherit; color: #f1e6c8; background: #1d1711; border: 1px solid #000; border-radius: 3px; padding: 5px 10px;
  box-shadow: 0 0 0 1px #8a6c3a, inset 0 1px 3px rgba(0, 0, 0, 0.8);
}
.toolbar input { flex: 1 1 220px; min-width: 0; }
.inv { width: 100%; border-collapse: collapse; table-layout: fixed; }
.inv th { text-align: left; color: var(--ink-soft); font-weight: normal; font-size: 13px; padding: 4px 6px; border-bottom: 2px solid var(--line); }
.inv td { padding: 6px; vertical-align: middle; border-bottom: 1px solid var(--line); overflow: hidden; }
.inv .icon { width: 34px; height: 34px; }
.inv th:nth-child(2), .inv td:nth-child(2) { width: 90px; }
.inv th:nth-child(3), .inv td:nth-child(3) { width: 28%; }
.inv .num { text-align: right; font-size: 16px; }
.inv .sub { margin: 2px 0 0 46px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.source { color: var(--ink-soft); white-space: nowrap; text-overflow: ellipsis; }

/* ---- calendar ----------------------------------------------------------- */
.cal-event { padding: 12px 2px; border-bottom: 1px solid var(--line); }
.cal-event .rel { margin: 0; }
.cal-event .when { font-size: 15px; }

/* ---- red buttons -------------------------------------------------------- */
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-width: 170px; height: 36px; padding: 0 18px;
  font: 16px var(--font); color: #f6e7bd; text-shadow: 0 1px 0 #000; cursor: pointer; white-space: nowrap;
  background: linear-gradient(180deg, #a3271c 0%, #7a140c 45%, #520904 100%);
  border: 1px solid #000; border-radius: 4px;
  box-shadow: 0 0 0 1px #b48a3a, inset 0 1px 0 rgba(255, 200, 150, 0.45), 0 2px 4px rgba(0, 0, 0, 0.6);
}
.button:hover { color: #fff; filter: brightness(1.15); }
.button:active { transform: translateY(1px); }
.button.big { height: 42px; font-size: 17px; }
.button.secondary { background: linear-gradient(180deg, #4a4d55, #2a2c32 55%, #1b1c20); }
.button small { color: #e8d9a8; font-size: 12px; }

/* ---- footer status line ------------------------------------------------- */
.statusbar {
  display: flex; justify-content: space-between; gap: 16px; margin-top: 12px; padding-top: 8px;
  border-top: 1px solid var(--line); font-size: 13px; color: var(--ink-soft);
}
.statusbar span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fresh.fresh { color: var(--ok); } .fresh.aging { color: var(--wait); } .fresh.stale, .fresh.warn { color: var(--warn); }
.fresh-group { display: flex; gap: 16px; min-width: 0; }

.credit { max-width: 1080px; margin: 12px auto 0; color: #6a6a6a; font: 11px/1.4 Arial, sans-serif; text-align: center; }
.credit a { text-decoration: underline; }
.demo-banner {
  max-width: 1080px; margin: 0 auto; padding: 6px 12px; text-align: center; font-size: 14px; color: #2b1d0f;
  background: linear-gradient(180deg, #f3dc9c, #d6b46a); border: 1px solid #000; border-radius: 4px;
  box-shadow: 0 0 0 1px #8a6c3a;
}
.demo-banner a { text-decoration: underline; }

/* ---- landing ------------------------------------------------------------ */
.landing { max-width: 780px; }
.landing .titlebar { padding-left: 142px; }
.landing-body { display: grid; gap: 14px; margin-top: 12px; padding-top: 22px; }
.landing p { margin: 8px 0; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 16px 0 6px; }
.steps { margin: 6px 0; padding-left: 22px; }
.steps li { margin: 4px 0; }
.error { color: var(--warn); border-left: 3px solid var(--warn); padding: 6px 10px; background: rgba(163, 28, 16, 0.08); margin: 0; }

/* ---- narrow screens ----------------------------------------------------- */
@media (max-width: 860px) {
  body { padding: 12px 16px 24px; }
  .frame { margin-top: 40px; padding: 0 8px 8px; }
  .titlebar { margin: 0 -8px; padding: 0 50px 0 84px; height: 54px; }
  .titlebar h1 { font-size: 21px; }
  .identity .guild { font-size: 13px; }
  .crest { width: 72px; height: 72px; top: -26px; left: 4px; }
  .close { top: 8px; }
  .body { flex-direction: column; }
  .nav { flex: none; min-width: 0; flex-direction: row; overflow-x: auto; padding: 6px; }
  .nav a { flex: 1 0 auto; height: 40px; font-size: 14px; justify-content: center; }
  .dash { grid-template-columns: minmax(0, 1fr); grid-template-areas: "needs" "event" "projects" "inventory" "activity"; }
  .split { grid-template-columns: minmax(0, 1fr); }
  .facts, .req .bar, .pledges { margin-left: 0; }
  .project-row { grid-template-columns: 34px minmax(0, 1fr) 64px; }
  .project-row .bar { grid-column: 2 / 4; grid-row: 2; }
  .inv th:nth-child(3), .inv td:nth-child(3) { display: none; }
  .button { min-width: 0; }
}

/* ---- guild bank (inventory page): 14 x 7 slots, tabs on the right ------- */
.bank { display: grid; grid-template-columns: minmax(0, 1fr) 132px; gap: 12px; align-items: start; }
.vault {
  background: var(--stone-noise), linear-gradient(180deg, #2a2119, #1a140f);
  border-color: #000; box-shadow: inset 0 0 0 1px rgba(201, 162, 74, 0.35), inset 0 0 30px rgba(0, 0, 0, 0.8);
  padding: 14px;
}
.slots { display: grid; grid-template-columns: repeat(14, minmax(0, 1fr)); gap: 5px; }
.slot {
  position: relative; aspect-ratio: 1; display: block; border-radius: 3px;
  background: radial-gradient(circle at 50% 40%, #2c2a27, #0d0c0b);
  border: 1px solid #000; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.07), 0 1px 0 rgba(201, 162, 74, 0.15);
}
.slot img { position: absolute; inset: 1px; width: calc(100% - 2px); height: calc(100% - 2px); border-radius: 2px; }
.slot:hover { box-shadow: 0 0 0 2px #ffd76a, 0 0 8px rgba(255, 215, 106, 0.6); z-index: 1; }
.slot.ql2 { box-shadow: inset 0 0 0 2px #1eb400; } .slot.ql3 { box-shadow: inset 0 0 0 2px #0070dd; }
.slot.ql4 { box-shadow: inset 0 0 0 2px #a335ee; } .slot.ql5 { box-shadow: inset 0 0 0 2px #ff8000; }
.slot.ql2 img, .slot.ql3 img, .slot.ql4 img, .slot.ql5 img { inset: 2px; width: calc(100% - 4px); height: calc(100% - 4px); }
.slot .count {
  position: absolute; right: 3px; bottom: 1px; font: bold 12px/1 Arial, sans-serif; color: #fff;
  text-shadow: -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000;
}
.vault-note { color: #b9a77e; margin: 10px 0 0; }
.bank-tabs { display: flex; flex-direction: column; gap: 8px; }
.bank-tab {
  display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 4px; text-align: center;
  font-size: 13px; color: #e8e2d4; text-shadow: 0 1px 0 #000;
  background: var(--stone-noise), linear-gradient(180deg, #3a3d45, #22242a 55%, #1a1b20);
  border: 1px solid #000; border-radius: 4px; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14);
}
.bank-tab img { width: 40px; height: 40px; border: 1px solid #000; border-radius: 4px; box-shadow: 0 0 0 1px #6b5a3a; }
.bank-tab span { max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bank-tab:hover { filter: brightness(1.18); }
.bank-tab.active { background: linear-gradient(180deg, #3c78d0, #1d4d9c 55%, #163d7e); box-shadow: 0 0 0 1px #8fc3ff, 0 0 10px rgba(80, 160, 255, 0.5); color: #fff; }
@media (max-width: 860px) {
  .bank { grid-template-columns: minmax(0, 1fr); }
  .bank-tabs { flex-direction: row; overflow-x: auto; order: -1; }
  .bank-tab { flex: 0 0 88px; }
  .slots { grid-template-columns: repeat(7, minmax(0, 1fr)); }
}

/* ---- calendar: month grid like the in-game calendar + event detail ------ */
.cal { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 14px; align-items: start; }
.cal-side { display: grid; gap: 12px; min-width: 0; }
.cal-nav { display: flex; gap: 6px; }
.mini {
  display: inline-grid; place-items: center; min-width: 30px; height: 24px; padding: 0 8px; font-size: 13px; color: #f6e7bd;
  background: linear-gradient(180deg, #a3271c, #520904); border: 1px solid #000; border-radius: 3px; box-shadow: 0 0 0 1px #b48a3a;
}
.mini:hover { filter: brightness(1.2); }
.grid-body { padding: 8px; background: var(--stone-noise), linear-gradient(180deg, #2a2119, #1a140f); border-color: #000; }
.weekdays, .month { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 3px; }
.weekdays span { text-align: center; color: var(--gold); font-size: 13px; padding: 2px 0 6px; text-shadow: 0 1px 0 #000; }
.day {
  min-height: 92px; padding: 3px; display: flex; flex-direction: column; gap: 3px; min-width: 0;
  background: linear-gradient(180deg, #3b3226, #2a231a); border: 1px solid #000; border-radius: 2px;
  box-shadow: inset 0 1px 0 rgba(255, 230, 170, 0.12);
}
.day .num { color: #e6d6ad; font-size: 13px; text-shadow: 0 1px 0 #000; }
.day.other { opacity: 0.4; }
.day.past:not(.today) { filter: grayscale(0.6) brightness(0.8); }
.day.today { box-shadow: 0 0 0 2px #ffd76a, inset 0 0 12px rgba(255, 215, 106, 0.3); }
.day.today .num { color: #ffd76a; font-weight: bold; }
.chip {
  display: flex; align-items: center; gap: 4px; min-width: 0; padding: 2px; border-radius: 2px; font-size: 11px; color: #fff;
  background: rgba(0, 0, 0, 0.55); border: 1px solid rgba(201, 162, 74, 0.5); text-shadow: 0 1px 0 #000;
}
.chip:hover, .chip.selected { border-color: #ffd76a; background: rgba(60, 120, 208, 0.55); }
.chip-art {
  flex: none; width: 22px; height: 22px; border-radius: 2px; border: 1px solid #000;
  background-repeat: no-repeat; background-size: 72px 36px; background-position: -14px 0;
}
.chip-art.big { width: 40px; height: 40px; background-size: 130px 65px; background-position: -26px 0; }
.chip { align-items: flex-start; }
.chip-text { min-width: 0; line-height: 1.2; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow-wrap: anywhere; }
.chip-text b { display: block; color: #ffd76a; font-weight: normal; }
.event-banner {
  height: 120px; margin: 0 -4px 10px; border: 2px solid #1a120a; border-radius: 3px;
  background-repeat: no-repeat; background-size: 470px 235px; background-position: -10px -10px;
  box-shadow: 0 0 0 1px #8a6c3a;
}
.cal-side .event-title { font-size: 21px; }
.up-row .name small { color: var(--ink-soft); font-size: 12px; }
.up-row .value { font-size: 12px; margin-left: auto; }
@media (max-width: 860px) {
  .cal { grid-template-columns: minmax(0, 1fr); }
  .day { min-height: 56px; }
  .chip-text { display: none; }
}

/* ======================================================================
   Sprite skin: the GuildHub asset sheet (docs/design/assets.png, cut by
   tools/slice-assets.py into static/ui/). Pieces are 9-slice border
   images, so frames stretch to any size and keep their corners. This
   layer overrides the CSS-drawn look above.
   ====================================================================== */

.frame {
  padding: 0 4px 4px; border: 26px solid transparent; border-top-width: 18px; border-radius: 0;
  border-image: url("ui/panel-dark.png") 40 fill / 26px 26px 26px 26px stretch;
  background: none; box-shadow: 0 24px 60px rgba(0, 0, 0, 0.85);
}
.frame::before, .frame::after { background: url("ui/rivet.png") center / contain no-repeat; box-shadow: none; width: 14px; height: 14px; bottom: -18px; }
.frame::before { left: -18px; } .frame::after { right: -18px; }

.titlebar {
  margin: 0 0 4px; height: 70px; border: 0; border-radius: 0; box-shadow: none; padding-top: 2px;
  border-image: url("ui/title-bar.png") 16 fill / 12px stretch; background: none;
}
.crest { left: -30px; top: -46px; width: 128px; height: 146px; border: 0; border-radius: 0; box-shadow: none; background: none; filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.85)); }
.crest.ringed { width: 128px; height: 131px; padding: 22px; border-radius: 0; background: url("ui/ring.png") center / 100% 100% no-repeat; object-fit: cover; clip-path: none; }
.close {
  top: 16px; right: 12px; width: 38px; height: 36px; border: 0; box-shadow: none; color: transparent; text-shadow: none;
  background: url("ui/close.png") center / 100% 100% no-repeat;
}

.nav { padding-top: 76px; border: 0; box-shadow: none; background: rgba(0, 0, 0, 0.35); border-radius: 0; }
.nav a, .bank-tab {
  border: 9px solid transparent; border-radius: 0; box-shadow: none; background: none;
  border-image: url("ui/nav.png") 14 fill / 9px stretch;
}
.nav a { height: 46px; padding: 0 6px; }
.nav a:hover, .bank-tab:hover { border-image-source: url("ui/nav-hover.png"); filter: none; }
.nav a.active, .bank-tab.active { border-image: url("ui/nav-active.png") 16 fill / 10px stretch; box-shadow: none; background: none; }

.parchment {
  position: relative; border: 22px solid transparent; border-radius: 0; box-shadow: none; background: none;
  border-image: url("ui/parchment.png") 40 fill / 22px stretch; padding: 4px 4px 2px;
}
.parchment::before { /* gold corner ornaments */
  content: ""; position: absolute; inset: -16px; pointer-events: none; z-index: 2;
  background:
    url("ui/corner-tl.png") top left / 34px auto no-repeat,
    url("ui/corner-tr.png") top right / 34px auto no-repeat,
    url("ui/corner-bl.png") bottom left / 34px auto no-repeat,
    url("ui/corner-br.png") bottom right / 34px auto no-repeat;
}

.panel h2 {
  position: relative; height: 42px; padding: 0 14px 0 54px; border: 0; border-radius: 0; box-shadow: none; background: none;
  border-image: url("ui/header.png") 12 14 12 58 fill / 10px 12px 10px 48px stretch;
}
.panel h2 .hicon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 26px; height: 26px; border: 0; box-shadow: none; }
.panel.tertiary h2 { height: 36px; padding-left: 48px; border-image-width: 8px 10px 8px 42px; }
.panel.tertiary h2 .hicon { left: 10px; width: 22px; height: 22px; }
.pbody {
  border: 14px solid transparent; border-radius: 0; box-shadow: none; background: none; padding: 0 2px;
  border-image: url("ui/parchment-box.png") 24 fill / 14px stretch;
}

.bar {
  height: 18px; border: 4px solid transparent; border-radius: 0; box-shadow: none; background: none;
  border-image: url("ui/bar-track.png") 8 fill / 4px stretch;
}
.seg { background: url("ui/bar-blue.png") 0 0 / 100% 100% no-repeat; box-shadow: none; }
.seg.pledge { background: url("ui/bar-blue-hatch.png") 0 0 / auto 100% repeat-x; opacity: 0.75; box-shadow: none; }

.button, .mini {
  border: 8px solid transparent; border-radius: 0; box-shadow: none; background: none;
  border-image: url("ui/button.png") 14 fill / 8px stretch; color: #f8e9c0;
}
.button { height: 40px; }
.mini { height: 28px; border-width: 6px; border-image-width: 6px; padding: 0 6px; }
.button:hover, .mini:hover { border-image-source: url("ui/button-hover.png"); filter: none; }
.button:active, .mini:active { border-image-source: url("ui/button-down.png"); }
.button.secondary { border-image-source: url("ui/nav.png"); }

.slot { border: 0; border-radius: 0; box-shadow: none; background: url("ui/slot.png") center / 100% 100% no-repeat; }
.slot img { inset: 14%; width: 72%; height: 72%; }
.slot.ql2, .slot.ql3, .slot.ql4, .slot.ql5 { box-shadow: none; }
.slot.ql2 img, .slot.ql3 img, .slot.ql4 img, .slot.ql5 img { inset: 14%; width: 72%; height: 72%; }
.slot.ql2 img { box-shadow: 0 0 0 2px #1eb400; } .slot.ql3 img { box-shadow: 0 0 0 2px #0070dd; }
.slot.ql4 img { box-shadow: 0 0 0 2px #a335ee; } .slot.ql5 img { box-shadow: 0 0 0 2px #ff8000; }

.vault, .grid-body {
  border: 18px solid transparent; border-radius: 0; box-shadow: none; background: none;
  border-image: url("ui/panel-dark.png") 40 fill / 18px stretch;
}

.statusbar { border-top: 0; padding-top: 16px; background: url("ui/divider.png") top center / 100% 14px no-repeat; }
.row, .need, .req, .cal-event { border-bottom-color: rgba(110, 82, 40, 0.35); }

@media (max-width: 860px) {
  .frame { border-width: 14px; border-image-width: 16px; }
  .crest { left: -14px; top: -30px; width: 84px; height: 96px; }
  .crest.ringed { width: 84px; height: 86px; padding: 14px; }
  .titlebar { padding-left: 80px; }
  .nav { padding-top: 6px; }
  .nav a { height: 42px; }
  .parchment { border-width: 14px; border-image-width: 14px; }
}
