/* =========================================================================
   GILDED. Carson, 26 November 2026, after three mockups of the Room and four
   more pages: "I like it. It makes it more royal duke vibes too. Lets go with
   gilded." The approved mockups are linked in
   Dukes Picks/design-gilded-2026-11-26.md.

   Looks only. Every word, button and order stays as it was. The colours are
   in theme.css; this file adds the finishes:
     - engraved double hairlines on the cards, the top bar and the menu edge
     - brushed gold foil on the one main button, Duke's ring, level badges,
       the tab underline and today's date, and nowhere else
     - the chosen option of a switch is a cream pill with an engraved outline,
       not a gold fill, so the foil stays special
     - fine gold line icons in the menu, italic serif for fine print
   Carson, same day: upgrades and downgrades stay green and red, a richer
   green and red.

   Loaded last. Every rule starts :root:root so it outranks the light-mode
   overrides written as :root:not([data-theme="dark"]) .thing.
   ========================================================================= */

/* ---- the frame ---------------------------------------------------------- */
:root:root .sidebar { border-right: 3px double var(--hair); }
:root:root .sidebar-head { border-bottom: 3px double var(--hair); }
:root:root .tool-view > .tool-head { border-bottom: 3px double var(--hair-2); }
:root:root .tool-head-top { border-bottom: 3px double var(--hair); }
:root:root .sidebar-brand .eyebrow {
  background: var(--foil-text); -webkit-background-clip: text; background-clip: text; color: transparent;
}
:root:root .hsearch-field {
  background: var(--bg-raised); border-color: var(--hair);
  box-shadow: inset 0 0 0 2px var(--bg-raised), inset 0 0 0 3px var(--hair-2);
}

/* the menu */
:root:root .tool-link[aria-current="true"],
:root:root .acct-menu-item[aria-current="true"] {
  background: var(--bg-raised); color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--hair), 0 2px 8px -3px rgba(110, 80, 20, 0.2);
}
:root:root .tool-link[aria-current="true"]::after,
:root:root .acct-menu-item[aria-current="true"]::after {
  content: ''; flex: none; margin-left: auto; width: 7px; height: 7px; transform: rotate(45deg);
  background: var(--foil); box-shadow: 0 0 0 1px rgba(120, 88, 24, 0.3);
}
:root:root .app.collapsed .tool-link[aria-current="true"]::after { display: none; }
:root:root .tool-link[aria-current="true"] .ch-new { display: none; }
:root:root .door-icon, :root:root .tool-link > svg, :root:root .door-section > svg { color: var(--accent); }
:root:root .door-icon .ch-icon { display: block; margin: 0 auto; }
:root:root .door-group-name { color: var(--accent); }

/* the page tabs: a foil underline under the one you are in */
:root:root .door[aria-current="true"] {
  color: var(--ink); border-bottom-color: transparent;
  background: var(--foil-line) no-repeat 50% 100% / calc(100% - 24px) 2px;
}
:root:root .door[aria-current="true"] > svg { color: var(--accent); }

/* the phone's tab bar */
@media (max-width: 860px) {
  :root:root .tabbar { background: var(--bg-deep); border-top: 3px double var(--hair); box-shadow: 0 -10px 30px -20px rgba(80, 60, 20, 0.3); }
  :root:root .tabbar-tab[aria-current="true"] { color: var(--ink); font-weight: 600; }
  :root:root .tabbar-tab[aria-current="true"] > svg { color: var(--accent); }
  :root:root .tabbar-tab[aria-current="true"]::before {
    content: ''; position: absolute; top: 0; left: 50%; width: 18px; height: 2px; margin-left: -9px; border-radius: 2px; background: var(--foil-line);
  }
}

/* ---- cards: an outer gold hairline and a faint second one inside it ----- */
:root:root :is(.r-card, .h-widget, .ln-card, .acct-card, .acct-list, .bl-card, .s-box, .u-section, .sc-day, .sc-cal, .login-card, .b-extras) {
  border-color: var(--hair);
  box-shadow: inset 0 0 0 3px var(--bg-raised), inset 0 0 0 4px var(--hair-2), var(--lift-1);
}
:root:root .r-post, :root:root .r-profile, :root:root .ck-card {
  box-shadow: inset 0 0 0 3px var(--bg-raised), inset 0 0 0 4px var(--hair-on-2), var(--lift-2);
}
@media (hover: hover) { :root:root .r-post:hover { border-color: var(--hair-on); } }

