/*
  Sekhema's Sandbox — Sandstone UI Skin
  Version 103

  The existing Obsidian skin remains as a structural compatibility layer.
  This file replaces its visual materials with vector nine-slice sandstone,
  a 2048px seamless grain texture, static carved ornament, and no moving particle assets.
*/

body.theme-sandstone,
.theme-sandstone {
  color-scheme: dark;
  --bg:#090706;
  --panel:#211812;
  --panel-2:#15100c;
  --line:rgba(181,132,73,.34);
  --line-soft:rgba(35,25,18,.86);
  --text:#f5ead6;
  --muted:#d0b994;
  --gold:#e0b66f;
  --gold-2:#f1d293;
  --shadow:0 18px 48px rgba(26,13,5,.46);

  --obsidian-black:#070605;
  --obsidian-panel:rgba(28,20,15,.98);
  --obsidian-panel-soft:rgba(38,27,20,.96);
  --obsidian-gold:#d4a860;
  --obsidian-gold-bright:#f1d599;
  --obsidian-gold-dim:rgba(110,66,34,.42);
  --obsidian-line:rgba(235,202,146,.34);
  --obsidian-shadow:0 24px 68px rgba(27,14,6,.54);
  --obsidian-texture:url("assets/ui/sandstone/sandstone-texture.webp");
  --obsidian-panel-art:url("assets/ui/sandstone/sandstone-texture.webp");
  --obsidian-modal-art:url("assets/ui/sandstone/sandstone-texture.webp");
  --obsidian-button-art:url("assets/ui/sandstone/ornate-weathered-button.svg");
  --obsidian-button-hover-art:url("assets/ui/sandstone/ornate-weathered-button.svg");
  --obsidian-divider-art:url("assets/ui/sandstone/ornate-weathered-divider.svg");
  --obsidian-banner-art:url("assets/ui/sandstone/sandstone-texture.webp");
  --obsidian-header-frame-hires:url("assets/ui/sandstone/ornate-weathered-header.svg");
  --obsidian-item-frame-hires:url("assets/ui/sandstone/ornate-weathered-frame.svg");
  --obsidian-currency-frame-hires:url("assets/ui/sandstone/ornate-weathered-frame.svg");
  --obsidian-secondary-frame-hires:url("assets/ui/sandstone/ornate-weathered-frame.svg");
  --obsidian-well-frame-hires:url("assets/ui/sandstone/ornate-weathered-frame.svg");
}

body.theme-sandstone {
  position:relative;
  isolation:isolate;
  background-color:#090706;
  background-image:
    radial-gradient(circle at 50% -15%, rgba(201,147,78,.18), transparent 39rem),
    linear-gradient(180deg, rgba(46,35,25,.52), rgba(12,10,8,.94)),
    var(--obsidian-texture);
  background-size:auto, auto, 1024px 1024px;
  background-position:center top, center, center top;
  background-repeat:no-repeat, no-repeat, repeat;
  background-attachment:fixed, fixed, fixed;
}

body.theme-sandstone::before {
  background:
    radial-gradient(ellipse at center, transparent 30%, rgba(36,19,8,.34) 100%),
    linear-gradient(90deg, rgba(28,14,6,.22), transparent 18%, transparent 82%, rgba(28,14,6,.22));
}

body.theme-sandstone > .app-shell {
  position:relative;
  z-index:1;
}

/* Version 103: home mode is a distinct screen, not a transparent layer over
   the crafting workspace. This also protects the layout if a future skin
   accidentally changes the entrance positioning again. */
body.theme-sandstone.home-active .topbar,
body.theme-sandstone.home-active .workspace {
  display:none !important;
}

body.theme-sandstone:not(.home-active) .entrance-screen {
  display:none;
}

.theme-sandstone .entrance-screen {
  background-color:#090706;
  background-image:
    radial-gradient(circle at 50% 26%, rgba(202,153,88,.18), transparent 37%),
    linear-gradient(180deg, rgba(50,39,29,.48), rgba(12,10,8,.92)),
    var(--obsidian-texture);
  background-size:auto, auto, 1024px 1024px;
  background-repeat:no-repeat, no-repeat, repeat;
}

/* Static home-stage texture: vector carving and seamless stone replace all
   animated grains, so the entrance has depth without continuous repainting. */
.theme-sandstone .entrance-screen {
  position:fixed;
  inset:0;
  width:100vw;
  min-height:100dvh;
  isolation:isolate;
  overflow:auto;
  overscroll-behavior:contain;
}
.theme-sandstone .entrance-screen::before {
  content:"";
  position:absolute;
  left:50%;
  top:50%;
  width:min(1480px,94vw);
  height:min(920px,92vh);
  transform:translate(-50%,-50%);
  z-index:0;
  pointer-events:none;
  opacity:.92;
  background-image:
    linear-gradient(180deg, rgba(10,7,5,.24), rgba(5,4,3,.72)),
    url("assets/ui/sandstone/ornate-weathered-backdrop.svg"),
    var(--obsidian-texture);
  background-size:100% 100%, 100% 100%, 768px 768px;
  background-position:center, center, center;
  background-repeat:no-repeat, no-repeat, repeat;
  filter:drop-shadow(0 34px 72px rgba(0,0,0,.66));
}
.theme-sandstone .entrance-card,
.theme-sandstone .support-launch-btn,
.theme-sandstone .support-overlay {
  position:relative;
  z-index:2;
}

.theme-sandstone .panel,
.theme-sandstone .entrance-card,
.theme-sandstone .topbar,
.theme-sandstone .home-info-card,
.theme-sandstone .legal-disclosure-card,
.theme-sandstone .support-card,
.theme-sandstone dialog,
.theme-sandstone .challenge-target-card,
.theme-sandstone .challenge-score-card,
.theme-sandstone .challenge-empty,
.theme-sandstone .challenge-status-panel,
.theme-sandstone .reverse-plan-card,
.theme-sandstone .reverse-simple-route {
  border-color:transparent;
  background-color:rgba(29,21,16,.985);
  background-image:
    linear-gradient(180deg, rgba(151,111,62,.12), rgba(18,14,11,.44)),
    var(--obsidian-texture);
  background-size:auto, 1024px 1024px;
  background-repeat:no-repeat, repeat;
  box-shadow:
    inset 0 0 0 1px rgba(247,222,176,.08),
    inset 0 0 46px rgba(61,35,17,.32),
    0 24px 68px rgba(25,12,5,.48);
}

/* Vector frames preserve corner geometry at every size. Edge segments repeat
   rather than elongating, eliminating visible stretch distortion. */
.theme-sandstone .topbar::before {
  border-image-source:var(--obsidian-header-frame-hires) !important;
  border-image-repeat:round !important;
  filter:drop-shadow(0 15px 24px rgba(36,18,7,.52)) !important;
}

.theme-sandstone .item-panel::before,
.theme-sandstone .currency-panel::before,
.theme-sandstone .entrance-card::before,
.theme-sandstone .dialog-card::before,
.theme-sandstone .home-info-card::before,
.theme-sandstone .modifier-browser-card::before,
.theme-sandstone .legal-disclosure-card::before,
.theme-sandstone .support-card::before,
.theme-sandstone #choiceDialog.well-of-souls-dialog .dialog-card::before {
  border-image-source:var(--obsidian-item-frame-hires) !important;
  border-image-repeat:round !important;
  filter:drop-shadow(0 15px 24px rgba(36,18,7,.48)) !important;
}

.theme-sandstone .topbar {
  background-image:
    linear-gradient(90deg, rgba(73,45,27,.7), rgba(139,97,57,.72), rgba(73,45,27,.7)),
    var(--obsidian-texture);
  background-size:auto, 1024px 1024px;
}

.theme-sandstone .topbar h1,
.theme-sandstone .entrance-card h1,
.theme-sandstone h2,
.theme-sandstone h3,
.theme-sandstone .panel-heading h2 {
  color:#f6e7c8;
  text-shadow:0 2px 0 rgba(55,31,16,.88), 0 0 20px rgba(245,207,140,.13);
}

.theme-sandstone .eyebrow,
.theme-sandstone .entrance-game,
.theme-sandstone .currency-category {
  color:#f0ca84;
}

.theme-sandstone .item-card {
  background-color:rgba(20,17,14,.96);
  background-image:
    linear-gradient(180deg, rgba(39,31,24,.72), rgba(13,11,9,.96)),
    var(--obsidian-texture);
  background-size:auto, 1024px 1024px;
  background-repeat:no-repeat, repeat;
  border-color:transparent;
  box-shadow:inset 0 0 50px rgba(15,8,4,.5), 0 10px 30px rgba(25,12,5,.34);
}

.theme-sandstone .currency-panel {
  background-color:rgba(34,24,18,.98);
  background-image:
    linear-gradient(180deg, rgba(162,119,68,.15), rgba(21,17,13,.42)),
    var(--obsidian-texture);
  background-size:auto, 1024px 1024px;
}

.theme-sandstone .currency-panel .currency-group {
  border-color:rgba(111,70,37,.54);
  background-color:rgba(181,139,86,.34);
  background-image:
    linear-gradient(180deg, rgba(234,197,139,.12), rgba(76,48,28,.13)),
    var(--obsidian-texture);
  background-size:auto, 1024px 1024px;
}

.theme-sandstone .currency-panel .currency-group > summary {
  color:#f3dfb8;
  background:linear-gradient(180deg, rgba(145,98,55,.48), rgba(83,51,29,.42));
}

.theme-sandstone .currency-panel .currency-image-button,
.theme-sandstone .currency-panel .currency-name-button,
.theme-sandstone .currency-panel .currency-text-button:not(.well-reveal-button) {
  border-color:rgba(229,188,119,.46);
  background:linear-gradient(180deg, rgba(114,72,39,.13), rgba(64,38,22,.14));
  color:#f3e5cc;
  backdrop-filter:blur(1px);
}

.theme-sandstone .currency-panel .currency-image-button.available,
.theme-sandstone .currency-panel .currency-name-button.available,
.theme-sandstone .currency-panel .currency-text-button.available:not(.well-reveal-button) {
  border-color:rgba(244,204,137,.68);
  background:linear-gradient(180deg, rgba(145,94,51,.20), rgba(78,45,25,.22));
}

.theme-sandstone .currency-panel .currency-image-button.available:hover,
.theme-sandstone .currency-panel .currency-name-button.available:hover,
.theme-sandstone .currency-panel .currency-text-button.available:not(.well-reveal-button):hover {
  border-color:#f2cf90;
  box-shadow:0 0 0 1px rgba(247,210,147,.16), inset 0 0 18px rgba(255,224,166,.10);
}

.theme-sandstone .ui-ornate-button,
.theme-sandstone .primary-home-choice,
.theme-sandstone .choice-btn {
  border-image-source:var(--obsidian-button-art) !important;
  border-image-repeat:round !important;
  color:#f3e4c8;
  background:linear-gradient(180deg, rgba(92,57,33,.74), rgba(49,31,21,.88));
}

.theme-sandstone .primary-home-choice:hover:not(:disabled),
.theme-sandstone .choice-btn:hover:not(:disabled),
.theme-sandstone .ui-ornate-button:hover:not(:disabled) {
  border-image-source:var(--obsidian-button-hover-art) !important;
  color:#fff0d0;
  background:linear-gradient(180deg, rgba(137,88,47,.78), rgba(61,37,22,.9));
  filter:brightness(1.05);
}

.theme-sandstone .btn,
.theme-sandstone .mode-toggle,
.theme-sandstone .home-info-action {
  color:#f0e0c4;
  border-color:rgba(231,193,128,.38);
  background:linear-gradient(180deg, rgba(105,67,39,.88), rgba(54,34,23,.94));
}

.theme-sandstone .btn:hover:not(:disabled),
.theme-sandstone .mode-toggle:hover,
.theme-sandstone .home-info-action:hover {
  color:#fff0d2;
  border-color:rgba(246,210,146,.72);
}

.theme-sandstone input,
.theme-sandstone select,
.theme-sandstone textarea,
.theme-sandstone .reverse-input {
  color:#f6ead7;
  background-color:rgba(54,35,24,.82);
  border-color:rgba(225,185,118,.35);
}

.theme-sandstone .badge,
.theme-sandstone .count-chip,
.theme-sandstone .message-bar,
.theme-sandstone .metric,
.theme-sandstone .choice-btn,
.theme-sandstone .reverse-simple-route li {
  background-color:rgba(54,35,24,.58);
  border-color:rgba(220,178,111,.24);
}

.theme-sandstone .divider,
.theme-sandstone .ui-ornate-divider {
  background-image:var(--obsidian-divider-art);
  background-size:100% 100%;
  background-repeat:no-repeat;
  opacity:.78;
}


/* Dark carved sandstone: fine incised diamonds and recessed inner edges add
   ornament without brightening the dark-mode-adjacent surface. */
.theme-sandstone .panel,
.theme-sandstone .entrance-card,
.theme-sandstone .topbar,
.theme-sandstone .home-info-card,
.theme-sandstone .legal-disclosure-card,
.theme-sandstone .support-card,
.theme-sandstone dialog .dialog-card {
  background-blend-mode:soft-light, normal;
}

.theme-sandstone .panel-heading,
.theme-sandstone .dialog-header,
.theme-sandstone .item-title-block {
  border-bottom:1px solid rgba(239,190,112,.10);
  box-shadow:0 1px 0 rgba(8,6,4,.72);
}

.theme-sandstone .panel,
.theme-sandstone .entrance-card,
.theme-sandstone .topbar,
.theme-sandstone .home-info-card,
.theme-sandstone .legal-disclosure-card,
.theme-sandstone .support-card,
.theme-sandstone dialog .dialog-card {
  position:relative;
}


/* Static incised ornament on major surfaces. No animation or particle image is loaded. */
.theme-sandstone .panel,
.theme-sandstone .entrance-card,
.theme-sandstone .topbar,
.theme-sandstone .home-info-card,
.theme-sandstone .legal-disclosure-card,
.theme-sandstone .support-card,
.theme-sandstone dialog .dialog-card,
.theme-sandstone .modifier-browser-card {
  outline:1px solid rgba(8,5,3,.82);
  outline-offset:-7px;
}
.theme-sandstone .panel-heading::before,
.theme-sandstone .dialog-header::before,
.theme-sandstone .modifier-browser-header::before {
  content:"◆  ◇  ◆";
  display:block;
  margin:0 0 8px;
  color:rgba(175,122,63,.38);
  font-size:.56rem;
  letter-spacing:.55em;
  text-align:center;
}

/* Keep all item/currency art at its intrinsic aspect ratio. */
.theme-sandstone img,
.theme-sandstone .currency-image-button img,
.theme-sandstone .cost-icon img,
.theme-sandstone .patreon-image-button img {
  object-fit:contain;
  image-rendering:auto;
}

.theme-sandstone .item-card.has-item-art::before {
  background-size:contain !important;
  background-repeat:no-repeat !important;
  background-position:center !important;
  image-rendering:auto;
  transform:translate(-50%, -50%) scale(1) !important;
}

.theme-sandstone .mod-line .mod-level {
  color:#ff4a43;
  font-size:.54rem;
  letter-spacing:.015em;
  text-transform:lowercase;
  text-shadow:none;
}

/* Modifier Data keeps its frame fixed while only the pool contents scroll. */
.theme-sandstone .modifier-browser-dialog[open] {
  display:grid;
  grid-template-rows:minmax(0,1fr);
  height:min(92vh,940px);
  max-height:none;
  overflow:hidden;
}
.theme-sandstone .modifier-browser-dialog .modifier-browser-card {
  box-sizing:border-box;
  height:100%;
  max-height:none;
  min-height:0;
  overflow:hidden;
}
.theme-sandstone .modifier-browser-dialog .modifier-browser-content {
  flex:1 1 0;
  min-height:0;
  max-height:none;
  overflow-x:hidden;
  overflow-y:scroll !important;
  overscroll-behavior:contain;
  touch-action:pan-y;
  scrollbar-gutter:stable both-edges;
}

/* Version 103: home screen restyle inspired by the ornate weathered sandstone
   mockup. The layout stays faithful to the user's functional buttons while
   moving them into the framed composition. */
body.theme-sandstone {
  background-color:#0a0806;
  background-image:
    radial-gradient(circle at 50% -10%, rgba(214,168,96,.12), transparent 36rem),
    linear-gradient(180deg, rgba(32,24,18,.32), rgba(8,6,5,.96)),
    var(--obsidian-texture);
}

.theme-sandstone .entrance-screen {
  display:grid;
  place-items:center;
  padding:24px;
  background-image:
    radial-gradient(circle at 50% 20%, rgba(208,157,89,.16), transparent 28rem),
    linear-gradient(180deg, rgba(42,31,23,.36), rgba(9,7,6,.9)),
    var(--obsidian-texture);
}

.theme-sandstone .entrance-screen::before {
  width:min(1500px,96vw);
  height:min(900px,94vh);
  opacity:1;
  background-image:
    linear-gradient(180deg, rgba(11,8,6,.1), rgba(6,4,3,.6)),
    url("assets/ui/sandstone/ornate-weathered-backdrop.svg"),
    radial-gradient(circle at center, rgba(248,225,182,.06), transparent 55%),
    var(--obsidian-texture);
  background-size:100% 100%, 100% 100%, auto, 768px 768px;
}

.theme-sandstone .entrance-card {
  width:min(1320px, 93vw);
  min-height:min(760px, 84vh);
  padding:40px 52px 44px;
  display:grid;
  grid-template-columns:minmax(0, 1.8fr) minmax(260px, .72fr);
  grid-template-rows:auto auto 1fr auto;
  grid-template-areas:
    "title title"
    "meta meta"
    "primary secondary"
    "footer secondary";
  align-items:start;
  gap:18px 54px;
  text-align:left;
  background:
    linear-gradient(180deg, rgba(173,133,78,.06), rgba(28,20,15,.06)),
    linear-gradient(180deg, rgba(197,166,121,.78), rgba(173,144,108,.72));
  box-shadow:
    inset 0 0 0 1px rgba(252,232,194,.08),
    inset 0 0 48px rgba(81,52,25,.18),
    0 34px 90px rgba(0,0,0,.54);
}

.theme-sandstone .entrance-card::before {
  filter:drop-shadow(0 18px 26px rgba(34,18,7,.58));
}

.theme-sandstone .entrance-game,
.theme-sandstone .entrance-byline,
.theme-sandstone .entrance-version {
  display:none;
}

.theme-sandstone .entrance-card h1 {
  grid-area:title;
  justify-self:center;
  margin:22px 0 10px;
  font-size:clamp(2.8rem, 4.8vw, 4.45rem);
  line-height:1.04;
  letter-spacing:.01em;
  text-align:center;
  color:#f1d79d;
  text-shadow:0 2px 0 rgba(60,37,18,.95), 0 0 18px rgba(255,215,146,.1);
}

.theme-sandstone .entrance-byline,
.theme-sandstone .entrance-version {
  display:inline-block;
  margin:0 8px 0 0;
  color:#8f6940;
  font-size:.74rem;
  letter-spacing:.11em;
  text-transform:uppercase;
}

