/* A single daylight worktable. All grain is local, static and deliberately quieter
   than the jewellery. No overlays on the live specimens or the portrait cameras. */
:root {
  --ash: url('light-desk-art/ash.jpg');
  --linen: url('light-desk-art/milk-linen.jpg');
  --tray: url('light-desk-art/grey-linen.jpg');
  --ink: #302e29; --quiet: #615b4f; --chapter: #314b43;
  --ribbon: #a78c5e; --rule: #c7bba4; --leaf: #fffaf0; --wash: #f4eee1;
  --paper: linear-gradient(115deg,#fffdf5,#f8f1e3);
  --print-shadow: 0 1px 2px #4f40251a, 1px 4px 8px #4f402511;
}
body[data-chapter=sea] { --chapter:#2e514c; --ribbon:#9b8057 }
body {
  background: linear-gradient(120deg,#fff7dc5c,transparent 65%),#dbc4a3 var(--ash) center top / 512px 288px;
}
main {
  min-height:100vh;
  background: linear-gradient(110deg,#fffdf648,transparent 62%),#f4eee0 var(--linen) center top / 256px 256px;
  border:0; border-inline:1px solid #fff8e5;
  box-shadow:0 0 0 1px #a5907050,2px 0 8px #523e2738;
}
/* The workbench keeps the original responsive touch-grid dimensions. */
main:not(:has(> #bench:not([hidden]))) {
  width:min(calc(100% - 12px),36rem);
  padding:max(12px,env(safe-area-inset-top)) clamp(9px,3.4vw,22px) max(24px,env(safe-area-inset-bottom));
}
button:not(.mb-cell):not(.lb-cell) { border-radius:3px; }
button:focus-visible, a:focus-visible, summary:focus-visible { outline:3px solid #176b70; outline-offset:2px }
#dayDesk { color:var(--ink); min-height:calc(100vh - 12px); min-height:calc(100svh - 12px); }
#dayDesk > header { padding-right:3.4rem; }
#dayDesk > header::before {
  content:''; position:absolute; right:2px; top:50%; width:43px; height:43px; transform:translateY(-50%);
  background:url('light-desk-art/hallmark.svg') center / contain no-repeat; pointer-events:none;
}
#dayDesk > header, .folio-head, #album .folio-head {
  position:relative; padding:.45rem 0 .65rem; background:none; box-shadow:none;
  border:0; border-block-end:3px double #b5a17d; border-radius:0; color:var(--ink);
}
#dayDesk > header::after, .folio-head::after, #album .folio-head::after {
  content:''; position:absolute; inset:auto 0 -5px auto; width:8px; height:8px;
  background:#b0915a; border:2px solid var(--wash); transform:rotate(45deg); z-index:auto;
}
#dayDesk h1, .folio-head h1, #album .folio-head h1 { color:var(--ink); font-weight:400; letter-spacing:-.035em; }
#dayDesk > header .eyebrow, .folio-head .eyebrow, #album .eyebrow,
#deskWork > small, #clientDesk > small, #clientInbox > small {
  display:block; font:700 .66rem/1.4 system-ui,sans-serif; letter-spacing:.13em; color:#65533a;
}
#dayDesk > header h1 { margin-top:.12rem; }
#deskWork { margin-top:.9rem; padding:clamp(.75rem,3.4vw,1.2rem); color:var(--ink);
  border:1px solid #c8b99d; border-top:3px solid #ac9063; border-radius:2px;
  background:var(--paper); box-shadow:var(--print-shadow); }
#deskWork > h2 { font-size:clamp(1.32rem,5.4vw,1.85rem); margin:.3rem 0; line-height:1.08; text-wrap:balance; }
#deskWork > p { margin:.3rem 0 .7rem; font:italic 1rem/1.35 Georgia,serif; color:var(--quiet); }
#deskSketches { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:clamp(6px,2vw,12px); }
#deskSketches [data-desk-sketch] {
  position:relative; min-width:0; display:grid; align-content:end; justify-items:stretch; gap:1px;
  padding:4px; border:1px solid #c1b49d; background:#faf6ec; box-shadow:inset 0 0 0 2px #fffdf6;
}
#deskSketches canvas,.desk-resume-mount,.cl-sketches canvas {
  display:block; width:100%; height:auto; background:#f2ece0 var(--linen) center / 200px;
}
#deskSketches strong { font:500 1.02rem/1.3 Georgia,serif; color:var(--ink); padding:.18rem .4rem; }
#deskSketches [aria-pressed=true] { border-color:#3f6355; box-shadow:inset 0 0 0 2px #3f6355; }
#deskSketches [aria-pressed=true]::after {
  content:'✓'; position:absolute; right:6px; top:6px; width:1.25rem; line-height:1.25rem;
  border-radius:50%; background:#375749; color:white; font-family:system-ui,sans-serif; }
