/* Screen presentation only. The existing A4/SVG print rules stay independent. */
@media screen {
  :root {
    --brand-forest: #234c3a;
    --brand-forest-hover: #1b3e2f;
    --brand-olive: #82934f;
    --brand-ink: #27352d;
    --brand-muted: #6c786a;
    --brand-border: #e0e5dc;
    --brand-surface: #ffffff;
    --brand-canvas: #f5f6f3;
    font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", "Malgun Gothic", sans-serif;
    font-size: 14px;
    color: var(--brand-ink);
    background: var(--brand-canvas);
    -webkit-font-smoothing: antialiased;
  }

  body { background: var(--brand-canvas); line-height: 1.5; }
  h1, h2, h3 { color: #25382c; letter-spacing: -.035em; word-break: keep-all; }
  h1 { font-size: 28px; font-weight: 700; line-height: 1.3; }
  h2 { font-size: 17px; font-weight: 650; line-height: 1.45; }
  p { line-height: 1.7; }
  small, .muted { color: var(--brand-muted); }
  a { color: var(--brand-forest); }
  .ui-icon { display: inline-block; width: 20px; height: 20px; flex: 0 0 auto; fill: none; stroke-width: 1.8; vertical-align: middle; }

  button, .link-button {
    min-height: 38px;
    padding: 9px 14px;
    border: 1px solid var(--brand-forest);
    border-radius: 8px;
    background: var(--brand-forest);
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.35;
    letter-spacing: -.015em;
    transition: background-color 120ms ease, border-color 120ms ease, box-shadow 120ms ease;
  }
  button:hover, .link-button:hover { background: var(--brand-forest-hover); border-color: var(--brand-forest-hover); filter: none; }
  button:disabled { opacity: .45; cursor: default; }
  button:focus-visible, a:focus-visible { outline: 3px solid #9eb286; outline-offset: 3px; }
  .secondary, .ghost { border-color: #dce2d6; background: #fff; color: #4c5b50; box-shadow: 0 1px 1px #24352a03; }
  .secondary:hover, .ghost:hover { border-color: #c6d1be; background: #f4f7f0; color: var(--brand-forest); }
  .danger { border-color: #e9cbc4; background: #fff5f2; color: #a84233; }
  .danger:hover { border-color: #dcaea3; background: #ffede7; color: #983426; }
  .kakao-button { border-color: #e4d02b; background: #fee500; color: #342d12; }
  .kakao-button:hover { border-color: #d9c51c; background: #f4dc00; color: #342d12; }
  .actions { gap: 8px; }

  input, select, textarea { border-color: #dce2d8; border-radius: 7px; background: #fff; padding: 9px 11px; color: var(--brand-ink); }
  input:not([type="checkbox"]), select { min-height: 39px; }
  input::placeholder, textarea::placeholder { color: #96a090; }
  input:focus, select:focus, textarea:focus { border-color: #759265; outline: 3px solid #79975b20; outline-offset: 0; }
  input:disabled, select:disabled, textarea:disabled { background: #f3f5f0; color: #919a8c; border-color: #e7ebe3; opacity: 1; }
  input[type="number"], .number { font-variant-numeric: tabular-nums; }
  label { color: #465549; font-size: 13px; font-weight: 550; }
  label input, label select, label textarea { margin-top: 6px; margin-bottom: 17px; font-weight: 400; }

  #workspace > header {
    position: sticky;
    top: 0;
    z-index: 30;
    height: 88px;
    padding: 0 32px 0 22px;
    border-bottom: 1px solid var(--brand-border);
    background: #fff;
    color: var(--brand-ink);
    gap: 24px;
  }
  .workspace-brand { display: flex; align-items: center; gap: 14px; min-width: 0; }
  .brand-logo { display: block; width: 64px; height: 64px; object-fit: contain; flex: 0 0 auto; }
  .brand-copy { display: flex; flex-direction: column; gap: 3px; }
  .brand-copy strong { color: var(--brand-forest); font-size: 20px; font-weight: 750; line-height: 1.2; letter-spacing: -.055em; }
  .brand-copy span { color: #6c786a; font-size: 12px; line-height: 1.4; letter-spacing: -.01em; }
  .header-sub { color: #788572; border-color: #dce3d7; font-size: 13px; }
  .header-right { justify-content: flex-end; gap: 8px; }
  #userLabel { padding-right: 10px; color: #64725f; font-size: 12px; font-weight: 550; }
  .header-right .ghost { min-height: 33px; padding: 7px 10px; border-color: #e4e8df; color: #687462; font-size: 12px; font-weight: 500; }

  .shell { max-width: none; grid-template-columns: 220px minmax(0, 1fr); min-height: calc(100vh - 88px); }
  .shell > aside {
    position: sticky;
    top: 88px;
    align-self: start;
    height: calc(100vh - 88px);
    overflow-y: auto;
    padding: 27px 14px;
    border-right: 1px solid var(--brand-border);
    background: #fbfcf9;
  }
  .nav-title { margin: 0 13px 13px; color: #929b89; font-size: 11px; font-weight: 650; letter-spacing: .06em; }
  nav { display: flex; flex-direction: column; gap: 4px; }
  nav button { display: flex; align-items: center; gap: 11px; width: 100%; min-height: 45px; margin: 0; padding: 11px 13px; border: 1px solid transparent; border-radius: 8px; background: transparent; color: #66715f; font-size: 14px; font-weight: 550; text-align: left; }
  nav button .ui-icon { width: 24px; height: 24px; color: #89967d; stroke-width: 1.65; }
  nav button:hover { border-color: transparent; background: #f0f3ea; color: #3a593c; }
  nav button.active { border-color: #e0e8d2; background: #eaf0df; color: var(--brand-forest); font-weight: 650; box-shadow: inset 3px 0 0 var(--brand-olive); }
  nav button.active .ui-icon { color: #6b8244; }
  .aside-note { margin: 34px 13px 0; padding-top: 23px; border-top: 1px solid #e7ebdf; color: #919b87; font-size: 11px; line-height: 1.9; }
  .aside-note strong { color: #758469; font-size: 11px; font-weight: 650; }
  .aside-note p { margin: 10px 0; line-height: 2; }
  .aside-note ol { margin: 11px 0; padding-left: 16px; }
  .aside-note li { padding-left: 2px; margin: 5px 0; color: #76836b; }
  .aside-note small { color: #9ba38f; font-size: 10px; }

  .content { width: 100%; max-width: 1640px; padding: 30px 34px 52px; margin: 0 auto; min-width: 0; }
  .page-heading { gap: 20px; margin-bottom: 25px; align-items: center; }
  .page-heading h1 { margin: 0; font-size: 27px; letter-spacing: -.045em; }
  .eyebrow { margin-bottom: 6px; color: #8a977c; font-size: 10px; font-weight: 600; letter-spacing: .13em; }
  .page-description { margin: 7px 0 0; color: #6c786a; font-size: 12px; line-height: 1.6; }
  .page-heading > .actions { flex-shrink: 0; }
  #sync { color: #6c786a; font-size: 11px; font-variant-numeric: tabular-nums; }
  #refresh { min-height: 35px; padding: 7px 11px; font-size: 12px; }
  #autosaveGlobal { padding: 5px 9px; border-radius: 6px; background: #f6efdd; color: #9b7a35; font-size: 11px; }
  #autosaveGlobal.error { background: #fff0e9; color: #b3513c; }

  .stats { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 24px; }
  .stat { min-width: 0; padding: 18px 20px; border: 1px solid var(--brand-border); border-radius: 11px; background: #fff; box-shadow: 0 1px 2px #293e2703; }
  .stat span { color: #6c786a; font-size: 12px; }
  .stat .stat-label { display: flex; align-items: center; gap: 8px; min-height: 22px; font-weight: 550; }
  .stat .stat-label .ui-icon { width: 18px; height: 18px; color: #8d9b7b; }
  .stat .stat-label span { display: inline; }
  .stat b { margin: 11px 0 5px; color: #2b442e; font-size: 33px; font-weight: 650; line-height: 1.15; letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
  .stat small { color: #6c786a; font-size: 11px; }
  .stat.warning { background: #fffefa; border-color: #e9e4d5; }
  .stat.warning b { color: #9f803a; }
  .stat.warning .ui-icon { color: #aa975f; }

  .card { margin-bottom: 22px; padding: 22px; border: 1px solid var(--brand-border); border-radius: 12px; background: var(--brand-surface); box-shadow: 0 1px 2px #273c2603; }
  .card-heading { gap: 14px; margin-bottom: 18px; }
  .card-heading h2 { color: #334a33; font-size: 16px; font-weight: 650; }
  .card-heading > button, .card-heading > select { flex-shrink: 0; }
  .hint { margin-bottom: 17px; padding: 12px 14px; border: 1px solid #e9eddf; border-radius: 7px; background: #f7f9f3; color: #6c786a; font-size: 12px; line-height: 1.8; }
  .hint b { color: #536843; font-weight: 600; }
  .filters { gap: 9px; margin-bottom: 14px; }
  .filters input { width: 260px; font-size: 13px; }
  .filters select { font-size: 12px; }
  .reorder-help { margin-bottom: 12px; color: #6c786a; font-size: 11px; }
  .table-wrap { min-width: 0; max-width: 100%; overflow: auto; overscroll-behavior-x: contain; border: 1px solid #e9ecdf; border-radius: 8px; }
  table { font-size: 13px; font-variant-numeric: tabular-nums; }
  th { padding: 11px 12px; border-bottom-color: #e4e9d8; background: #f8f9f4; color: #6c786a; font-size: 12px; font-weight: 600; }
  td { padding: 12px; border-bottom-color: #edf0e6; color: #4f5e50; line-height: 1.55; }
  tbody tr:last-child td { border-bottom: 0; }
  tr:hover td { background: #fafcf6; }
  td strong { color: #3d5736; font-weight: 600; }
  td small { margin-top: 3px; color: #6c786a; font-size: 11px; }
  .note-text { max-width: 240px; color: #6c786a; }
  .number { text-align: right; }
  .negative { color: #b64d3d; font-weight: 650; }
  .positive { color: #41734a; }
  .empty { padding: 42px 20px; color: #98a08d; font-size: 12px; }

  .stockbook { width: 100%; max-width: none; margin-inline: 0; padding: 24px; border: 1px solid #dce4d1; border-radius: 12px; }
  .stockbook-heading { align-items: flex-start; gap: 12px; }
  .stockbook-title, .stockbook-heading > div:first-child { flex: 1 1 370px; min-width: 0; }
  .stockbook-kicker { margin: 0 0 6px; color: #859471; font-size: 12px; font-weight: 600; letter-spacing: .015em; }
  .stockbook-date { display: block; margin: 0; color: var(--brand-forest); font-size: 26px; font-weight: 700; line-height: 1.4; letter-spacing: -.055em; }
  .stockbook-updates { display: flex; flex-direction: column; gap: 2px; margin-top: 7px; }
  .stockbook-updated { display: block; color: #111111; font-size: 18px; font-weight: 450; line-height: 1.75; white-space: normal; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
  .stockbook-updated time { color: inherit; font-weight: 500; }
  .stockbook-updated.is-today { color: #d32f2f; }
  .stockbook-heading > div > .stockbook-updated { margin-top: 7px; }
  .stockbook-sales-link { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; min-height: 40px; margin: 0; padding: 10px 14px; border: 1px solid var(--brand-forest); border-radius: 8px; background: var(--brand-forest); color: #fff; font-size: 14px; font-weight: 600; line-height: 1.35; white-space: nowrap; box-shadow: 0 1px 2px #234c3a10; }
  .stockbook-heading > .secondary { min-height: 40px; font-size: 13px; }
  .stockbook-primary-actions { flex: 0 0 auto; gap: 8px; padding-top: 3px; }
  .stockbook-primary-actions > button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 40px; }
  .stockbook-primary-actions .ui-icon { width: 17px; height: 17px; }
  .stockbook-tools { margin-top: 19px; padding-top: 16px; border-top: 1px solid #edf0e4; }
  .stockbook-tools .actions { gap: 7px; }
  .stockbook-tools button { min-height: 35px; padding: 8px 11px; font-size: 12px; }
  .stockbook-tools p { margin: 10px 0 0; color: #6c786a; font-size: 12px; line-height: 1.75; overflow-wrap: anywhere; }
  .stockbook-tools p.error { color: #b54e3c; }
  .stockbook-help { display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px 12px; margin: 15px 0 18px; padding: 11px 13px; border: 1px solid #edf0e3; border-radius: 7px; background: #f9fbf5; color: #64705f; font-size: 12px; line-height: 1.85; word-break: keep-all; }
  .stockbook-help > b, .stockbook-help > span { display: block; }
  .stockbook-help > span:last-child { flex-basis: 100%; }
  .stockbook-help b { color: #617c49; font-weight: 550; }
  .stockbook-columns { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; align-items: start; }
  .stockbook-column { min-width: 0; overflow: auto; border: 1px solid #e1e7d6; border-radius: 8px; }
  .stockbook table { min-width: 0; font-size: 13px; table-layout: fixed; }
  .stockbook col.book-name-col { width: 40%; }
  .stockbook col:not(.book-name-col) { width: 20%; }
  .stockbook th, .stockbook td { height: 36px; padding: 7px 6px; border: 0; border-right: 1px solid #edf0e6; border-bottom: 1px solid #e9eedf; line-height: 1.45; vertical-align: middle; }
  .stockbook th:last-child, .stockbook td:last-child { border-right: 0; }
  .stockbook tbody tr:last-child th, .stockbook tbody tr:last-child td { border-bottom: 0; }
  .stockbook thead th { height: 37px; padding: 9px 5px; background: #f2f6e9; color: #667c4c; font-size: 11px; font-weight: 600; white-space: normal; word-break: keep-all; }
  .stockbook tbody th { color: #4a613b; font-weight: 550; white-space: normal; word-break: keep-all; overflow-wrap: anywhere; text-align: left; }
  .stockbook td { color: #657b52; text-align: right; white-space: normal; overflow-wrap: anywhere; }
  .stockbook tbody tr:nth-child(even) { background: #fbfcf8; }
  .stockbook tbody tr:hover, .stockbook tbody tr:hover td { background: #f3f7eb; }
  .stockbook .book-stock { color: #111111; }
  .stockbook .book-sales { color: #1565c0; }
  .stockbook .negative { color: #d32f2f; font-weight: 600; }
  .stockbook .positive { color: #16803c; }
  .stockbook-gap td { height: 36px; background: #f8faf4; }
  .stockbook tr.book-extra { background: #fbf7fc; }
  .stockbook tr.book-extra th { color: #896796; font-weight: 550; }

  .product-name { gap: 9px; }
  .product-name > div { min-width: 0; }
  .product-name strong { display: block; color: #3e543d; font-size: 13px; font-weight: 600; line-height: 1.5; }
  .product-drag { display: inline-flex; align-items: center; justify-content: center; min-height: 28px; width: 25px; flex-shrink: 0; padding: 0; border-color: #e5ebd9; border-radius: 5px; background: #fff; color: #a1b086; font-size: 18px; }
  .product-drag:hover { border-color: #cfdcc0; background: #f1f6e9; color: #748e54; }
  .product-rename { min-height: 24px; margin-top: 3px; padding: 1px 0; border: 0; border-radius: 3px; background: transparent; color: #687f4e; font-size: 11px; font-weight: 500; text-decoration: none; }
  .product-rename:hover { background: transparent; color: #4c732f; text-decoration: underline; }
  .product-spacing, .product-delete { margin-left: 10px; }
  .product-delete { color: #bc806a; }
  .product-delete:hover { color: #ad4b32; }
  .product-gap td { background: #f6f8f0 !important; border-bottom-color: #e5ebd9; }
  .product-highlight td { background: #f1f7e7; }
  .drop-before td { box-shadow: inset 0 3px #819956; }
  .drop-after td { box-shadow: inset 0 -3px #819956; }

  .inventory-date-panel { gap: 8px 20px; margin-bottom: 21px; padding: 17px 20px; border-color: #e0e8d3; border-radius: 10px; background: #fafcf5; }
  .inventory-date-panel > strong { color: #607e41; font-size: 14px; font-weight: 650; }
  .inventory-date-panel span { color: #6c786a; font-size: 12px; line-height: 1.7; font-variant-numeric: tabular-nums; }
  .inventory-date-panel > span:last-child { margin-left: auto; }
  .survey-table { min-width: 680px; }
  .survey-table th:first-child, .survey-table td:first-child { width: 94px; text-align: center; }
  .survey-table th:nth-child(2), .survey-table td:nth-child(2) { min-width: 180px; }
  .survey-table th:last-child, .survey-table td:last-child { min-width: 205px; }
  .survey-table thead label { gap: 7px; color: #7f9368; font-size: 11px; font-weight: 550; }
  .survey-table input[type="checkbox"] { width: 18px; height: 18px; min-height: 0; accent-color: #698346; cursor: pointer; }
  .survey-table .stock-input { width: 115px; min-height: 42px; padding: 9px 10px; border-color: #dce6ca; border-radius: 6px; color: #3b6328; font-size: 16px; font-weight: 600; }
  .survey-table .stock-note { width: 210px; min-height: 39px; font-size: 12px; }
  .survey-table .stock-input:disabled, .survey-table .stock-note:disabled { border-color: #e9eedf; background: #f6f8f1; color: #a0ad8e; font-weight: 400; }
  .survey-table tr:has(input[data-survey-select]:checked) > td { background: #f7faef; }
  .savebar { bottom: 16px; padding: 14px 18px; border-color: #d5e2bd; border-radius: 10px; background: #fff; box-shadow: 0 5px 22px #4156250b; }
  .survey-savebar { z-index: 4; margin-top: 20px; }
  .survey-savebar button { min-height: 42px; padding: 10px 16px; font-size: 14px; }
  #draftCount { color: #617b45; font-size: 12px; line-height: 1.65; }
  #draftCount.error { color: #b4573d; }
  .survey-conflicts { border-color: #ecdcbf; background: #fffdf6; }
  .survey-conflicts h2 { color: #9d8141; }
  .survey-conflicts p, .book-conflict { color: #a78243; font-size: 12px; }

  .badge { padding: 4px 8px; border: 1px solid transparent; border-radius: 5px; font-size: 10px; font-weight: 550; line-height: 1.4; }
  .badge.requested { border-color: #f0e4c8; background: #fffbef; color: #a28a42; }
  .badge.assigned { border-color: #dde7ed; background: #f1f7fa; color: #65859a; }
  .badge.purchased, .badge.partial { border-color: #e9dfee; background: #f8f3fb; color: #9679a6; }
  .badge.completed { border-color: #dde8d2; background: #f1f7e9; color: #74944e; }
  .badge.cancelled { border-color: #e8e9e3; background: #f8f9f5; color: #98a08c; }
  .row-actions { gap: 5px; }
  .row-actions button { min-height: 30px; padding: 6px 9px; font-size: 11px; }
  .event-list li { grid-template-columns: 135px 105px minmax(0, 1fr); gap: 18px; padding: 16px 2px; border-bottom-color: #edf0e4; color: #5e7151; font-size: 13px; }
  .event-list time { color: #6c786a; font-size: 11px; font-variant-numeric: tabular-nums; }
  .event-list strong { color: #627f47; font-size: 12px; font-weight: 600; }
  .event-list span { overflow-wrap: anywhere; }
  .role-card { padding: 16px; border: 1px solid #e7eddc; border-radius: 8px; background: #fafcf6; color: #6c786a; font-size: 12px; line-height: 2.1; }
  .role-card b { color: #5c7b3c; font-weight: 600; }
  #inviteOutput input { font-size: 12px; background: #fafcf5; }
  #notice { padding: 13px 16px; border-color: #dce7cb; border-radius: 8px; background: #f1f7e7; color: #668740; font-size: 12px; }
  #notice.error { border-color: #edd9ca; background: #fff8f2; color: #b86142; }
  .error { color: #b75d41; }
  .delete-summary { border-color: #efdfd3; background: #fff9f4; color: #9a6b48; }

  .auth { width: calc(100% - 32px); max-width: 448px; margin: clamp(36px, 9vh, 108px) auto; padding: 35px; border-color: #e1e7d8; border-radius: 16px; background: #fff; box-shadow: 0 8px 36px #334a1f06; }
  .auth-brand { display: flex; align-items: center; gap: 17px; margin-bottom: 26px; padding-bottom: 25px; border-bottom: 1px solid #edf0e4; }
  .auth-brand img { display: block; width: 80px; height: 80px; flex-shrink: 0; object-fit: contain; }
  .auth-brand > div { display: flex; flex-direction: column; gap: 5px; }
  .auth-brand strong { color: var(--brand-forest); font-size: 22px; font-weight: 750; line-height: 1.3; letter-spacing: -.06em; }
  .auth-brand span { color: #6c786a; font-size: 12px; }
  .auth h1 { margin-bottom: 9px; color: #395529; font-size: 24px; letter-spacing: -.055em; }
  #authHelp { margin: 0 0 25px; color: #6c786a; font-size: 12px; }
  .auth label { color: #718b54; font-size: 12px; font-weight: 600; }
  .auth input { min-height: 44px; border-color: #dfe8cf; font-size: 14px; }
  .auth button { min-height: 44px; margin-top: 3px; padding: 11px 16px; font-size: 14px; }
  .auth .muted { margin-top: 23px; color: #6c786a; font-size: 11px; line-height: 1.75; }
  #authError { margin-bottom: 12px; font-size: 12px; }

  dialog { width: 480px; max-width: calc(100vw - 32px); padding: 25px; border: 1px solid #e2e8d7; border-radius: 14px; color: var(--brand-ink); box-shadow: 0 20px 90px #24381726; }
  dialog::backdrop { background: #15260d73; backdrop-filter: blur(2px); }
  .dialog-heading { align-items: flex-start; gap: 18px; margin-bottom: 7px; }
  .dialog-heading h2 { font-size: 19px; font-weight: 650; }
  .dialog-heading .icon { display: flex; align-items: center; justify-content: center; width: 28px; height: 28px; min-height: 28px; padding: 0; border: 0; border-radius: 5px; background: transparent; color: #9ead88; font-size: 24px; }
  .dialog-heading .icon:hover { background: #f2f6e9; color: #5e7c3f; }
  #dialogBody { font-size: 13px; }
  #dialogBody label { color: #789259; font-size: 12px; }
  #dialogBody textarea { min-height: 92px; resize: vertical; }
  #dialogError { font-size: 12px; }
  #dialogForm > .actions { margin-top: 23px; }
  .stockbook, .sales-tools-panel, .product-highlight { scroll-margin-top: 104px; }
  .sales-tools-panel { border-color: #dce7cb; }
  .sales-tools-panel.sales-panel-open { margin-bottom: 22px; }
  .sales-tools-panel iframe { border-color: #e3ebd6; border-radius: 8px; }

  @media (max-width: 1199px) {
    .content { padding: 26px 26px 44px; }
    .stockbook { padding: 20px; }
    .stockbook-heading > div:first-child { flex-basis: 100%; }
    .stockbook-columns { grid-template-columns: 1fr; gap: 18px; }
    .stockbook table { min-width: 0; font-size: 13px; }
    .stockbook th, .stockbook td { padding: 8px 12px; }
    .stockbook-gap:not(:has(~ tr[data-book-product])) { display: none; }
    .stats { gap: 11px; }
    .stat { padding: 17px; }
  }

  @media (max-width: 1050px) {
    .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .page-heading { align-items: flex-start; }
    .page-heading > .actions { flex-wrap: wrap; justify-content: flex-end; max-width: 210px; }
  }

  @media (max-width: 900px) {
    .stockbook, .sales-tools-panel, .product-highlight { scroll-margin-top: 160px; }
    #workspace > header { height: 80px; padding: 0 20px; gap: 18px; }
    .brand-logo { width: 56px; height: 56px; }
    .brand-copy strong { font-size: 18px; }
    .brand-copy span { font-size: 11px; }
    .shell { display: block; min-height: calc(100vh - 80px); }
    .shell > aside { position: sticky; top: 80px; z-index: 20; height: auto; padding: 9px 16px; overflow: hidden; border-right: 0; border-bottom: 1px solid #e1e8d4; background: #fbfcf7; }
    .nav-title, .aside-note { display: none; }
    nav { flex-direction: row; gap: 5px; overflow-x: auto; scrollbar-width: thin; }
    nav button { flex: 0 0 auto; width: auto; min-height: 41px; padding: 9px 12px; gap: 8px; white-space: nowrap; }
    nav button .ui-icon { width: 21px; height: 21px; }
    nav button.active { box-shadow: inset 0 -2px 0 #869b59; }
    .content { padding: 25px 24px 42px; }
    .stockbook-heading > div:first-child { flex-basis: 330px; }
    .event-list li { grid-template-columns: 115px 90px minmax(0, 1fr); gap: 14px; }
  }

  @media (max-width: 600px) {
    .stockbook, .sales-tools-panel, .product-highlight { scroll-margin-top: 80px; }
    #workspace > header { position: relative; height: auto; min-height: 80px; padding: 13px 16px 12px; gap: 10px; flex-wrap: wrap; align-items: center; }
    .workspace-brand { gap: 11px; }
    .brand-logo { width: 48px; height: 48px; }
    .brand-copy strong { font-size: 17px; }
    .brand-copy span { font-size: 10px; }
    .header-right { flex: 1 1 100%; justify-content: flex-end; gap: 7px; }
    .header-right #userLabel { width: auto; margin-right: auto; padding-right: 0; text-align: left; font-size: 11px; overflow-wrap: anywhere; }
    .header-right .ghost { min-height: 32px; padding: 6px 9px; font-size: 11px; }
    .shell > aside { top: 0; padding: 7px 10px; }
    nav { gap: 4px; }
    nav button { min-height: 42px; padding: 9px 11px; gap: 7px; font-size: 13px; }
    nav button .ui-icon { width: 20px; height: 20px; }
    .content { padding: 21px 14px 34px; }
    .page-heading { gap: 12px; margin-bottom: 19px; flex-wrap: wrap; }
    .page-heading h1 { font-size: 24px; }
    .page-description { max-width: 260px; font-size: 11px; }
    .page-heading > .actions { min-width: 0; max-width: 100%; margin-left: auto; flex-wrap: wrap; }
    #autosaveGlobal { max-width: 100%; white-space: normal; overflow-wrap: anywhere; }
    .eyebrow { font-size: 9px; }
    #sync { font-size: 10px; }
    #refresh { min-height: 33px; font-size: 11px; }
    .stats { gap: 10px; margin-bottom: 18px; }
    .stat { padding: 14px; border-radius: 9px; }
    .stat .stat-label { gap: 6px; }
    .stat .stat-label .ui-icon { width: 16px; height: 16px; }
    .stat span { font-size: 12px; }
    .stat b { margin-top: 9px; font-size: 28px; }
    .stat small { font-size: 11px; }
    .card { padding: 16px; margin-bottom: 17px; border-radius: 10px; }
    .card-heading { gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
    .card-heading h2 { font-size: 15px; }
    .card-heading > button, .card-heading > select { min-height: 35px; font-size: 11px; }
    .hint { padding: 11px 12px; font-size: 11px; }
    .filters input { width: 100%; font-size: 16px; }
    .filters select { flex: 1; }
    .stockbook { padding: 16px; }
    .stockbook-heading { gap: 10px; }
    .stockbook-heading > div:first-child { flex-basis: 100%; }
    .stockbook-kicker { font-size: 11px; }
    .stockbook-date { font-size: 23px; }
    .stockbook-updates { margin-top: 6px; }
    .stockbook-updated { font-size: 18px; line-height: 1.75; }
    .stockbook-sales-link { flex: 1 1 150px; min-height: 40px; padding: 10px 12px; font-size: 13px; }
    .stockbook-heading > .secondary { flex: 1 1 120px; min-height: 40px; font-size: 12px; }
    .stockbook-primary-actions { width: 100%; padding-top: 0; }
    .stockbook-primary-actions > button { flex: 1 1 120px; }
    .stockbook-tools { margin-top: 16px; padding-top: 14px; }
    .stockbook-tools .actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
    .stockbook-tools button { width: 100%; min-height: 44px; padding: 9px 8px; font-size: 12px; white-space: normal; word-break: keep-all; }
    .stockbook-tools [data-sales-action="apply"] { grid-column: 1 / -1; }
    .stockbook-tools p { font-size: 11px; }
    .stockbook-help { flex-direction: column; align-items: flex-start; gap: 5px; padding: 11px 12px; margin: 13px 0 15px; font-size: 12px; }
    .stockbook-columns { gap: 16px; }
    .stockbook table { min-width: 0; font-size: 13px; }
    .stockbook th, .stockbook td { padding: 7px 6px; }
    .stockbook thead th { font-size: 10px; }
    .inventory-date-panel { padding: 14px 15px; gap: 6px 13px; margin-bottom: 17px; }
    .inventory-date-panel > strong { font-size: 13px; }
    .inventory-date-panel span { font-size: 11px; }
    .inventory-date-panel > span:last-child { flex-basis: 100%; margin-left: 0; }
    .table-wrap:has(> .survey-table) { overflow: visible; border: 0; border-radius: 0; }
    .survey-table { display: block; width: 100%; min-width: 0; font-size: 13px; white-space: normal; }
    .survey-table thead, .survey-table thead tr { display: block; }
    .survey-table thead { margin-bottom: 12px; }
    .survey-table thead th { display: none; }
    .survey-table thead th:first-child { display: block; width: 100%; padding: 11px 12px; border: 1px solid #e1e7d6; border-radius: 7px; text-align: left; }
    .survey-table thead label { min-height: 24px; gap: 9px; font-size: 12px; }
    .survey-table tbody { display: grid; gap: 10px; }
    .survey-table tbody > tr[data-product-id] { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 11px 8px; width: 100%; padding: 13px 12px; border: 1px solid #e3e8da; border-radius: 8px; background: #fff; }
    .survey-table tbody > tr[data-product-id] > td { display: block; min-width: 0; width: auto; padding: 0; border: 0; white-space: normal; text-align: left; }
    .survey-table tbody > tr[data-product-id] > td:first-child { grid-column: 1; grid-row: 1; width: 28px; padding-top: 3px; text-align: left; }
    .survey-table tbody > tr[data-product-id] > td:nth-child(2) { grid-column: 2; grid-row: 1; }
    .survey-table tbody > tr[data-product-id] > td:nth-child(3) { grid-column: 2; grid-row: 2; }
    .survey-table tbody > tr[data-product-id] > td:nth-child(4) { grid-column: 2; grid-row: 3; }
    .survey-table tbody > tr[data-product-id] > td:nth-child(3)::before, .survey-table tbody > tr[data-product-id] > td:nth-child(4)::before { display: block; margin-bottom: 5px; color: #6c786a; font-size: 11px; font-weight: 500; }
    .survey-table tbody > tr[data-product-id] > td:nth-child(3)::before { content: '이번 조사 수량'; }
    .survey-table tbody > tr[data-product-id] > td:nth-child(4)::before { content: '조사 비고'; }
    .survey-table tbody > tr[data-product-id]:has(input[data-survey-select]:checked) { border-color: #b9cba0; background: #f7faef; }
    .survey-table .product-name { align-items: flex-start; gap: 7px; }
    .survey-table .product-name strong { white-space: normal; overflow-wrap: anywhere; font-size: 13px; }
    .survey-table input[type="checkbox"] { width: 20px; height: 20px; }
    .survey-table .stock-input { width: calc(100% - 44px); max-width: 190px; min-height: 44px; font-size: 16px; }
    .survey-table .stock-note { width: 100%; min-height: 42px; font-size: 14px; }
    .survey-table .product-gap { display: block; }
    .survey-table .product-gap td { display: block; width: 100%; border-radius: 5px; }
    .survey-table .empty { display: block; }
    .survey-savebar { bottom: 10px; padding: 12px 14px; gap: 10px; }
    .survey-savebar button { width: 100%; min-height: 42px; font-size: 13px; }
    #draftCount { font-size: 11px; }
    .event-list li { grid-template-columns: 1fr; gap: 5px; padding: 15px 0; }
    .event-list time { font-size: 10px; }
    .role-card { padding: 13px; font-size: 11px; }
    .auth { width: calc(100% - 28px); margin: 28px auto; padding: 25px; border-radius: 13px; }
    .auth-brand { gap: 15px; margin-bottom: 22px; padding-bottom: 21px; }
    .auth-brand img { width: 72px; height: 72px; }
    .auth-brand strong { font-size: 20px; }
    .auth h1 { font-size: 23px; }
    .auth input { font-size: 16px; }
    dialog { max-width: calc(100vw - 24px); padding: 21px; border-radius: 12px; }
    .dialog-heading h2 { font-size: 18px; }
    #dialogBody input, #dialogBody select, #dialogBody textarea { font-size: 16px; }
    #dialogForm > .actions { margin-top: 20px; }
  }

  @media (prefers-reduced-motion: reduce) {
    button, .link-button { transition: none; }
  }
}

/* Header home control retains the company lockup appearance. */
#brandHome,#brandHome:hover,#brandHome:active { background:transparent; border:0; padding:0; box-shadow:none; text-align:left; color:inherit; transform:none; }
#brandHome:focus-visible { outline:2px solid var(--brand-forest); outline-offset:6px; border-radius:4px; }

/* Reserve room for sales packaging equivalents without breaking units. */
.stockbook table { width:100%; min-width:0; }
.stockbook-column { container-type:inline-size; }
.stockbook col.book-name-col { width:26%; }
.stockbook col:nth-child(2) { width:16%; }
.stockbook col:nth-child(3) { width:29%; }
.stockbook col:nth-child(4) { width:29%; }
.stockbook td { white-space:nowrap; overflow-wrap:normal; word-break:normal; padding-left:4px; padding-right:4px; font-size:clamp(9px,2.5cqi,13px); letter-spacing:-.025em; }

/* SUNFLOW approved bright workspace theme. Presentation only. */
@media screen {
 :root {--brand-forest:#292b28;--brand-forest-hover:#41443e;--brand-olive:#777970;--brand-ink:#252525;--brand-muted:#696964;--brand-border:#e4e4df;--brand-canvas:#fff;--brand-surface:#fff;}
 body,.content {background:#fff;color:#252525;}
 h1,h2,h3,.card-heading h2,.brand-copy strong,.stat b {color:#252525;}
 #workspace > header {height:76px;border-bottom-color:#e9e9e5;}
 .brand-logo {width:52px;height:52px;}.brand-copy strong {font-size:19px;letter-spacing:-.035em;}.brand-copy span,#userLabel {color:#666660;}
 .shell {min-height:calc(100vh - 76px);grid-template-columns:232px minmax(0,1fr);}
 .shell > aside {top:76px;height:calc(100vh - 76px);background:#f7f7f5;border-color:#e6e6e1;padding:24px 16px;}
 .nav-title {color:#777770;letter-spacing:0;}.nav-emoji {font-family:'Segoe UI Emoji','Apple Color Emoji',sans-serif;font-size:22px;line-height:26px;width:26px;flex:0 0 26px;text-align:center;}
 nav button {color:#50504b;border-radius:7px;padding:12px 11px;gap:12px;font-weight:550;}
 nav button:hover {background:#ededea;color:#252525;}nav button.active {background:#e9e9e5;border-color:transparent;color:#202020;box-shadow:none;font-weight:700;}
 .aside-note {border-color:#deded9;color:#74746c;}.aside-note strong {color:#474741;}
 .content {padding:32px 34px 52px;}.eyebrow {color:#72726b;}.page-description,#sync {color:#696962;}.page-heading h1 {font-size:30px;font-weight:750;}
 .page-heading h1:before {display:block;font-size:34px;line-height:1.3;margin-bottom:10px;letter-spacing:0;}
 #workspace:has(nav [data-page="dashboard"].active) h1:before {content:'🏡';}
 #workspace:has(nav [data-page="stockbook"].active) h1:before {content:'📋';}
 #workspace:has(nav [data-page="shipment"].active) h1:before {content:'🚚';}
 #workspace:has(nav [data-page="pending"].active) h1:before {content:'🔎';}
 #workspace:has(nav [data-page="inventory"].active) h1:before {content:'📋';}
 #workspace:has(nav [data-page="weekly"].active) h1:before {content:'📊';}
 #workspace:has(nav [data-page="purchases"].active) h1:before {content:'🛒';}
 #workspace:has(nav [data-page="history"].active) h1:before {content:'🕘';}
 #workspace:has(nav [data-page="team"].active) h1:before {content:'👥';}
 .stat,.card,.stockbook {border-color:#e3e3de;border-radius:10px;box-shadow:none;}.stat {padding:21px;}.stat span,.stat small {color:#666660;}.stat.warning {background:#fff;border-color:#e3e3de;}.stat.warning b {color:#d95e43;}
 .stat-label .ui-icon {display:none;}.stat-label:after {margin-left:auto;font-size:20px;}.stat:nth-child(1) .stat-label:after{content:'📦';}.stat:nth-child(2) .stat-label:after{content:'✅';}.stat:nth-child(3) .stat-label:after{content:'🔔';}.stat:nth-child(4) .stat-label:after{content:'🚚';}
 .secondary,.ghost {border-color:#d9d9d3;color:#41413b;background:#fff;}.secondary:hover,.ghost:hover {background:#f3f3ef;border-color:#c9c9c2;color:#252525;}
 button:focus-visible,a:focus-visible {outline-color:#758fa9;}input,select,textarea {border-color:#d9d9d2;color:#252525;}input:focus,select:focus,textarea:focus{border-color:#7c8b98;outline-color:#7c8b9825;}input::placeholder{color:#77776f;}label,td strong {color:#3d3d37;}
 .hint,.stockbook-help {background:#f7f7f4;border-color:#e7e7e1;color:#62625c;}.hint b,.stockbook-help b {color:#44443e;}.stockbook-kicker {color:#66665e;}.stockbook-kicker:before{content:'📦 ';}.stockbook-date {color:#292b28;}
 .table-wrap,.stockbook-column {border-color:#e5e5df;}th {background:#f5f5f2;color:#52524c;border-color:#e2e2dc;}td {color:#35352f;border-color:#e9e9e3;}tr:hover td {background:#fafaf7;}
 .stockbook th,.stockbook td {border-color:#e8e8e2;}.stockbook thead th {background:#f5f5f2;color:#50504a;}.stockbook tbody th {background:#fff;color:#35352f;}.stockbook tr:nth-child(even) td,.stockbook tr:nth-child(even) th {background:#fafaf7;}.stockbook .stockbook-gap td {background:#f9f9f6;}
 .stockbook .book-stock,.stockbook .book-stock span {color:#111;}.stockbook .book-sales{color:#1565c0;}.stockbook .positive{color:#16803c;}.stockbook .negative{color:#d32f2f;}.stockbook .book-extra th{color:#8e24aa;}
 .survey-savebar {border-color:#deded7;background:#fff;}.weekly-sales-section,.weekly-sales-table th {border-color:#e3e3dc;}
 @media(max-width:900px){.shell{grid-template-columns:190px minmax(0,1fr);}.shell>aside{padding:20px 10px;}.content{padding:24px 20px;}.nav-emoji{font-size:20px;}}
 @media(max-width:650px){#workspace>header{height:auto;min-height:76px;}.shell{display:block;}.shell>aside{position:static;height:auto;padding:10px;border-right:0;border-bottom:1px solid #e5e5df;}nav{flex-direction:row;overflow:auto;}nav button{width:auto;flex-shrink:0;white-space:nowrap;}.nav-title,.aside-note{display:none;}.content{padding:22px 14px;}.brand-copy strong{font-size:16px;}.page-heading h1{font-size:25px;}}
}

/* Approved time-slot shipment view; original three product groups retained. */
.shipment-columns .stockbook-column table{table-layout:fixed;width:100%;min-width:0;font-size:clamp(9px,2.5cqi,12px)}
.shipment-columns .stockbook-column th,.shipment-columns .stockbook-column td{padding:5px 3px!important;width:auto;min-width:0}
.shipment-columns .stockbook-column thead th{font-size:clamp(9px,2.3cqi,11px);white-space:nowrap}
.shipment-columns .wf-col-handle::after{right:0}
.shipment-columns .stockbook-column tbody th{white-space:normal;word-break:keep-all;font-size:inherit}
.shipment-columns .stockbook-column tbody td{white-space:nowrap}
/* Shipment names have no repeated unit line. Allow conversion rows to grow. */
.shipment-columns .stockbook-column tbody th,.shipment-columns .stockbook-column tbody td{height:30px;padding-block:4px!important;vertical-align:middle}
.shipment-columns .shipment-pack:empty{display:none}
.shipment-pack{display:block;font-size:clamp(7.5px,2.1cqi,9px);margin-top:2px}
.shipment-cell-unit{display:inline}
.shipment-columns .shipment-box-mark{font-weight:800}
.stockbook .shipment-columns .shipment-total{background:#f3ebfa;color:#713b91;font-weight:800}
.shipment-columns thead th.shipment-total-heading{background:#e6d3f2;color:#713b91}
.shipment-slot-option{display:flex;align-items:center;gap:14px;border:1px solid #deded9;border-radius:8px;padding:17px;margin:10px 0;cursor:pointer;background:white}
.shipment-slot-option:has(input:checked){border-color:#444;background:#f5f5f3}
.shipment-slot-option input{width:18px;height:18px;accent-color:#333}
.shipment-slot-option small{display:block;color:#777;margin-top:6px}
@media(max-width:1000px){.shipment-columns{overflow-x:auto!important;grid-template-columns:repeat(3,minmax(330px,1fr))!important}}
@media(max-width:700px){.shipment-cell-unit{display:block;font-size:8px;line-height:1.05}.shipment-columns .book-stock .shipment-cell-box{display:inline;font-size:inherit}.shipment-columns .stockbook-column tbody td{line-height:1.12}}

#nav .nav-new{display:inline-flex;align-items:center;justify-content:center;margin-left:7px;width:18px;height:18px;border-radius:6px;background:#dc2626;color:white;font-size:11px;font-weight:800;line-height:1;flex:0 0 auto}#nav .nav-new[hidden]{display:none}

.stockbook-updated .update-actor{color:#16803c!important}
.stockbook .book-stock-edit{display:inline-flex;align-items:center;justify-content:flex-end;gap:4px;width:100%;min-height:28px;padding:2px 3px;border:1px solid transparent;border-radius:5px;background:transparent;color:#111;font:inherit;text-align:right;white-space:nowrap;cursor:pointer}
.stockbook .book-stock-edit:hover,.stockbook .book-stock-edit:focus-visible{border-color:#a6bea5;background:#f0f7ef;outline:none}
.stockbook .book-stock-edit span{color:#6a846d;font-size:11px}
.book-stock-modes{display:flex;flex-wrap:wrap;gap:18px 32px;margin:12px 0;padding:16px;border:1px solid #e3e9df;border-radius:8px}
.book-stock-modes legend{padding:0 4px;font-weight:600}
.book-stock-modes label{display:inline-flex;align-items:center;gap:10px;margin:0;flex:0 0 auto;min-height:40px;white-space:nowrap;cursor:pointer}
.book-stock-modes input[type="radio"]{width:18px;height:18px;min-width:18px;min-height:18px;padding:0;margin:0;flex:0 0 18px}
.stockbook .book-product-actions{display:inline-flex;flex-wrap:wrap;align-items:center;gap:2px;max-width:100%;vertical-align:middle}
.stockbook .book-product-delete{flex:0 0 auto;display:inline-flex;align-items:center;justify-content:center;width:17px;height:17px;padding:0;border:1px solid transparent;border-radius:4px;background:transparent;color:#b7645a;font-size:15px;line-height:1;cursor:pointer}
.stockbook .book-product-delete:hover,.stockbook .book-product-delete:focus-visible{border-color:#d9a39a;background:#fff0ed;color:#a52b20;outline:none}
.stockbook .book-add-product,.stockbook .book-product-edit{display:inline-flex;align-items:center;gap:4px;max-width:100%;padding:2px 3px;border:1px solid transparent;border-radius:5px;background:transparent;color:inherit;font:inherit;font-weight:inherit;text-align:left;word-break:keep-all;cursor:pointer}
.stockbook .book-add-product:hover,.stockbook .book-add-product:focus-visible,.stockbook .book-product-edit:hover,.stockbook .book-product-edit:focus-visible{border-color:#a6bea5;background:#f0f7ef;outline:none}
.stockbook .book-add-product span,.stockbook .book-product-edit span{flex:0 0 auto;color:#6a846d;font-size:11px}
.stockbook .stockbook-click-gap td,.stockbook .stockbook-add-row td{height:36px;padding:0!important;background:#f9f9f6}
.stockbook .book-empty-add{display:block;width:100%;min-height:36px;margin:0;padding:7px 8px;border:0;border-radius:0;background:transparent;color:#748a72;font:inherit;font-size:11px;text-align:left;cursor:pointer}
.stockbook .stockbook-click-gap .book-empty-add span{opacity:.55}
.stockbook .book-empty-add span{font-size:18px;font-weight:700;line-height:1}
.stockbook .book-empty-add:hover,.stockbook .book-empty-add:focus-visible{background:#eaf3e7;color:#234c3a;outline:2px solid #9eb286;outline-offset:-2px}
.stockbook .book-empty-add:hover span,.stockbook .book-empty-add:focus-visible span{opacity:1}
.stockbook tr.book-missing th,.stockbook tr.book-missing td,.stockbook tr.book-missing:nth-child(even) th,.stockbook tr.book-missing:nth-child(even) td{background:#f7f0fb;color:#713b91;border-color:#dccbe6}
.stockbook tr.book-missing th{white-space:normal}
.stockbook tr.book-missing th button{display:block;width:100%;padding:2px 4px;border:0;border-radius:4px;background:transparent;color:#713b91;font:inherit;font-weight:700;text-align:left;word-break:keep-all;cursor:pointer}
.stockbook tr.book-missing th button small{display:block;margin-top:2px;font-size:10px;font-weight:600;color:#8950a0}
.stockbook tr.book-missing th button:hover,.stockbook tr.book-missing th button:focus-visible{background:#eadbf3;outline:2px solid #a876bb;outline-offset:1px}
.stockbook tr.book-missing td.book-sales{font-weight:700;text-align:right}

/* One release number beside SUNFLOW on both login and workspace headers. */
@media screen {
  .brand-copy strong { white-space: nowrap; }
  .auth-brand .app-version, .brand-copy .app-version {
    display: inline-block;
    margin-left: 3px;
    padding: 2px 6px;
    border: 1px solid #d9ddd5;
    border-radius: 5px;
    background: #f5f6f3;
    color: #4c554d;
    font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 10px;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: 0;
    font-variant-numeric: tabular-nums;
    vertical-align: 2px;
    white-space: nowrap;
  }
  @media (max-width: 420px) {
    .auth-brand { gap: 10px; }
    .auth-brand img { width: 56px; height: 56px; }
    .auth-brand strong { font-size: 16px; letter-spacing: -.035em; white-space: nowrap; }
    .auth-brand .app-version, .brand-copy .app-version { padding: 2px 4px; font-size: 9px; }
  }
  @media (max-width: 360px) {
    .auth-brand > div { min-width: 0; }
    .auth-brand strong { white-space: normal; word-break: keep-all; }
  }
}

/* Optional persistent login, off by default. */
.auth-remember-row {margin:0 0 18px;}
.auth-remember {display:flex;align-items:center;gap:9px;min-height:44px;width:fit-content;cursor:pointer;color:#2f4939;font-size:14px;font-weight:650;}
.auth-remember input[type="checkbox"] {display:inline-block;flex:0 0 19px;width:19px;height:19px;min-height:0;margin:0;accent-color:#245b43;cursor:pointer;}
.auth-remember-row small {display:block;font-size:12px;line-height:1.6;color:#647064;word-break:keep-all;}

/* Pending view on phones: keep the item column, divide the other space equally. */
@media screen and (max-width:700px) {
 #workspace:has(nav [data-page="pending"].active) .stockbook col:not(.book-name-col) {width:calc(74% / 3);}
}

/* Stockbook only: two columns, readable names and saved quantities. */
#workspace:has(nav [data-page="stockbook"].active) .stockbook col.book-name-col { width:66%; }
#workspace:has(nav [data-page="stockbook"].active) .stockbook col:not(.book-name-col) { width:34%; }
.stockbook .stockbook-inventory-columns table {font-size:15px;}
.stockbook .stockbook-inventory-columns thead th {height:42px;font-size:13px;font-weight:700;}
.stockbook .stockbook-inventory-columns tbody th {font-size:15px;font-weight:600;}
.stockbook .stockbook-inventory-columns tbody td {font-size:16px;font-weight:650;letter-spacing:0;}
.stockbook .stockbook-inventory-columns tr[data-book-product]>th,
.stockbook .stockbook-inventory-columns tr[data-book-product]>td {height:42px;padding-block:6px;}
.stockbook .stockbook-inventory-columns .book-stock-edit {min-height:30px;}
@media(max-width:700px){
 .stockbook .stockbook-inventory-columns thead th {font-size:14px;}
 .stockbook .stockbook-inventory-columns tbody th {font-size:16px;}
 .stockbook .stockbook-inventory-columns tbody td {font-size:17px;}
 .stockbook .stockbook-inventory-columns tr[data-book-product]>th,
 .stockbook .stockbook-inventory-columns tr[data-book-product]>td {height:46px;}
}

/* Layout tools live only inside the stockbook editor. */
.book-layout-toolbar {position:sticky;top:76px;z-index:4;display:flex;align-items:center;justify-content:space-between;gap:16px;background:#fff;padding:16px 0;border-bottom:1px solid #dce2d8;}
.book-layout-toolbar h2 {font-size:22px;margin:0 0 6px;}
.book-layout-toolbar p {margin:0 0 5px;font-size:14px;color:#394a35;}
.book-layout-toolbar small {font-size:12px;color:#687163;}
.book-layout-toolbar .actions {flex-wrap:nowrap;}
.book-layout-toolbar button {white-space:nowrap;}
.book-layout-grid {display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px;margin-top:14px;}
.book-layout-column h3 {margin:0;padding:10px 12px;background:#edf1e9;font-size:14px;border:1px solid #dce2d8;border-bottom:0;}
.book-layout-column ol {list-style:none;padding:0;margin:0;border:1px solid #dce2d8;}
.book-layout-column li {padding:8px 9px;min-height:45px;border-bottom:1px solid #e4e8df;display:flex;align-items:center;justify-content:space-between;gap:8px;}
.book-layout-column li:last-child {border-bottom:0;}
.book-layout-column button {color:#465b3b;background:#fff;border:1px solid #d5decf;padding:5px 7px;min-height:30px;font-size:11px;white-space:nowrap;}
.book-layout-name {font-size:13px;font-weight:650;word-break:keep-all;}
.book-layout-actions {display:flex;gap:3px;flex-shrink:0;}
.book-layout-empty {background:#fafbf8;color:#99a092;font-size:11px;}
.book-layout-empty button {border:0;background:transparent;color:#798272;}
.book-layout-item.is-selected {background:#edf6e8;outline:2px solid #73945f;outline-offset:-2px;}
.book-layout-column .book-layout-target {width:100%;background:#edf6e8;border:1px dashed #82a96a;color:#305721;}
@media(max-width:1000px){.book-layout-grid {grid-template-columns:1fr;}.book-layout-toolbar {align-items:flex-start;flex-wrap:wrap;}.book-layout-toolbar .actions {margin-left:auto;}}

#workspace:has(nav [data-page="stockbook"].active) .book-product-actions {display:flex;flex-wrap:nowrap;width:100%;gap:2px;}
#workspace:has(nav [data-page="stockbook"].active) .book-product-edit {min-width:0;flex:1;}
#workspace:has(nav [data-page="stockbook"].active) .book-product-delete {min-height:17px;}

@media(min-width:1200px) and (max-width:1399px){
  #workspace:has(nav [data-page="stockbook"].active) .book-product-edit>span {display:none;}
  #workspace:has(nav [data-page="stockbook"].active) .book-product-edit {padding-inline:0;gap:0;}
  #workspace:has(nav [data-page="stockbook"].active) .stockbook tbody th {padding-inline:2px;}
}
@media(max-width:700px){.book-layout-toolbar {top:0;}}

/* Mobile stock input: the decimal keypad does not always provide a minus key. */
.stock-quantity-control{display:flex;align-items:center;gap:8px;max-width:100%}
#dialogBody .stock-quantity-control{margin:8px 0}
#dialogBody .stock-quantity-control input{flex:1 1 0;min-width:0;width:0;margin:0;min-height:46px;font-size:18px;font-variant-numeric:tabular-nums}
.stock-quantity-control .stock-sign-toggle{flex:0 0 48px;width:48px;min-width:48px;min-height:46px;margin:0;padding:0;line-height:1;font-size:26px;font-weight:650;color:#325748;background:#eef5ef;border:1px solid #bbcebd;border-radius:7px;touch-action:manipulation}
.stock-quantity-control .stock-sign-toggle:hover:not(:disabled){background:#deeddf}
.stock-quantity-control .stock-sign-toggle:disabled{opacity:.4;cursor:default}
.stock-sign-help{margin:5px 0 12px;color:#43694d;font-size:13px;line-height:1.6}
.stock-sign-help b{font-size:17px}
.survey-table .stock-quantity-control{display:inline-flex;width:210px;vertical-align:middle}
.survey-table .stock-quantity-control .stock-input{flex:1 1 115px;width:115px;min-width:0;max-width:115px;margin:0;min-height:46px}
.survey-table .stock-quantity-control>span{white-space:nowrap}
@media(max-width:600px){.survey-table .stock-quantity-control{width:100%}.survey-table .stock-quantity-control .stock-input{max-width:190px}}

/* Inventory entry keeps saved stock visible and leaves new quantities empty. */
.survey-table .survey-current-heading{color:#316a4b;background:#eef5ee}
.survey-table td.survey-current-stock{min-width:145px;background:#f5faf5;color:#276345;white-space:nowrap;font-variant-numeric:tabular-nums}
.survey-current-stock strong{font-size:21px;font-weight:750}
.survey-current-stock>span{margin-left:6px;font-size:13px;font-weight:600}
.survey-table .stock-input::placeholder{font-size:13px;font-weight:400;color:#98a394}
.survey-save-status{flex:1 1 400px;display:flex;flex-direction:column;gap:7px}
.survey-save-preview{font-size:13px;line-height:1.6;color:#38644a;font-weight:600}
.survey-save-actions{display:flex;gap:14px;flex-wrap:wrap}
.survey-save-actions #addSurvey{background:#315c46;color:#fff;border-color:#315c46}
.survey-save-actions #saveSurvey{background:#fff;color:#315c46;border-color:#91ad9b}
@media(max-width:600px){
 .survey-table tbody>tr[data-product-id]>td:nth-child(3){grid-column:2;grid-row:2}
 .survey-table tbody>tr[data-product-id]>td:nth-child(4){grid-column:2;grid-row:3}
 .survey-table tbody>tr[data-product-id]>td:nth-child(5){grid-column:2;grid-row:4}
 .survey-table tbody>tr[data-product-id]>td:nth-child(3)::before{content:'저장된 현재 재고'}
 .survey-table tbody>tr[data-product-id]>td:nth-child(4)::before{content:'이번 입력 수량'}
 .survey-table tbody>tr[data-product-id]>td:nth-child(5)::before{content:'조사 비고';display:block;margin-bottom:5px;color:#6c786a;font-size:11px;font-weight:500}
 .survey-table tbody>tr[data-product-id]>td.survey-current-stock{padding:10px 12px;border-radius:6px;background:#eef6ef}
 .survey-save-status{flex-basis:100%}.survey-save-actions{width:100%;gap:12px;flex-direction:column-reverse}
 .survey-save-actions #saveSurvey{background:#315c46;color:#fff;border-color:#315c46}
 .survey-save-actions #addSurvey{background:#fff;color:#315c46;border-color:#91ad9b}
 .survey-savebar #draftCount{font-size:13px}.survey-save-preview{font-size:12px}
 .survey-savebar button{font-size:14px}
}

/* Add a product and its opening count without leaving the dialog. */
#dialogBody .product-add-stock-fields{display:grid;grid-template-columns:minmax(110px,0.8fr) minmax(160px,1.2fr);gap:18px;align-items:end;margin-top:16px}
#dialogBody .product-add-stock-fields label{margin:0 0 6px}
#dialogBody .product-add-stock-fields select{margin:6px 0 0;min-height:46px}
#dialogBody #productInitialUnit{font-weight:500;color:#607460}
#dialogBody .product-add-stock-summary{display:grid;gap:5px;padding:16px;margin:16px 0 0;border:1px solid #b9d5b9;background:#f1f8ef;border-radius:10px;color:#315e38;font-size:13px;line-height:1.5}
#dialogBody .product-add-stock-summary strong{font-size:19px;font-weight:750;font-variant-numeric:tabular-nums;color:#244c2b;overflow-wrap:anywhere}
@media(max-width:400px){#dialogBody .product-add-stock-fields{grid-template-columns:minmax(90px,0.7fr) minmax(150px,1.3fr);gap:10px}#dialogBody .product-add-stock-summary{padding:12px}#dialogBody .product-add-stock-summary strong{font-size:18px}}

/* Keep both stock columns equal and their headings on one line on phones. */
@media screen and (max-width:700px){.shipment-columns table:not(.wf-width-custom) col:nth-child(1){width:25%!important}.shipment-columns table:not(.wf-width-custom) col:nth-child(2),.shipment-columns table:not(.wf-width-custom) col:nth-child(3){width:15.5%!important}}

/* Shipment only: distinguish hourly shipments and remaining stock. */
.stockbook .shipment-columns .book-sales:not(.shipment-total){color:#1565c0}
.stockbook .shipment-columns .positive{color:#006d68}

/* Emphasize the shipment balance, including shortage and conversion lines. */
.stockbook .shipment-columns .shipment-balance{font-weight:700}

/* Phone shipment: stack the three groups like pending and keep narrow tables readable. */
@media screen and (max-width:700px) {
 .stockbook:has(.shipment-columns) {padding-inline:10px;}
 .shipment-columns {grid-template-columns:minmax(0,1fr) !important; overflow-x:visible !important;}
 .shipment-columns .stockbook-column table:not(.wf-width-custom) {min-width:308px;}
}

/* Preview only: the horizontal menu must not retain desktop sidebar height. */
@media screen and (min-width: 651px) and (max-width: 900px) {
  .shell > aside { height: auto; }
}