.theme-sandstone .entrance-byline { justify-self:center; }
.theme-sandstone .entrance-version {
  grid-area:meta;
  justify-self:center;
  margin-left:122px;
}

.theme-sandstone .home-primary-actions,
.theme-sandstone .entrance-options {
  grid-area:primary;
  display:grid;
  grid-template-columns:1fr;
  gap:16px;
  max-width:700px;
  width:100%;
  margin:36px 0 0 70px;
}

.theme-sandstone .primary-home-choice,
.theme-sandstone .entrance-choice.primary-home-choice {
  min-height:96px;
  padding:22px 30px;
  border:18px solid transparent;
  border-image-source:url("assets/ui/sandstone/ornate-weathered-button.svg");
  border-image-slice:120 fill;
  border-image-width:18px;
  border-image-repeat:round;
  background:linear-gradient(180deg, rgba(228,210,177,.9), rgba(197,176,141,.88));
  color:#2e1f11;
  box-shadow:0 8px 24px rgba(74,43,18,.14);
  text-align:center;
  align-content:center;
  gap:4px;
}

.theme-sandstone .primary-home-choice:hover,
.theme-sandstone .entrance-choice.primary-home-choice:hover {
  background:linear-gradient(180deg, rgba(234,218,191,.95), rgba(205,185,151,.93));
  border-image-source:url("assets/ui/sandstone/ornate-weathered-button.svg");
  transform:translateY(-1px);
}

.theme-sandstone .primary-home-choice strong {
  font-size:clamp(1.5rem, 2.6vw, 2.5rem);
  line-height:1.1;
  color:#2f1d10;
  text-shadow:0 1px 0 rgba(255,255,255,.28);
}

.theme-sandstone .primary-home-choice span {
  display:none;
}

.theme-sandstone .home-info-actions {
  grid-area:secondary;
  display:grid;
  grid-template-columns:1fr;
  align-content:start;
  justify-self:stretch;
  gap:12px;
  margin:66px 6px 0 0;
  padding:22px 22px 26px;
  min-height:348px;
  border:22px solid transparent;
  border-image-source:url("assets/ui/sandstone/ornate-weathered-frame.svg");
  border-image-slice:160 fill;
  border-image-width:22px;
  border-image-repeat:round;
  background:linear-gradient(180deg, rgba(65,45,28,.88), rgba(43,29,18,.92));
  box-shadow:inset 0 0 36px rgba(0,0,0,.2);
}

.theme-sandstone .home-info-action,
.theme-sandstone .mode-toggle {
  min-height:58px;
  margin:0;
  border:14px solid transparent;
  border-image-source:url("assets/ui/sandstone/ornate-weathered-button.svg");
  border-image-slice:120 fill;
  border-image-width:14px;
  border-image-repeat:round;
  background:linear-gradient(180deg, rgba(103,69,39,.72), rgba(66,44,25,.78));
  color:#efd9ab;
  font-size:1rem;
  font-weight:700;
  letter-spacing:.03em;
  text-transform:none;
  box-shadow:none;
}

.theme-sandstone .home-info-action:hover,
.theme-sandstone .mode-toggle:hover {
  color:#fff2cd;
  background:linear-gradient(180deg, rgba(116,78,45,.82), rgba(77,52,31,.82));
}

.theme-sandstone #modeToggleBtn {
  grid-area:footer;
  justify-self:center;
  align-self:end;
  width:min(290px, 56%);
  margin:12px 0 0 80px;
}

.theme-sandstone .support-launch-btn {
  right:max(28px, calc(50vw - 620px));
  bottom:max(18px, calc(50vh - 392px));
  min-width:170px;
  min-height:52px;
  padding:10px 18px;
  border:16px solid transparent;
  border-image-source:url("assets/ui/sandstone/ornate-weathered-button.svg");
  border-image-slice:120 fill;
  border-image-width:16px;
  border-image-repeat:round;
  background:linear-gradient(180deg, rgba(224,205,174,.96), rgba(189,168,136,.94));
  color:#2b1b10;
  font-size:.95rem;
  letter-spacing:.06em;
  text-transform:none;
  box-shadow:0 12px 28px rgba(0,0,0,.38);
  backdrop-filter:none;
}
.theme-sandstone .support-launch-btn:hover {
  color:#1f130b;
  background:linear-gradient(180deg, rgba(234,218,191,.98), rgba(200,179,146,.96));
  border-color:transparent;
}

.theme-sandstone .support-card {
  background:linear-gradient(180deg, rgba(224,205,176,.97), rgba(190,166,131,.96));
  color:#2e1f10;
}
.theme-sandstone .support-card h2,
.theme-sandstone .support-message { color:#2e1f10; }

/* Workspace restyle so the in-app panels better match the preferred home-page
   mockup while keeping all simulator controls intact. */
.theme-sandstone .topbar,
.theme-sandstone .panel,
.theme-sandstone .home-info-card,
.theme-sandstone .legal-disclosure-card,
.theme-sandstone .support-card,
.theme-sandstone dialog,
.theme-sandstone .challenge-target-card,
.theme-sandstone .challenge-score-card,
.theme-sandstone .challenge-empty,
.theme-sandstone .challenge-status-panel,
.theme-sandstone .reverse-plan-card,
.theme-sandstone .reverse-simple-route {
  background-color:rgba(33,23,16,.98);
  background-image:
    linear-gradient(180deg, rgba(213,176,119,.07), rgba(21,15,11,.25)),
    var(--obsidian-texture);
  box-shadow:
    inset 0 0 0 1px rgba(253,230,185,.07),
    inset 0 0 44px rgba(94,60,29,.2),
    0 24px 64px rgba(15,9,6,.48);
}

.theme-sandstone .topbar {
  background-image:
    linear-gradient(90deg, rgba(68,44,26,.84), rgba(126,87,50,.9), rgba(68,44,26,.84)),
    var(--obsidian-texture);
}

.theme-sandstone .panel::before,
.theme-sandstone .home-info-card::before,
.theme-sandstone .legal-disclosure-card::before,
.theme-sandstone .support-card::before,
.theme-sandstone .modifier-browser-card::before,
.theme-sandstone .dialog-card::before {
  filter:drop-shadow(0 16px 26px rgba(31,17,7,.5));
}

@media (max-width: 1100px) {
  .theme-sandstone .entrance-card {
    width:min(930px,94vw);
    min-height:auto;
    grid-template-columns:1fr;
    grid-template-rows:auto auto auto auto auto;
    grid-template-areas:
      "title"
      "meta"
      "primary"
      "secondary"
      "footer";
    text-align:center;
    gap:18px;
    padding:34px 28px 38px;
  }
  .theme-sandstone .home-primary-actions,
  .theme-sandstone .entrance-options {
    max-width:none;
    margin:22px 0 0;
  }
  .theme-sandstone .home-info-actions {
    margin:8px 0 0;
    min-height:0;
  }
  .theme-sandstone #modeToggleBtn {
    width:min(320px, 100%);
    margin:10px auto 0;
  }
  .theme-sandstone .entrance-version {
    margin-left:0;
  }
}

@media (max-width: 680px) {
  .theme-sandstone .entrance-card h1 {
    font-size:clamp(2.15rem, 9vw, 3rem);
  }
  .theme-sandstone .primary-home-choice {
    min-height:82px;
    padding:18px 20px;
  }
  .theme-sandstone .primary-home-choice strong {
    font-size:1.5rem;
  }
  .theme-sandstone .support-launch-btn {
    right:16px;
    bottom:16px;
    min-width:128px;
    min-height:44px;
    font-size:.82rem;
  }
}

/* Version 103 final cleanup: keep the home screen visually close to the
   reference layout by suppressing the extra home metadata line. */
.theme-sandstone .entrance-byline,
.theme-sandstone .entrance-version,
.theme-sandstone .entrance-game {
  display:none !important;
}

/* Version 104 — full-frame art refresh.
   Replace the improvised sandstone frames with the newly generated ornate
   gold-on-weathered-stone assets across the project and tighten button scale. */
body.theme-sandstone,
.theme-sandstone {
  --bg:#100b09;
  --panel:#1c120f;
  --panel-2:#140d0a;
  --line:rgba(190,138,77,.34);
  --line-soft:rgba(74,43,24,.58);
  --text:#f0dfc0;
  --muted:#c8ab82;
  --gold:#c99b54;
  --gold-2:#edd5a0;
  --shadow:0 20px 54px rgba(0,0,0,.5);
  --obsidian-texture:url("assets/ui/sandstone/sandstone-texture.webp");
}

body.theme-sandstone {
  background-color:#100b09;
  background-image:
    radial-gradient(circle at 50% 0%, rgba(124,67,40,.22), transparent 34rem),
    linear-gradient(180deg, rgba(34,19,13,.84), rgba(9,6,5,.98)),
    var(--obsidian-texture);
  background-attachment:fixed, fixed, fixed;
}

.theme-sandstone .entrance-screen {
  background-image:
    radial-gradient(circle at 50% 18%, rgba(154,85,53,.18), transparent 28rem),
    linear-gradient(180deg, rgba(43,24,17,.92), rgba(11,8,7,.98)),
    var(--obsidian-texture);
}

.theme-sandstone .entrance-screen::before {
  width:min(1500px,96vw) !important;
  height:min(920px,94vh) !important;
  left:50% !important;
  top:50% !important;
  transform:translate(-50%,-50%) !important;
  background-image:
    linear-gradient(180deg, rgba(10,7,6,.06), rgba(8,5,4,.36)),
    url("assets/ui/gothic/home_backdrop.png"),
    var(--obsidian-texture) !important;
  background-size:100% 100%, 100% 100%, 768px 768px !important;
  background-repeat:no-repeat, no-repeat, repeat !important;
  background-position:center center, center center, center center !important;
  opacity:1 !important;
  filter:drop-shadow(0 30px 70px rgba(0,0,0,.56)) !important;
}

.theme-sandstone .entrance-card {
  background:rgba(0,0,0,0.001) !important;
  box-shadow:none !important;
}

.theme-sandstone .entrance-card::before {
  inset:-8px !important;
  border:none !important;
  background:url("assets/ui/gothic/panel_frame_sandstone.png") center/100% 100% no-repeat !important;
  filter:drop-shadow(0 18px 34px rgba(0,0,0,.42)) !important;
}

.theme-sandstone .topbar,
.theme-sandstone .panel,
.theme-sandstone .home-info-card,
.theme-sandstone .legal-disclosure-card,
.theme-sandstone .support-card,
.theme-sandstone dialog .dialog-card,
.theme-sandstone .challenge-target-card,
.theme-sandstone .challenge-score-card,
.theme-sandstone .challenge-empty,
.theme-sandstone .challenge-status-panel,
.theme-sandstone .reverse-plan-card,
.theme-sandstone .reverse-simple-route,
.theme-sandstone .item-card,
.theme-sandstone .currency-group,
.theme-sandstone .metric,
.theme-sandstone .message-bar,
.theme-sandstone .badge,
.theme-sandstone .count-chip,
.theme-sandstone .reverse-simple-route li {
  background-color:rgba(24,16,12,.95) !important;
  background-image:
    linear-gradient(180deg, rgba(109,67,40,.18), rgba(15,10,8,.34)),
    var(--obsidian-texture) !important;
  background-size:auto, 768px 768px !important;
  background-repeat:no-repeat, repeat !important;
  box-shadow:inset 0 0 0 1px rgba(240,209,159,.06), inset 0 0 36px rgba(0,0,0,.26), 0 18px 42px rgba(0,0,0,.34) !important;
  border-color:rgba(166,114,67,.24) !important;
}

.theme-sandstone .topbar {
  background-image:
    linear-gradient(90deg, rgba(35,19,16,.96), rgba(54,28,22,.92), rgba(35,19,16,.96)),
    var(--obsidian-texture) !important;
}

.theme-sandstone .topbar::before {
  inset:-14px -18px !important;
  border:none !important;
  background:url("assets/ui/gothic/header_banner.png") center/100% 100% no-repeat !important;
  filter:drop-shadow(0 14px 26px rgba(0,0,0,.48)) !important;
}

.theme-sandstone .item-panel::before,
.theme-sandstone .currency-panel::before,
.theme-sandstone .dialog-card::before,
.theme-sandstone .home-info-card::before,
.theme-sandstone .modifier-browser-card::before,
.theme-sandstone .legal-disclosure-card::before,
.theme-sandstone .support-card::before,
.theme-sandstone #choiceDialog.well-of-souls-dialog .dialog-card::before,
.theme-sandstone .panel::before {
  inset:-14px !important;
  border:none !important;
  background:url("assets/ui/gothic/panel_frame_main.png") center/100% 100% no-repeat !important;
  filter:drop-shadow(0 16px 26px rgba(0,0,0,.46)) !important;
}

.theme-sandstone .history-panel::before,
.theme-sandstone .assumptions-panel::before,
.theme-sandstone .challenge-status-panel::before,
.theme-sandstone .support-overlay .support-card::before {
  inset:-12px !important;
  border:none !important;
  background:url("assets/ui/gothic/panel_frame_vertical.png") center/100% 100% no-repeat !important;
}

.theme-sandstone .currency-panel,
.theme-sandstone .history-panel,
.theme-sandstone .assumptions-panel {
  position:relative;
  isolation:isolate;
  overflow:visible;
}
.theme-sandstone .currency-panel > *,
.theme-sandstone .history-panel > *,
.theme-sandstone .assumptions-panel > * { position:relative; z-index:1; }

.theme-sandstone .ui-ornate-button,
.theme-sandstone .primary-home-choice,
.theme-sandstone .choice-btn,
.theme-sandstone .btn,
.theme-sandstone .mode-toggle,
.theme-sandstone .home-info-action,
.theme-sandstone .support-launch-btn,
.theme-sandstone .history-tab,
.theme-sandstone .currency-panel .currency-image-button,
.theme-sandstone .currency-panel .currency-name-button,
.theme-sandstone .currency-panel .currency-text-button:not(.well-reveal-button),
.theme-sandstone .save-base-button,
.theme-sandstone .new-seed-btn,
.theme-sandstone .reverse-guide-direct-action,
.theme-sandstone .window-close-btn,
.theme-sandstone .dialog-close-btn {
  background-color:transparent !important;
  background-image:url("assets/ui/gothic/button_frame.png") !important;
  background-size:100% 100% !important;
  background-repeat:no-repeat !important;
  border:none !important;
  box-shadow:none !important;
  color:#f2e3c4 !important;
  text-shadow:0 1px 0 rgba(0,0,0,.7);
  min-height:42px !important;
  padding:10px 16px !important;
  border-radius:0 !important;
}

.theme-sandstone .primary-home-choice {
  min-height:76px !important;
  padding:16px 22px !important;
}

.theme-sandstone .primary-home-choice strong,
.theme-sandstone .choice-btn strong,
.theme-sandstone .btn,
.theme-sandstone .mode-toggle,
.theme-sandstone .home-info-action,
.theme-sandstone .support-launch-btn {
  color:#f2e0bd !important;
  font-weight:700 !important;
}

.theme-sandstone .ui-ornate-button:hover:not(:disabled),
.theme-sandstone .primary-home-choice:hover:not(:disabled),
.theme-sandstone .choice-btn:hover:not(:disabled),
.theme-sandstone .btn:hover:not(:disabled),
.theme-sandstone .mode-toggle:hover,
.theme-sandstone .home-info-action:hover,
.theme-sandstone .support-launch-btn:hover,
.theme-sandstone .history-tab:hover,
.theme-sandstone .currency-panel .currency-image-button.available:hover,
.theme-sandstone .currency-panel .currency-name-button.available:hover,
.theme-sandstone .currency-panel .currency-text-button.available:hover:not(.well-reveal-button) {
  filter:brightness(1.08) saturate(1.03);
  color:#fff0d1 !important;
}

.theme-sandstone .window-close-btn,
.theme-sandstone .dialog-close-btn {
  min-width:40px !important;
  width:40px !important;
  min-height:40px !important;
  padding:0 !important;
  background-image:url("assets/ui/gothic/button_frame_sandstone.png") !important;
  background-size:100% 100% !important;
}

.theme-sandstone .currency-panel .currency-group {
  background-color:rgba(53,31,23,.78) !important;
  background-image:
    linear-gradient(180deg, rgba(149,90,55,.16), rgba(32,19,14,.18)),
    var(--obsidian-texture) !important;
  box-shadow:inset 0 0 0 1px rgba(210,157,98,.08), inset 0 0 16px rgba(0,0,0,.18) !important;
}

.theme-sandstone .currency-panel .currency-group > summary,
.theme-sandstone .panel-heading,
.theme-sandstone .dialog-header,
.theme-sandstone .item-title-block {
  color:#f0ddbc !important;
  border-bottom-color:rgba(186,131,80,.18) !important;
  background:linear-gradient(180deg, rgba(96,52,35,.42), rgba(44,25,18,.18)) !important;
}

.theme-sandstone input,
.theme-sandstone select,
.theme-sandstone textarea,
.theme-sandstone .reverse-input {
  color:#f3e5c9 !important;
  background:rgba(34,22,17,.88) !important;
  border-color:rgba(180,123,74,.42) !important;
  box-shadow:inset 0 0 16px rgba(0,0,0,.18);
}

.theme-sandstone .topbar h1,
.theme-sandstone .entrance-card h1,
.theme-sandstone h2,
.theme-sandstone h3,
.theme-sandstone .panel-heading h2 {
  color:#f2dfbe !important;
  text-shadow:0 2px 0 rgba(27,13,9,.92), 0 0 16px rgba(213,171,107,.12) !important;
}

.theme-sandstone .home-info-actions {
  gap:10px !important;
}

.theme-sandstone .support-launch-btn {
  min-width:120px !important;
  max-width:160px;
  padding:8px 14px !important;
}

.theme-sandstone .divider,
.theme-sandstone .ui-ornate-divider {
  background-image:url("assets/ui/gothic/header_banner_sandstone.png") !important;
  background-size:100% 100% !important;
  opacity:.55 !important;
}

@media (max-width: 900px) {
  .theme-sandstone .item-panel::before,
  .theme-sandstone .currency-panel::before,
  .theme-sandstone .dialog-card::before,
  .theme-sandstone .home-info-card::before,
  .theme-sandstone .modifier-browser-card::before,
  .theme-sandstone .legal-disclosure-card::before,
  .theme-sandstone .support-card::before,
  .theme-sandstone .panel::before {
    inset:-10px !important;
  }
  .theme-sandstone .topbar::before {
    inset:-10px -12px !important;
  }
  .theme-sandstone .ui-ornate-button,
  .theme-sandstone .primary-home-choice,
  .theme-sandstone .choice-btn,
  .theme-sandstone .btn,
  .theme-sandstone .mode-toggle,
  .theme-sandstone .home-info-action,
  .theme-sandstone .support-launch-btn {
    min-height:38px !important;
    padding:8px 12px !important;
  }
}

/* Version 105 — use the generated frame art as true borders instead of full
   embedded images, and realign the application into a cleaner tool-first
   layout. */
