/* HIG-inspired web UI: no changes to business data or calculations. */
:root{--text-muted:#b9b0a1;--ui-font:system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI","Hiragino Kaku Gothic ProN","Yu Gothic",sans-serif;}
body,input,select,textarea,button,h1,.inv-card-name,.footer-title{font-family:var(--ui-font);}
body{font-size:16px;line-height:1.6;}
.field label,.gravity-entry-label{font-size:.875rem;line-height:1.5;}
.sched-note,.inventory-table-note,.water-ph-tool-desc,.water-ph-caution,.cloud-dialog-note{font-size:.875rem;line-height:1.7;}
.section-title{font-size:1rem;letter-spacing:normal;text-transform:none;}
header .header-copy h1{font-size:1rem;font-weight:600;}
header .sub{display:none;}
header .mark{width:36px;height:36px;}
header{padding-bottom:12px;margin-bottom:12px;}
.screen-heading{margin:0 0 16px;font-size:1.75rem;font-weight:700;line-height:1.3;overflow-wrap:anywhere;}
.record-list-title,.record-list-kicker,.inventory-ledger-title,.inventory-ledger-kicker{display:none;}
.editor-status{margin:0 0 16px;font-size:.875rem;line-height:1.6;color:var(--text-muted);}
.inventory-display-buttons{display:flex;align-items:end;gap:10px;padding:12px;background:var(--surface-2);border:1px solid var(--border);border-radius:12px;}
.inventory-view-selector{flex:1;margin:0;}.inventory-view-selector label{margin-bottom:6px;}.inventory-view-selector select{min-height:44px;}
.inventory-display-buttons .help-button{flex:0 0 44px;}
.inventory-category-sheet{max-height:none;margin-bottom:12px;}
.inventory-category-sheet .inventory-table{min-width:1180px;}
.inventory-category-sheet .inventory-action-cell{max-width:none;white-space:nowrap;}
.inventory-sheet-actions{margin:0;min-width:max-content;flex-wrap:nowrap;}
.inventory-sheet-actions .inv-action-danger{margin-left:0;}
.inventory-sheet-history>td{padding:14px!important;background:var(--surface-2);}
.has-help{gap:16px;}
.has-help .help-button{margin-left:auto;flex:0 0 44px;width:44px;height:44px;min-width:44px;}
summary.section-title::after{min-width:56px;padding-left:12px;border-left:1px solid var(--border);text-align:center;}
.inv-card-actions .inv-action-danger{margin-left:auto;color:#f5a895;border-color:#875a50;}
.icon-btn{min-width:44px;min-height:44px;}
.icon-btn[aria-label*="削除"]{color:#f5a895;}
.welcome-panel{padding:20px;margin-bottom:20px;border:1px solid var(--copper);border-radius:16px;background:var(--surface);}
.welcome-heading{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;}
.welcome-heading h3{font-size:1.15rem;margin:0;}
.welcome-panel p{margin:12px 0;color:var(--text-muted);}
.welcome-actions{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;}
.welcome-actions .btn{white-space:normal;min-height:52px;}
.inventory-empty-guide{font-size:.95rem;margin:0 0 20px;}
.operational-note{padding:10px 14px;border-left:3px solid var(--copper);background:rgba(196,129,40,.08);font-size:.875rem;}
.calendar-export-actions{display:flex;align-items:center;gap:16px;}
.calendar-export-actions .add-row-btn{flex:1;min-width:0;}
.calendar-export-actions .help-button{flex:0 0 44px;}
.menu-section-title:has(.help-button){display:flex;align-items:center;justify-content:space-between;gap:16px;}
.export-dialog{width:calc(100% - 32px);max-width:720px;max-height:85vh;max-height:85dvh;overflow:auto;box-sizing:border-box;padding:24px;color:var(--text);background:var(--bg);border:1px solid var(--border);border-radius:18px;}
.export-dialog::backdrop{background:rgba(0,0,0,.65);}
.export-dialog-head{display:flex;align-items:center;justify-content:space-between;gap:16px;}
.export-dialog-head h2{font-size:1.3rem;margin:0;}
.export-dialog-note{font-size:.875rem;color:var(--text-muted);line-height:1.7;}
.export-group{margin:20px 0;padding:16px 0;border-top:1px solid var(--border);}
.export-group h3{font-size:1rem;margin:0 0 12px;}
.export-dialog .footer-actions{display:grid;gap:10px;}
.export-dialog .footer-link{width:100%;min-height:48px;white-space:normal;font-size:.95rem;}
.sched-col-header-planned,.sched-col-header-actual{white-space:normal;}
.sync-status-badge{font-size:.8rem;}
.workflow-device-hint{display:inline-flex;align-items:center;gap:7px;margin:-8px 0 14px;padding:5px 10px;border:1px solid var(--border);border-radius:999px;color:var(--text-muted);background:var(--surface);font-size:.8rem;font-weight:600;}
.workflow-device-hint[data-mode="mobile"]{border-color:rgba(201,123,19,.55);color:var(--copper-bright);}
.workflow-device-hint[data-mode="hybrid"]{border-color:rgba(201,123,19,.4);color:var(--text);}
.process-target-hint{margin:10px 0;padding:10px 12px;border-left:3px solid var(--copper);border-radius:0 8px 8px 0;background:rgba(201,123,19,.09);font-size:.9rem;font-weight:600;}
.fermentation-entry-toolbar{display:flex;align-items:end;justify-content:space-between;gap:12px;margin:10px 0;}
.fermentation-entry-toolbar .add-row-btn{margin:0;min-height:44px;}
.fermentation-sort-field{min-width:210px;margin:0;}
.fermentation-sort-field label{margin-bottom:4px;}
.fermentation-sort-field select{min-height:44px;}
.fermentation-tank-hint{margin:8px 0;padding:8px 10px;border:1px solid var(--border);border-radius:8px;background:var(--surface-2);color:var(--copper-bright);font-weight:600;}
.style-reference-head{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:10px;}
.style-reference-help{position:relative;margin-left:auto;}
.style-reference-help>summary{list-style:none;cursor:pointer;display:grid;place-items:center;}
.style-reference-help>summary::-webkit-details-marker{display:none;}
.style-reference-help>div{position:absolute;z-index:20;right:0;top:calc(100% + 8px);width:min(360px,calc(100vw - 48px));padding:12px;border:1px solid var(--border);border-radius:10px;background:var(--surface-2);box-shadow:0 10px 28px rgba(0,0,0,.35);font-size:.85rem;line-height:1.6;}
.style-reference-help>div p{margin:0 0 8px;}
.style-reference-help>div a{color:var(--copper-bright);font-weight:700;}
@media(max-width:700px){
  .wrap{padding-bottom:calc(124px + env(safe-area-inset-bottom));}
  .tabs{position:fixed;left:0;right:0;bottom:0;top:auto;z-index:100;display:grid;grid-template-columns:repeat(var(--visible-tab-count,6),minmax(0,1fr));gap:2px;margin:0;padding:6px 6px calc(6px + env(safe-area-inset-bottom));border-width:1px 0 0;border-radius:0;background:var(--bg);}
  .tab{min-height:60px;min-width:0;padding:6px 2px;font-size:.75rem;line-height:1.3;display:flex;flex-direction:column;gap:4px;white-space:normal;overflow-wrap:anywhere;}
  .tab::before{font-size:1.25rem;line-height:1;}
  .tab[data-tab="inventory"]::before{content:"▦";}.tab[data-tab="new"]::before{content:"＋";}.tab[data-tab="list"]::before{content:"▤";}.tab[data-tab="schedule"]::before{content:"◷";}.tab[data-tab="fermentation"]::before{content:"◉";}.tab[data-tab="tanks"]::before{content:"▥";}.tab[data-tab="packaging"]::before{content:"▣";}
  input,textarea,select{font-size:1rem;}
  .screen-heading{font-size:1.5rem;}
  .app-meta{margin-bottom:12px;}
  .mock-banner,.version-line{font-size:.75rem;}
  .has-help{flex-wrap:wrap;}
  .welcome-actions{grid-template-columns:1fr;}
  .export-dialog{padding:16px;}
  .fermentation-entry-toolbar{align-items:stretch;flex-direction:column;}
  .fermentation-entry-toolbar .add-row-btn,.fermentation-sort-field{width:100%;}
  .workflow-device-hint{margin-top:-6px;}
}
@media(prefers-reduced-motion:reduce){*{scroll-behavior:auto!important;}}