/* headings carry a soft engraved edge */
:root:root :is(.r-top h2, .ln-h, .acct-title, .h-widget-title, .ln-ctitle, .ck-title, .r-post-title, .r-profile-name, .acct-blocked-title, .tool-head-name) {
  text-shadow: var(--engrave);
}

/* small labels: a tiny gold diamond before them */
:root:root :is(.w-block-tag, .ck-eyebrow, .ck-flag, .ln-eyebrow)::before {
  content: ''; display: inline-block; width: 4px; height: 4px; margin: 0 7px 0 1px; vertical-align: 0.16em;
  transform: rotate(45deg); background: currentColor; opacity: 0.75;
}
:root:root :is(.ck-eyebrow, .ln-eyebrow) { color: var(--accent); }

/* fine print in small italic serif */
:root:root :is(.ck-foot, .n-intro, .r-bio-hint) {
  font-family: var(--display); font-style: italic; font-weight: 400; color: var(--muted);
}
:root:root .ck-foot { font-size: 13.5px; }
:root:root .n-intro { font-size: 14px; }

/* ---- switches: the chosen option is a cream pill with an engraved edge -- */
:root:root :is(.t-seg, .ln-tabs, .r-who, .appearance, .u-tabs, .u-windows, .sc-seg, .admin-switch):not(.seg-none):not([hidden]) {
  background: var(--seg-track); border-color: transparent; box-shadow: inset 0 1px 2px rgba(80, 60, 20, 0.1);
}
:root:root :is(.t-seg, .ln-tabs, .r-who, .appearance, .u-tabs, .u-windows, .sc-seg, .admin-switch):not(.seg-none) > :is(button, a):is([aria-pressed="true"], [aria-current="true"], .is-on, .u-tab--on, .u-window--on):not([hidden]),
:root:root :is(.who-chip.on, .t-legbar-btn[aria-pressed="true"], .o-race[aria-current="true"], .ln-pill.is-on, .r-chip[aria-current="true"]) {
  background: var(--bg-raised); color: var(--ink); border-color: transparent;
  box-shadow: inset 0 0 0 1px var(--hair-on), inset 0 0 0 3px var(--bg-raised), inset 0 0 0 4px var(--hair-2), 0 1px 3px rgba(80, 60, 20, 0.14);
}
:root:root .r-chip { background: var(--bg-raised); border-color: var(--hair); color: var(--ink-2); }
:root:root .r-chip .ch-icon { color: var(--accent); flex: none; }

/* ---- buttons ------------------------------------------------------------- */
/* The main button: brushed foil. */
:root:root :where(.t-btn--primary, .btn--accent, .r-btn:not(.r-btn--line):not(.r-btn--quiet):not(.r-btn--danger), .ln-btn:not(.ln-btn--quiet):not(.ln-btn--line):not(.ln-btn--danger), .bl-btn--gold, .sure-yes, .r-new, .r-new-side) {
  background: var(--foil); color: var(--foil-ink); border-color: transparent; letter-spacing: 0.02em;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5), inset 0 -1px 0 rgba(90, 60, 10, 0.3), 0 0 0 1px rgba(120, 88, 24, 0.45), 0 8px 18px -8px rgba(140, 100, 30, 0.55);
}
@media (hover: hover) {
  :root:root :where(.t-btn--primary, .btn--accent, .r-btn:not(.r-btn--line):not(.r-btn--quiet):not(.r-btn--danger), .ln-btn:not(.ln-btn--quiet):not(.ln-btn--line):not(.ln-btn--danger), .bl-btn--gold, .sure-yes):hover:not([disabled]) {
    background: var(--foil); color: var(--foil-ink); filter: brightness(1.06);
  }
}
/* The second gold button in the welcome card goes espresso, so the two never fight. */
:root:root .ck-mail-on.t-btn--primary {
  background: var(--espresso); color: var(--espresso-ink);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 0 0 1px var(--espresso-edge), 0 6px 14px -8px rgba(42, 31, 18, 0.7);
}
@media (hover: hover) { :root:root .ck-mail-on.t-btn--primary:hover { background: var(--espresso); color: var(--espresso-ink); filter: brightness(1.12); } }
/* Quiet buttons: cream with a gold hairline. */
:root:root .t-btn:not(.t-btn--primary) { background: var(--bg-raised); border-color: var(--hair-on); color: var(--ink); }
:root:root .r-btn--line, :root:root .ln-btn--quiet { background: var(--bg-raised); border: 1px solid var(--hair-on); color: var(--ink); }
:root:root .r-rd-btn {
  background: var(--bg-raised); color: var(--ink); box-shadow: inset 0 0 0 1px var(--hair-on), var(--lift-0);
}
:root:root .r-rd-btn > svg { color: var(--accent); }
:root:root .h-showmore { background: var(--bg-raised); border: 1px solid var(--hair-on); color: var(--ink); }

