@font-face {
  font-family: "Paladins Gradient";
  src: url("assets/fonts/paladins-gradient.ttf") format("truetype");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "Paladins 3D";
  src: url("assets/fonts/paladins-3d.ttf") format("truetype");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "Press Start 2P";
  src: url("assets/fonts/press-start-2p.ttf") format("truetype");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "Kenney Future Square";
  src: url("assets/fonts/kenney-future-square.ttf") format("truetype");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "Hemi Head Bold Italic";
  src: url("assets/fonts/hemi-head-bold-italic.otf") format("opentype");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

:root {
  --surface: #131313;
  --surface-low: #1c1b1b;
  --surface-mid: #201f1f;
  --surface-high: #2a2a2a;
  --vellum: #dfd7c8;
  --vellum-bright: #efe8db;
  --bone: #8c8273;
  --outline: #4d4639;
  --gold: #c9a75d;
  --gold-bright: #e6c275;
  --crimson: #7a2d2d;
  --verdigris: #2e4a42;
  --surface-rgb: 19, 19, 19;
  --surface-low-rgb: 28, 27, 27;
  --texture-line: rgba(201, 167, 93, 0.025);
  --texture-line-soft: rgba(201, 167, 93, 0.018);
  --sidebar-hatch: rgba(255, 255, 255, 0.012);
  --ambient-accent: rgba(201, 167, 93, 0.07);
  --panel-fill: rgba(28, 27, 27, 0.9);
  --card-fill: rgba(28, 27, 27, 0.8);
  --header-fill: rgba(19, 19, 19, 0.96);
  --text-soft: #aaa193;
  --text-muted: #948b7d;
  --text-faint: #736b60;
  --shadow: rgba(0, 0, 0, 0.36);
  --active-wash: rgba(201, 167, 93, 0.08);
  --hover-wash: rgba(201, 167, 93, 0.055);
  --inner-rule: rgba(140, 130, 115, 0.16);
  --display: "Uncial Antiqua", "Palatino Linotype", Georgia, serif;
  --label: Cinzel, "Times New Roman", serif;
  --body: Bahnschrift, "Arial Narrow", Arial, sans-serif;
  --pixel: "Press Start 2P", "Courier New", monospace;
  --heading-one: "Paladins Gradient", "Uncial Antiqua", Georgia, serif;
  --heading-two: "Hemi Head Bold Italic", Bahnschrift, Arial, sans-serif;
  --card-radius: 8px;
  --control-radius: 6px;
}

:root[data-theme="light"] {
  color-scheme: light;
  --surface: #eee5d6;
  --surface-low: #e3dbce;
  --surface-mid: #d8d1c5;
  --surface-high: #c8c0b4;
  --vellum: #2f2d29;
  --vellum-bright: #242321;
  --bone: #635e52;
  --outline: #4a4741;
  --gold: #856b35;
  --gold-bright: #6c5428;
  --crimson: #985047;
  --verdigris: #385d53;
  --surface-rgb: 238, 229, 214;
  --surface-low-rgb: 227, 219, 206;
  --texture-line: rgba(74, 71, 65, 0.055);
  --texture-line-soft: rgba(74, 71, 65, 0.035);
  --sidebar-hatch: rgba(74, 71, 65, 0.045);
  --ambient-accent: rgba(133, 107, 53, 0.08);
  --panel-fill: rgba(216, 209, 197, 0.95);
  --card-fill: rgba(216, 209, 197, 0.95);
  --header-fill: rgba(238, 229, 214, 0.98);
  --text-soft: #4e4a43;
  --text-muted: #635e52;
  --text-faint: #81796d;
  --shadow: rgba(36, 35, 33, 0.26);
  --active-wash: rgba(133, 107, 53, 0.14);
  --hover-wash: rgba(133, 107, 53, 0.09);
  --inner-rule: rgba(74, 71, 65, 0.3);
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: var(--surface);
  color: var(--vellum);
}

body {
  font-family: var(--body);
  background-image: radial-gradient(circle at 78% 18%, var(--ambient-accent), transparent 28%);
}

button,
a {
  color: inherit;
}

button {
  font: inherit;
}

button:focus-visible,
a:focus-visible {
  outline: 2px solid var(--gold-bright);
  outline-offset: 3px;
}

.site-shell {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template: 78px minmax(0, 1fr) / 244px minmax(0, 1fr);
  width: 100vw;
  height: 100dvh;
  min-height: 560px;
}

.masthead {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 244px minmax(0, 1fr) auto;
  align-items: center;
  border-bottom: 1px solid var(--outline);
  background: var(--header-fill);
  position: relative;
}

.masthead::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: -4px;
  left: 244px;
  border-bottom: 1px dotted rgba(201, 167, 93, 0.45);
}