#deskGems { display:flex; align-items:start; justify-content:center; flex-wrap:wrap; gap:.22rem clamp(6px,2vw,12px); margin:.62rem 0; }
#deskGems span { display:grid; justify-items:center; color:#504b42; }
#deskGems img { width:clamp(30px,9vw,43px); height:auto; display:block; object-fit:contain; filter:drop-shadow(0 1px 1px #51443544); }
#deskGems small { font:500 .73rem/1.25 Georgia,serif; }
#deskCTA, button.gold, #mineralEnd #benchFinish, #mineralEnd #benchRetry:not([hidden]), #closeLoupe, #closeDetail {
  color:#fffdf3; background:#375749; border-color:#334e42; box-shadow:0 2px 2px #37332424;
}
#deskCTA { width:100%; font-size:.94rem; min-height:46px; }
#deskCTA:disabled { color:#565a50; background:#e0e0d4; border-color:#c4c4b7; opacity:1; box-shadow:none; }
.desk-resume-mount { width:min(60%,14rem); margin:.6rem auto; }
.desk-letters, #shelfPages { display:grid; gap:.5rem; margin:.6rem 0; }
.desk-letters button, #shelfPages button { text-align:start; background:var(--paper); border-inline-start:3px solid var(--ribbon); }
/* The navigation itself is the little collection of props on the wood, not
   four app icons. Real button names remain available if artwork fails to load. */