body.theme-sandstone,
.theme-sandstone {
  --bg:#100b09;
  --panel:#1b1310;
  --panel-2:#140d0b;
  --line:rgba(171,112,66,.28);
  --line-soft:rgba(85,49,29,.42);
  --text:#f0dfc6;
  --muted:#bea07a;
  --gold:#c79858;
  --gold-2:#ead3a2;
  --shadow:0 16px 34px rgba(0,0,0,.34);
}

body.theme-sandstone {
  background-color:#0f0a08;
  background-image:
    radial-gradient(circle at 50% 0%, rgba(137,78,46,.14), transparent 32rem),
    linear-gradient(180deg, rgba(27,18,14,.96), rgba(10,8,7,.99)),
    var(--obsidian-texture);
  background-size:auto, auto, 900px 900px;
  background-repeat:no-repeat, no-repeat, repeat;
}

body.theme-sandstone::before {
  background:
    radial-gradient(ellipse at center, transparent 38%, rgba(0,0,0,.26) 100%),
    linear-gradient(90deg, rgba(0,0,0,.18), transparent 16%, transparent 84%, rgba(0,0,0,.18));
}

.theme-sandstone .app-shell {
  width:min(1480px, calc(100vw - 48px));
  margin:0 auto 64px;
}

.theme-sandstone .entrance-screen {
  display:grid;
  place-items:center;
  padding:28px;
  background-image:
    radial-gradient(circle at 50% 14%, rgba(118,70,44,.14), transparent 26rem),
    linear-gradient(180deg, rgba(24,16,12,.95), rgba(10,8,7,.99)),
    var(--obsidian-texture);
  background-size:auto, auto, 900px 900px;
}

.theme-sandstone .entrance-screen::before {
  content:none !important;
}

.theme-sandstone .entrance-card,
.theme-sandstone .item-panel,
.theme-sandstone .metric-panel,
.theme-sandstone .home-info-card,
.theme-sandstone .legal-disclosure-card,
.theme-sandstone .support-card,
.theme-sandstone .modifier-browser-card,
.theme-sandstone dialog .dialog-card,
.theme-sandstone .challenge-target-card,
.theme-sandstone .challenge-score-card,
.theme-sandstone .challenge-empty,
.theme-sandstone .challenge-status-panel,
.theme-sandstone .reverse-plan-card,
.theme-sandstone .reverse-simple-route {
  position:relative;
  overflow:visible;
  border:24px solid transparent !important;
  border-radius:0 !important;
  border-image-source:url("assets/ui/gothic/panel_frame_main.png") !important;
  border-image-slice:170 170 170 170 !important;
  border-image-width:24px !important;
  border-image-repeat:stretch !important;
  background-color:rgba(25,17,13,.97) !important;
  background-image:
    linear-gradient(180deg, rgba(105,67,42,.14), rgba(15,11,9,.26)),
    var(--obsidian-texture) !important;
  background-size:auto, 820px 820px !important;
  background-repeat:no-repeat, repeat !important;
  background-clip:padding-box !important;
  box-shadow:0 18px 40px rgba(0,0,0,.34), inset 0 0 0 1px rgba(231,198,145,.04), inset 0 0 34px rgba(0,0,0,.18) !important;
}

.theme-sandstone .currency-panel,
.theme-sandstone .history-panel,
.theme-sandstone .assumptions-panel {
  position:relative;
  overflow:visible;
  border:22px solid transparent !important;
  border-radius:0 !important;
  border-image-source:url("assets/ui/gothic/panel_frame_vertical.png") !important;
  border-image-slice:240 160 240 160 !important;
  border-image-width:22px !important;
  border-image-repeat:stretch !important;
  background-color:rgba(24,17,13,.97) !important;
  background-image:
    linear-gradient(180deg, rgba(103,63,40,.15), rgba(15,10,9,.26)),
    var(--obsidian-texture) !important;
  background-size:auto, 820px 820px !important;
  background-repeat:no-repeat, repeat !important;
  background-clip:padding-box !important;
  box-shadow:0 18px 40px rgba(0,0,0,.34), inset 0 0 0 1px rgba(231,198,145,.04), inset 0 0 34px rgba(0,0,0,.18) !important;
}

.theme-sandstone .topbar {
  position:relative;
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:24px;
  padding:24px 20px 18px;
  margin:10px auto 16px;
  border:22px solid transparent !important;
  border-radius:0 !important;
  border-image-source:url("assets/ui/gothic/header_banner.png") !important;
  border-image-slice:170 300 170 300 !important;
  border-image-width:20px 30px !important;
  border-image-repeat:stretch !important;
  background-color:rgba(21,14,12,.96) !important;
  background-image:
    linear-gradient(90deg, rgba(31,19,16,.96), rgba(45,24,20,.92), rgba(31,19,16,.96)),
    var(--obsidian-texture) !important;
  background-size:auto, 820px 820px !important;
  background-repeat:no-repeat, repeat !important;
  background-clip:padding-box !important;
  box-shadow:0 16px 34px rgba(0,0,0,.34), inset 0 0 24px rgba(0,0,0,.14) !important;
}

.theme-sandstone .topbar::before,
.theme-sandstone .panel::before,
.theme-sandstone .item-panel::before,
.theme-sandstone .currency-panel::before,
.theme-sandstone .dialog-card::before,
.theme-sandstone .home-info-card::before,
.theme-sandstone .modifier-browser-card::before,
.theme-sandstone .legal-disclosure-card::before,
.theme-sandstone .support-card::before,
.theme-sandstone .entrance-card::before,
.theme-sandstone .history-panel::before,
.theme-sandstone .assumptions-panel::before {
  content:none !important;
}

.theme-sandstone .workspace {
  grid-template-columns:minmax(380px, 430px) minmax(0, 1fr);
  gap:22px;
  align-items:start;
}

.theme-sandstone .left-column,
.theme-sandstone .right-column {
  gap:22px;
}

.theme-sandstone .control-strip {
  grid-template-columns:130px minmax(200px, 1fr) 220px auto;
  gap:16px;
  padding:18px 20px;
  margin-bottom:18px;
}

.theme-sandstone .panel-heading {
  align-items:flex-start;
  margin-bottom:12px;
}

.theme-sandstone .panel-heading h2,
.theme-sandstone .topbar h1,
.theme-sandstone .entrance-card h1,
.theme-sandstone h2,
.theme-sandstone h3,
.theme-sandstone .choice-btn strong,
.theme-sandstone .primary-home-choice strong {
  color:#f0dfbf !important;
  text-shadow:0 1px 0 rgba(0,0,0,.9), 0 0 12px rgba(205,152,88,.08) !important;
}

.theme-sandstone .topbar h1,
.theme-sandstone .entrance-card h1 {
  font-size:clamp(1.85rem, 2.6vw, 2.7rem);
  letter-spacing:-.02em;
}

.theme-sandstone .subtitle,
.theme-sandstone .reverse-copy,
.theme-sandstone .support-message,
.theme-sandstone .choice-btn span,
.theme-sandstone .primary-home-choice span {
  color:#c9b090 !important;
}

.theme-sandstone .entrance-card {
  width:min(1260px, 92vw);
  min-height:auto;
  padding:34px 34px 28px;
  display:grid;
  grid-template-columns:minmax(0, 1.5fr) minmax(250px, .7fr);
  grid-template-areas:
    "title title"
    "primary secondary"
    "footer secondary";
  align-items:start;
  gap:20px 24px;
  text-align:left;
}

.theme-sandstone .entrance-card h1 {
  grid-area:title;
  text-align:center;
  justify-self:center;
  width:100%;
  margin:0;
}

.theme-sandstone .entrance-byline,
.theme-sandstone .entrance-version,
.theme-sandstone .entrance-game {
  display:none !important;
}

.theme-sandstone .home-primary-actions,
.theme-sandstone .entrance-options {
  grid-area:primary;
  display:grid;
  grid-template-columns:1fr;
  gap:14px;
  width:100%;
  margin:0;
  max-width:none;
}

.theme-sandstone .home-info-actions {
  grid-area:secondary;
  display:grid;
  grid-template-columns:1fr;
  gap:10px;
  align-content:start;
  margin:0;
  padding:18px;
  border:18px solid transparent;
  border-image-source:url("assets/ui/gothic/panel_frame_vertical.png");
  border-image-slice:240 160 240 160;
  border-image-width:18px;
  border-image-repeat:stretch;
  background:linear-gradient(180deg, rgba(65,39,30,.48), rgba(22,13,10,.34)), var(--obsidian-texture);
  background-size:auto, 760px 760px;
  background-clip:padding-box;
}

.theme-sandstone #modeToggleBtn {
  grid-area:footer;
  justify-self:start;
  width:auto;
  max-width:220px;
  margin:0;
}

.theme-sandstone .ui-ornate-button,
.theme-sandstone .primary-home-choice,
.theme-sandstone .choice-btn,
.theme-sandstone .btn,
.theme-sandstone .mode-toggle,
.theme-sandstone .home-info-action,
.theme-sandstone .support-launch-btn,
.theme-sandstone .history-tab,
.theme-sandstone .currency-panel .currency-image-button,
.theme-sandstone .currency-panel .currency-name-button,
.theme-sandstone .currency-panel .currency-text-button:not(.well-reveal-button),
.theme-sandstone .save-base-button,
.theme-sandstone .new-seed-btn,
.theme-sandstone .reverse-guide-direct-action {
  border:12px solid transparent !important;
  border-radius:0 !important;
  border-image-source:url("assets/ui/gothic/button_frame.png") !important;
  border-image-slice:220 340 220 340 !important;
  border-image-width:11px 13px !important;
  border-image-repeat:stretch !important;
  background:linear-gradient(180deg, rgba(71,41,32,.95), rgba(34,21,18,.98)) !important;
  background-clip:padding-box !important;
  box-shadow:inset 0 0 0 1px rgba(255,255,255,.02), 0 3px 10px rgba(0,0,0,.18) !important;
  color:#f1e0c2 !important;
  min-height:40px !important;
  padding:8px 14px !important;
  text-shadow:0 1px 0 rgba(0,0,0,.75) !important;
}

.theme-sandstone .window-close-btn,
.theme-sandstone .dialog-close-btn,
.theme-sandstone .support-close-btn,
.theme-sandstone .home-info-close {
  border:10px solid transparent !important;
  border-image-source:url("assets/ui/gothic/button_frame.png") !important;
  border-image-slice:220 340 220 340 !important;
  border-image-width:10px 12px !important;
  border-image-repeat:stretch !important;
  background:linear-gradient(180deg, rgba(68,39,31,.95), rgba(32,20,17,.98)) !important;
  background-clip:padding-box !important;
  color:#f1e0c2 !important;
  border-radius:0 !important;
  box-shadow:0 2px 8px rgba(0,0,0,.18) !important;
}

.theme-sandstone .primary-home-choice {
  min-height:68px !important;
  padding:12px 16px !important;
  text-align:left;
  align-content:center;
  gap:3px;
}

.theme-sandstone .primary-home-choice strong {
  font-size:clamp(1.18rem, 1.55vw, 1.5rem);
  line-height:1.15;
}

.theme-sandstone .primary-home-choice span {
  display:block;
  font-size:.76rem;
  line-height:1.35;
}

.theme-sandstone .ui-ornate-button:hover:not(:disabled),
.theme-sandstone .primary-home-choice:hover:not(:disabled),
.theme-sandstone .choice-btn:hover:not(:disabled),
.theme-sandstone .btn:hover:not(:disabled),
.theme-sandstone .mode-toggle:hover,
.theme-sandstone .home-info-action:hover,
.theme-sandstone .support-launch-btn:hover,
.theme-sandstone .history-tab:hover,
.theme-sandstone .currency-panel .currency-image-button.available:hover,
.theme-sandstone .currency-panel .currency-name-button.available:hover,
.theme-sandstone .currency-panel .currency-text-button.available:not(.well-reveal-button):hover {
  filter:brightness(1.06);
  transform:none !important;
}

.theme-sandstone .support-launch-btn {
  right:20px;
  bottom:20px;
  min-width:110px !important;
  padding:7px 12px !important;
  font-size:.78rem !important;
}

.theme-sandstone .support-card {
  width:min(620px, calc(100vw - 36px));
  padding:52px 42px 42px;
  color:#f0dfc5;
}

.theme-sandstone .item-card {
  width:min(100%, 500px);
  min-height:670px;
  padding:20px 24px 22px;
  background:
    linear-gradient(180deg, rgba(6,6,8,.96), rgba(14,12,11,.98)),
    var(--obsidian-texture) !important;
  background-size:auto, 760px 760px !important;
  background-repeat:no-repeat, repeat !important;
  border:1px solid rgba(143,102,63,.44);
  box-shadow:inset 0 0 32px rgba(194,142,84,.06), 0 8px 26px rgba(0,0,0,.28);
}

.theme-sandstone .currency-panel .currency-group,
.theme-sandstone .badge,
.theme-sandstone .count-chip,
.theme-sandstone .message-bar,
.theme-sandstone .metric,
.theme-sandstone .reverse-simple-route li {
  background-color:rgba(54,33,26,.56) !important;
  background-image:none !important;
  border-color:rgba(176,122,72,.22) !important;
  box-shadow:none !important;
}

.theme-sandstone input,
.theme-sandstone select,
.theme-sandstone textarea,
.theme-sandstone .reverse-input {
  color:#f2e5cb !important;
  background:rgba(31,22,18,.94) !important;
  border:1px solid rgba(166,114,67,.42) !important;
  border-radius:6px !important;
  box-shadow:inset 0 0 12px rgba(0,0,0,.18) !important;
}

.theme-sandstone .divider,
.theme-sandstone .ui-ornate-divider {
  height:1px;
  background-image:linear-gradient(90deg, transparent, rgba(188,132,79,.62), transparent) !important;
  opacity:.75 !important;
}

@media (max-width: 1100px) {
  .theme-sandstone .app-shell {
    width:min(100vw - 24px, 1480px);
  }
  .theme-sandstone .entrance-card {
    grid-template-columns:1fr;
    grid-template-areas:
      "title"
      "primary"
      "secondary"
      "footer";
    padding:30px 24px 24px;
  }
  .theme-sandstone .workspace {
    grid-template-columns:1fr;
  }
  .theme-sandstone .control-strip {
    grid-template-columns:1fr 1fr;
  }
  .theme-sandstone #modeToggleBtn {
    justify-self:start;
  }
}

@media (max-width: 720px) {
  .theme-sandstone .app-shell {
    width:min(100vw - 16px, 1480px);
  }
  .theme-sandstone .topbar {
    align-items:flex-start;
    flex-direction:column;
    padding:20px 14px 16px;
  }
  .theme-sandstone .control-strip {
    grid-template-columns:1fr;
    padding:16px 14px;
  }
  .theme-sandstone .primary-home-choice strong {
    font-size:1.1rem;
  }
}

.theme-sandstone .panel { position:relative; overflow:visible; border:24px solid transparent !important; border-radius:0 !important; border-image-source:url("assets/ui/gothic/panel_frame_main.png") !important; border-image-slice:170 170 170 170 !important; border-image-width:24px !important; border-image-repeat:stretch !important; background-clip:padding-box !important; }
.theme-sandstone .panel::before { content:none !important; }


/* Version 106 — fitted border system and compact controls. */
body.theme-sandstone,
.theme-sandstone {
  --frame-button:url("assets/ui/gothic/button-border-minimal.svg");
  --frame-wide:url("assets/ui/gothic/frame-wide.svg");
  --frame-tall:url("assets/ui/gothic/frame-tall.svg");
  --frame-modal:url("assets/ui/gothic/frame-modal.svg");
  --frame-header:url("assets/ui/gothic/frame-header.svg");
}

/* Remove legacy frame pseudo-images. Ornament now lives only in border-image. */
.theme-sandstone .topbar::before,
.theme-sandstone .panel::before,
.theme-sandstone .item-panel::before,
.theme-sandstone .currency-panel::before,
.theme-sandstone .history-panel::before,
.theme-sandstone .assumptions-panel::before,
.theme-sandstone .entrance-card::before,
.theme-sandstone .dialog-card::before,
.theme-sandstone .home-info-card::before,
.theme-sandstone .modifier-browser-card::before,
.theme-sandstone .legal-disclosure-card::before,
.theme-sandstone .support-card::before {
  content:none !important;
  display:none !important;
}

.theme-sandstone .topbar {
  border:20px solid transparent !important;
  border-image-source:var(--frame-header) !important;
  border-image-slice:82 105 82 105 !important;
  border-image-width:20px 26px !important;
  border-image-repeat:stretch !important;
  background-clip:padding-box !important;
  padding:18px 18px 14px !important;
  margin:12px auto 18px !important;
}

.theme-sandstone .entrance-card,
.theme-sandstone .panel,
.theme-sandstone .challenge-target-card,
.theme-sandstone .challenge-score-card,
.theme-sandstone .challenge-empty,
.theme-sandstone .challenge-status-panel,
.theme-sandstone .reverse-plan-card,
.theme-sandstone .reverse-simple-route {
  border:20px solid transparent !important;
  border-image-source:var(--frame-wide) !important;
  border-image-slice:128 !important;
  border-image-width:20px !important;
  border-image-repeat:stretch !important;
  border-radius:0 !important;
  background-clip:padding-box !important;
}

.theme-sandstone .item-panel,
.theme-sandstone .currency-panel,
.theme-sandstone .history-panel,
.theme-sandstone .assumptions-panel,
.theme-sandstone .home-info-actions {
  border:18px solid transparent !important;
  border-image-source:var(--frame-tall) !important;
  border-image-slice:132 !important;
  border-image-width:18px !important;
  border-image-repeat:stretch !important;
  border-radius:0 !important;
  background-clip:padding-box !important;
}

.theme-sandstone .dialog-card,
.theme-sandstone .home-info-card,
.theme-sandstone .modifier-browser-card,
.theme-sandstone .legal-disclosure-card,
.theme-sandstone .support-card,
.theme-sandstone dialog .dialog-card {
  border:20px solid transparent !important;
  border-image-source:var(--frame-modal) !important;
  border-image-slice:112 !important;
  border-image-width:20px !important;
  border-image-repeat:stretch !important;
  border-radius:0 !important;
  background-clip:padding-box !important;
}

.theme-sandstone .entrance-card {
  width:min(1240px, calc(100vw - 72px)) !important;
  padding:30px 30px 26px !important;
  gap:18px 24px !important;
  margin:auto !important;
}

.theme-sandstone .home-info-actions {
  padding:16px !important;
  margin:0 !important;
  min-height:0 !important;
}