.site-title {
  grid-column: 1 / -1;
  justify-self: center;
  margin: 0;
  color: var(--vellum-bright);
  font-size: clamp(48px, 5vw, 66px);
  line-height: 0.92;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.brand {
  align-self: stretch;
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 0 22px;
  border-right: 1px solid var(--outline);
  text-decoration: none;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 35px;
  height: 35px;
  border: 1px solid var(--gold);
  outline: 1px solid rgba(201, 167, 93, 0.5);
  outline-offset: 3px;
  color: var(--gold-bright);
  font-family: var(--display);
  font-size: 20px;
  transform: rotate(45deg);
}

.brand-mark i {
  display: block;
  font-style: normal;
  transform: rotate(-45deg);
}

.brand > span:last-child {
  display: grid;
  gap: 1px;
}

.brand strong {
  color: var(--vellum-bright);
  font: 20px/1 var(--display);
  letter-spacing: 0.04em;
}

.brand small,
.workspace-switcher small,
.brief-action small {
  color: var(--bone);
  font: 600 9px/1.2 var(--label);
  letter-spacing: 0.17em;
  text-transform: uppercase;
}

.masthead-context {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 28px;
}

.context-rule {
  width: 36px;
  height: 3px;
  border-top: 1px solid var(--outline);
  border-bottom: 1px solid var(--outline);
}

.context-label,
.eyebrow,
.metric-label {
  color: var(--bone);
  font: 700 10px/1.4 var(--label);
  letter-spacing: 0.17em;
  text-transform: uppercase;
}

.masthead-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-right: 26px;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-width: 88px;
  justify-content: center;
}

.theme-icon {
  color: var(--gold-bright);
  font: 16px/1 Georgia, serif;
}

.button {
  min-height: 34px;
  padding: 0 16px;
  border: 1px solid var(--bone);
  border-radius: 0;
  background: transparent;
  color: var(--vellum);
  cursor: pointer;
  font: 700 10px/1 var(--label);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  transition: 140ms ease;
}

.button:hover {
  border-color: var(--gold);
  color: var(--gold-bright);
}

.button-primary {
  border-color: var(--gold);
  outline: 1px solid var(--gold);
  outline-offset: 2px;
  background: var(--gold);
  color: #201800;
}

:root[data-theme="light"] .button-primary {
  border-color: #23211e;
  outline-color: #23211e;
  background: #23211e;
  color: #ece6db;
}

:root[data-theme="light"] .button-primary:hover {
  border-color: var(--gold);
  background: var(--gold);
  color: #fff8ef;
}

.button-primary:hover {
  background: transparent;
  color: var(--gold-bright);
}

.sidebar {
  min-height: 0;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--outline);
  background:
    repeating-linear-gradient(135deg, transparent 0 7px, var(--sidebar-hatch) 7px 8px),
    var(--surface-low);
  padding: 25px 15px 16px;
}