/* ---- people -------------------------------------------------------------- */
/* Duke and the team: espresso inside a foil ring. Members: a soft gold ring. */
:root:root .r-av {
  border: 2px solid transparent; box-sizing: border-box;
  background: linear-gradient(var(--av-fill), var(--av-fill)) padding-box, var(--av-ring) border-box;
  color: var(--av-ink);
}
:root:root .r-av:is(.r-av--duke, .r-av--admin) {
  background: linear-gradient(var(--espresso), var(--espresso)) padding-box, var(--foil) border-box;
  color: var(--espresso-ink);
}
:root:root .r-av-lvl { background: var(--foil); color: var(--foil-ink); border-color: var(--bg-raised); }
:root:root .r-profile > .r-av { border-width: 3px; }
:root:root .r-lb-level-pill {
  background: var(--bg-raised); color: var(--accent-soft); border-color: transparent; border-radius: 999px;
  box-shadow: inset 0 0 0 1px var(--hair-on), inset 0 0 0 3px var(--bg-raised), inset 0 0 0 4px var(--hair-2);
}
:root:root .r-lb-level-pill::before {
  content: ''; width: 5px; height: 5px; transform: rotate(45deg); background: var(--foil); flex: none;
}
:root:root .r-here-strip { background: var(--bg-raised); border-color: var(--hair); }

/* ---- the welcome card ---------------------------------------------------- */
:root:root .ck-card { background: var(--bg-raised); border-color: var(--hair); padding: 20px 22px 16px; }
:root:root .ck-bar { height: 3px; background: var(--seg-track); box-shadow: inset 0 1px 1px rgba(80, 60, 20, 0.1); }
:root:root .ck-bar-fill { background: var(--foil-line); min-width: 6px; }
:root:root .ck-tick { border-color: var(--hair-on); box-shadow: inset 0 0 0 3px var(--bg-raised), inset 0 0 0 4px var(--hair-2); }
:root:root .ck-item.is-done .ck-tick { background: var(--foil); border-color: transparent; box-shadow: none; }
:root:root .ck-item.ck-item--star {
  position: relative; background: var(--plate); box-shadow: inset 0 0 0 1px var(--hair-2);
}
:root:root .ck-item.ck-item--star::before {
  content: ''; position: absolute; left: 0; top: 12px; bottom: 12px; width: 2px; border-radius: 2px; background: var(--foil);
}
:root:root .ck-item.ck-item--star .ck-tick { box-shadow: inset 0 0 0 3px var(--plate), inset 0 0 0 4px var(--hair-2); }