/* Minimal border-only button artwork. No opaque image center or black box. */
.theme-sandstone .ui-ornate-button,
.theme-sandstone .primary-home-choice,
.theme-sandstone .choice-btn,
.theme-sandstone .btn,
.theme-sandstone .mode-toggle,
.theme-sandstone .home-info-action,
.theme-sandstone .support-launch-btn,
.theme-sandstone .history-tab,
.theme-sandstone .currency-panel .currency-image-button,
.theme-sandstone .currency-panel .currency-name-button,
.theme-sandstone .currency-panel .currency-text-button:not(.well-reveal-button),
.theme-sandstone .save-base-button,
.theme-sandstone .new-seed-btn,
.theme-sandstone .reverse-guide-direct-action,
.theme-sandstone .window-close-btn,
.theme-sandstone .dialog-close-btn,
.theme-sandstone .support-close-btn,
.theme-sandstone .home-info-close {
  border:8px solid transparent !important;
  border-image-source:var(--frame-button) !important;
  border-image-slice:42 82 !important;
  border-image-width:8px 10px !important;
  border-image-repeat:stretch !important;
  border-radius:0 !important;
  background:linear-gradient(180deg, rgba(86,51,38,.64), rgba(45,29,24,.62)) !important;
  background-image:linear-gradient(180deg, rgba(86,51,38,.64), rgba(45,29,24,.62)) !important;
  background-clip:padding-box !important;
  box-shadow:0 2px 7px rgba(0,0,0,.16) !important;
  color:#f1dfc2 !important;
  text-shadow:0 1px 0 rgba(0,0,0,.72) !important;
}

.theme-sandstone .primary-home-choice {
  min-height:62px !important;
  padding:10px 14px !important;
}
.theme-sandstone .home-info-action,
.theme-sandstone .mode-toggle,
.theme-sandstone .btn {
  min-height:36px !important;
  padding:6px 11px !important;
}

/* Every close label stays inside and centered in its button. */
.theme-sandstone .window-close-btn,
.theme-sandstone .dialog-close-btn,
.theme-sandstone .support-close-btn,
.theme-sandstone .home-info-close {
  display:inline-grid !important;
  place-items:center !important;
  min-width:70px !important;
  width:auto !important;
  height:34px !important;
  min-height:34px !important;
  padding:0 10px !important;
  line-height:1 !important;
  white-space:nowrap !important;
  overflow:hidden !important;
}
.theme-sandstone .support-close-btn {
  position:absolute !important;
  top:20px !important;
  right:20px !important;
  z-index:4 !important;
}
.theme-sandstone .home-info-close,
.theme-sandstone .dialog-close-btn,
.theme-sandstone .window-close-btn {
  top:16px;
  right:16px;
}

/* Support opens as an independent viewport modal, not inside the home card. */
.theme-sandstone .support-overlay {
  position:fixed !important;
  inset:0 !important;
  z-index:2147483660 !important;
  display:grid !important;
  place-items:center !important;
  padding:24px !important;
  background:rgba(7,5,4,.86) !important;
  backdrop-filter:blur(7px) !important;
}
.theme-sandstone .support-overlay.hidden {
  display:none !important;
}
.theme-sandstone .support-card {
  position:relative !important;
  width:min(620px, calc(100vw - 36px)) !important;
  min-height:330px !important;
  padding:56px 48px 42px !important;
  text-align:center !important;
}

/* Bottom-right home support entry. */
.theme-sandstone .support-launch-btn {
  position:fixed !important;
  right:24px !important;
  bottom:22px !important;
  z-index:2147483610 !important;
  min-width:108px !important;
  min-height:34px !important;
  padding:5px 10px !important;
  font-size:.76rem !important;
}

/* Compact Currency Library controls: roughly half-height while retaining art. */
.theme-sandstone .currency-image-grid {
  grid-template-columns:repeat(10, minmax(32px, 1fr)) !important;
  gap:4px !important;
}
.theme-sandstone .currency-name-grid {
  grid-template-columns:repeat(8, minmax(0, 1fr)) !important;
  gap:4px !important;
  padding:0 6px 6px !important;
}
.theme-sandstone .currency-panel .currency-image-button {
  min-height:34px !important;
  height:34px !important;
  padding:1px !important;
  border-width:5px !important;
  border-image-width:5px 6px !important;
  background:rgba(93,57,40,.24) !important;
  overflow:visible !important;
}
.theme-sandstone .currency-panel .currency-image-button img {
  width:28px !important;
  height:28px !important;
  max-width:100% !important;
  object-fit:contain !important;
}
.theme-sandstone .currency-fallback-label {
  width:27px !important;
  height:27px !important;
  font-size:.52rem !important;
  background:radial-gradient(circle, rgba(104,65,44,.58), rgba(48,30,24,.72) 72%) !important;
}
.theme-sandstone .currency-panel .currency-name-button {
  min-height:24px !important;
  padding:2px 4px !important;
  border-width:5px !important;
  border-image-width:5px 6px !important;
  font-size:.62rem !important;
  background:rgba(93,57,40,.24) !important;
}
.theme-sandstone .currency-panel .currency-text-button:not(.well-reveal-button) {
  min-height:30px !important;
  padding:3px 6px !important;
  border-width:5px !important;
  border-image-width:5px 6px !important;
  font-size:.64rem !important;
  background:rgba(93,57,40,.24) !important;
}

/* Professional spacing and alignment pass. */
.theme-sandstone .app-shell {
  width:min(1480px, calc(100vw - 40px)) !important;
  margin:0 auto 64px !important;
}
.theme-sandstone .workspace {
  grid-template-columns:minmax(400px, 450px) minmax(0, 1fr) !important;
  gap:20px !important;
}
.theme-sandstone .left-column,
.theme-sandstone .right-column {
  gap:20px !important;
}
.theme-sandstone .item-panel,
.theme-sandstone .currency-panel,
.theme-sandstone .metric-panel,
.theme-sandstone .history-panel,
.theme-sandstone .assumptions-panel {
  padding:14px !important;
}
.theme-sandstone .panel-heading {
  margin-bottom:10px !important;
}

@media (max-width:1180px) {
  .theme-sandstone .currency-image-grid {
    grid-template-columns:repeat(8, minmax(32px, 1fr)) !important;
  }
}
@media (max-width:900px) {
  .theme-sandstone .app-shell {
    width:min(100vw - 20px, 1480px) !important;
  }
  .theme-sandstone .workspace {
    grid-template-columns:1fr !important;
  }
  .theme-sandstone .currency-image-grid {
    grid-template-columns:repeat(10, minmax(32px, 1fr)) !important;
  }
  .theme-sandstone .entrance-card {
    width:min(100vw - 24px, 900px) !important;
  }
}
@media (max-width:620px) {
  .theme-sandstone .currency-image-grid {
    grid-template-columns:repeat(6, minmax(32px, 1fr)) !important;
  }
  .theme-sandstone .currency-name-grid {
    grid-template-columns:repeat(4, minmax(0, 1fr)) !important;
  }
  .theme-sandstone .support-launch-btn {
    right:12px !important;
    bottom:12px !important;
  }
  .theme-sandstone .support-card {
    padding:54px 28px 34px !important;
  }
}

/* Version 107 — geometric Sekhema frame system and persistent Reverse Craft guide. */
body.theme-sandstone,
.theme-sandstone {
  --sekhema-frame-wide:url("assets/ui/sekhema/frame-wide.svg");
  --sekhema-frame-tall:url("assets/ui/sekhema/frame-tall.svg");
  --sekhema-frame-modal:url("assets/ui/sekhema/frame-modal.svg");
  --sekhema-frame-header:url("assets/ui/sekhema/frame-header.svg");
  --sekhema-frame-button:url("assets/ui/sekhema/frame-button.svg");
  --sekhema-frame-medallion:url("assets/ui/sekhema/frame-medallion.svg");
  --bg:#17100c;
  --panel:#261a14;
  --panel-2:#1b120e;
  --line:rgba(177,126,70,.38);
  --line-soft:rgba(92,57,34,.5);
  --text:#f1e3cc;
  --muted:#c4aa88;
  --gold:#d0a35c;
  --gold-2:#ecd198;
}

body.theme-sandstone {
  background-color:#130d0a;
  background-image:
    radial-gradient(circle at 50% -8%, rgba(163,108,56,.18), transparent 34rem),
    linear-gradient(180deg, rgba(44,30,22,.92), rgba(16,11,9,.99)),
    var(--obsidian-texture);
  background-size:auto, auto, 880px 880px;
}

/* Fit-specific, transparent-center vector borders based on the supplied angular sandstone frame. */
.theme-sandstone .entrance-card,
.theme-sandstone .metric-panel,
.theme-sandstone .challenge-target-card,
.theme-sandstone .challenge-score-card,
.theme-sandstone .challenge-empty,
.theme-sandstone .reverse-plan-card,
.theme-sandstone .reverse-simple-route {
  border:22px solid transparent !important;
  border-image-source:var(--sekhema-frame-wide) !important;
  border-image-slice:116 !important;
  border-image-width:22px !important;
  border-image-repeat:round !important;
  border-radius:0 !important;
  background-clip:padding-box !important;
}

.theme-sandstone .item-panel,
.theme-sandstone .currency-panel,
.theme-sandstone .history-panel,
.theme-sandstone .assumptions-panel,
.theme-sandstone .challenge-status-panel.reverse-guide-status,
.theme-sandstone .home-info-actions {
  border:20px solid transparent !important;
  border-image-source:var(--sekhema-frame-tall) !important;
  border-image-slice:98 !important;
  border-image-width:20px !important;
  border-image-repeat:round !important;
  border-radius:0 !important;
  background-clip:padding-box !important;
}

.theme-sandstone .dialog-card,
.theme-sandstone .home-info-card,
.theme-sandstone .modifier-browser-card,
.theme-sandstone .legal-disclosure-card,
.theme-sandstone .support-card,
.theme-sandstone dialog .dialog-card {
  border:22px solid transparent !important;
  border-image-source:var(--sekhema-frame-modal) !important;
  border-image-slice:100 !important;
  border-image-width:22px !important;
  border-image-repeat:round !important;
  border-radius:0 !important;
  background-clip:padding-box !important;
}

.theme-sandstone .topbar {
  border:20px solid transparent !important;
  border-image-source:var(--sekhema-frame-header) !important;
  border-image-slice:92 104 !important;
  border-image-width:20px 24px !important;
  border-image-repeat:round !important;
  border-radius:0 !important;
  background-clip:padding-box !important;
}

/* Remove every legacy frame pseudo-layer; geometry now belongs to the actual border. */
.theme-sandstone .topbar::before,
.theme-sandstone .panel::before,
.theme-sandstone .item-panel::before,
.theme-sandstone .currency-panel::before,
.theme-sandstone .history-panel::before,
.theme-sandstone .assumptions-panel::before,
.theme-sandstone .dialog-card::before,
.theme-sandstone .home-info-card::before,
.theme-sandstone .modifier-browser-card::before,
.theme-sandstone .legal-disclosure-card::before,
.theme-sandstone .support-card::before,
.theme-sandstone .entrance-card::before,
.theme-sandstone .challenge-status-panel::before {
  content:none !important;
}

.theme-sandstone .entrance-card,
.theme-sandstone .panel,
.theme-sandstone .home-info-card,
.theme-sandstone .legal-disclosure-card,
.theme-sandstone .support-card,
.theme-sandstone dialog .dialog-card,
.theme-sandstone .challenge-status-panel,
.theme-sandstone .reverse-plan-card,
.theme-sandstone .reverse-simple-route {
  background-color:rgba(52,37,27,.965) !important;
  background-image:
    linear-gradient(180deg, rgba(140,99,57,.11), rgba(27,18,14,.16)),
    var(--obsidian-texture) !important;
  background-size:auto, 760px 760px !important;
  background-repeat:no-repeat, repeat !important;
  box-shadow:0 16px 36px rgba(0,0,0,.33), inset 0 0 0 1px rgba(246,217,166,.04), inset 0 0 34px rgba(0,0,0,.16) !important;
}

.theme-sandstone .topbar {
  background-color:rgba(42,28,21,.97) !important;
  background-image:
    linear-gradient(90deg, rgba(69,45,31,.68), rgba(91,57,36,.62), rgba(69,45,31,.68)),
    var(--obsidian-texture) !important;
  background-size:auto, 760px 760px !important;
}

/* Small fixed medallions retain the reference image's center emphasis without stretching. */
.theme-sandstone .entrance-card::after,
.theme-sandstone .challenge-status-panel.reverse-guide-status::after,
.theme-sandstone .support-card::after,
.theme-sandstone .home-info-card::after,
.theme-sandstone .modifier-browser-card::after,
.theme-sandstone .dialog-card::after {
  content:"";
  position:absolute;
  top:-31px;
  left:50%;
  width:78px;
  height:52px;
  transform:translateX(-50%);
  background:var(--sekhema-frame-medallion) center/contain no-repeat;
  pointer-events:none;
  z-index:3;
}

/* Compact geometric button borders. */
.theme-sandstone .ui-ornate-button,
.theme-sandstone .primary-home-choice,
.theme-sandstone .choice-btn,
.theme-sandstone .btn,
.theme-sandstone .mode-toggle,
.theme-sandstone .home-info-action,
.theme-sandstone .support-launch-btn,
.theme-sandstone .history-tab,
.theme-sandstone .currency-panel .currency-image-button,
.theme-sandstone .currency-panel .currency-name-button,
.theme-sandstone .currency-panel .currency-text-button:not(.well-reveal-button),
.theme-sandstone .save-base-button,
.theme-sandstone .new-seed-btn,
.theme-sandstone .reverse-guide-direct-action,
.theme-sandstone .window-close-btn,
.theme-sandstone .dialog-close-btn,
.theme-sandstone .support-close-btn,
.theme-sandstone .home-info-close {
  border:7px solid transparent !important;
  border-image-source:var(--sekhema-frame-button) !important;
  border-image-slice:54 92 !important;
  border-image-width:7px 9px !important;
  border-image-repeat:round !important;
  border-radius:0 !important;
  background:linear-gradient(180deg, rgba(91,56,39,.76), rgba(46,30,24,.82)) !important;
  background-clip:padding-box !important;
  color:#f2e3c7 !important;
  box-shadow:0 2px 7px rgba(0,0,0,.14) !important;
  text-shadow:0 1px 0 rgba(0,0,0,.72) !important;
}

/* Default mode. */
body.theme-sandstone.experienced-mode .mode-toggle {
  border-color:transparent !important;
  filter:brightness(1.05);
}

/* Persistent three-column Reverse Craft workspace. */
.reverse-guide-column {
  display:block;
  min-width:0;
  align-self:start;
  position:sticky;
  top:12px;
  max-height:calc(100vh - 24px);
  overflow:auto;
  scrollbar-gutter:stable;
  z-index:6;
}
.reverse-guide-column.hidden { display:none !important; }

body.reverse-workspace-active.theme-sandstone .app-shell {
  width:min(1780px, calc(100vw - 24px)) !important;
}
body.reverse-workspace-active.theme-sandstone .workspace {
  grid-template-columns:minmax(390px, 430px) minmax(500px, 1fr) minmax(330px, 380px) !important;
  gap:14px !important;
  align-items:start !important;
}
body.reverse-workspace-active.theme-sandstone .left-column,
body.reverse-workspace-active.theme-sandstone .right-column {
  gap:14px !important;
}
body.reverse-workspace-active.theme-sandstone .currency-panel {
  padding:10px !important;
}

.theme-sandstone .challenge-status-panel.reverse-guide-status {
  position:relative;
  display:grid !important;
  grid-template-columns:1fr !important;
  gap:10px !important;
  width:100%;
  margin:0 !important;
  padding:14px !important;
  max-height:none;
  overflow:visible;
  background-color:rgba(45,31,24,.98) !important;
}

/* Guide actions are always visible at the top. */
.theme-sandstone .reverse-guide-toolbar {
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:8px;
  padding-bottom:8px;
  border-bottom:1px solid rgba(210,159,91,.23);
}
.theme-sandstone .reverse-guide-toolbar > b {
  color:#e6c684;
  font-size:.72rem;
  letter-spacing:.08em;
  text-transform:uppercase;
}
.theme-sandstone .reverse-guide-buttons {
  display:flex;
  flex-wrap:wrap;
  justify-content:flex-end;
  gap:5px;
}
.theme-sandstone .reverse-guide-buttons .btn {
  min-height:30px !important;
  padding:4px 8px !important;
  font-size:.66rem !important;
}
.theme-sandstone .reverse-guide-main {
  width:100%;
  display:grid;
  gap:8px;
  min-width:0;
}
.theme-sandstone .reverse-guide-progress {
  display:grid;
  grid-template-columns:auto minmax(0,1fr);
  gap:8px;
  align-items:baseline;
}
.theme-sandstone .reverse-guide-progress span {
  text-align:right;
  font-size:.64rem;
}
.theme-sandstone .reverse-guide-current {
  width:100%;
  padding:9px 10px;
  border-radius:0;
  background:rgba(24,17,14,.5);
}
.theme-sandstone .reverse-guide-current p {
  width:100%;
  margin:4px 0 6px;
  font-size:.73rem;
  line-height:1.34;
}
.theme-sandstone .reverse-guide-current small {
  font-size:.62rem;
  line-height:1.35;
}
.theme-sandstone .reverse-guide-target {
  width:100%;
  font-size:.65rem;
}

/* Currency images are 75% larger than Version 106, while fixed-size columns remove unused horizontal padding. */
.theme-sandstone .currency-image-grid {
  grid-template-columns:repeat(auto-fill, 60px) !important;
  justify-content:start !important;
  gap:2px !important;
  padding:2px 4px 5px !important;
}
.theme-sandstone .currency-name-grid {
  grid-template-columns:repeat(auto-fill, minmax(84px, 1fr)) !important;
  gap:3px !important;
  padding:0 4px 5px !important;
}
.theme-sandstone .currency-tip {
  width:60px;
  min-width:60px;
  max-width:60px;
}
.theme-sandstone .currency-panel .currency-image-button {
  width:60px !important;
  min-width:60px !important;
  height:60px !important;
  min-height:60px !important;
  padding:2px !important;
  border-width:6px !important;
  border-image-width:6px 7px !important;
  background:rgba(104,68,45,.26) !important;
}
.theme-sandstone .currency-panel .currency-image-button img {
  width:49px !important;
  height:49px !important;
  object-fit:contain !important;
}
.theme-sandstone .currency-fallback-label {
  width:47px !important;
  height:47px !important;
  font-size:.62rem !important;
}
.theme-sandstone .currency-panel .currency-name-button {
  min-height:28px !important;
  padding:3px 5px !important;
  font-size:.61rem !important;
}
.theme-sandstone .currency-panel .currency-text-button:not(.well-reveal-button) {
  min-height:34px !important;
  padding:4px 7px !important;
  font-size:.63rem !important;
}

/* Modifier metadata uses one visual hierarchy on both sides of the row. */
.theme-sandstone .mod-line .mod-level,
.theme-sandstone .mod-line .mod-meta {
  color:#8f8477 !important;
  font:600 .66rem/1.25 ui-sans-serif,system-ui,sans-serif !important;
  letter-spacing:0 !important;
  text-shadow:none !important;
}