.folio-index {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 0 8px 18px;
  border-bottom: 3px double var(--outline);
  color: var(--bone);
  font: 700 10px/1 var(--label);
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.folio-index strong {
  color: var(--gold);
  font-size: 12px;
}

.nav-list {
  display: grid;
  gap: 5px;
  padding-top: 18px;
}

.nav-item {
  display: grid;
  grid-template-columns: 18px 1fr auto;
  align-items: center;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 0;
  background: transparent;
  color: var(--text-soft);
  cursor: pointer;
  text-align: left;
  font: 700 11px/1 var(--label);
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.nav-item small {
  color: var(--text-faint);
  font: 700 9px/1 var(--label);
}

.nav-item:hover {
  color: var(--vellum-bright);
  border-color: var(--outline);
}

.nav-item.is-active {
  border-color: var(--gold);
  background: var(--active-wash);
  box-shadow: inset 3px 0 var(--gold);
  color: var(--gold-bright);
}

.nav-item.is-active small {
  color: var(--gold);
}

.nav-sigil {
  color: var(--gold);
  font-size: 8px;
}

.sidebar-note {
  margin: auto 8px 20px;
  padding: 17px 0 17px;
  border-top: 3px double var(--outline);
  border-bottom: 1px dotted var(--outline);
}

.sidebar-note strong {
  display: block;
  margin-top: 7px;
  color: var(--vellum-bright);
  font: 600 13px/1.3 var(--label);
  letter-spacing: 0.04em;
}

.sidebar-note p {
  margin: 8px 0 0;
  color: var(--text-soft);
  font-size: 14px;
  line-height: 1.35;
}

.workspace-switcher {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 12px;
  border: 1px solid var(--outline);
  border-radius: var(--card-radius);
  background: var(--surface);
  color: var(--vellum);
  cursor: pointer;
  text-align: left;
}

.workspace-switcher > span:nth-child(2) {
  display: grid;
  gap: 3px;
}

.workspace-switcher strong {
  font: 600 12px/1.2 var(--label);
  letter-spacing: 0.04em;
}

.status-seal {
  width: 9px;
  height: 9px;
  background: var(--verdigris);
  outline: 1px solid #78958c;
  outline-offset: 2px;
  transform: rotate(45deg);
}

.workspace {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: clamp(14px, 2.2vh, 24px);
  padding: clamp(22px, 3vw, 40px);
  overflow: hidden;
}

.workspace-empty {
  display: block;
}

.workspace-cards {
  display: flex;
  align-items: flex-start;
  gap: clamp(16px, 2vw, 26px);
  flex-wrap: wrap;
}

.glyph-background {
  position: fixed;
  z-index: 0;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.glyph-controls {
  width: min(230px, 100%);
  margin: 0;
  padding: 16px;
  color: #302e2a;
}

.glyph-controls__heading {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr;
  align-items: center;
  gap: 9px;
  min-height: 56px;
  margin: -8px -8px 16px;
  padding: 0 12px;
}

.glyph-controls h2 {
  margin: 0;
  color: #251b19;
  font: 400 15px/1.1 var(--heading-two);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.glyph-controls p {
  margin: 0 0 16px;
  color: #5f5a51;
  font: 7px/1.75 var(--pixel);
}

.glyph-controls__intro {
  position: relative;
  z-index: 1;
}

.glyph-field {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 7px;
}

.glyph-field > span {
  color: #5f5a51;
  font: 400 7px/1 var(--pixel);
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.glyph-field select {
  width: 100%;
  min-height: 38px;
  padding: 0 34px 0 11px;
  border: 1px solid rgba(74, 71, 65, 0.72);
  border-radius: var(--control-radius);
  background: rgba(238, 229, 214, 0.58);
  color: #302e2a;
  font: 400 7px/1 var(--pixel);
  letter-spacing: 0.025em;
}

.glyph-shuffle {
  position: relative;
  z-index: 1;
  width: 100%;
  min-height: 36px;
  margin-top: 10px;
  border: 1px solid rgba(74, 71, 65, 0.75);
  border-radius: var(--control-radius);
  background: rgba(133, 107, 53, 0.11);
  color: #44391f;
  cursor: pointer;
  font: 400 7px/1 var(--pixel);
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.glyph-shuffle:hover {
  border-color: var(--gold);
  background: rgba(140, 109, 40, 0.15);
}

.encounter-card {
  width: min(640px, 100%);
  padding: 16px;
}

.encounter-card__title {
  display: flex;
  min-height: 56px;
  align-items: center;
  margin: -8px -8px 16px;
  padding: 0 18px;
  border-color: rgba(58, 35, 32, 0.88);
  background:
    radial-gradient(ellipse at 28% 12%, rgba(229, 174, 158, 0.18) 0%, transparent 52%),
    linear-gradient(105deg, #a65c51 0%, #985047 48%, #824139 100%);
  box-shadow:
    inset 0 1px rgba(239, 199, 184, 0.22),
    inset 0 -3px rgba(67, 35, 31, 0.08),
    2px 3px 0 rgba(58, 48, 43, 0.22);
}

.encounter-card__title h2 {
  margin: 0;
  color: #251a18;
  font: 400 clamp(18px, 2vw, 25px)/1 var(--heading-two);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.encounter-card__body {
  position: relative;
  z-index: 1;
  padding: 4px 6px 6px;
}

.encounter-card__meta {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 13px;
  padding-bottom: 9px;
  border-bottom: 1px solid rgba(74, 71, 65, 0.55);
  color: #625b50;
  font: 400 7px/1.5 var(--pixel);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.encounter-card__body p {
  margin: 0;
  color: #302e2a;
  font: 16px/1.55 var(--body);
}

.page-heading {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 24px;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 5px;
  color: var(--vellum-bright);
  font: 400 clamp(28px, 3.1vw, 42px)/1.05 var(--heading-one);
  letter-spacing: 0.025em;
}

h2 {
  font-family: var(--heading-two);
  font-weight: 400;
}

.page-heading p {
  margin-bottom: 0;
  color: var(--text-soft);
  font-size: clamp(14px, 1.2vw, 17px);
  line-height: 1.4;
}

.view-tools {
  display: flex;
  gap: 6px;
}

.icon-button {
  width: 36px;
  height: 34px;
  border: 1px solid var(--outline);
  border-radius: 0;
  background: var(--surface-low);
  color: var(--bone);
  cursor: pointer;
}

.icon-button:hover,
.icon-button.is-selected {
  border-color: var(--gold);
  color: var(--gold-bright);
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.metric-card {
  position: relative;
  min-width: 0;
  padding: 15px 17px;
  border: 1px solid var(--outline);
  border-radius: var(--card-radius);
  background: var(--card-fill);
}

.metric-card::before,
.panel::before {
  content: "";
  position: absolute;
  top: 3px;
  right: 3px;
  bottom: 3px;
  left: 3px;
  border: 1px solid var(--inner-rule);
  border-radius: calc(var(--card-radius) - 3px);
  pointer-events: none;
}

.metric-card::after {
  content: "◆";
  position: absolute;
  top: 14px;
  right: 14px;
  color: var(--text-faint);
  font-size: 7px;
}

.metric-gold { border-top-color: var(--gold); }
.metric-gold::after { color: var(--gold); }
.metric-green { border-top-color: #66867d; }
.metric-green::after { color: #66867d; }
.metric-quiet { border-top-color: var(--crimson); }
.metric-quiet::after { color: #a15050; }

.metric-value {
  margin: 7px 0 1px;
  color: var(--vellum-bright);
  font: 700 clamp(24px, 2.5vw, 34px)/1 var(--label);
  letter-spacing: 0.02em;
}

.metric-card p {
  overflow: hidden;
  margin-bottom: 0;
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.trend { color: var(--gold-bright); }

.content-grid {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(520px, 2fr) minmax(260px, 0.85fr);
  gap: 14px;
}

.panel {
  position: relative;
  min-width: 0;
  min-height: 0;
  border: 2px solid var(--bone);
  border-radius: var(--card-radius);
  background: var(--panel-fill);
  box-shadow: 5px 5px 0 var(--shadow);
}

.panel-header {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 72px;
  padding: 15px 20px;
  border-bottom: 3px double var(--outline);
}

.panel h2 {
  margin: 3px 0 0;
  color: var(--vellum-bright);
  font: 400 clamp(18px, 1.7vw, 23px)/1.1 var(--heading-two);
  letter-spacing: 0.025em;
}

.text-button {
  border: 0;
  background: transparent;
  color: var(--gold);
  cursor: pointer;
  font: 700 10px/1 var(--label);
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.project-list {
  position: relative;
  z-index: 1;
  display: grid;
  height: calc(100% - 72px);
  grid-template-rows: 30px repeat(3, minmax(58px, 1fr));
  padding: 0 18px 13px;
}

.project-row {
  display: grid;
  grid-template-columns: minmax(190px, 1.45fr) minmax(130px, 1fr) minmax(100px, 0.8fr) minmax(120px, 1fr);
  align-items: center;
  gap: 12px;
  width: 100%;
  border: 0;
  border-bottom: 1px solid var(--outline);
  border-radius: 0;
  background: transparent;
  color: inherit;
  text-align: left;
}

button.project-row {
  cursor: pointer;
}

button.project-row:hover {
  background: var(--hover-wash);
}

.project-row-head {
  color: var(--bone);
  font: 700 9px/1 var(--label);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.project-name {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.project-name i {
  color: var(--gold);
  font: normal 700 9px/1 var(--label);
  letter-spacing: 0.12em;
}

.project-name strong {
  overflow: hidden;
  color: var(--vellum-bright);
  font: 600 13px/1.2 var(--label);
  letter-spacing: 0.03em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.owner {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  color: var(--text-soft);
  font-size: 13px;
}

.owner b {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 27px;
  height: 27px;
  border: 1px solid var(--outline);
  color: var(--vellum);
  font: 700 8px/1 var(--label);
}

.owner span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status-chip {
  display: inline-flex;
  min-height: 23px;
  align-items: center;
  padding: 0 8px;
  border: 1px solid var(--gold);
  color: var(--gold-bright);
  font: 700 8px/1 var(--label);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.status-green { border-color: #66867d; color: #aecdc3; }
.status-red { border-color: var(--crimson); color: #e6a29e; }

.progress-cell {
  display: grid;
  grid-template-columns: 1fr 30px;
  align-items: center;
  gap: 8px;
}

.progress-cell > span {
  height: 5px;
  border: 1px solid var(--outline);
  background: var(--surface);
}

.progress-cell i {
  display: block;
  width: var(--progress);
  height: 100%;
  background: var(--gold);
}

.progress-cell b {
  color: var(--bone);
  font: 700 9px/1 var(--label);
}

.briefing-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
}

.folio-number {
  color: var(--gold);
  font: 700 15px/1 var(--label);
}

.brief-list {
  position: relative;
  z-index: 1;
  display: grid;
  align-content: stretch;
  grid-template-rows: repeat(3, minmax(55px, 1fr));
  min-height: 0;
  padding: 3px 18px;
}

.brief-item {
  display: grid;
  grid-template-columns: 58px 1fr;
  align-items: center;
  gap: 10px;
  border-bottom: 1px dotted var(--outline);
}

.brief-item time {
  color: var(--gold);
  font: 700 9px/1.2 var(--label);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.brief-item div {
  min-width: 0;
}

.brief-item strong {
  display: block;
  overflow: hidden;
  color: var(--vellum-bright);
  font: 600 11px/1.3 var(--label);
  letter-spacing: 0.025em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brief-item p {
  overflow: hidden;
  margin: 4px 0 0;
  color: var(--text-muted);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brief-action {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 58px;
  margin: 12px 18px 17px;
  padding: 10px 13px;
  border: 1px solid var(--gold);
  border-radius: var(--card-radius);
  background: var(--active-wash);
  color: var(--gold-bright);
  cursor: pointer;
  text-align: left;
}

.brief-action > span:first-child {
  display: grid;
  gap: 5px;
}

.brief-action strong {
  color: var(--vellum-bright);
  font: 600 12px/1 var(--label);
}

@media (max-width: 980px) {
  .site-shell {
    grid-template-columns: 184px minmax(0, 1fr);
  }

  .masthead {
    grid-template-columns: 184px minmax(0, 1fr) auto;
  }

  .masthead::after { left: 184px; }
  .brand { padding: 0 14px; }
  .brand small { display: none; }
  .masthead-context { display: none; }
  .masthead-actions { grid-column: 3; }
  .metric-card { padding: 13px; }
  .metric-card p { display: none; }
  .content-grid { grid-template-columns: minmax(460px, 1.6fr) minmax(230px, 0.8fr); }
  .project-row { grid-template-columns: minmax(160px, 1.3fr) minmax(100px, 0.8fr) 92px minmax(94px, 0.8fr); }
  .owner b { display: none; }
}

@media (max-width: 760px) {
  .site-shell {
    min-height: 520px;
    grid-template: 64px 58px minmax(0, 1fr) / 1fr;
  }

  .masthead {
    grid-row: 1;
    grid-template-columns: 1fr auto;
  }

  .masthead::after { left: 0; }
  .site-title { font-size: 50px; }
  .brand { border-right: 0; }
  .brand-mark { width: 28px; height: 28px; font-size: 16px; }
  .masthead-actions { grid-column: 2; padding-right: 14px; }
  .button-ghost { display: none; }
  .theme-toggle { min-width: 34px; width: 34px; padding: 0; }
  .theme-label { display: none; }
  .button { min-height: 30px; padding: 0 11px; font-size: 8px; }

  .sidebar {
    grid-row: 2;
    flex-direction: row;
    align-items: stretch;
    padding: 6px 10px;
    border-right: 0;
    border-bottom: 1px solid var(--outline);
  }

  .folio-index,
  .sidebar-note,
  .workspace-switcher { display: none; }
  .glyph-controls {
    display: grid;
    width: min(230px, 100%);
    grid-template-columns: 1fr;
    align-items: stretch;
    gap: 7px;
    margin: 0;
    padding: 12px;
    border-radius: var(--card-radius);
  }
  .glyph-controls__heading { display: grid; margin: -5px -5px 5px; }
  .glyph-field { gap: 6px; }
  .glyph-field > span { display: block; }
  .glyph-field select { min-height: 34px; }
  .glyph-shuffle { width: 100%; min-height: 34px; margin: 0; padding: 0 12px; }
  .nav-list { width: 100%; grid-template-columns: repeat(4, 1fr); gap: 3px; padding: 0; }
  .nav-item { grid-template-columns: 12px 1fr; min-height: 44px; padding: 0 7px; font-size: 8px; letter-spacing: 0.05em; }
  .nav-item small { display: none; }

  .workspace {
    grid-row: 3;
    gap: 10px;
    padding: 14px;
  }

  .page-heading p,
  .view-tools { display: none; }
  h1 { margin: 2px 0 0; font-size: 25px; }
  .metric-grid { grid-template-columns: repeat(4, 1fr); gap: 5px; }
  .metric-card { padding: 9px; }
  .metric-label { font-size: 7px; letter-spacing: 0.08em; }
  .metric-value { font-size: 20px; }
  .content-grid { grid-template-columns: 1fr; }
  .briefing-panel { display: none; }
  .project-row { grid-template-columns: minmax(150px, 1.4fr) minmax(95px, 0.8fr) 88px; }
  .project-row > :last-child { display: none; }
}

@media (max-width: 480px) {
  .brand strong { font-size: 17px; }
  .nav-sigil { display: none; }
  .nav-item { display: flex; justify-content: center; }
  .metric-grid { grid-template-columns: repeat(3, 1fr); }
  .metric-card:last-child { display: none; }
  .project-list { padding-inline: 10px; }
  .project-row { grid-template-columns: minmax(130px, 1.4fr) 88px; }
  .project-row > :nth-child(2) { display: none; }
}

@media (max-height: 700px) and (min-width: 761px) {
  .site-shell { grid-template-rows: 68px minmax(0, 1fr); }
  .workspace { gap: 11px; padding-block: 17px; }
  .sidebar { padding-top: 18px; }
  .sidebar-note { display: none; }
  .metric-card { padding-block: 10px; }
  .metric-value { margin-top: 3px; font-size: 24px; }
  .metric-card p { display: none; }
  .panel-header { min-height: 62px; padding-block: 10px; }
  .project-list { height: calc(100% - 62px); }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; }
}

/* Affinity component studies -------------------------------------------------
   Web-native recreations of card.svg and red_card_title.svg. The texture is a
   self-contained SVG noise field, so these components need no image assets. */

.fx-card {
  --card-noise-opacity: 0.075;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  border: 1px solid rgba(74, 71, 65, 0.78);
  border-radius: var(--card-radius);
  background:
    radial-gradient(ellipse at 34% 28%, rgba(255, 250, 239, 0.22) 0%, rgba(255, 250, 239, 0.06) 40%, transparent 68%),
    linear-gradient(105deg, #ddd7cd 0%, #d8d1c5 48%, #cec7bb 100%);
  box-shadow:
    inset 0 1px rgba(255, 250, 239, 0.42),
    inset 0 -3px rgba(74, 71, 65, 0.06),
    3px 4px 0 rgba(55, 52, 47, 0.24),
    0 8px 16px rgba(55, 52, 47, 0.1);
}

.fx-card::after,
.fx-card__title::after {
  content: "";
  position: absolute;
  z-index: 0;
  inset: 0;
  border-radius: inherit;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160' viewBox='0 0 160 160'%3E%3Cfilter id='n' x='0' y='0' width='100%25' height='100%25'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.72' numOctaves='3' seed='17' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.42'/%3E%3C/svg%3E");
  background-repeat: repeat;
  mix-blend-mode: multiply;
  opacity: var(--card-noise-opacity);
  pointer-events: none;
}

.fx-card > *,
.fx-card__title > * {
  position: relative;
  z-index: 1;
}

.fx-card__title {
  --card-noise-opacity: 0.09;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  min-height: clamp(52px, 5.2vw, 74px);
  padding: 0 clamp(20px, 2.3vw, 34px);
  border: 1px solid rgba(58, 35, 32, 0.82);
  border-radius: var(--card-radius);
  background:
    radial-gradient(ellipse at 32% 22%, rgba(229, 174, 158, 0.18) 0%, transparent 58%),
    linear-gradient(103deg, #a65c51 0%, #985047 48%, #824139 100%);
  box-shadow:
    inset 0 1px rgba(239, 199, 184, 0.22),
    inset 0 -3px rgba(67, 35, 31, 0.08),
    2px 3px 0 rgba(58, 48, 43, 0.22);
}
