/* Second generation. All fonts are resolved on the device. */
:root {
  --ink: #252924;
  --muted: #555e55;
  --line: #d8dace;
  --paper: #f3f2ec;
}
body, body[data-kind] { background: var(--paper); --green: #365247; --gold: #e9d7a7; }
body[data-kind=shochu] { --green: #63482d; }
body[data-kind=liqueur] { --green: #754051; }
body[data-kind=wine] { --green: #553650; }
main { max-width: 1360px; padding: 0 clamp(14px, 4vw, 64px) 30px; }
.mast { background: #202e29; color: #fdfcf7; }
.mast-inner { display: flex; align-items: center; max-width: 1360px; margin: auto; gap: 15px; padding: 20px clamp(14px, 4vw, 64px); }
.mast h1 { font: 600 clamp(20px, 3vw, 30px)/1.25 "Yu Mincho","Hiragino Mincho ProN",serif; letter-spacing: .07em; margin: 0; }
.mast small { color: #d2d9cf; font-size: 11px; letter-spacing: .12em; }
.identity-mark { position: relative; width: 37px; height: 40px; border: 2px solid #ebd5a5; border-radius: 3px 7px 7px 3px; box-shadow: inset 5px 0 #ebd5a5; flex: none; }
.identity-mark::before, .identity-mark::after { content: ""; position: absolute; left: 12px; right: 6px; top: 12px; height: 2px; background: #ebd5a5; }
.identity-mark::after { top: 19px; right: 10px; }
.build-label { margin-left: auto; text-align: right; font-size: 12px; color: #d2d9cf; }
.build-label b { display: block; color: #f5e1b4; font: 600 15px/1.5 ui-monospace, monospace; }
.workspace-nav { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; padding: 15px 0; margin: 0 0 22px; border-bottom: 1px solid #b9beb1; }
.nav-group { display: flex; flex-wrap: wrap; gap: 5px; }
.workspace-nav button, .text-button { border: 1px solid transparent; border-radius: 7px; padding: 9px 15px; min-height: 44px; font-size: 15px; font-weight: 600; background: transparent; color: #404b41; }
.workspace-nav button:hover,.text-button:hover { background: #e7e9de; }
.workspace-nav button[aria-pressed=true] { background: #293c33; color: #fff; }
.mode-heading { margin: 0 0 16px; }
.mode-heading h2, #ledger h2, #files h2 { font-size: clamp(24px, 3vw, 36px); color: var(--ink); letter-spacing: .03em; line-height: 1.35; }
.sale-picker { background: #fff; max-width: 490px; }
.switch-notice, #mode-note { margin: 7px 0; }
.switch-notice { margin-bottom: 20px; }
.calculator-grid { grid-template-columns: minmax(0, 1.35fr) minmax(295px, .85fr); gap: clamp(16px, 2.3vw, 34px); }
.panel { border-radius: 12px; border-color: var(--line); box-shadow: 0 2px 5px #18281d06; padding: clamp(17px, 2.2vw, 30px); }
.panel h2 { font-size: 19px; }
.section-title { margin-bottom: 17px; }
.section-title h2, .result-card .eyebrow { letter-spacing: .03em; }
.section-title h2::before { content: ""; display: inline-block; height: .9em; width: 4px; margin-right: .65em; background: var(--green); }
.result-card { background: #23372f; padding: clamp(20px, 2.2vw, 32px); border-radius: 12px; }
.result-card .eyebrow,.result-card .eyebrow.light { color: #f3e2ba; font-size: 13px; }
.result-card label,.result-card .price-secondary,.result-card .result-label,.result-card .field-help,.result-card small { color: #f3f4eb; }
.price { line-height: 1.07; font-variant-numeric: tabular-nums; margin: 11px 0 17px; letter-spacing: -.035em; }
.price-secondary { margin: 0 0 16px; }
.rate-chart { border-block-start: 1px solid #718276; padding: 13px 0 4px; }
.rate-chart label { display:flex; justify-content:space-between; font-size: 13px; }
.rate-chart meter { display:block; appearance: none; width:100%; height: 10px; margin: 8px 0; border: 0; border-radius: 8px; background: #cfdbce; }
.rate-chart meter::-webkit-meter-bar { height:10px; border:0; background: #cfdbce; }
.rate-chart meter::-webkit-meter-optimum-value { background: #dbb878; }
.rate-chart meter::-moz-meter-bar { background: #dbb878; }
.rate-chart p { font-size: 12px; color: #edf2e8; margin: 0 0 8px; }
.rate-chart.loss meter::-webkit-meter-optimum-value { background: #f0a595; }
.text-button { color: var(--green); text-decoration: underline; }
.save-bar { display:grid; gap:6px; border-radius: 12px; }
#advanced-controls:empty, #save-choice:empty { display:none; }
#save-choice:not([hidden]) { padding: 12px; border: 1px solid #a77928; background: #fff9e8; }
details { overflow-wrap:anywhere; }
summary { padding-block:12px; min-height:44px; cursor:pointer; font-weight:650; }
#advanced-controls details, #advanced-controls > section { margin: 0 0 14px; padding: 13px 16px; background: #fff; border: 1px solid var(--line); border-radius: 10px; }
textarea, .panel input, .panel select, .panel textarea { max-width:100%; }
.panel :is(button,summary), .save-bar button, #advanced-controls button { min-height: 44px; }
.panel button:not([class]), #advanced-controls button:not([class]) { border:1px solid var(--line); background:#f5f6f0; color:var(--ink); padding:9px 12px; border-radius:6px; }
.panel button:disabled { opacity:.55; }
#cost-form :is(input[type=checkbox],input[type=radio]), .panel :is(input[type=checkbox],input[type=radio]) { display:inline-block; width:1.15em; height:1.15em; margin:.4em; vertical-align:middle; }
#files-screen, #ledger-screen { max-width: 1080px; }
.notice-section, .help-section { max-width: 100%; }
footer { gap: 10px; flex-wrap:wrap; }
input, select, textarea, button, .result-card, .saved-item, .field, .panel, .results-column { min-width: 0; overflow-wrap:anywhere; }
.table-scroll { overflow:auto; }
@media(max-width:780px){
 .mast-inner { padding-block:14px; }
 .workspace-nav { display:grid; grid-template-columns:2fr 1fr; gap:4px; margin-bottom:18px; padding-block:9px; }
 .nav-group { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:3px; }
 .nav-group:last-child { grid-template-columns:1fr; }
 .workspace-nav button { padding:6px 3px; font-size:14px; background:#e8eae1; }
 .calculator-grid { grid-template-columns:minmax(0,1fr); gap:0; }
 .panel { margin-bottom:14px; }
 .field-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
 .result-card { margin-bottom:14px; }
}
@media(max-width:450px){
 .field-grid { grid-template-columns:minmax(0,1fr); gap:0; }
 .panel { padding:16px 14px; }
 .display-label { min-width:87px; }
 .mode-heading { gap:8px; }
 .mode-heading h2 { font-size:22px; }
 .saved-heading, .saved-item { gap:8px; flex-wrap:wrap; }
 .file-actions { display:grid; grid-template-columns:1fr; }
 .metrics>div { flex-wrap:wrap; }
 .switch-notice { margin-bottom:14px; }
}
@media print { .workspace-nav, .build-label, .save-bar, #toast { display:none !important; } }
.advanced-table-wrap { max-width: 100%; overflow-x:auto; }
.advanced-checks { display:flex; gap:6px 12px; flex-wrap:wrap; }
.advanced-checks label { min-height:44px; display:inline-flex; align-items:center; }
.advanced-row { margin-block:12px; padding-block-start:12px; border-block-start:1px solid var(--line); }
.advanced-output { font-variant-numeric:tabular-nums; }
#identity-fields { margin-bottom:16px; }
#identity-fields summary { color:var(--green); }
.status-success,.status-warning,.status-error { padding:12px; border-inline-start:4px solid; }
.status-success { color:#215b3e; background:#e8f5e9; }
.status-warning { color:#744b0e; background:#fff2ce; }
.status-error { color:#862c2c; background:#fbe9e6; }
#catalog-tools, #product-extra { margin-block: 12px; }
.result-card .waiting { color:#f4eddb; background:#32493e; border-color:#607569; }
.panel .segmented button[aria-pressed=true] { background:var(--green); color:white; }
.quick-price { display:none; }
@media (max-width:780px) {
 .quick-price:not([hidden]) { position:fixed; z-index:3; inset:auto 0 0; display:flex; align-items:center; justify-content:space-between; gap:6px; padding:10px 15px max(10px,env(safe-area-inset-bottom)); min-height:48px; color:white; background:#243b30; text-decoration:none; box-shadow:0 -2px 8px #0002; }
 .quick-price strong { font-variant-numeric:tabular-nums; }
 .quick-price span { font-size:12px; } body:has(.quick-price:not([hidden])) { padding-bottom:64px; }
 #toast { bottom:74px; }
}
@media print { .quick-price { display:none !important; } }