@media (max-width:1450px) {
  body.reverse-workspace-active.theme-sandstone .workspace {
    grid-template-columns:minmax(360px, 410px) minmax(440px, 1fr) minmax(300px, 340px) !important;
  }
}
@media (max-width:1180px) {
  body.reverse-workspace-active.theme-sandstone .workspace,
  .theme-sandstone .workspace {
    grid-template-columns:1fr !important;
  }
  .reverse-guide-column {
    position:relative;
    top:auto;
    max-height:none;
    grid-column:1;
  }
  .theme-sandstone .currency-image-grid {
    grid-template-columns:repeat(auto-fill, 60px) !important;
  }
}

/* Remaining generic framed surfaces use the new wide model; item, library, history,
   and assumptions panels retain their later fit-specific tall declarations. */
.theme-sandstone .panel:not(.item-panel):not(.currency-panel):not(.history-panel):not(.assumptions-panel) {
  border:22px solid transparent !important;
  border-image-source:var(--sekhema-frame-wide) !important;
  border-image-slice:116 !important;
  border-image-width:22px !important;
  border-image-repeat:round !important;
  border-radius:0 !important;
  background-clip:padding-box !important;
}

/* Version 108 — weathered reference frame overhaul, zero-gap currency wall,
   and category-specific pin glows. */
body.theme-sandstone,
.theme-sandstone {
  --sekhema-frame-wide:url("assets/ui/sekhema/frame-wide.svg");
  --sekhema-frame-tall:url("assets/ui/sekhema/frame-tall.svg");
  --sekhema-frame-modal:url("assets/ui/sekhema/frame-modal.svg");
  --sekhema-frame-header:url("assets/ui/sekhema/frame-header.svg");
  --sekhema-frame-button:url("assets/ui/sekhema/frame-button.svg");
  --sekhema-frame-medallion:url("assets/ui/sekhema/frame-medallion.svg");
  --sekhema-stone-surface:url("assets/ui/sekhema/stone-surface-v108.webp");
  --panel:#2d211a;
  --panel-2:#211712;
  --line:rgba(177,129,76,.34);
  --line-soft:rgba(83,55,38,.62);
  --text:#f0dfc5;
  --muted:#c2a985;
  --gold:#c69a5a;
  --gold-2:#e3c58c;
}

body.theme-sandstone {
  background-color:#120d0a;
  background-image:
    radial-gradient(circle at 50% -12%, rgba(138,96,57,.16), transparent 34rem),
    linear-gradient(180deg, rgba(43,31,23,.9), rgba(14,10,8,.99)),
    var(--sekhema-stone-surface);
  background-size:auto, auto, 1024px 768px;
  background-repeat:no-repeat, no-repeat, repeat;
}

.theme-sandstone .entrance-screen {
  background-color:#120d0a;
  background-image:
    radial-gradient(circle at 50% 12%, rgba(147,101,59,.15), transparent 30rem),
    linear-gradient(180deg, rgba(45,32,24,.93), rgba(15,10,8,.99)),
    var(--sekhema-stone-surface);
  background-size:auto, auto, 1024px 768px;
  background-repeat:no-repeat, no-repeat, repeat;
}

/* Realistic rough surface from the supplied reference replaces the smooth
   synthetic sandstone fill on every framed interface. */
.theme-sandstone .entrance-card,
.theme-sandstone .panel,
.theme-sandstone .home-info-card,
.theme-sandstone .legal-disclosure-card,
.theme-sandstone .support-card,
.theme-sandstone dialog .dialog-card,
.theme-sandstone .challenge-target-card,
.theme-sandstone .challenge-score-card,
.theme-sandstone .challenge-empty,
.theme-sandstone .challenge-status-panel,
.theme-sandstone .reverse-plan-card,
.theme-sandstone .reverse-simple-route {
  background-color:rgba(48,35,27,.97) !important;
  background-image:
    linear-gradient(180deg, rgba(127,92,56,.08), rgba(22,15,12,.22)),
    var(--sekhema-stone-surface) !important;
  background-size:auto, cover !important;
  background-position:center, center !important;
  background-repeat:no-repeat !important;
  box-shadow:
    0 18px 42px rgba(0,0,0,.4),
    inset 0 0 0 1px rgba(236,207,158,.035),
    inset 0 0 36px rgba(18,11,8,.24) !important;
}

.theme-sandstone .topbar {
  background-color:rgba(43,29,22,.98) !important;
  background-image:
    linear-gradient(90deg, rgba(61,42,29,.76), rgba(83,56,35,.7), rgba(61,42,29,.76)),
    var(--sekhema-stone-surface) !important;
  background-size:auto, cover !important;
  background-repeat:no-repeat !important;
}

/* Fit-specific borders: use stretch only within the matching aspect model,
   avoiding the repeated or plastic-looking edges from Version 107. */
.theme-sandstone .entrance-card,
.theme-sandstone .metric-panel,
.theme-sandstone .challenge-target-card,
.theme-sandstone .challenge-score-card,
.theme-sandstone .challenge-empty,
.theme-sandstone .reverse-plan-card,
.theme-sandstone .reverse-simple-route,
.theme-sandstone .panel:not(.item-panel):not(.currency-panel):not(.history-panel):not(.assumptions-panel) {
  border:22px solid transparent !important;
  border-image-source:var(--sekhema-frame-wide) !important;
  border-image-slice:122 !important;
  border-image-width:22px !important;
  border-image-repeat:stretch !important;
}

.theme-sandstone .item-panel,
.theme-sandstone .currency-panel,
.theme-sandstone .history-panel,
.theme-sandstone .assumptions-panel,
.theme-sandstone .challenge-status-panel.reverse-guide-status,
.theme-sandstone .home-info-actions {
  border:20px solid transparent !important;
  border-image-source:var(--sekhema-frame-tall) !important;
  border-image-slice:124 !important;
  border-image-width:20px !important;
  border-image-repeat:stretch !important;
}

.theme-sandstone .dialog-card,
.theme-sandstone .home-info-card,
.theme-sandstone .modifier-browser-card,
.theme-sandstone .legal-disclosure-card,
.theme-sandstone .support-card,
.theme-sandstone dialog .dialog-card {
  border:22px solid transparent !important;
  border-image-source:var(--sekhema-frame-modal) !important;
  border-image-slice:126 !important;
  border-image-width:22px !important;
  border-image-repeat:stretch !important;
}

.theme-sandstone .topbar {
  border:20px solid transparent !important;
  border-image-source:var(--sekhema-frame-header) !important;
  border-image-slice:96 110 !important;
  border-image-width:20px 24px !important;
  border-image-repeat:stretch !important;
}

.theme-sandstone .entrance-card::after,
.theme-sandstone .challenge-status-panel.reverse-guide-status::after,
.theme-sandstone .support-card::after,
.theme-sandstone .home-info-card::after,
.theme-sandstone .modifier-browser-card::after,
.theme-sandstone .dialog-card::after {
  width:72px !important;
  height:48px !important;
  top:-29px !important;
  background-image:var(--sekhema-frame-medallion) !important;
  filter:drop-shadow(0 5px 5px rgba(0,0,0,.48));
}

.theme-sandstone .ui-ornate-button,
.theme-sandstone .primary-home-choice,
.theme-sandstone .choice-btn,
.theme-sandstone .btn,
.theme-sandstone .mode-toggle,
.theme-sandstone .home-info-action,
.theme-sandstone .support-launch-btn,
.theme-sandstone .history-tab,
.theme-sandstone .currency-panel .currency-image-button,
.theme-sandstone .currency-panel .currency-name-button,
.theme-sandstone .currency-panel .currency-text-button:not(.well-reveal-button),
.theme-sandstone .save-base-button,
.theme-sandstone .new-seed-btn,
.theme-sandstone .reverse-guide-direct-action,
.theme-sandstone .window-close-btn,
.theme-sandstone .dialog-close-btn,
.theme-sandstone .support-close-btn,
.theme-sandstone .home-info-close {
  border-image-source:var(--sekhema-frame-button) !important;
  border-image-slice:58 96 !important;
  border-image-width:7px 9px !important;
  border-image-repeat:stretch !important;
  background:
    linear-gradient(180deg, rgba(91,63,42,.76), rgba(44,30,24,.88)),
    var(--sekhema-stone-surface) !important;
  background-size:auto, cover !important;
  background-position:center !important;
  color:#f1dfc1 !important;
  box-shadow:0 2px 7px rgba(0,0,0,.2), inset 0 0 10px rgba(0,0,0,.13) !important;
}

/* Currency tiles touch edge-to-edge. Their visible border line forms one
   continuous compact wall, reducing the Currency Library's total width. */
.theme-sandstone .currency-image-grid {
  grid-template-columns:repeat(auto-fill, 60px) !important;
  justify-content:start !important;
  gap:0 !important;
  row-gap:0 !important;
  column-gap:0 !important;
  padding:0 !important;
}
.theme-sandstone .currency-tip {
  margin:0 !important;
  width:60px !important;
  min-width:60px !important;
  max-width:60px !important;
}
.theme-sandstone .currency-panel .currency-image-button {
  margin:0 !important;
  width:60px !important;
  min-width:60px !important;
  height:60px !important;
  min-height:60px !important;
}
.theme-sandstone .normal-currency-section,
.theme-sandstone .desecration-left-controls,
.theme-sandstone .desecration-right-controls {
  gap:0 !important;
}

/* Narrower Currency Library in both standard and Reverse Craft layouts. */
body:not(.reverse-workspace-active).theme-sandstone .workspace {
  grid-template-columns:minmax(390px, 430px) minmax(420px, 560px) !important;
  justify-content:center !important;
  gap:16px !important;
}
body:not(.reverse-workspace-active).theme-sandstone .right-column {
  width:100%;
  max-width:560px;
}
body.reverse-workspace-active.theme-sandstone .workspace {
  grid-template-columns:minmax(390px, 430px) minmax(420px, 480px) minmax(340px, 390px) !important;
  justify-content:center !important;
  gap:12px !important;
}
body.reverse-workspace-active.theme-sandstone .right-column {
  width:100%;
  max-width:480px;
}
body.reverse-workspace-active.theme-sandstone .currency-panel {
  padding:8px !important;
}

/* Pin feedback: persistent Omens glow soft red; user-pinned Desecration
   currencies glow light green. The frame remains visible beneath the glow. */
.theme-sandstone .currency-tip.omen-pinned .currency-image-button,
.theme-sandstone .currency-tip.omen-pinned .currency-text-button {
  outline:1px solid rgba(235,91,82,.8) !important;
  outline-offset:-2px !important;
  box-shadow:
    inset 0 0 0 2px rgba(244,99,88,.42),
    inset 0 0 18px rgba(220,55,49,.16),
    0 0 12px rgba(228,67,58,.34) !important;
  filter:brightness(1.05) saturate(1.06);
}
.theme-sandstone .currency-tip.desecration-pinned .currency-image-button,
.theme-sandstone .currency-tip.desecration-pinned .currency-text-button {
  outline:1px solid rgba(133,224,151,.82) !important;
  outline-offset:-2px !important;
  box-shadow:
    inset 0 0 0 2px rgba(141,231,157,.4),
    inset 0 0 18px rgba(71,185,104,.15),
    0 0 12px rgba(91,211,126,.32) !important;
  filter:brightness(1.05) saturate(1.05);
}

@media (max-width:1180px) {
  body:not(.reverse-workspace-active).theme-sandstone .workspace,
  body.reverse-workspace-active.theme-sandstone .workspace {
    grid-template-columns:1fr !important;
  }
  body:not(.reverse-workspace-active).theme-sandstone .right-column,
  body.reverse-workspace-active.theme-sandstone .right-column {
    max-width:none;
  }
}

/* Preserve full icon art inside the zero-gap 60px currency tiles. */
.theme-sandstone .currency-panel .currency-image-button {
  border-width:4px !important;
  border-image-width:4px 5px !important;
  padding:1px !important;
}
.theme-sandstone .currency-panel .currency-image-button img {
  width:49px !important;
  height:49px !important;
}

/* Version 109 — detailed navigation controls, measured Currency Library
   spacing/width, and one neutral sandstone fill across every framed interior. */
body.theme-sandstone,
.theme-sandstone {
  --sekhema-frame-button:url("assets/ui/sekhema/frame-button-nav.svg");
  --sekhema-fill-surface:url("assets/ui/sekhema/stone-fill-neutral-v109.webp");
}

/* Use the same neutral, frame-free sandstone interior everywhere. The texture
   repeats at a fixed scale, so it no longer stretches decorative frame pieces
   or changes character between wide, tall, and modal containers. */
.theme-sandstone .entrance-card,
.theme-sandstone .panel,
.theme-sandstone .topbar,
.theme-sandstone .home-info-actions,
.theme-sandstone .home-info-card,
.theme-sandstone .legal-disclosure-card,
.theme-sandstone .support-card,
.theme-sandstone dialog .dialog-card,
.theme-sandstone .modifier-browser-card,
.theme-sandstone .challenge-target-card,
.theme-sandstone .challenge-score-card,
.theme-sandstone .challenge-empty,
.theme-sandstone .challenge-status-panel,
.theme-sandstone .reverse-plan-card,
.theme-sandstone .reverse-simple-route {
  background-color:rgba(47,34,26,.97) !important;
  background-image:
    linear-gradient(180deg, rgba(119,84,52,.08), rgba(25,17,13,.18)),
    var(--sekhema-fill-surface) !important;
  background-size:auto, 512px 384px !important;
  background-position:center, 0 0 !important;
  background-repeat:no-repeat, repeat !important;
  background-clip:padding-box !important;
}

.theme-sandstone .currency-panel .currency-group,
.theme-sandstone .item-card,
.theme-sandstone .message-bar,
.theme-sandstone .metric,
.theme-sandstone .reverse-simple-route li,
.theme-sandstone .badge,
.theme-sandstone .count-chip {
  background-image:
    linear-gradient(180deg, rgba(66,43,30,.3), rgba(22,15,12,.34)),
    var(--sekhema-fill-surface) !important;
  background-size:auto, 512px 384px !important;
  background-position:center, 0 0 !important;
  background-repeat:no-repeat, repeat !important;
}

/* Navigation and utility buttons gain clipped stone ends, inset bronze lines,
   and end-cap diamonds rather than reading as unfinished square boxes. */
.theme-sandstone button:not(.currency-image-button):not(.well-reveal-button),
.theme-sandstone .ui-ornate-button,
.theme-sandstone .primary-home-choice,
.theme-sandstone .choice-btn,
.theme-sandstone .btn,
.theme-sandstone .mode-toggle,
.theme-sandstone .home-info-action,
.theme-sandstone .support-launch-btn,
.theme-sandstone .history-tab,
.theme-sandstone .currency-panel .currency-name-button,
.theme-sandstone .currency-panel .currency-text-button:not(.well-reveal-button),
.theme-sandstone .save-base-button,
.theme-sandstone .new-seed-btn,
.theme-sandstone .reverse-guide-direct-action,
.theme-sandstone .window-close-btn,
.theme-sandstone .dialog-close-btn,
.theme-sandstone .support-close-btn,
.theme-sandstone .home-info-close {
  display:inline-flex !important;
  align-items:center !important;
  justify-content:center !important;
  gap:6px !important;
  border:9px solid transparent !important;
  border-image-source:var(--sekhema-frame-button) !important;
  border-image-slice:56 100 !important;
  border-image-width:8px 11px !important;
  border-image-repeat:stretch !important;
  border-radius:0 !important;
  clip-path:polygon(8px 0, calc(100% - 8px) 0, 100% 8px, 100% calc(100% - 8px), calc(100% - 8px) 100%, 8px 100%, 0 calc(100% - 8px), 0 8px) !important;
  background:
    linear-gradient(180deg, rgba(91,61,42,.82), rgba(44,28,23,.92)),
    var(--sekhema-fill-surface) !important;
  background-size:auto, 512px 384px !important;
  background-position:center, 0 0 !important;
  background-repeat:no-repeat, repeat !important;
  background-clip:padding-box !important;
  box-shadow:
    0 3px 8px rgba(0,0,0,.22),
    inset 0 0 0 1px rgba(231,190,123,.08),
    inset 0 0 12px rgba(0,0,0,.16) !important;
  color:#f2dfbf !important;
  text-shadow:0 1px 0 rgba(0,0,0,.78) !important;
}

.theme-sandstone button:not(.currency-image-button):not(.well-reveal-button):hover:not(:disabled),
.theme-sandstone .ui-ornate-button:hover:not(:disabled),
.theme-sandstone .primary-home-choice:hover:not(:disabled),
.theme-sandstone .choice-btn:hover:not(:disabled),
.theme-sandstone .btn:hover:not(:disabled),
.theme-sandstone .mode-toggle:hover,
.theme-sandstone .home-info-action:hover,
.theme-sandstone .support-launch-btn:hover,
.theme-sandstone .history-tab:hover {
  filter:brightness(1.08) saturate(1.04) !important;
  box-shadow:
    0 3px 9px rgba(0,0,0,.24),
    inset 0 0 0 1px rgba(239,202,138,.13),
    inset 0 0 14px rgba(214,157,90,.08) !important;
}

/* Close controls receive enough width for the label, with explicit centering
   independent of the modal's absolute positioning rules. */
.theme-sandstone .window-close-btn,
.theme-sandstone .dialog-close-btn,
.theme-sandstone .support-close-btn,
.theme-sandstone .home-info-close {
  min-width:82px !important;
  width:auto !important;
  height:36px !important;
  min-height:36px !important;
  padding:0 14px !important;
  line-height:1 !important;
  text-align:center !important;
  white-space:nowrap !important;
  overflow:visible !important;
}

.theme-sandstone .support-launch-btn {
  right:20px !important;
  bottom:20px !important;
  min-width:118px !important;
  min-height:38px !important;
  padding:6px 14px !important;
}

/* Currency icons regain a small visual breath between tiles while preserving
   their 60px control and 49px image dimensions. */
.theme-sandstone .currency-image-grid {
  grid-template-columns:repeat(auto-fill, 60px) !important;
  justify-content:start !important;
  gap:4px !important;
  row-gap:4px !important;
  column-gap:4px !important;
  padding:2px !important;
}
.theme-sandstone .currency-tip {
  margin:0 !important;
}
.theme-sandstone .normal-currency-section,
.theme-sandstone .desecration-left-controls,
.theme-sandstone .desecration-right-controls {
  gap:4px !important;
}

/* The Currency Library is 25% wider than Version 108 in both layouts. */
body:not(.reverse-workspace-active).theme-sandstone .workspace {
  grid-template-columns:minmax(380px, 420px) minmax(560px, 700px) !important;
  justify-content:center !important;
  gap:18px !important;
}
body:not(.reverse-workspace-active).theme-sandstone .right-column {
  width:100% !important;
  max-width:700px !important;
}
body.reverse-workspace-active.theme-sandstone .workspace {
  grid-template-columns:minmax(380px, 410px) minmax(520px, 600px) minmax(330px, 360px) !important;
  justify-content:center !important;
  gap:12px !important;
}
body.reverse-workspace-active.theme-sandstone .right-column {
  width:100% !important;
  max-width:600px !important;
}

