/* iOS-inspired grouped workspace. Loaded for screens only. */
:root {
  color-scheme: light;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
  color: #1c1c1e;
  background: #f2f2f7;
  --green: #0066d6;
  --border: #e5e5ea;
  --muted: #636366;
  --accent: #0066d6;
  --tint: #edf4ff;
  --danger: #bc2926;
  -webkit-font-smoothing: antialiased;
}
html { scroll-padding-top: 92px; }
body { background: #f2f2f7; }
button, input, select, textarea { -webkit-tap-highlight-color: transparent; }
button { min-height: 44px; min-width: 44px; border: 0; border-radius: 12px; color: var(--accent); background: #f2f2f7; font-size: .9375rem; font-weight: 600; padding: 10px 16px; transition: background-color .15s, opacity .15s; }
button:hover { filter: none; background: #e8e8ef; }
button:active { opacity: .7; }
button:disabled { cursor: wait; opacity: .5; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible, a:focus-visible { outline: 3px solid #0066d6; outline-offset: 3px; }
input, select, textarea { font-size: 1rem; min-height: 46px; padding: 11px 13px; border: 1px solid transparent; border-radius: 11px; background: #f2f2f7; color: #1c1c1e; accent-color: var(--accent); }
input::placeholder, textarea::placeholder { color: #6c6c72; opacity: 1; }
input:disabled { color: #76767b; background: #f2f2f7; }
label { color: #48484a; font-size: .875rem; }
h1 { font-size: 2.125rem; line-height: 1.22; letter-spacing: -.045em; font-weight: 750; }
h2 { font-size: 1.1875rem; font-weight: 700; letter-spacing: -.03em; }
h3 { font-size: 1rem; font-weight: 650; letter-spacing: -.02em; }
.primary, .primary:hover { color: #fff; background: #0066d6; border-color: transparent; box-shadow: 0 3px 9px #0066d61a; }
.primary:hover { background: #005bc0; }
.secondary, .secondary:hover { color: var(--accent); background: var(--tint); border-color: transparent; }
.secondary:hover { background: #dfeaff; }
.quiet { color: var(--accent); background: transparent; }
.remove, .remove:hover { color: var(--danger); background: #fff0ef; }
.topbar { position: sticky; top: 0; z-index: 8; min-height: 60px; padding: calc(10px + env(safe-area-inset-top, 0px)) max(24px, calc((100vw - 1200px)/2)) 10px; border-bottom: 1px solid #d7d7df; background: #fafafd; }
@supports ((backdrop-filter: blur(20px)) or (-webkit-backdrop-filter: blur(20px))) {
  .topbar, .save-bar { background: #fafafae8; backdrop-filter: saturate(180%) blur(24px); -webkit-backdrop-filter: saturate(180%) blur(24px); }
}
.brand { font-size: 1.0625rem; letter-spacing: -.025em; font-weight: 700; gap: 9px; }
.brand-icon { width: 30px; height: 30px; border-radius: 9px; background: #0066d6; box-shadow: 0 2px 6px #0066d626; }
.brand-icon svg { width: 19px; height: 19px; }
.brand-sub { border: 0; padding-left: 8px; margin-left: 0; font-size: .875rem; }
.header-right { color: var(--muted); font-size: .8125rem; }
main { max-width: 1248px; padding: 30px max(24px, env(safe-area-inset-right, 0px)) calc(128px + env(safe-area-inset-bottom, 0px)) max(24px, env(safe-area-inset-left, 0px)); }
.page-heading { align-items: end; }
.page-heading p { color: var(--muted); font-size: .9375rem; margin-top: 8px; }
.date-controls { align-items: center; gap: 9px; padding: 7px; background: #fff; border-radius: 15px; box-shadow: 0 2px 8px #1c1c1e04; }
.date-controls label { padding-left: 8px; color: var(--muted); }
.date-controls input { background: #f2f2f7; width: 162px; min-width: 0; }
.date-controls #save { border-radius: 11px; }
.utility { margin: 20px 0 16px; gap: 8px; }
.utility label { color: var(--muted); font-size: .875rem; }
.utility select { background: #fff; font-size: 1rem; min-width: 134px; }
.utility #reload { font-size: .875rem; }
.utility #print { background: #fff; }
.utility-more>summary { min-height: 44px; border: 0; border-radius: 12px; padding: 11px 14px; font-size: .875rem; background: #fff; color: #48484a; }
.utility-more[open]>div { border: 1px solid #e5e5ea; border-radius: 16px; padding: 8px; gap: 2px; box-shadow: 0 12px 36px #1c1c1e20; background: #fff; }
.utility-more button { text-align: left; background: #fff; color: var(--accent); }
.work-nav { width: fit-content; max-width: 100%; display: flex; flex-wrap: wrap; gap: 3px; margin: 0 0 24px; padding: 4px; border-radius: 13px; background: #e7e7ed; }
.work-nav a { display: flex; align-items: center; justify-content: center; min-height: 44px; padding: 9px 17px; border-radius: 10px; font-size: .875rem; font-weight: 600; color: #3a3a3c; background: #fff; box-shadow: 0 1px 4px #00000009; }
.work-nav a:hover { color: var(--accent); background: #f8faff; }
.metrics { gap: 12px; }
.metric { position: relative; padding: 20px; background: #fff; border: 0; border-radius: 20px; box-shadow: 0 3px 12px #1c1c1e04; }
.metric>span { color: #48484a; font-size: .875rem; font-weight: 600; }
.metric>strong { font-size: clamp(1.5rem, 2.8vw, 2.15rem); font-weight: 700; letter-spacing: -.035em; line-height: 1.2; margin: 12px 0 9px; }
.metric small { font-size: .9375rem; font-weight: 500; color: var(--muted); }
.metric p { font-size: .8125rem; line-height: 1.5; color: var(--muted); }
.metric:first-child>strong { color: #0066d6; }
.metric:nth-child(2)>strong { color: #137967; }
.metric.featured { color: #1c1c1e; background: #e8f4ee; border: 0; }
.metric.featured>span, .metric.featured p { color: #246444; }
.metric.featured>strong, .metric.featured small { color: #126b40; }
.metric.shortage { background: #ffefed; }
.metric.shortage>span, .metric.shortage>strong, .metric.shortage p, .metric.shortage small { color: #a72d24; }
.yield-details { margin: 14px 0 24px; border: 0; border-radius: 15px; background: #fff; }
.yield-details>summary { color: #48484a; padding: 14px 18px; min-height: 48px; }
.yield-details .yield-panel { border-color: var(--border); background: transparent; padding: 18px; }
.yield-panel p, .yield-indicator span { color: var(--muted); }
.yield-indicator strong { color: var(--accent); }
.work-grid { grid-template-columns: 1.15fr 1fr; gap: 20px; }
.panel { padding: 24px; border: 0; border-radius: 22px; box-shadow: 0 3px 15px #1c1c1e04; }
.section-heading { gap: 12px; }
.section-heading button { white-space: nowrap; }
.step { display: inline-grid; place-items: center; padding: 0; width: 28px; height: 28px; border-radius: 8px; font-size: .75rem; letter-spacing: 0; color: #fff; background: #0066d6; }
.stocks>.section-heading .step { background: #137967; }
.other-stock-panel .step { background: #7753b9; }
.help { margin-top: 12px; margin-bottom: 18px; font-size: .875rem; line-height: 1.6; color: var(--muted); }
.rows { gap: 0; border-radius: 15px; background: #f5f5f9; }
.saved-entry { padding: 14px 15px; border: 0; border-bottom: 1px solid #e1e1e8; border-radius: 0; background: transparent; }
.saved-entry:first-child { border-radius: 15px 15px 0 0; }
.saved-entry:last-child { border-bottom: 0; border-radius: 0 0 15px 15px; }
.saved-entry:only-child { border-radius: 15px; }
.saved-entry-top strong { font-size: 1rem; font-weight: 650; color: #1c1c1e; }
.saved-entry-top p, .saved-entry .saved-rate { color: var(--muted); font-size: .875rem; }
.saved-entry-actions { gap: 1px; }
.saved-entry-actions button { min-height: 44px; min-width: 44px; font-size: .875rem; padding: 9px; background: transparent; }
.saved-entry-actions .remove { color: var(--danger); }
.saved-entry-actions button:hover { background: #e9e9f0; }
.saved-entry .entry-footer { border: 0; padding: 0; margin-top: 6px; gap: 8px; font-size: .8125rem; color: var(--muted); }
.saved-entry .entry-footer strong { color: #1c1c1e; font-size: 1rem; font-weight: 650; }
.empty { padding: 26px 16px; background: #f7f7fa; border: 0; border-radius: 15px; }
.empty strong { font-weight: 600; color: #48484a; }
.empty p { font-size: .875rem; }
.subheading { color: var(--muted); font-size: .875rem; font-weight: 500; margin-top: 24px; }
.client-summary>div { border-color: #ededf2; padding: 11px 0; font-size: .9375rem; }
.total-row { border-color: var(--border); font-size: .9375rem; padding-top: 16px; margin-top: 16px; }
.total-row strong { color: #1c1c1e; font-weight: 700; }
.stock-subsection { padding-top: 22px; margin-top: 20px; border-color: var(--border); }
.stock-subsection .section-heading h3 { font-size: 1rem; }
.stock-grand-total { background: #eaf5f0; border: 0; border-radius: 14px; padding: 17px; color: #246444; }
.stock-grand-total strong { color: #126b40; }
.selection { border-color: var(--border); }
.photo-actions { gap: 8px; }
.photo-actions button { min-height: 44px; }
.other-stock-panel { margin-top: 22px; }
.other-stock-fields { gap: 14px; }
.other-stock-entry { background: #f5f5f9; border: 0; padding: 16px; border-radius: 16px; }
.other-stock-entry .section-heading button { font-size: .875rem; padding: 9px 12px; background: #fff; }
.other-stock-rows { gap: 0; }
.other-stock-saved { padding: 10px 0; border: 0; border-bottom: 1px solid #e1e1e8; border-radius: 0; background: transparent; }
.other-stock-saved>span { font-size: .9375rem; }
.other-stock-saved>div { gap: 0; flex-direction: row; }
.other-stock-saved button { background: transparent; min-width: 44px; min-height: 44px; font-size: .875rem; padding: 8px; }
.other-stock-saved strong { color: #1c1c1e; font-weight: 650; }
.other-stock-total { border-color: #e1e1e8; font-size: .875rem; color: var(--muted); }
.other-stock-inputs input, .other-stock-inputs select { background: #fff; font-size: 1rem; }
.compact-empty { color: var(--muted); }
.settings { margin-top: 22px; padding: 20px 24px; }
.settings summary { min-height: 44px; color: #48484a; font-size: 1rem; line-height: 1.5; }
.settings summary span { display: block; margin: 7px 0 0 17px; font-size: .875rem; color: var(--muted); }
.preset-section { border-color: var(--border); }
.rate-entry { background: #f5f5f9; border-radius: 14px; padding: 14px; }
.rate-entry input { background: #fff; font-size: 1rem; }
.note-panel { margin-top: 18px; }
.note-panel label { color: #1c1c1e; font-size: 1rem; font-weight: 600; }
.note-panel textarea { background: #f5f5f9; border: 0; border-radius: 13px; font-size: 1rem; line-height: 1.6; }
.notice { background: #edf4ff; color: #174f95; border: 0; border-radius: 14px; font-size: .9375rem; }
.notice.error { color: #a72d24; background: #fff0ee; border: 0; }
footer { color: var(--muted); font-size: .8125rem; padding: 0 6px; }
.save-bar { border-color: #d7d7df; padding: 13px max(24px, calc((100vw - 1200px)/2)) calc(13px + env(safe-area-inset-bottom, 0px)); gap: 14px; box-shadow: none; background-color: #fafafd; }
.save-bar strong { font-size: .875rem; color: #1c1c1e; }
.save-bar span { color: var(--muted); font-size: .875rem; }
.save-bar.is-dirty span { color: #8a5317; }
.save-bar-actions { gap: 10px; }
.save-bar-actions button { font-size: .9375rem; min-height: 46px; padding: 11px 20px; border-radius: 14px; }
.save-bar-actions>button:first-child { background: #ebebf0; color: #3a3a3c; }
.save-bar-actions .primary { min-width: 150px; }
.topbar, .save-bar { padding-left: max(24px, calc((100vw - 1200px)/2), env(safe-area-inset-left, 0px)); padding-right: max(24px, calc((100vw - 1200px)/2), env(safe-area-inset-right, 0px)); }
dialog { color: #1c1c1e; background: #fff; border: 0; border-radius: 24px; box-shadow: 0 25px 90px #00000030; }
dialog::backdrop { background: #12121c66; }
.entry-dialog { width: min(520px, calc(100vw - 32px)); border-radius: 26px; padding: 26px; max-height: calc(100dvh - 40px); overscroll-behavior: contain; scroll-padding: 20px; }
.entry-dialog[open] { animation: sheet-appear .18s ease-out; }
.entry-dialog::backdrop { background: #12121c66; }
.editor-heading { gap: 14px; margin-bottom: 24px; }
.editor-heading p { color: var(--muted); font-size: .875rem; }
.editor-heading h2 { font-size: 1.5rem; letter-spacing: -.03em; font-weight: 700; }
.editor-heading>button { color: var(--accent); background: #f2f2f7; border-radius: 50px; min-height: 44px; }
.entry-dialog label { color: #48484a; font-size: .875rem; font-weight: 500; gap: 8px; }
.entry-dialog input, .entry-dialog select { min-height: 50px; border: 1px solid transparent; border-radius: 13px; background: #f2f2f7; color: #1c1c1e; font-size: 1.0625rem; padding: 12px 14px; }
.editor-name { margin-bottom: 20px; }
.editor-quantity { gap: 12px; }
.weight-shortcuts { gap: 8px; margin-bottom: 20px; }
.weight-shortcuts button { min-width: 74px; min-height: 44px; padding: 9px 16px; color: var(--accent); background: #edf4ff; border: 0; border-radius: 20px; }
.entry-dialog details { border: 0; border-radius: 14px; background: #f7f7fa; padding: 15px; margin-top: 20px; }
.entry-dialog details>summary { min-height: 44px; color: #48484a; font-size: .875rem; font-weight: 600; }
.entry-dialog details>summary span { font-size: .875rem; color: var(--muted); }
.entry-dialog details input, .entry-dialog details select { background: #fff; }
.editor-preview { background: #edf4ff; border: 0; border-radius: 14px; color: #005bc0; padding: 16px; font-size: 1.0625rem; font-weight: 650; }
.editor-feedback { color: #1c6445; background: #eaf5ee; border-radius: 13px; font-size: .875rem; }
.editor-save-help { font-size: .875rem; line-height: 1.5; color: var(--muted); margin: 14px 0 20px; }
.editor-actions { gap: 10px; }
.editor-actions button { min-height: 50px; font-size: .9375rem; border-radius: 14px; }
.editor-actions .secondary { background: #edf4ff; }
.photo-row { border: 0; background: #f2f2f7; border-radius: 14px; }
.photo-row input, .photo-row select { font-size: 1rem; background: #fff; }
.photo-source { color: var(--muted); font-size: .875rem; }
.photo-source strong { color: #8a5317; }
.photo-dialog-footer { border-color: var(--border); }
.login-panel { border: 0; border-radius: 24px; box-shadow: 0 12px 45px #1c1c1e09; }
@keyframes sheet-appear { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: translateY(0); } }
@media (max-width: 1050px) {
  .work-grid { grid-template-columns: 1fr; }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .page-heading { align-items: center; }
  .date-controls { flex-wrap: wrap; }
}
@media (max-width: 600px) {
  html { scroll-padding-top: calc(76px + env(safe-area-inset-top, 0px)); }
  .topbar { padding: calc(10px + env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-left, 0px)) 10px; align-items: center; gap: 10px; min-height: 56px; }
  .header-right { font-size: .75rem; line-height: 1.4; text-align: right; max-width: 47%; }
  .header-right button { min-width: 44px; min-height: 44px; }
  .brand { font-size: 1rem; }
  main { padding: 24px max(16px, env(safe-area-inset-right, 0px)) calc(132px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px)); }
  h1 { font-size: 2rem; letter-spacing: -.05em; }
  .page-heading { display: block; }
  .page-heading p { font-size: .875rem; }
  .date-controls { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 8px; margin-top: 20px; padding: 8px; border-radius: 16px; }
  .date-controls label { font-size: .875rem; padding-left: 5px; }
  .date-controls input { width: 100%; min-width: 0; padding: 10px 8px; font-size: 1rem; }
  .date-controls #save { padding: 10px 12px; font-size: .875rem; }
  .utility { margin: 14px 0; gap: 7px; }
  .utility>div:first-child { gap: 8px; }
  .utility button, .utility-more>summary { font-size: .875rem; min-height: 44px; padding: 10px 12px; }
  .utility select { flex: 1; min-width: 120px; font-size: 1rem; }
  .utility-more[open]>div { left: 0; right: auto; max-width: calc(100vw - 32px); }
  .work-nav { width: 100%; margin-bottom: 18px; border-radius: 13px; gap: 3px; }
  .work-nav a { flex: 1 1 28%; min-width: 0; padding: 9px 5px; min-height: 44px; font-size: .875rem; text-align: center; }
  .metrics { gap: 10px; }
  .metric { padding: 16px 14px; border-radius: 17px; }
  .metric>span { font-size: .875rem; }
  .metric>strong { font-size: clamp(1.45rem, 6vw, 1.9rem); margin: 10px 0 7px; }
  .metric small { font-size: .875rem; }
  .metric p { font-size: .8125rem; }
  .yield-details { margin: 12px 0 18px; }
  .yield-details>summary { font-size: .875rem; padding: 14px 16px; }
  .yield-panel { flex-wrap: wrap; }
  .yield-indicator { text-align: left; }
  .panel { border-radius: 19px; padding: 20px 16px; }
  .section-heading h2 { font-size: 1.0625rem; }
  .section-heading { gap: 10px; }
  .section-heading button { min-height: 44px; padding: 9px 12px; font-size: .875rem; }
  .step { width: 26px; height: 26px; border-radius: 8px; }
  .help { font-size: .875rem; }
  .saved-entry { padding: 13px 12px; }
  .saved-entry-top { gap: 8px; align-items: center; }
  .saved-entry-actions button { min-height: 44px; min-width: 44px; padding: 9px 7px; }
  .saved-entry-top>div:first-child { display: block; }
  .saved-entry-top p { margin-top: 4px; }
  .other-stock-entry { border-radius: 14px; padding: 14px; }
  .other-stock-fields { gap: 12px; }
  .other-stock-saved>div { flex-direction: row; }
  .settings { padding: 18px 16px; }
  .settings summary span { font-size: .875rem; margin-left: 17px; }
  .save-bar { padding: 11px max(16px, env(safe-area-inset-right, 0px)) calc(11px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px)); gap: 10px; }
  .save-bar>div:first-child { min-width: 0; }
  .save-bar strong { font-size: .8125rem; }
  .save-bar span { font-size: .8125rem; line-height: 1.35; }
  .save-bar-actions { gap: 7px; flex-shrink: 0; }
  .save-bar-actions button { min-height: 46px; padding: 10px 13px; font-size: .875rem; border-radius: 13px; }
  .save-bar-actions .primary { min-width: 90px; }
  .entry-dialog { inset: auto 0 0; width: 100%; max-width: 100%; max-height: calc(100dvh - max(16px, env(safe-area-inset-top, 0px))); margin: 0; border-radius: 27px 27px 0 0; padding: 24px 20px calc(24px + env(safe-area-inset-bottom, 0px)); }
  .editor-heading { margin-bottom: 22px; }
  .entry-dialog .editor-heading h2 { font-size: 1.375rem; }
  .editor-heading>button { min-height: 44px; }
  .editor-actions { flex-wrap: wrap; gap: 9px; }
  .editor-actions button { font-size: .9375rem; min-height: 50px; flex: 1 1 170px; }
  .editor-quantity { grid-template-columns: minmax(0, 1fr) minmax(110px, .7fr); }
  #photo-dialog { width: calc(100vw - 20px); border-radius: 22px; padding: 20px 16px; }
  .photo-row label { font-size: .875rem; }
  footer { font-size: .8125rem; gap: 8px; }
}
@media (max-width: 360px) {
  .date-controls { grid-template-columns: 1fr auto; }
  .date-controls label { grid-column: 1/-1; }
  .save-bar { flex-wrap: wrap; gap: 8px; }
  .save-bar>div:first-child { width: 100%; flex-direction: row; justify-content: space-between; gap: 8px; }
  .save-bar-actions { width: 100%; }
  .save-bar-actions button { flex: 1; }
  main { padding-bottom: calc(160px + env(safe-area-inset-bottom, 0px)); }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
@supports ((backdrop-filter: blur(20px)) or (-webkit-backdrop-filter: blur(20px))) {
  .save-bar { background-color: #fafafae8; }
}