/* ---- Duke's Notes -------------------------------------------------------- */
/* Green and red stay green and red (Carson, 26 Nov 2026), in a richer shade. */
:root:root :is(.mk-sym--big_up, .mk-sym--up, .mk-count--up) { color: var(--up); }
:root:root :is(.mk-sym--big_down, .mk-sym--down, .mk-count--down) { color: var(--down); }
:root:root .mk-pill--up { color: var(--up); border-color: rgba(var(--up-rgb), 0.6); background: rgba(var(--up-rgb), 0.08); }
:root:root .mk-pill--down { color: var(--down); border-color: rgba(var(--down-rgb), 0.6); background: rgba(var(--down-rgb), 0.08); }
:root:root .mk-pill--big_up {
  color: #fff; border-color: transparent;
  background: linear-gradient(180deg, var(--up-hi), var(--up-fill));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22), 0 1px 2px rgba(10, 60, 35, 0.3);
}
:root:root .mk-pill--big_down {
  color: #fff; border-color: transparent;
  background: linear-gradient(180deg, var(--down-hi), var(--down-fill));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(70, 12, 16, 0.3);
}
/* An empty day reads as a resting card, not a stray line. */
:root:root .n-quiet {
  display: flex; align-items: center; gap: 14px; padding: 16px 18px; border-radius: var(--radius);
  background: var(--bg-raised); border: 1px solid var(--hair);
  box-shadow: inset 0 0 0 3px var(--bg-raised), inset 0 0 0 4px var(--hair-2), var(--lift-0);
  color: var(--ink-2); line-height: 1.5;
}
:root:root .n-quiet::before {
  content: ''; flex: none; width: 38px; height: 38px; border-radius: 50%;
  background: var(--accent);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 38 38'%3E%3Ccircle cx='19' cy='19' r='18.5' fill='none' stroke='%23000' stroke-width='1'/%3E%3Ccircle cx='19' cy='19' r='15.5' fill='none' stroke='%23000' stroke-width='.6' opacity='.5'/%3E%3Cpath d='M19 11.5l2.2 4.6 5 .6-3.7 3.4 1 5-4.5-2.5-4.5 2.5 1-5-3.7-3.4 5-.6z' fill='none' stroke='%23000' stroke-width='1.3' stroke-linejoin='round'/%3E%3C/svg%3E") center / 100% no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 38 38'%3E%3Ccircle cx='19' cy='19' r='18.5' fill='none' stroke='%23000' stroke-width='1'/%3E%3Ccircle cx='19' cy='19' r='15.5' fill='none' stroke='%23000' stroke-width='.6' opacity='.5'/%3E%3Cpath d='M19 11.5l2.2 4.6 5 .6-3.7 3.4 1 5-4.5-2.5-4.5 2.5 1-5-3.7-3.4 5-.6z' fill='none' stroke='%23000' stroke-width='1.3' stroke-linejoin='round'/%3E%3C/svg%3E") center / 100% no-repeat;
}

/* ---- the Room ------------------------------------------------------------ */
:root:root .r-top h2 .ch-icon { width: 24px; height: 24px; margin: 0 10px 0 0; vertical-align: -3px; color: var(--accent); }
/* All Posts' line: a hairline with a diamond, then the line in italic serif. */
:root:root .r-top > div > p:not(.r-eyebrow) {
  font-family: var(--display); font-style: italic; font-size: 14px; color: var(--muted);
}
:root:root .r-top > div > h2 + p:not(.r-eyebrow)::before {
  content: ''; display: block; width: 150px; height: 9px; margin: 10px 0 8px; background: var(--foil);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 150 9'%3E%3Cpath d='M0 4.5h66M84 4.5h66' stroke='%23000' stroke-width='1' opacity='.55'/%3E%3Cpath d='M75 1l3.5 3.5L75 8l-3.5-3.5z'/%3E%3C/svg%3E") left center / 150px 9px no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 150 9'%3E%3Cpath d='M0 4.5h66M84 4.5h66' stroke='%23000' stroke-width='1' opacity='.55'/%3E%3Cpath d='M75 1l3.5 3.5L75 8l-3.5-3.5z'/%3E%3C/svg%3E") left center / 150px 9px no-repeat;
}
:root:root .r-compose-open { background: var(--bg-input); border-color: var(--hair-2); }
:root:root .r-posted-in a { color: var(--accent-soft); }
:root:root .r-foot { border-top-color: var(--line-soft); }
:root:root .r-act > svg { color: var(--muted); }
:root:root .h-customize:hover { color: var(--ink); }