@media (max-width:1400px) {
  body.reverse-workspace-active.theme-sandstone .workspace {
    grid-template-columns:minmax(370px, 400px) minmax(500px, 560px) minmax(320px, 350px) !important;
  }
}

@media (max-width:1220px) {
  body:not(.reverse-workspace-active).theme-sandstone .workspace,
  body.reverse-workspace-active.theme-sandstone .workspace {
    grid-template-columns:1fr !important;
  }
  body:not(.reverse-workspace-active).theme-sandstone .right-column,
  body.reverse-workspace-active.theme-sandstone .right-column {
    max-width:none !important;
  }
}

.theme-sandstone .currency-panel .currency-image-button,
.theme-sandstone .currency-panel .currency-name-button,
.theme-sandstone .currency-panel .currency-text-button:not(.well-reveal-button) {
  border-image-source:var(--sekhema-frame-button) !important;
  background:
    linear-gradient(180deg, rgba(87,58,40,.66), rgba(42,27,22,.76)),
    var(--sekhema-fill-surface) !important;
  background-size:auto, 512px 384px !important;
  background-position:center, 0 0 !important;
  background-repeat:no-repeat, repeat !important;
  background-clip:padding-box !important;
}

/* Version 110 — wider crafting surfaces, balanced guide/library columns,
   single-line modifier rows, uniform base selectors, and persistent Favorites. */
body.theme-sandstone > .app-shell,
body.reverse-workspace-active.theme-sandstone > .app-shell,
body.theme-sandstone .app-shell {
  width:min(2500px, calc(100vw - 28px)) !important;
  max-width:none !important;
}

/* Home actions use a consistent centered hierarchy. */
.theme-sandstone .primary-home-choice {
  text-align:center !important;
  justify-items:center !important;
  align-content:center !important;
}
.theme-sandstone .primary-home-choice strong,
.theme-sandstone .primary-home-choice span {
  width:100%;
  text-align:center !important;
}
.theme-sandstone .primary-home-choice span {
  display:block !important;
  margin-top:4px;
}

/* Item/base picker buttons share one stable row height, independent of title
   length or subtext wrapping. */
.theme-sandstone .craft-item-dialog .dialog-card {
  width:min(1120px, calc(100vw - 36px)) !important;
}
.theme-sandstone .craft-item-dialog .dialog-option-list {
  display:grid !important;
  grid-template-columns:repeat(auto-fill, minmax(250px, 1fr)) !important;
  grid-auto-rows:1fr !important;
  gap:10px !important;
  align-items:stretch !important;
}
.theme-sandstone .craft-item-dialog .choice-btn {
  min-height:104px !important;
  height:100% !important;
  display:flex !important;
  flex-direction:column !important;
  justify-content:center !important;
  align-items:center !important;
  text-align:center !important;
}
.theme-sandstone .craft-item-dialog .choice-btn strong,
.theme-sandstone .craft-item-dialog .choice-btn span {
  width:100%;
  text-align:center !important;
}

/* The item workspace is substantially wider so normal modifier lines remain
   horizontal. Only true hybrid modifiers split onto stacked lines. */
.theme-sandstone .item-card {
  width:100% !important;
  max-width:none !important;
  min-height:690px !important;
}
.theme-sandstone .mod-block {
  overflow-x:auto;
  scrollbar-width:thin;
}
.theme-sandstone .mod-line {
  grid-template-columns:72px minmax(max-content, 1fr) max-content !important;
  column-gap:10px !important;
  align-items:baseline !important;
  min-width:0;
  white-space:nowrap !important;
  font-size:.84rem !important;
}
.theme-sandstone .mod-line .mod-level,
.theme-sandstone .mod-line .mod-meta,
.theme-sandstone .mod-line .mod-content {
  white-space:nowrap !important;
}
.theme-sandstone .mod-line .mod-content {
  text-align:left !important;
  line-height:1.35 !important;
}
.theme-sandstone .mod-line.hybrid {
  align-items:start !important;
}
.theme-sandstone .mod-line.hybrid .mod-content {
  white-space:normal !important;
  display:block !important;
  line-height:1.28 !important;
}
.theme-sandstone .mod-line.hybrid .mod-content br {
  display:block;
  content:"";
}

/* 66%-class expansion on large monitors; proportional minimums keep the
   three-column Reverse Craft tool usable at standard desktop widths. */
body:not(.reverse-workspace-active).theme-sandstone .workspace {
  grid-template-columns:minmax(560px, .74fr) minmax(760px, 1.26fr) !important;
  gap:22px !important;
  justify-content:stretch !important;
}
body:not(.reverse-workspace-active).theme-sandstone .right-column {
  width:100% !important;
  max-width:none !important;
}
body.reverse-workspace-active.theme-sandstone .workspace {
  grid-template-columns:minmax(560px, 1.15fr) minmax(700px, 1.65fr) minmax(470px, 1fr) !important;
  gap:16px !important;
  justify-content:stretch !important;
}
body.reverse-workspace-active.theme-sandstone .right-column {
  width:100% !important;
  max-width:none !important;
}
body.reverse-workspace-active.theme-sandstone .reverse-guide-column {
  min-width:470px !important;
  width:100% !important;
  max-width:none !important;
}
.theme-sandstone .challenge-status-panel.reverse-guide-status {
  width:100% !important;
  min-width:0 !important;
  padding:16px !important;
}
.theme-sandstone .reverse-guide-current p,
.theme-sandstone .reverse-guide-current small,
.theme-sandstone .reverse-guide-recovery,
.theme-sandstone .reverse-guide-target {
  max-width:none !important;
  width:100% !important;
}

/* Favorites shelf above the searchable library. */
.theme-sandstone .currency-favorites {
  display:grid;
  gap:6px;
  margin:0 0 10px;
}
.theme-sandstone .currency-favorites-toggle {
  width:100% !important;
  min-height:36px !important;
  display:flex !important;
  justify-content:space-between !important;
  align-items:center !important;
  padding:6px 12px !important;
}
.theme-sandstone .currency-favorites-toggle::after {
  content:"▸";
  margin-left:auto;
  padding-left:10px;
  color:#d7b477;
}
.theme-sandstone .currency-favorites-toggle.active::after {
  content:"▾";
}
.theme-sandstone .currency-favorites-count {
  display:inline-grid;
  place-items:center;
  min-width:24px;
  height:20px;
  margin-left:8px;
  padding:0 6px;
  border:1px solid rgba(205,157,91,.28);
  background:rgba(28,18,14,.42);
  color:#e6c994;
  font-size:.67rem;
}
.theme-sandstone .currency-favorites-area {
  min-height:72px;
  padding:6px;
  border:1px solid rgba(189,135,78,.28);
  background:
    linear-gradient(180deg, rgba(75,49,34,.26), rgba(26,18,14,.32)),
    var(--sekhema-fill-surface) !important;
  background-size:auto, 512px 384px !important;
}
.theme-sandstone .currency-favorites-area.hidden {
  display:none !important;
}
.theme-sandstone .currency-favorites-empty {
  margin:0;
  padding:14px 10px;
  color:#b9a58a;
  text-align:center;
  font-size:.72rem;
}
.theme-sandstone .currency-favorites-grid {
  display:grid !important;
  grid-template-columns:repeat(auto-fill, 60px) !important;
  justify-content:start !important;
  gap:5px !important;
  padding:0 !important;
}
.theme-sandstone .currency-tip.currency-favorite-active .currency-image-button,
.theme-sandstone .currency-tip.currency-favorite-active .currency-text-button {
  box-shadow:inset 0 0 0 1px rgba(232,190,119,.22), 0 0 8px rgba(214,161,91,.12) !important;
}

/* Right-click action menu used for Favorites, tier choice, and pinning. */
.currency-context-menu {
  position:fixed;
  z-index:2147483660;
  width:min(270px, calc(100vw - 24px));
  padding:7px;
  display:grid;
  gap:4px;
  border:14px solid transparent;
  border-image-source:var(--sekhema-frame-modal, url("assets/ui/sekhema/frame-modal-v109.svg"));
  border-image-slice:76;
  border-image-width:14px;
  border-image-repeat:round;
  background:
    linear-gradient(180deg, rgba(72,47,33,.94), rgba(27,18,14,.98)),
    var(--sekhema-fill-surface, none);
  background-size:auto, 512px 384px;
  background-clip:padding-box;
  box-shadow:0 18px 46px rgba(0,0,0,.56);
}
.currency-context-title {
  padding:5px 7px 7px;
  color:#e8cd98;
  font-size:.72rem;
  font-weight:800;
  letter-spacing:.04em;
  border-bottom:1px solid rgba(205,153,88,.24);
}
.currency-context-action {
  width:100%;
  min-height:34px;
  padding:6px 9px;
  border:1px solid rgba(188,132,75,.28);
  background:rgba(42,28,22,.78);
  color:#e7d7bc;
  text-align:left;
  font-size:.7rem;
}
.currency-context-action:hover,
.currency-context-action.current {
  border-color:rgba(232,186,111,.62);
  background:rgba(83,53,35,.84);
  color:#fff0cf;
}
.currency-context-separator {
  height:1px;
  margin:3px 0;
  background:linear-gradient(90deg, transparent, rgba(208,157,92,.44), transparent);
}

@media (min-width:2300px) {
  body:not(.reverse-workspace-active).theme-sandstone .workspace {
    grid-template-columns:minmax(660px, 700px) minmax(1000px, 1160px) !important;
    justify-content:center !important;
  }
  body.reverse-workspace-active.theme-sandstone .workspace {
    grid-template-columns:minmax(660px, 700px) minmax(900px, 1000px) minmax(560px, 600px) !important;
    justify-content:center !important;
  }
}

@media (max-width:1780px) {
  body:not(.reverse-workspace-active).theme-sandstone .workspace {
    grid-template-columns:minmax(520px, .86fr) minmax(680px, 1.14fr) !important;
  }
  body.reverse-workspace-active.theme-sandstone .workspace {
    grid-template-columns:minmax(520px, 1.05fr) minmax(650px, 1.4fr) minmax(430px, .95fr) !important;
  }
  body.reverse-workspace-active.theme-sandstone .reverse-guide-column {
    min-width:430px !important;
  }
}

@media (max-width:1500px) {
  body:not(.reverse-workspace-active).theme-sandstone .workspace,
  body.reverse-workspace-active.theme-sandstone .workspace {
    grid-template-columns:1fr !important;
  }
  body.reverse-workspace-active.theme-sandstone .reverse-guide-column {
    min-width:0 !important;
    position:relative !important;
    top:auto !important;
    max-height:none !important;
  }
}

/* Keep context-menu actions compact; do not inherit the large navigation frame. */
.theme-sandstone .currency-context-menu .currency-context-action {
  display:block !important;
  min-height:34px !important;
  padding:6px 9px !important;
  border:1px solid rgba(188,132,75,.28) !important;
  border-image:none !important;
  clip-path:none !important;
  background:rgba(42,28,22,.82) !important;
  box-shadow:none !important;
  color:#e7d7bc !important;
  text-align:left !important;
  justify-content:flex-start !important;
  font-size:.7rem !important;
}
.theme-sandstone .currency-context-menu .currency-context-action:hover,
.theme-sandstone .currency-context-menu .currency-context-action.current {
  border-color:rgba(232,186,111,.62) !important;
  background:rgba(83,53,35,.88) !important;
  color:#fff0cf !important;
  filter:none !important;
}

/* Version 111 — centered picker/modifiers, stable Favorites, and a 15%-smaller
   Reverse Craft item window so every frame edge remains visible. */
.theme-sandstone #choiceDialog.craft-item-dialog {
  width:min(1120px, calc(100vw - 36px)) !important;
  max-width:min(1120px, calc(100vw - 36px)) !important;
  padding:0 !important;
  border:0 !important;
  margin:auto !important;
  overflow:visible !important;
  background:transparent !important;
  box-sizing:border-box !important;
}
.theme-sandstone #choiceDialog.craft-item-dialog .dialog-card {
  width:100% !important;
  max-width:100% !important;
  margin:0 auto !important;
  box-sizing:border-box !important;
}

.theme-sandstone .mod-line .mod-content,
.theme-sandstone .mod-line.hybrid .mod-content {
  width:100% !important;
  justify-self:stretch !important;
  text-align:center !important;
}

body.reverse-workspace-active.theme-sandstone .workspace {
  grid-template-columns:minmax(476px, .92fr) minmax(700px, 1.65fr) minmax(470px, 1fr) !important;
}

/* Favorites controls remain mounted during normal render cycles. Avoid visual
   transitions on their icon layer so click/focus state changes stay stable. */
.theme-sandstone .currency-favorites-grid .currency-image-button,
.theme-sandstone .currency-favorites-grid .currency-image-button img,
.theme-sandstone .currency-favorites-grid .currency-fallback-label {
  transition:none !important;
  animation:none !important;
  backface-visibility:hidden;
}

@media (min-width:2300px) {
  body.reverse-workspace-active.theme-sandstone .workspace {
    grid-template-columns:minmax(561px, 595px) minmax(900px, 1000px) minmax(560px, 600px) !important;
  }
}

@media (max-width:1780px) {
  body.reverse-workspace-active.theme-sandstone .workspace {
    grid-template-columns:minmax(442px, .89fr) minmax(650px, 1.4fr) minmax(430px, .95fr) !important;
  }
}

@media (max-width:1500px) {
  body.reverse-workspace-active.theme-sandstone .workspace {
    grid-template-columns:1fr !important;
  }
}


/* Version 112 — fixed currency guidance, compact item workspace, temporary
   Favorites, and a Currency Library reduced by approximately 15%. */

/* Currency guidance now renders in a fixed body-level layer. Suppressing the
   legacy pseudo-element prevents the wrong-side first frame and removes all
   clipping/stacking interactions with Currency Library category borders. */
.theme-sandstone .currency-tip::after {
  display:none !important;
}
.currency-hover-tooltip {
  position:fixed;
  z-index:2147483668;
  width:min(440px, calc(100vw - 24px));
  max-height:calc(100vh - 24px);
  overflow:auto;
  box-sizing:border-box;
  padding:11px 13px;
  border:1px solid rgba(223,176,105,.62);
  background:
    linear-gradient(180deg, rgba(55,36,27,.985), rgba(18,12,10,.99)),
    var(--sekhema-fill-surface, none);
  background-size:auto, 512px 384px;
  color:#efe1cb;
  box-shadow:0 16px 42px rgba(0,0,0,.62), inset 0 0 0 1px rgba(255,222,164,.06);
  font:600 .72rem/1.48 ui-sans-serif,system-ui,sans-serif;
  text-align:left;
  overflow-wrap:anywhere;
  opacity:0;
  visibility:hidden;
  pointer-events:none;
  transform:translateZ(0);
}
.currency-hover-tooltip.visible {
  opacity:1;
}
.currency-hover-tooltip::-webkit-scrollbar { width:7px; }
.currency-hover-tooltip::-webkit-scrollbar-track { background:rgba(0,0,0,.18); }
.currency-hover-tooltip::-webkit-scrollbar-thumb { background:rgba(198,146,82,.46); }

/* Remove the artificial 690px floor. The card remains content-sized once a
   heavily modified item genuinely needs more room. */
.theme-sandstone .item-card {
  min-height:345px !important;
  padding:12px 16px 14px !important;
}
.theme-sandstone .item-card .divider {
  margin:7px 0 !important;
}
.theme-sandstone .item-card .requirements,
.theme-sandstone .item-card .stat-lines,
.theme-sandstone .item-card .implicit-lines,
.theme-sandstone .item-card .socket-lines,
.theme-sandstone .item-card .special-lines {
  line-height:1.32 !important;
}
.theme-sandstone .item-card .mod-block {
  margin-top:6px !important;
}
.theme-sandstone .item-card .mod-section-label {
  margin:6px 0 4px !important;
}
.theme-sandstone .item-card .socket-lines,
.theme-sandstone .item-card .implicit-lines {
  margin-top:6px !important;
}
.theme-sandstone .item-card .special-lines {
  margin-top:7px !important;
}

/* All controls beneath the item card occupy one contiguous strip rather than
   two separated button regions. */
.theme-sandstone .item-control-strip {
  display:grid !important;
  grid-template-columns:repeat(6, minmax(0, 1fr));
  gap:4px;
  margin-top:8px;
  align-items:stretch;
}
.theme-sandstone .item-control-strip .craft-state-actions,
.theme-sandstone .item-control-strip .item-actions {
  display:contents !important;
  margin:0 !important;
}
.theme-sandstone .item-control-strip .btn {
  width:100% !important;
  min-width:0 !important;
  min-height:36px !important;
  height:36px !important;
  padding:2px 4px !important;
  border-width:5px !important;
  border-image-width:5px 6px !important;
  font-size:.55rem !important;
  line-height:1.08 !important;
  white-space:normal !important;
  overflow:hidden !important;
}
.theme-sandstone .item-control-strip .btn.hidden {
  display:none !important;
}

/* Standard layout: reduce the Currency Library's proportional share and
   minimum width by 15%, reallocating the recovered width to the item workspace. */
body:not(.reverse-workspace-active).theme-sandstone .workspace {
  grid-template-columns:minmax(560px, .93fr) minmax(646px, 1.07fr) !important;
}

/* Reverse Craft: apply the same reduction without shrinking its guide. */
body.reverse-workspace-active.theme-sandstone .workspace {
  grid-template-columns:minmax(476px, .92fr) minmax(595px, 1.24fr) minmax(470px, 1fr) !important;
}

@media (min-width:2300px) {
  body:not(.reverse-workspace-active).theme-sandstone .workspace {
    grid-template-columns:minmax(660px, 760px) minmax(850px, 986px) !important;
  }
  body.reverse-workspace-active.theme-sandstone .workspace {
    grid-template-columns:minmax(561px, 650px) minmax(765px, 850px) minmax(560px, 600px) !important;
  }
}

@media (max-width:1780px) {
  body:not(.reverse-workspace-active).theme-sandstone .workspace {
    grid-template-columns:minmax(520px, 1.03fr) minmax(578px, .97fr) !important;
  }
  body.reverse-workspace-active.theme-sandstone .workspace {
    grid-template-columns:minmax(442px, .89fr) minmax(553px, 1.08fr) minmax(430px, .95fr) !important;
  }
}

@media (max-width:1500px) {
  body:not(.reverse-workspace-active).theme-sandstone .workspace,
  body.reverse-workspace-active.theme-sandstone .workspace {
    grid-template-columns:1fr !important;
  }
  body:not(.reverse-workspace-active).theme-sandstone .right-column,
  body.reverse-workspace-active.theme-sandstone .right-column {
    width:85% !important;
    max-width:none !important;
    justify-self:center !important;
  }
}

@media (max-width:760px) {
  .theme-sandstone .item-control-strip {
    grid-template-columns:repeat(3, minmax(0, 1fr));
  }
  .currency-hover-tooltip {
    width:min(420px, calc(100vw - 16px));
    max-height:calc(100vh - 16px);
  }
}

/* Version 113 — final-only quality values, a 20%-narrower Reverse Craft item
   column, a half-height Current Item header, and lower-cost interaction paths. */

