:root {
  color-scheme: light;
  --serif: "Hiragino Mincho ProN","Yu Mincho","YuMincho","Noto Serif JP",serif;
  --sans: "Hiragino Kaku Gothic ProN","Yu Gothic",Meiryo,sans-serif;
  --ink: #342724;
  --soft: #67584e;
  --paper: #fff9e9;
  --wine: #702d39;
  --line: #d4c1a0;
  --green: #365448;
  font-family: var(--sans); color: var(--ink);
  background: #362426;
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0; min-height: 100vh;
  background: radial-gradient(ellipse at 30% 4%, #fffaed, transparent 51rem), linear-gradient(118deg,#e9dfce,#f5edde 62%,#e7ddce);
}
button, a { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
button, input { font: inherit; }
button { cursor: pointer; }
button:disabled { opacity: .6; cursor: default; }
a { color: inherit; }
:focus-visible { outline: 3px solid #4e79a0; outline-offset: 3px; }
.work-bar { padding-block-start: var(--site-header-inset, 0px); color: #fff7e2; background: #362426; border-bottom: 2px solid #ae8b54; }
.work-bar-inner { max-width: 1110px; margin: auto; min-height: 52px; padding-inline: max(28px, env(safe-area-inset-left, 0px)) max(28px, env(safe-area-inset-right, 0px)); display: flex; align-items: center; gap: 15px; }
.back-link, .sound-toggle, .wallet { display: inline-flex; align-items: center; gap: .45em; font-size: .875rem; }
.back-link { text-decoration: none; min-height: 44px; margin-right: auto; }
.back-link::before { content: ''; width: .52em; height: .52em; border: solid #e7cc96; border-width: 0 0 1.5px 1.5px; transform: rotate(45deg); }
.wallet { font-variant-numeric: tabular-nums; }
.pay-envelope::before {
  content:''; display: inline-block; width: 15px; height: 15px; border-radius: 50%; border: 1px solid #f4f3e8;
  background: repeating-conic-gradient(from -20deg,#d8d6cb 0deg 35deg,#9294a1 50deg,#f6f5f1 74deg,#b3b2b4 109deg);
  box-shadow: inset 0 0 0 2px #c6c7c7,inset 0 0 0 3px #838995,0 1px 2px #211a20;
}
.wallet strong { font-size: 1rem; color: #fff; }
.sound-toggle { min-height: 44px; padding: .3rem .1rem .3rem .95rem; border: 0; border-left: 1px solid #795d57; background: transparent; color: #fff6e4; }
.sound-toggle[aria-pressed="true"] { color: #ffe0a2; }
.work-shell { max-width: 1110px; margin: auto; padding: 0 28px max(36px,env(safe-area-inset-bottom)); }
.work-heading { padding: clamp(22px,3.6vw,43px) 0 clamp(18px,2vw,27px); }
.work-heading h1, .desk-card h2, .desk-card h3, .journal > summary, .note-excerpt strong { font-family: var(--serif); }
.work-heading h1 { display: flex; align-items: center; gap: .34em; margin: 0; font-size: clamp(2.1rem,4.2vw,3.4rem); font-weight: 600; letter-spacing: .075em; line-height: 1.17; color: #43262c; }
.work-heading h1::before { content: ''; width: .16em; height: .8em; margin-right: .06em; background: #803842; box-shadow: 3px 0 #f2debb,4px 0 #bda16d; }
.work-heading p { margin: .55em 0 0; color: var(--soft); font: .95rem/1.65 var(--serif); letter-spacing: .06em; }
.work-grid { display:grid; grid-template-columns: minmax(0,.95fr) minmax(0,1.05fr); gap: clamp(14px,2.3vw,28px); align-items: stretch; }
.stage-card { min-width: 0; min-height: 0; position: relative; overflow: hidden; isolation: isolate; display: flex; flex-direction: column; background: #4a332d; border: 1px solid #6c4f3e; border-radius: 9px; box-shadow: 0 8px 24px -12px #634b3b8a; }
.stage-scenery {
  position: relative; flex: 1; min-height: 360px; isolation: isolate; overflow: hidden;
  background: #aa8a66 url("/assets/work/guild.webp") center center/cover no-repeat;
}
.stage-scenery::before { content:''; position:absolute; inset: 0; pointer-events:none; background: linear-gradient(0deg,#4c301a55,transparent 16%,transparent 87%,#51352131); z-index:0; }
.stage-scenery::after { content:''; position: absolute; inset: 8px; border: 1px solid #fff0c679; pointer-events:none; z-index:4; }
.stage-scenery[data-phase="working"][data-job="bookshop"] { background-image: url("/assets/work/scene-bookshop.webp"); background-position: 48% 50%; }
.stage-scenery[data-phase="working"][data-job="post"] { background-image: url("/assets/work/scene-post.webp"); background-position: 50% 58%; }
.stage-scenery[data-phase="working"][data-job="salon"] { background-image: url("/assets/work/scene-salon.webp"); background-position: 60% 50%; }
.stage-scenery[data-phase="working"][data-job="palace"] { background-image: url("/assets/work/scene-palace.webp"); background-position: 55% 50%; }
.stage-avatar { position: absolute; z-index: 1; bottom: 2%; right: 5%; width: 75%; height: 91%; transform-origin: 50% 99%; filter: drop-shadow(2px 4px 4px #38292442); }
.stage-avatar::before { content: ''; position: absolute; z-index: -1; left: 15%; right: 15%; bottom: 0; height: 5%; border-radius: 50%; background: radial-gradient(ellipse,#31282e66,transparent 70%); }
.stage-avatar img { display: block; width: 100%; height: 100%; object-fit: contain; object-position: center bottom; }
.scene-tag { position: absolute; z-index: 5; top: 17px; left: 17px; padding: 6px 14px 7px; color: #fff8df; background: #442d2ce8; border: 1px solid #cfaf76; font: 600 .875rem/1.45 var(--serif); letter-spacing: .09em; }
.stage-caption { min-height: 73px; padding: 11px 18px; color: #f5e6ce; border-top: 1px solid #bba174; background: linear-gradient(120deg,#44302f,#302328); display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.stage-caption > div { min-width: 0; }
.stage-caption span { color: #e3cda2; font-size: .78rem; letter-spacing: .12em; }
.stage-caption strong { display:block; margin-top: 2px; font: 600 1.03rem/1.4 var(--serif); letter-spacing:.04em; }
.wardrobe-link { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; padding: .45em .9em; border: 1px solid #b49b76; border-radius: 4px; text-decoration: none; font-size: .875rem; }
.desk-card { min-width: 0; padding: clamp(16px,2.8vw,29px); border:1px solid #c6af8b; border-radius: 8px; background: linear-gradient(120deg,#fffaf0,#fcf6e8); box-shadow: inset 0 0 0 3px #faf3e2, inset 0 0 0 4px #e6dbc5,0 8px 24px -13px #725c4273; }
.desk-card h2, .desk-card h3 { color: #452e2d; }
.desk-card h2 { margin: 0 0 15px; font-size: 1.45rem; line-height: 1.3; font-weight: 650; letter-spacing: .085em; }
.desk-card h3 { margin: 19px 0 8px; font-size: 1rem; letter-spacing: .07em; }
.jobs-list, .shift-list { display: grid; gap: 7px; }
.jobs-list { grid-template-columns: repeat(2,minmax(0,1fr)); }
.job-option { appearance: none; overflow: hidden; position: relative; min-width: 0; min-height: 80px; padding: 8px 5px 8px 53px; text-align: left; background: #fffbf1; color: var(--ink); border: 1px solid #d9c8ab; border-radius: 5px; line-height: 1.32; }
.job-option::before { content: ''; position:absolute; left: 6px; top: 50%; transform: translateY(-50%); width: 42px; height: 48px; background: var(--icon) center/contain no-repeat; mix-blend-mode: multiply; pointer-events:none; }
.job-option[data-job="bookshop"] { --icon: url("/assets/salon/exhibit-quill.webp"); }
.job-option[data-job="post"] { --icon: url("/assets/salon/exhibit-letter.webp"); }
.job-option[data-job="salon"] { --icon: url("/assets/salon/exhibit-cup.webp"); }
.job-option[data-job="palace"] { --icon: url("/assets/salon/duel-honor-fan.webp"); }
.job-option[aria-pressed="true"] { border-color:#8a4146; background: #f8eadd; box-shadow: inset 0 0 0 1px #975959; }
.job-title,.job-role,.job-fit { display:block; overflow-wrap:anywhere; }
.job-title { color:#502f33; font: 650 .99rem/1.35 var(--serif); }
.job-title-phrase { display:inline-block; white-space:nowrap; }
.job-role { color: var(--soft); font-size: .79rem; padding-top: 3px; }
.job-fit { margin-top:2px; color: var(--green); font-size: .77rem; }
.job-option[data-fit="no"] .job-fit { color: #794930; }
.job-brief { margin: 13px 0 0; }
.job-description, .activity-line, .note-excerpt p, .journal-pages p { margin: 0; line-height: 1.7; overflow-wrap: anywhere; }
.job-description { font-size: .94rem; }
.code-line { display: flex; align-items: baseline; flex-wrap: wrap; gap: 2px 7px; padding: 7px 0; color:var(--soft); border-block: 1px solid #dfd2bb; font-size: .85rem; margin-top: 9px; }
.code-line strong { color:var(--ink); font-weight: 550; }
.code-status { margin-left: auto; font-weight: 600; color: var(--green); }
.code-status[data-fit="no"] { color: #83472e; }
.shift-list { grid-template-columns: repeat(4,minmax(0,1fr)); }
.shift-option { appearance:none; min-width:0; min-height: 44px; border:1px solid #cdb896; background: #fffaf0; border-radius:4px; padding: 6px 3px; color: var(--ink); font-size: .94rem; }
.shift-option[aria-pressed="true"] { color: #fff9e9; background: #624447; border-color:#624447; box-shadow: inset 0 0 0 2px #624447,inset 0 0 0 3px #d5b296; }
.shift-summary { margin: 15px 0 12px; display:flex; flex-wrap:wrap; justify-content: space-between; gap: 8px 12px; }
.shift-summary > div { display:flex; align-items:baseline; gap: .4em; }
.shift-summary dt { color: var(--soft); font-size: .87rem; }
.shift-summary dd { margin:0; font-weight:650; font-variant-numeric:tabular-nums; }
#quoted-pay, #active-pay { color: var(--wine); }
.work-button,.secondary-button { position:relative; display: flex; text-align: center; width:100%; min-height: 48px; padding: 9px 14px; align-items:center; justify-content:center; border-radius:4px; text-decoration:none; font: 650 1.02rem/1.5 var(--serif); letter-spacing:.07em; }
.work-button { color:#fffae8; background: linear-gradient(110deg,#74313c,#63252f); border: 1px solid #6d3037; box-shadow: inset 0 0 0 2px #74313c,inset 0 0 0 3px #c79a78,0 2px 4px #50372c2e; }
.work-button.wardrobe-action { color: #fff5df; border-color: #554242; background: #524047; box-shadow: inset 0 0 0 2px #524047,inset 0 0 0 3px #c7a581; }
.secondary-button { border:1px solid #b49a75; background:#fcf6e9; color:var(--ink); }
.room-return { margin-top:8px; }
.save-hint { text-align:center; margin:9px 0 0; color:var(--soft); font-size:.81rem; line-height:1.55; }
#message { margin:0; color: #6a3338; }
#message:not(:empty) { margin-top:12px; border-left: 3px solid #9f6470; padding: 7px 12px; background: #fbf1e4; }
.panel-kicker { margin:0 0 9px; color: var(--wine); font: 600 .95rem/1.6 var(--serif); letter-spacing:.12em; }
.active-panel, .paid-panel { padding-block: clamp(5px,2.4vw,25px); }
.active-panel h2, .paid-panel h2 { font-size: clamp(1.6rem,2.5vw,2.3rem); }
.time-block, .pay-envelope { margin: 23px 0 19px; border-block: 1px solid var(--line); padding: 18px 2px; }
.time-block span, .pay-envelope span { display:block; color:var(--soft); font: 600 .9rem var(--serif); letter-spacing:.09em; }
.time-block strong, .pay-envelope strong { display:block; margin-top:5px; font: 600 clamp(1.7rem,3.5vw,2.45rem)/1.25 var(--serif); font-variant-numeric:tabular-nums; color:#60333a; }
.time-block progress { display:block; width:100%; height: 6px; margin-top:13px; appearance:none; accent-color:#80515c; border:0; border-radius:3px; color:#80515c; background:#e1d2b8; }
.time-block progress::-webkit-progress-bar { background:#e1d2b8; border-radius:3px; }
.time-block progress::-webkit-progress-value { background:#80515c; border-radius:3px; }
.time-block progress::-moz-progress-bar { background:#80515c; border-radius:3px; }
.active-panel .shift-summary { margin:18px 0; }
.pay-envelope { position: relative; padding: 15px 65px 17px 17px; border:1px solid #d6bc96; background: linear-gradient(145deg,#f9edcf,#f4e2c0); }
.pay-envelope::before { position:absolute; width:35px; height:35px; right:18px; top:calc(50% - 17px); }
.note-excerpt { margin: 0 0 22px; }
.note-excerpt strong { display:block; margin:7px 0; font-size:1.09rem; }
.journal { margin-top:17px; border-block:1px solid var(--line); background:#fff6e65c; }
.journal > summary { display:flex; align-items:center; gap:.75em; padding:12px 10px; min-height:48px; cursor:pointer; font-weight:600; letter-spacing:.08em; }
.journal > summary::-webkit-details-marker { display:none; }
.journal > summary::before { content:''; display:inline-block; width:9px; height:9px; border:solid var(--wine); border-width:0 1.5px 1.5px 0; transform: translateY(-2px) rotate(45deg); margin-right:3px; }
.journal[open] > summary::before { transform:translateY(2px) rotate(225deg); }
.journal > summary span { font: .88rem var(--sans); letter-spacing:normal; color: var(--soft); }
.journal-pages { padding: 0 16px 14px; }
.journal-job { padding: 15px 0 10px; border-top: 1px solid var(--line); }
.journal-job-count { margin-left: 10px; font: normal .85rem var(--sans); }
.journal-entry { border-bottom: 1px dotted var(--line); }
.entry-title { cursor: pointer; padding: 12px 4px; font: 600 .96rem/1.5 var(--serif); }
.entry-text { padding: 1px 8px 14px; }
.journal-empty { color: var(--soft); font-size: .9rem; }
.journal-pages h3 { margin: 3px 0 5px; font:600 1.1rem/1.4 var(--serif); }
.journal-pages small, .journal-pages time { color: var(--soft); }
.stage-effects { position:absolute; inset:0; z-index:2; overflow:hidden; pointer-events:none; }
.stage-effects i { display:none; position:absolute; }
[data-phase="working"] .stage-avatar { animation: depart .85s ease-out both; }
[data-phase="return"] .stage-avatar { animation: greet 1.1s cubic-bezier(.18,.65,.32,1) both; }
[data-phase="paid"] .stage-avatar { animation: curtsy 1s ease both; }
.stage-scenery[data-phase="return"] .stage-effects { background: linear-gradient(120deg,#f5dfa42b,transparent 65%); }
.stage-scenery[data-phase="paid"] .stage-effects i { display:block; width:15px; height:15px; left:var(--x); top: 63%; border:1px solid #fff9e5; border-radius:50%; background:linear-gradient(135deg,#fffbe8,#9297aa 52%,#fffdf7); box-shadow:inset 0 0 0 2px #c5c6c8,0 0 8px #fffbd4; animation: wage-coins 1.3s var(--delay) ease-out both; }
.stage-effects i:nth-child(1) { --x: 35%; --drift:-17px; --delay:0s; }
.stage-effects i:nth-child(2) { --x: 43%; --drift:8px; --delay:.18s; }
.stage-effects i:nth-child(3) { --x: 52%; --drift:-13px; --delay:.12s; }
.stage-effects i:nth-child(4) { --x: 62%; --drift:16px; --delay:.26s; }
.stage-effects i:nth-child(5) { --x: 69%; --drift:12px; --delay:.08s; }
.stage-scenery[data-event="depart"]::before { z-index:2; background:linear-gradient(100deg,transparent 12%,#fff2c39c 48%,transparent 82%); animation:doorlight 1.35s ease both; }
@keyframes doorlight { from { transform:translateX(-103%); opacity:0; } 35% { opacity:.83; } to { transform:translateX(103%); opacity:0; } }
@keyframes depart { 0%{opacity:.15;transform:translate(-8%,1%) scale(.975)} 70%{transform:translate(.5%,-.4%)} 100%{opacity:1;transform:none} }
@keyframes greet { 0%{opacity:0;transform:translate(11%,-2%) scale(.88)} 70%{opacity:1;transform:translate(-.6%,0) scale(1.008)} 100%{transform:none} }
@keyframes curtsy { 0%,100%{transform:none} 40%{transform:translateY(2%) rotate(-1deg) scale(.986)} }
@keyframes wage-coins { 0%{opacity:0;transform:translateY(12px) scale(.5)} 16%{opacity:1} 68%{opacity:1} 100%{opacity:0;transform:translate(var(--drift),-95px) rotateY(235deg) scale(.72)} }

.energy-card { display:flex; align-items:center; gap:14px; margin:0 0 17px; padding:0 0 12px; border-bottom:1px solid var(--line); }
.energy-vitals { flex:1; min-width:0; }
.energy-reading { display:flex; flex-wrap:wrap; align-items:baseline; gap:2px 7px; color:var(--green); font-size:.9rem; line-height:1.4; }
.energy-reading strong { font:650 1.12rem var(--serif); font-variant-numeric:tabular-nums; }
#energy-clock { font-size:.79rem; color:var(--soft); }
#energy-meter { display:block; width:100%; max-width:15rem; height:5px; margin-top:5px; border:0; appearance:none; border-radius:3px; background:#e5ddd0; }
#energy-meter::-webkit-meter-bar { background:#e5ddd0; border:0; border-radius:3px; height:5px; }
#energy-meter::-webkit-meter-optimum-value { background:#59775c; border-radius:3px; }
#energy-meter::-moz-meter-bar { background:#59775c; border-radius:3px; }
.tea-link { display:inline-flex; align-items:center; justify-content:center; flex:none; min-height:44px; color:#5c3841; font:600 .9rem var(--serif); text-decoration:underline; text-underline-offset:.27em; }
.planned-summary { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); row-gap:6px; }
.planned-summary > div { flex-wrap:wrap; }
.planned-summary #planned-cost, .planned-summary #planned-energy { color:var(--green); }
.energy-shortage { display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:0 8px; margin-bottom:10px; padding:3px 10px; border:1px solid #d9af96; border-radius:4px; background:#fff2e3; color:#733d39; }
.energy-shortage p { margin:0; font-size:.9rem; }

@media(hover:hover) {
  .job-option:hover, .shift-option:not([aria-pressed="true"]):hover { border-color: #9d7462; }
  .work-button:hover { filter:brightness(1.08); }
  .back-link:hover, .sound-toggle:hover { color:#ffe1a8; }
  .wardrobe-link:hover, .secondary-button:hover { box-shadow: inset 0 0 0 1px #b49b76; }
}
@media(max-width:830px) and (min-width:701px) {
  .work-shell {padding-inline:16px;} .work-grid {grid-template-columns:minmax(0,.75fr) minmax(0,1.15fr);}
  .desk-card {padding:17px;} .job-option { padding-left:44px;} .job-option::before { width:34px; }
}
@media(max-width:700px) {
  .work-bar-inner { padding-inline: max(15px,env(safe-area-inset-left)) max(15px,env(safe-area-inset-right)); min-height:48px; gap:12px; }
  .work-shell { padding-inline: max(13px,env(safe-area-inset-left)) max(13px,env(safe-area-inset-right)); }
  .work-heading { padding:17px 2px 14px; }
  .work-heading h1 { font-size:2.08rem; }
  .work-heading p { margin-top:4px; font-size:.86rem; }
  .work-grid { grid-template-columns: 1fr; gap:12px; }
  .stage-scenery { min-height: unset; flex:none; height: clamp(178px,46vw,285px); background-position: center 58%; }
  .stage-scenery::after { inset:5px; }
  .stage-avatar { right: 15%; width:52%; height:96%; bottom: 1%; }
  .scene-tag {left:12px; top:12px; padding: 4px 10px; font-size:.81rem; }
  .stage-caption { align-items:center; min-height:51px; padding:3px 10px 3px 13px; }
  .stage-caption span { font-size:.75rem; }
  .stage-caption strong { margin:0; font-size:.94rem; }
  .wardrobe-link { border:0; text-decoration: underline; text-underline-offset:.28em; }
  .desk-card { padding:17px 14px; }
  .desk-card h2 { margin-bottom:11px; font-size:1.28rem; }
  .job-option { min-height:73px; }
  .active-panel h2, .paid-panel h2 { font-size:1.65rem; }
}
@media(max-width:370px) {
  .job-option { padding-left:39px; }
  .job-option::before { width:30px; left:5px; }
  .jobs-list, .shift-list { gap:5px; }
  .work-shell { padding-inline:9px; } .desk-card { padding-inline:11px; }
  .job-title { font-size:.93rem; }
}
@media(prefers-reduced-motion:reduce) {
  *, *::before, *::after { animation:none !important; transition:none !important; scroll-behavior:auto !important; }
  .stage-effects { display:none; }
}