/* ---- Learn and Schedule -------------------------------------------------- */
/* Course covers matted like framed prints, a fine gold line inside each. */
:root:root .ln-course { padding: 8px 8px 0; }
:root:root .ln-course .ln-cover { border-radius: 6px; }
:root:root .ln-course .ln-cover-img { outline: 1px solid rgba(242, 224, 168, 0.55); outline-offset: -7px; }
:root:root .ln-bar { height: 3px; background: var(--seg-track); }
:root:root .ln-bar > span { background: var(--foil-line); }
:root:root .ln-dow { font-size: 10.5px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--muted); }
:root:root .ln-calgrid { border-top: 3px double var(--line-soft); }
:root:root .ln-day.is-today { background: rgba(var(--accent-rgb), 0.07); }
:root:root .ln-day.is-today .ln-dn {
  background: var(--foil); color: var(--foil-ink);
  box-shadow: 0 0 0 1px rgba(120, 88, 24, 0.4), 0 3px 8px -3px rgba(140, 100, 30, 0.6);
}
:root:root .ln-key--live, :root:root .ln-key--big { background: var(--foil); }
:root:root .ln-key--zoom { background: var(--vc); }
:root:root .ln-ev--zoom { background: var(--vc-bg); border-left-color: var(--vc); }
@media (max-width: 860px) { :root:root .ln-ev--zoom { background: var(--vc); } }

/* Schedule's day list sits in its own card beside the month. */
:root:root .sc-split > .sc-list {
  padding: 18px 20px; background: var(--bg-raised); border: 1px solid var(--hair); border-radius: var(--radius);
  box-shadow: inset 0 0 0 3px var(--bg-raised), inset 0 0 0 4px var(--hair-2), var(--lift-0);
}
:root:root .sc-list-title { text-shadow: var(--engrave); }

/* ---- tokens only this file reads ----------------------------------------- */
:root {
  --foil-text: linear-gradient(115deg, #b8954f 0%, #e9d29e 40%, #f6e8c2 50%, #c9a457 70%, #a8822f 100%);
  --hair-on-2: rgba(212, 175, 111, 0.14);
  --seg-track: #120e09;
  --ink-2: #cbbda2;
  --av-fill: #2a2318; --av-ink: #e5d6b6; --av-ring: linear-gradient(150deg, #6d5d3e, #3a3020);
  --espresso-edge: rgba(212, 175, 111, 0.5);
  --up-rgb: 69, 196, 131; --down-rgb: 227, 98, 95;
  --up-hi: #26996a; --down-hi: #c23d45;
  --vc: #7f9cc0; --vc-bg: rgba(127, 156, 192, 0.16);
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --foil-text: linear-gradient(115deg, #6f5219 0%, #a8822f 30%, #cfae62 48%, #8d6a24 70%, #6f5219 100%);
    --hair-on-2: rgba(160, 122, 46, 0.16);
    --seg-track: #efe5d0;
    --ink-2: #514330;
    --av-fill: #f3ebda; --av-ink: #5a4a30; --av-ring: linear-gradient(150deg, #e7dcc4, #b9a47a);
    --espresso-edge: rgba(42, 31, 18, 0.9);
    --up-rgb: 20, 121, 74; --down-rgb: 168, 38, 46;
    --up-hi: #1a8a57; --down-hi: #bb333c;
    --vc: #4f6d8f; --vc-bg: #e6ecf2;
  }
}
:root[data-theme="light"] {
  --foil-text: linear-gradient(115deg, #6f5219 0%, #a8822f 30%, #cfae62 48%, #8d6a24 70%, #6f5219 100%);
  --hair-on-2: rgba(160, 122, 46, 0.16);
  --seg-track: #efe5d0;
  --ink-2: #514330;
  --av-fill: #f3ebda; --av-ink: #5a4a30; --av-ring: linear-gradient(150deg, #e7dcc4, #b9a47a);
  --espresso-edge: rgba(42, 31, 18, 0.9);
  --up-rgb: 20, 121, 74; --down-rgb: 168, 38, 46;
  --up-hi: #1a8a57; --down-hi: #bb333c;
  --vc: #4f6d8f; --vc-bg: #e6ecf2;
}