/* Catalyst/quality scaling displays only the live final value. The original
   value is exposed by the modifier's hover tooltip instead of consuming line
   width beside every adjusted modifier. */
.theme-sandstone .quality-original,
.theme-sandstone .quality-arrow {
  display:none !important;
}

/* Compress the pre-item controls from two stacked rows into one row. The
   explicit horizontal axis prevents inherited responsive rules from turning
   the control width basis into vertical whitespace. */
.theme-sandstone .item-panel > .panel-heading {
  margin-bottom:5px !important;
  gap:8px !important;
  flex-direction:row !important;
  flex-wrap:wrap;
  align-items:flex-start !important;
  align-content:flex-start !important;
}
.theme-sandstone .item-panel > .panel-heading > div:first-child {
  flex:1 1 auto !important;
  min-width:0;
}
.theme-sandstone .item-panel > .panel-heading .eyebrow {
  margin-bottom:2px !important;
  line-height:1 !important;
}
.theme-sandstone .item-panel .item-selector-stack {
  display:grid !important;
  grid-template-columns:minmax(105px, 140px) minmax(180px, 1fr) !important;
  align-items:center !important;
  gap:5px !important;
  margin-top:2px !important;
}
.theme-sandstone .item-panel .boot-selector-label,
.theme-sandstone .item-panel .save-base-controls {
  width:100% !important;
  margin:0 !important;
}
.theme-sandstone .item-panel .boot-selector-label select,
.theme-sandstone .item-panel .save-base-button {
  min-height:28px !important;
  height:28px !important;
}
.theme-sandstone .item-panel .boot-selector-label select {
  padding:2px 7px !important;
}
.theme-sandstone .item-panel .save-base-controls {
  grid-template-columns:repeat(2, minmax(0, 1fr)) !important;
  gap:4px !important;
}

/* Reverse Craft only: cap the item/crafting column near 80% of Version 112's
   measured width while retaining the Version 112 library and guide sizing. */
body.reverse-workspace-active.theme-sandstone .workspace {
  grid-template-columns:minmax(381px, 433px) minmax(595px, 1.24fr) minmax(470px, 1fr) !important;
}

@media (min-width:2300px) {
  body.reverse-workspace-active.theme-sandstone .workspace {
    grid-template-columns:minmax(449px, 520px) minmax(765px, 850px) minmax(560px, 600px) !important;
  }
}

@media (max-width:1780px) {
  body.reverse-workspace-active.theme-sandstone .workspace {
    grid-template-columns:minmax(354px, 433px) minmax(553px, 1.08fr) minmax(430px, .95fr) !important;
  }
}

@media (max-width:1500px) {
  body.reverse-workspace-active.theme-sandstone .workspace {
    grid-template-columns:1fr !important;
  }
}

@media (max-width:520px) {
  .theme-sandstone .item-panel .item-selector-stack {
    grid-template-columns:1fr !important;
  }
}


/* Version 114 — Reverse Craft workspace rebalance and sandstone history tabs. */

/* Reallocate fifteen percent of both secondary Reverse Craft columns to the
   Current Item/crafting column. The formulas preserve the prior Currency
   Library-to-guide ratio while returning the reclaimed width to modifier text,
   tier labels, and value metadata. */
body.reverse-workspace-active.theme-sandstone .workspace {
  grid-template-columns:
    minmax(560px, calc(15vw + 359px))
    minmax(506px, calc(47.0536vw - 232px))
    minmax(400px, calc(37.9464vw - 187px)) !important;
}

/* Remove the legacy black capsule surrounding Audit trail and Costs. Each tab
   keeps the same sandstone button frame and fill used by the other controls. */
.theme-sandstone .history-tabs {
  display:inline-flex !important;
  align-items:center !important;
  gap:4px !important;
  padding:0 !important;
  border:0 !important;
  border-radius:0 !important;
  background:transparent !important;
  box-shadow:none !important;
}
.theme-sandstone .history-tab.active {
  background:
    linear-gradient(180deg, rgba(124,82,50,.92), rgba(57,36,27,.96)),
    var(--sekhema-fill-surface) !important;
  background-size:auto, 512px 384px !important;
  background-position:center, 0 0 !important;
  background-repeat:no-repeat, repeat !important;
  color:#fff0cf !important;
  filter:brightness(1.06) saturate(1.04) !important;
}

@media (min-width:2300px) {
  body.reverse-workspace-active.theme-sandstone .workspace {
    grid-template-columns:minmax(700px, 738px) minmax(650px, 723px) minmax(460px, 510px) !important;
  }
}

@media (max-width:1780px) and (min-width:1501px) {
  body.reverse-workspace-active.theme-sandstone .workspace {
    grid-template-columns:
      minmax(560px, calc(15vw + 359px))
      minmax(430px, calc(45.2217vw - 223px))
      minmax(360px, calc(39.7783vw - 196px)) !important;
  }
}

@media (max-width:1500px) {
  body.reverse-workspace-active.theme-sandstone .workspace {
    grid-template-columns:1fr !important;
  }
}

/* Version 115 — independent standard, Reverse Craft, and Crafting Challenge
   column systems; persistent Challenge target column; Alloy reapply guard. */

/* Standard crafting and Crafting Challenge use a Current Item column roughly
   thirty percent narrower than Version 114's full-width proportional track.
   Reverse Craft is intentionally exempt because its modifier metadata needs
   the additional horizontal room requested below. */
body:not(.reverse-workspace-active):not(.challenge-workspace-active).theme-sandstone .workspace {
  grid-template-columns:minmax(420px, 610px) minmax(646px, 1fr) !important;
  gap:22px !important;
  justify-content:stretch !important;
}

/* Crafting Challenge now mirrors the Reverse Craft information architecture:
   Current Item, Currency Library, then the persistent target/score column. */
body.challenge-workspace-active.theme-sandstone .workspace {
  grid-template-columns:minmax(420px, 610px) minmax(560px, 1fr) minmax(350px, 430px) !important;
  gap:16px !important;
  align-items:start !important;
  justify-content:stretch !important;
}
body.challenge-workspace-active.theme-sandstone .right-column,
body.challenge-workspace-active.theme-sandstone .reverse-guide-column {
  width:100% !important;
  max-width:none !important;
  min-width:0 !important;
}
body.challenge-workspace-active.theme-sandstone .left-column,
body.challenge-workspace-active.theme-sandstone .right-column {
  gap:14px !important;
}

/* Reverse Craft recovers another twenty percent for the live item compared
   with Version 114's measured 647px desktop column. The guide is reduced by
   twenty percent from roughly 542px; the Currency Library receives the fluid
   remainder so the page does not gain horizontal overflow. */
body.reverse-workspace-active.theme-sandstone .workspace {
  grid-template-columns:
    minmax(620px, min(776px, calc(10.8vw + 569px)))
    minmax(500px, 1fr)
    minmax(350px, min(433px, calc(23.7vw - 22px))) !important;
  gap:16px !important;
  align-items:start !important;
  justify-content:stretch !important;
}
body.reverse-workspace-active.theme-sandstone .reverse-guide-column {
  min-width:0 !important;
  width:100% !important;
  max-width:none !important;
}

/* Challenge target/score uses the same tall sandstone frame language as the
   guided Reverse Craft panel, but retains its own layout and controls. */
.theme-sandstone .challenge-status-panel.challenge-guide-status {
  position:relative;
  display:grid !important;
  grid-template-columns:1fr !important;
  gap:10px !important;
  width:100% !important;
  min-width:0 !important;
  margin:0 !important;
  padding:14px !important;
  max-height:none !important;
  overflow:visible !important;
  border:20px solid transparent !important;
  border-image-source:var(--sekhema-frame-tall) !important;
  border-image-slice:98 !important;
  border-image-width:20px !important;
  border-image-repeat:round !important;
  border-radius:0 !important;
  background-clip:padding-box !important;
  background-color:rgba(45,31,24,.98) !important;
}
.theme-sandstone .challenge-guide-toolbar {
  display:grid;
  gap:9px;
  padding-bottom:9px;
  border-bottom:1px solid rgba(210,159,91,.23);
}
.theme-sandstone .challenge-guide-toolbar > div:first-child {
  min-width:0;
}
.theme-sandstone .challenge-guide-toolbar strong,
.theme-sandstone .challenge-guide-toolbar span {
  display:block;
}
.theme-sandstone .challenge-guide-toolbar span {
  overflow-wrap:anywhere;
}
.theme-sandstone .challenge-guide-actions {
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  gap:5px;
}
.theme-sandstone .challenge-guide-actions b {
  margin-right:auto;
  color:#e6c684;
  font-size:.72rem;
  letter-spacing:.06em;
  text-transform:uppercase;
}
.theme-sandstone .challenge-guide-actions .btn {
  min-height:34px !important;
  padding:4px 8px !important;
  font-size:.62rem !important;
}
.theme-sandstone .challenge-guide-main {
  min-width:0;
  display:grid;
  gap:10px;
}
.theme-sandstone .challenge-guide-main .challenge-target-card,
.theme-sandstone .challenge-guide-main .challenge-score-card {
  width:100% !important;
  min-width:0 !important;
  margin:0 !important;
}
.theme-sandstone .challenge-guide-main .challenge-target-mods,
.theme-sandstone .challenge-guide-main .challenge-score-grid {
  grid-template-columns:1fr !important;
}
.theme-sandstone .challenge-guide-main .challenge-target-mods li,
.theme-sandstone .challenge-guide-main .challenge-compare-list li {
  overflow-wrap:anywhere;
}

@media (min-width:2300px) {
  body:not(.reverse-workspace-active):not(.challenge-workspace-active).theme-sandstone .workspace {
    grid-template-columns:minmax(460px, 490px) minmax(1000px, 1fr) !important;
    justify-content:center !important;
  }
  body.challenge-workspace-active.theme-sandstone .workspace {
    grid-template-columns:minmax(460px, 490px) minmax(900px, 1fr) minmax(370px, 430px) !important;
    justify-content:center !important;
  }
  body.reverse-workspace-active.theme-sandstone .workspace {
    grid-template-columns:minmax(820px, 886px) minmax(760px, 1fr) minmax(360px, 408px) !important;
    justify-content:center !important;
  }
}

@media (max-width:1780px) and (min-width:1501px) {
  body:not(.reverse-workspace-active):not(.challenge-workspace-active).theme-sandstone .workspace {
    grid-template-columns:minmax(420px, 560px) minmax(620px, 1fr) !important;
  }
  body.challenge-workspace-active.theme-sandstone .workspace {
    grid-template-columns:minmax(420px, 540px) minmax(430px, 1fr) minmax(310px, 350px) !important;
  }
  body.reverse-workspace-active.theme-sandstone .workspace {
    grid-template-columns:minmax(580px, 720px) minmax(430px, 1fr) minmax(300px, 350px) !important;
  }
}

@media (max-width:1500px) {
  body:not(.reverse-workspace-active):not(.challenge-workspace-active).theme-sandstone .workspace,
  body.reverse-workspace-active.theme-sandstone .workspace,
  body.challenge-workspace-active.theme-sandstone .workspace {
    grid-template-columns:1fr !important;
  }
  body.reverse-workspace-active.theme-sandstone .reverse-guide-column,
  body.challenge-workspace-active.theme-sandstone .reverse-guide-column {
    min-width:0 !important;
    position:relative !important;
    top:auto !important;
    max-height:none !important;
  }
}

/* Version 116 — larger lower item controls and a wider normal crafting track. */

/* The consolidated controls beneath the item card were intentionally compact in
   Version 112. Version 116 doubles their visible sizing so labels remain easy
   to scan while preserving the same responsive six-control strip. */
.theme-sandstone .item-control-strip .btn {
  min-height:72px !important;
  height:72px !important;
  padding:4px 8px !important;
  border-width:10px !important;
  border-image-width:10px 12px !important;
  font-size:1.1rem !important;
  line-height:1.08 !important;
}

/* Normal Craft an Item only: expand Version 115's 610px Current Item baseline
   by thirty percent to 793px. Reverse Craft and Challenge keep their independent
   column systems and are not matched by this selector. */
body:not(.reverse-workspace-active):not(.challenge-workspace-active).theme-sandstone .workspace {
  grid-template-columns:minmax(546px, 793px) minmax(646px, 1fr) !important;
}

@media (min-width:2300px) {
  body:not(.reverse-workspace-active):not(.challenge-workspace-active).theme-sandstone .workspace {
    grid-template-columns:minmax(598px, 637px) minmax(1000px, 1fr) !important;
  }
}

@media (max-width:1780px) and (min-width:1501px) {
  body:not(.reverse-workspace-active):not(.challenge-workspace-active).theme-sandstone .workspace {
    grid-template-columns:minmax(546px, 728px) minmax(620px, 1fr) !important;
  }
}

@media (max-width:1500px) {
  body:not(.reverse-workspace-active):not(.challenge-workspace-active).theme-sandstone .workspace {
    grid-template-columns:1fr !important;
  }
}

/* Version 117 — complete crafting-control frames and repaired modal controls. */
.theme-sandstone :is(
  #supportBtn,
  #workspaceReportIssueBtn,
  #homeReportIssueBtn,
  #saveBaseBtn,
  #retrieveBaseBtn,
  #auditViewBtn,
  #costViewBtn,
  #clearHistoryBtn,
  .workspace .btn,
  .workspace .history-tab,
  .support-card .btn,
  .home-info-card button[id^="reverseCraft"],
  .home-info-card button[id^="reverseGuide"],
  .home-info-card button[id^="challenge"],
  .challenge-status-panel .btn,
  .window-close-btn,
  .dialog-close-btn,
  .support-close-btn,
  .home-info-close
) {
  display:inline-flex !important;
  align-items:center !important;
  justify-content:center !important;
  gap:6px !important;
  border:10px solid transparent !important;
  border-image-source:var(--sekhema-frame-button) !important;
  border-image-slice:56 100 !important;
  border-image-width:9px 12px !important;
  border-image-repeat:stretch !important;
  border-radius:0 !important;
  clip-path:polygon(8px 0, calc(100% - 8px) 0, 100% 8px, 100% calc(100% - 8px), calc(100% - 8px) 100%, 8px 100%, 0 calc(100% - 8px), 0 8px) !important;
  background:
    linear-gradient(180deg, rgba(96,65,44,.86), rgba(44,28,23,.95)),
    var(--sekhema-fill-surface) !important;
  background-size:auto, 512px 384px !important;
  background-position:center, 0 0 !important;
  background-repeat:no-repeat, repeat !important;
  background-clip:padding-box !important;
  box-shadow:
    0 3px 9px rgba(0,0,0,.24),
    inset 0 0 0 1px rgba(239,202,138,.12),
    inset 0 0 14px rgba(34,20,13,.18) !important;
  color:#f4e1bf !important;
  text-shadow:0 1px 0 rgba(0,0,0,.8) !important;
}
.theme-sandstone :is(
  #supportBtn,
  #workspaceReportIssueBtn,
  #homeReportIssueBtn,
  #saveBaseBtn,
  #retrieveBaseBtn,
  #auditViewBtn,
  #costViewBtn,
  #clearHistoryBtn,
  .workspace .btn,
  .workspace .history-tab,
  .support-card .btn,
  .home-info-card button[id^="reverseCraft"],
  .home-info-card button[id^="reverseGuide"],
  .home-info-card button[id^="challenge"],
  .challenge-status-panel .btn,
  .window-close-btn,
  .dialog-close-btn,
  .support-close-btn,
  .home-info-close
):hover:not(:disabled) {
  filter:brightness(1.1) saturate(1.05) !important;
}
.theme-sandstone #modifierBrowserCloseBtn {
  position:absolute !important;
  top:18px !important;
  right:18px !important;
  z-index:20 !important;
  min-width:82px !important;
  width:auto !important;
  height:38px !important;
  min-height:38px !important;
  margin:0 !important;
  padding:0 14px !important;
}
.theme-sandstone .modifier-family-group > summary {
  background:
    linear-gradient(180deg, rgba(93,62,42,.48), rgba(42,28,23,.78)),
    var(--sekhema-fill-surface) !important;
  background-size:auto, 512px 384px !important;
  color:#f0ddbc !important;
}
.theme-sandstone .modifier-family-group .modifier-table thead th {
  background:#39271e !important;
  color:#e5c996 !important;
}
.theme-sandstone .reverse-guide-footer-actions {
  border-top-color:rgba(218,180,105,.28);
}
.theme-sandstone .reverse-guide-rollback {
  border-color:rgba(225,169,80,.5);
  background:
    linear-gradient(180deg, rgba(112,67,28,.28), rgba(55,34,22,.34)),
    var(--sekhema-fill-surface) !important;
  background-size:auto, 512px 384px !important;
}
@media (max-width:700px) {
  .theme-sandstone #modifierBrowserCloseBtn {
    top:12px !important;
    right:12px !important;
  }
}

/* Version 117 — keep modal close controls on the frame, not in padded content. */
.theme-sandstone .modifier-browser-dialog > #modifierBrowserCloseBtn {
  position:absolute !important;
  top:28px !important;
  right:28px !important;
}
.theme-sandstone .btn.hidden,
.theme-sandstone button.hidden {
  display:none !important;
}

/* Version 117 — hidden workspace controls must outrank the shared framed-button display. */
.theme-sandstone .workspace .item-actions .btn.hidden,
.theme-sandstone .workspace .craft-state-actions .btn.hidden,
.theme-sandstone .workspace .item-control-strip .btn.hidden {
  display:none !important;
}

/* Version 118 — universal high-definition sandstone button frame system. */
body.theme-sandstone {
  --sekhema-button-frame-hd:url("assets/ui/sekhema/button-frame-hd.svg");
  --sekhema-button-frame-hd-hover:url("assets/ui/sekhema/button-frame-hd-hover.svg");
  --sekhema-button-frame-hd-pressed:url("assets/ui/sekhema/button-frame-hd-pressed.svg");
  --sekhema-button-frame-hd-compact:url("assets/ui/sekhema/button-frame-hd-compact.svg");
}

/* The nonexistent ID inside :not() deliberately gives the universal layer enough
   specificity to replace every accumulated legacy button rule without rewriting
   earlier version history. */