.desk-objects {
  display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); align-items:stretch;
  gap:3px; margin:.85rem 0 0; padding:.4rem .22rem .5rem; background:#dbc4a3 var(--ash) center / 384px 216px;
  border:1px solid #c0ab8e; border-top-color:#f1e1c9; border-radius:4px; box-shadow:var(--print-shadow);
}
.desk-objects [data-object] {
  min-width:0; display:flex; flex-direction:column; align-items:center; justify-content:flex-start; gap:.18rem;
  color:#3e352a; background:transparent; box-shadow:none; border:1px solid transparent;
  padding:.18rem .03rem; font:600 clamp(.71rem,2.85vw,.88rem)/1.16 Georgia,serif; overflow-wrap:anywhere;
}
.desk-objects [data-object]::before {
  content:''; display:block; width:100%; height:clamp(43px,14.8vw,77px); pointer-events:none;
  background:var(--object) center / contain no-repeat; filter:drop-shadow(1px 2px 1px #49372350);
}
[data-object=letters] { --object:url('light-desk-art/letters.png'); }
[data-object=mirror] { --object:url('light-desk-art/mirror.png'); }
[data-object=album] { --object:url('light-desk-art/album.png'); }
[data-object=book] { --object:url('light-desk-art/book.png'); }
@media (hover:hover) { .desk-objects [data-object]:hover { background:#fff9e750; border-color:#ad9474; } }
.desk-objects [data-object]:active { background:#fff9e770; }
#deskHome { margin:0 0 .5rem; background:transparent; color:var(--chapter); border:0; box-shadow:none; padding:2px .4rem; }
#deskShelf { padding:1rem; border-left:5px solid #546656; background:var(--paper); box-shadow:var(--print-shadow); }
#deskShelf h1 { margin:.2rem 0 .65rem; }
#deskShelf p { border-block-end:1px solid var(--rule); padding:.5rem 0; color:var(--quiet); }
/* Existing scenes stay recognisable. The historical print, its inserts and
   its paper corners are never filtered or re-painted by this theme. */
#room .mirror { border:1px solid #b59c77; background:#dbc4a3 var(--ash) center / 384px 216px;
  box-shadow:inset 0 0 0 2px #e7d7bc,1px 3px 5px #46362129; }
#clientInbox, #clientDesk, #album:not([hidden]), #albumDetail, #clientMacro, #loupe {
  color:var(--ink); background:var(--paper); border:1px solid #c8b99d; box-shadow:var(--print-shadow); border-radius:3px;
}
#clientInbox, #clientDesk { margin:.75rem auto; padding:clamp(.72rem,3.4vw,1.1rem); }
#clientEnvelopes button,.cl-sketches button { background:#fffaf1; }
#clientDesk blockquote { color:#4d423a; background:#fffaf1; }
#album:not([hidden]) { border-inline-start:4px solid #50654f; padding:clamp(8px,2.2vw,14px); }
#album .mirror { box-shadow:var(--print-shadow); }
#albumCaption,.pattern { background:#fffaf0cf; }
#slots button, #slots button[aria-pressed=true] { background:var(--paper); }
#clientMacro, #loupe, #albumDetail { border-block-start:4px solid #ad9368; }
#clientMacro::backdrop, #loupe::backdrop, #albumDetail::backdrop { background:#302d279e; }
/* Both CrystalArt.board and the mesh fallback composite onto a transparent
   canvas. One cloth under both paths; the touch grid must never paint the bed. */
.mineral-bench { background:#f5eee0 var(--linen) center / 256px; color:var(--ink);
  border:1px solid var(--rule); border-radius:3px; box-shadow:var(--print-shadow); }
.mb-order { background:var(--paper); border-color:var(--rule); }
.mb-tray, .lb-board, .detail-plate, #clientMacroMount, #clientPortrait,
.cl-specimens img, #loupe .specimen.crystal-plate .crystal-photo {
  color:var(--ink); background:#b3b5af var(--tray) center / 256px;
  border-radius:3px; box-shadow:inset 1px 2px 4px #514e4521,0 0 0 1px #a09783;
}
#mineralBoard { background:transparent; }
.mb-grid .mb-cell::before { content:none; }
.mb-grid .mb-cell[aria-pressed=true], .mb-grid .mb-cell[data-hint=yes], .mb-grid .mb-cell:focus-visible {
  outline:2px solid #314f45; outline-offset:-2px; box-shadow:inset 0 0 0 4px #fff9e4;
}
.mb-grid .mb-cell[data-hint=yes] { outline-style:dashed; }
#loupe .specimen.crystal-plate { background:#f4eee0 var(--linen) center / 256px; box-shadow:none; }
#mineralEnd { background:#f8f1df; border-color:var(--rule); }
@media(max-width:460px) {
  .desk-objects { grid-template-columns:repeat(2,minmax(0,1fr)); gap:3px .4rem; padding:.35rem; }
  .desk-objects [data-object] { display:grid; grid-template-columns:minmax(37px,.68fr) minmax(0,1.32fr); gap:.25rem;
    padding:.16rem 0; text-align:start; hyphens:auto; font:500 clamp(.76rem,3.5vw,.95rem)/1.12 Georgia,serif; }
  .desk-objects [data-object]::before { width:100%; height:clamp(37px,13vw,58px); }
}
@media(min-height:720px) {
  #dayDesk > header { padding-block:1.2rem .9rem; }
  #deskWork { margin-top:1.15rem; }
  #deskWork > p { margin:.5rem 0 .85rem; }
  #deskGems { margin-block:1rem; }
  .desk-objects { margin-top:1rem; }
}
@media(max-height:650px) and (max-width:500px) {
  main:not(:has(> #bench:not([hidden]))) { padding-top:max(6px,env(safe-area-inset-top)); }
  #dayDesk > header { padding:.1rem 0 .46rem; }
  #deskWork { margin-top:.55rem; padding:.6rem; }
  #deskWork > p { margin-bottom:.45rem; font-size:.92rem; }
  #deskGems, .desk-objects { margin-top:.43rem; }
  #deskHome { min-height:44px; margin-bottom:0; }
}
/* Album index: mounted prints and empty mounts have identical footprints. */
#shelfPages .shelf-slot {
  display:grid; grid-template-columns:minmax(0,43%) minmax(0,1fr); align-items:center;
  gap:clamp(8px,2.5vw,16px); padding:clamp(6px,2vw,12px); color:var(--ink);
}
@media (min-height:720px){#shelfPages .shelf-slot{grid-template-columns:minmax(0,59%) minmax(0,1fr)}}
#shelfPages .shelf-print {
  display:grid; place-items:center; width:100%; aspect-ratio:4/5; height:auto; box-sizing:border-box;
  border:3px solid #fffdf6; outline:1px solid #bfb199; box-shadow:var(--print-shadow);
}
#shelfPages .shelf-slot strong {display:block; font:500 clamp(1.1rem,4.6vw,1.5rem)/1.12 Georgia,serif;}
#shelfPages .shelf-slot small {display:block; font:500 .83rem/1.3 system-ui,sans-serif; margin-top:.55rem; color:var(--chapter);}
#shelfPages .shelf-slot:enabled small {text-decoration:underline; text-underline-offset:.18em;}
#shelfPages div.shelf-slot {opacity:1; cursor:default; background:transparent; box-shadow:none; border:1px dashed #b6a68b;}
#shelfPages div.shelf-slot small {color:var(--quiet);}
#shelfPages div.shelf-slot .shelf-print {
  color:#776951; font:italic 1.3rem Georgia,serif; border:0; outline:0; box-shadow:inset 0 0 0 1px #cabca4;
  background:linear-gradient(135deg,#a5967b 7px,transparent 7.5px),linear-gradient(-45deg,#a5967b 7px,transparent 7.5px),#ece4d5;
}