body.theme-sandstone button:not(#sekhema-frame-exempt) {
  display:inline-flex !important;
  align-items:center !important;
  justify-content:center !important;
  gap:7px !important;
  box-sizing:border-box !important;
  border:13px solid transparent !important;
  border-image-source:var(--sekhema-button-frame-hd) !important;
  border-image-slice:82 150 !important;
  border-image-width:12px 18px !important;
  border-image-outset:0 !important;
  border-image-repeat:stretch !important;
  border-radius:0 !important;
  clip-path:polygon(12px 0, calc(100% - 12px) 0, 100% 12px, 100% calc(100% - 12px), calc(100% - 12px) 100%, 12px 100%, 0 calc(100% - 12px), 0 12px) !important;
  padding:8px 15px !important;
  background:
    radial-gradient(ellipse at 50% -25%, rgba(221,171,102,.24), transparent 58%),
    linear-gradient(180deg, rgba(112,77,53,.94) 0%, rgba(66,42,32,.97) 45%, rgba(34,22,19,.99) 100%),
    var(--sekhema-fill-surface) !important;
  background-size:auto, auto, 512px 384px !important;
  background-position:center, center, 0 0 !important;
  background-repeat:no-repeat, no-repeat, repeat !important;
  background-clip:padding-box !important;
  box-shadow:
    0 5px 12px rgba(0,0,0,.4),
    0 1px 0 rgba(238,202,139,.13),
    inset 0 1px 0 rgba(255,226,175,.12),
    inset 0 -10px 18px rgba(16,8,7,.28),
    inset 0 0 0 1px rgba(239,196,121,.08) !important;
  color:#f4e2c1 !important;
  text-shadow:0 2px 1px rgba(0,0,0,.88), 0 0 8px rgba(198,136,65,.08) !important;
  font-weight:800 !important;
  letter-spacing:.015em !important;
  text-decoration:none !important;
  transition:transform 90ms ease, filter 120ms ease, box-shadow 120ms ease, background 120ms ease !important;
  transform:translateY(0) !important;
  -webkit-tap-highlight-color:transparent;
}

body.theme-sandstone button:not(#sekhema-frame-exempt):hover:not(:disabled) {
  border-image-source:var(--sekhema-button-frame-hd-hover) !important;
  background:
    radial-gradient(ellipse at 50% -22%, rgba(255,213,137,.34), transparent 60%),
    linear-gradient(180deg, rgba(132,88,58,.97) 0%, rgba(77,47,35,.98) 46%, rgba(38,23,19,1) 100%),
    var(--sekhema-fill-surface) !important;
  background-size:auto, auto, 512px 384px !important;
  filter:brightness(1.06) saturate(1.08) !important;
  transform:translateY(-1px) !important;
  box-shadow:
    0 7px 15px rgba(0,0,0,.46),
    0 0 10px rgba(210,145,66,.11),
    inset 0 1px 0 rgba(255,231,183,.17),
    inset 0 -9px 16px rgba(20,10,8,.22),
    inset 0 0 0 1px rgba(250,209,137,.13) !important;
}

body.theme-sandstone button:not(#sekhema-frame-exempt):active:not(:disabled),
body.theme-sandstone button:not(#sekhema-frame-exempt)[aria-pressed="true"] {
  border-image-source:var(--sekhema-button-frame-hd-pressed) !important;
  background:
    radial-gradient(ellipse at 50% 115%, rgba(174,104,45,.2), transparent 62%),
    linear-gradient(180deg, rgba(58,37,29,.99), rgba(31,20,17,1)),
    var(--sekhema-fill-surface) !important;
  background-size:auto, auto, 512px 384px !important;
  transform:translateY(1px) !important;
  box-shadow:
    0 2px 5px rgba(0,0,0,.48),
    inset 0 3px 9px rgba(0,0,0,.38),
    inset 0 0 0 1px rgba(214,161,85,.08) !important;
}

body.theme-sandstone button:not(#sekhema-frame-exempt):focus-visible {
  outline:2px solid #f1cf83 !important;
  outline-offset:3px !important;
  filter:brightness(1.08) !important;
}

body.theme-sandstone button:not(#sekhema-frame-exempt):disabled {
  opacity:.42 !important;
  cursor:not-allowed !important;
  filter:grayscale(.38) brightness(.72) !important;
  transform:none !important;
  box-shadow:0 2px 5px rgba(0,0,0,.28), inset 0 0 0 1px rgba(183,150,99,.05) !important;
}

body.theme-sandstone button.primary:not(#sekhema-frame-exempt),
body.theme-sandstone button.active:not(#sekhema-frame-exempt),
body.theme-sandstone button[aria-selected="true"]:not(#sekhema-frame-exempt) {
  background:
    radial-gradient(ellipse at 50% -20%, rgba(255,215,143,.31), transparent 58%),
    linear-gradient(180deg, rgba(132,83,50,.98), rgba(75,42,29,.99) 52%, rgba(38,22,18,1)),
    var(--sekhema-fill-surface) !important;
  background-size:auto, auto, 512px 384px !important;
  color:#fff0cf !important;
}

body.theme-sandstone button.danger:not(#sekhema-frame-exempt) {
  background:
    radial-gradient(ellipse at 50% -20%, rgba(229,132,95,.22), transparent 58%),
    linear-gradient(180deg, rgba(105,46,39,.98), rgba(55,27,26,.99) 55%, rgba(27,17,17,1)),
    var(--sekhema-fill-surface) !important;
  background-size:auto, auto, 512px 384px !important;
  color:#ffd8c9 !important;
}

/* Primary home choices use the same material language at a larger architectural scale. */
body.theme-sandstone button.primary-home-choice:not(#sekhema-frame-exempt),
body.theme-sandstone button.entrance-choice:not(#sekhema-frame-exempt) {
  display:flex !important;
  flex-direction:column !important;
  align-items:flex-start !important;
  justify-content:center !important;
  border-width:18px !important;
  border-image-slice:82 150 !important;
  border-image-width:16px 23px !important;
  clip-path:polygon(17px 0, calc(100% - 17px) 0, 100% 17px, 100% calc(100% - 17px), calc(100% - 17px) 100%, 17px 100%, 0 calc(100% - 17px), 0 17px) !important;
  padding:17px 24px !important;
  text-align:left !important;
}
body.theme-sandstone button.primary-home-choice:not(#sekhema-frame-exempt) strong,
body.theme-sandstone button.entrance-choice:not(#sekhema-frame-exempt) strong {
  color:#f6dfad !important;
  letter-spacing:.035em !important;
}
body.theme-sandstone button.primary-home-choice:not(#sekhema-frame-exempt) span,
body.theme-sandstone button.entrance-choice:not(#sekhema-frame-exempt) span {
  color:#d3bea0 !important;
  font-weight:600 !important;
  text-shadow:0 1px 1px rgba(0,0,0,.88) !important;
}

/* Compact and image-first controls receive a dedicated denser frame rather than
   a scaled-down full-size border, preserving icon room and existing grid geometry. */
body.theme-sandstone button.currency-image-button:not(#sekhema-frame-exempt),
body.theme-sandstone button.well-reveal-button:not(#sekhema-frame-exempt),
body.theme-sandstone .omen-chip button:not(#sekhema-frame-exempt),
body.theme-sandstone .user-guide-toolbar button:not(#sekhema-frame-exempt),
body.theme-sandstone button[data-guide-zoom]:not(#sekhema-frame-exempt) {
  border-width:8px !important;
  border-image-source:var(--sekhema-button-frame-hd-compact) !important;
  border-image-slice:72 82 !important;
  border-image-width:7px 9px !important;
  clip-path:polygon(7px 0, calc(100% - 7px) 0, 100% 7px, 100% calc(100% - 7px), calc(100% - 7px) 100%, 7px 100%, 0 calc(100% - 7px), 0 7px) !important;
  padding:3px 6px !important;
  gap:3px !important;
}
body.theme-sandstone button.currency-image-button:not(#sekhema-frame-exempt):hover:not(:disabled),
body.theme-sandstone button.well-reveal-button:not(#sekhema-frame-exempt):hover:not(:disabled),
body.theme-sandstone .omen-chip button:not(#sekhema-frame-exempt):hover:not(:disabled),
body.theme-sandstone .user-guide-toolbar button:not(#sekhema-frame-exempt):hover:not(:disabled) {
  border-image-source:var(--sekhema-button-frame-hd-compact) !important;
  filter:brightness(1.15) saturate(1.1) !important;
}

/* Keep intentionally compact textual controls compact while retaining the full frame. */
body.theme-sandstone button.compact:not(#sekhema-frame-exempt),
body.theme-sandstone button.history-tab:not(#sekhema-frame-exempt),
body.theme-sandstone button.mode-toggle:not(#sekhema-frame-exempt),
body.theme-sandstone button.currency-favorites-toggle:not(#sekhema-frame-exempt) {
  border-width:10px !important;
  border-image-width:9px 13px !important;
  padding:5px 11px !important;
}

/* Version 116's large lower controls keep their 72px footprint but inherit the HD art. */
body.theme-sandstone .item-control-strip button.btn:not(#sekhema-frame-exempt) {
  min-height:72px !important;
  height:72px !important;
  border-width:12px !important;
  border-image-source:var(--sekhema-button-frame-hd) !important;
  border-image-slice:82 150 !important;
  border-image-width:11px 16px !important;
  padding:6px 12px !important;
  font-size:1.05rem !important;
}

/* Reverse Craft target route: decision controls are the first visible content. */
body.theme-sandstone .reverse-target-route-card {
  display:grid;
  gap:14px;
}
body.theme-sandstone .reverse-target-primary-actions {
  order:-10;
  display:grid !important;
  grid-template-columns:repeat(2, minmax(0, 1fr));
  gap:10px !important;
  margin:0 0 4px !important;
  padding:0 0 14px !important;
  border-bottom:1px solid rgba(221,177,99,.3);
}
body.theme-sandstone .reverse-target-primary-actions button:not(#sekhema-frame-exempt) {
  width:100% !important;
  min-height:58px !important;
  font-size:.9rem !important;
}
body.theme-sandstone .reverse-analysis-route-only > .reverse-plan-card {
  margin-top:0 !important;
}

/* Hidden controls remain hidden despite the universal display rule. */
body.theme-sandstone button.hidden:not(#sekhema-frame-exempt),
body.theme-sandstone button[hidden]:not(#sekhema-frame-exempt),
body.theme-sandstone .hidden > button:not(#sekhema-frame-exempt) {
  display:none !important;
}

@media (max-width:700px) {
  body.theme-sandstone button:not(#sekhema-frame-exempt) {
    border-width:10px !important;
    border-image-width:9px 13px !important;
    padding:7px 11px !important;
  }
  body.theme-sandstone button.primary-home-choice:not(#sekhema-frame-exempt),
  body.theme-sandstone button.entrance-choice:not(#sekhema-frame-exempt) {
    border-width:14px !important;
    border-image-width:12px 18px !important;
    padding:13px 17px !important;
  }
  body.theme-sandstone .reverse-target-primary-actions {
    grid-template-columns:1fr;
  }
}

/* The Patreon artwork is an anchor-based button rather than a native <button>. */
body.theme-sandstone .patreon-image-button:not(#sekhema-frame-exempt) {
  display:inline-flex !important;
  align-items:center !important;
  justify-content:center !important;
  box-sizing:border-box !important;
  border:13px solid transparent !important;
  border-image-source:var(--sekhema-button-frame-hd) !important;
  border-image-slice:82 150 !important;
  border-image-width:12px 18px !important;
  border-image-repeat:stretch !important;
  border-radius:0 !important;
  clip-path:polygon(12px 0, calc(100% - 12px) 0, 100% 12px, 100% calc(100% - 12px), calc(100% - 12px) 100%, 12px 100%, 0 calc(100% - 12px), 0 12px) !important;
  padding:7px 12px !important;
  background:linear-gradient(180deg, rgba(111,76,52,.96), rgba(38,24,20,.99)), var(--sekhema-fill-surface) !important;
  background-size:auto, 512px 384px !important;
  box-shadow:0 5px 12px rgba(0,0,0,.4), inset 0 0 0 1px rgba(239,196,121,.08) !important;
  transition:transform 90ms ease, filter 120ms ease, box-shadow 120ms ease !important;
}
body.theme-sandstone .patreon-image-button:not(#sekhema-frame-exempt):hover {
  border-image-source:var(--sekhema-button-frame-hd-hover) !important;
  transform:translateY(-1px) !important;
  filter:brightness(1.06) saturate(1.06) !important;
}

/* Version 119 — clearer item identity behind the crafting text. */
body.theme-sandstone .item-card.has-item-art::before {
  opacity:.24 !important;
  filter:drop-shadow(0 18px 32px rgba(0,0,0,.7)) saturate(.9) contrast(.96) !important;
}
body.theme-sandstone .item-card.has-item-art[data-item-class="amulet"]::before,
body.theme-sandstone .item-card.has-item-art[data-item-class="ring"]::before,
body.theme-sandstone .item-card.has-item-art[data-item-class="jewel"]::before {
  opacity:.22 !important;
}
@media (max-width:760px) {
  body.theme-sandstone .item-card.has-item-art::before,
  body.theme-sandstone .item-card.has-item-art[data-item-class="amulet"]::before,
  body.theme-sandstone .item-card.has-item-art[data-item-class="ring"]::before,
  body.theme-sandstone .item-card.has-item-art[data-item-class="jewel"]::before {
    opacity:.17 !important;
  }
}


/* Version 1.1.1 — green abyssal Well of Souls inside the red-sandstone skin. */
.theme-sandstone #choiceDialog.well-of-souls-dialog {
  background:rgba(0, 27, 13, .99) !important;
  border-color:rgba(56, 224, 121, .82) !important;
  box-shadow:0 28px 92px rgba(0,0,0,.82), inset 0 0 78px rgba(28, 215, 105, .30), 0 0 40px rgba(27, 190, 91, .20) !important;
}
.theme-sandstone #choiceDialog.well-of-souls-dialog .dialog-card {
  background-color:rgba(0, 22, 11, .99) !important;
  background-image:
    radial-gradient(circle at 50% 18%, rgba(44, 237, 126, .34), transparent 44%),
    radial-gradient(circle at 50% 92%, rgba(10, 126, 61, .30), transparent 52%),
    linear-gradient(180deg, rgba(3, 62, 31, .97), rgba(0, 16, 8, .99)),
    var(--sekhema-fill-surface) !important;
  background-size:auto, auto, auto, 512px 384px !important;
  box-shadow:0 38px 120px rgba(0,0,0,.82), inset 0 0 110px rgba(35, 225, 113, .31) !important;
}
.theme-sandstone #choiceDialog.well-of-souls-dialog .dialog-card::before {
  background:none !important;
  border:58px solid transparent !important;
  border-image-source:url("assets/ui/obsidian/well-of-souls-frame-green.png") !important;
  border-image-slice:160 180 160 180 !important;
  border-image-width:48px 52px !important;
  border-image-outset:1 !important;
  border-image-repeat:stretch !important;
  filter:saturate(1.65) brightness(.92) drop-shadow(0 20px 34px rgba(0,0,0,.68)) drop-shadow(0 0 28px rgba(35, 232, 115, .38)) !important;
}
.theme-sandstone #choiceDialog.well-of-souls-dialog .choice-btn {
  border-color:rgba(77, 226, 132, .64) !important;
  background:linear-gradient(180deg, rgba(7, 78, 39, .94), rgba(1, 32, 16, .97)) !important;
  box-shadow:inset 0 0 32px rgba(38, 210, 107, .22) !important;
}
.theme-sandstone #choiceDialog.well-of-souls-dialog .choice-btn:hover {
  border-color:rgba(136, 255, 177, .96) !important;
  background:linear-gradient(180deg, rgba(11, 108, 54, .97), rgba(1, 44, 22, .99)) !important;
  box-shadow:inset 0 0 40px rgba(56, 242, 135, .28), 0 0 26px rgba(39, 224, 113, .22) !important;
}
.theme-sandstone #choiceDialog.well-of-souls-dialog .dialog-card > .eyebrow,
.theme-sandstone #choiceDialog.well-of-souls-dialog .dialog-card > h2 {
  color:#c8f5d6 !important;
  text-shadow:0 0 18px rgba(77, 231, 137, .24) !important;
}
.theme-sandstone #choiceDialog.well-of-souls-dialog .dialog-card > p {
  color:#a8d9b8 !important;
}

.theme-sandstone .sandbox-byline {
  color:#c8b894 !important;
  text-shadow:0 1px 0 rgba(0,0,0,.62) !important;
  opacity:.92;
}

.theme-sandstone .entrance-title-credit {
  display:block !important;
  grid-area:title;
  align-self:end;
  justify-self:center;
  width:100%;
  margin:72px auto 12px !important;
  color:rgba(170, 158, 132, .62) !important;
  font-size:12px !important;
  letter-spacing:.14em !important;
  text-transform:uppercase;
  text-align:center !important;
  text-shadow:none !important;
}

/* Version 1.1.4 mobile disclosure hotfix — keep the action visible and scroll only the legal copy. */
@media (max-width:760px), (max-height:740px) {
  .theme-sandstone .legal-disclosure-overlay {
    display:flex !important;
    align-items:stretch !important;
    justify-content:center !important;
    overflow:hidden !important;
    padding:6px !important;
    padding-top:max(6px, env(safe-area-inset-top)) !important;
    padding-right:max(6px, env(safe-area-inset-right)) !important;
    padding-bottom:max(6px, env(safe-area-inset-bottom)) !important;
    padding-left:max(6px, env(safe-area-inset-left)) !important;
  }

  .theme-sandstone .legal-disclosure-card {
    display:flex !important;
    flex-direction:column !important;
    width:100% !important;
    height:calc(100vh - 12px) !important;
    height:calc(100dvh - 12px) !important;
    max-height:calc(100vh - 12px) !important;
    max-height:calc(100dvh - 12px) !important;
    min-height:0 !important;
    overflow:hidden !important;
    padding:12px 14px 10px !important;
    border-width:10px !important;
    border-image-width:10px !important;
    box-sizing:border-box !important;
  }

  .theme-sandstone .legal-disclosure-card > .entrance-game {
    flex:0 0 auto !important;
    margin:0 0 2px !important;
    font-size:.56rem !important;
    line-height:1.15 !important;
  }

  .theme-sandstone .legal-disclosure-card > h2 {
    flex:0 0 auto !important;
    margin:0 0 8px !important;
    font-size:clamp(1.25rem, 7vw, 1.65rem) !important;
    line-height:1.05 !important;
  }

  .theme-sandstone .legal-disclosure-content {
    flex:1 1 auto !important;
    min-height:0 !important;
    max-height:none !important;
    overflow-x:hidden !important;
    overflow-y:auto !important;
    -webkit-overflow-scrolling:touch;
    overscroll-behavior:contain;
    touch-action:pan-y;
    scrollbar-gutter:stable;
    padding:0 8px 10px 0 !important;
    gap:8px !important;
    font-size:.78rem !important;
    line-height:1.38 !important;
  }

  .theme-sandstone .legal-disclosure-content p {
    margin:0 !important;
  }

  .theme-sandstone .legal-contact {
    padding-top:9px !important;
  }

  .theme-sandstone .legal-disclosure-accept {
    position:relative !important;
    flex:0 0 auto !important;
    z-index:3 !important;
    width:100% !important;
    min-height:48px !important;
    margin:8px 0 0 !important;
    padding:10px 12px !important;
    box-shadow:0 -10px 24px rgba(20,12,8,.34) !important;
  }
}


/* Version 1.1.4 mobile disclosure close-state fix. The mobile flex layout must never override the hidden state. */
.theme-sandstone .legal-disclosure-overlay.hidden,
.theme-sandstone .legal-disclosure-overlay[hidden] {
  display:none !important;
  visibility:hidden !important;
  pointer-events:none !important;
}
