:root{--pine:#203c31;--pine-light:#e6ede5;--ink:#22332b;--muted:#737b71;--line:#d9ddd2;--canvas:#e9e8e0;--cream:#f8f8f2;--font:'Apple SD Gothic Neo','Malgun Gothic','맑은 고딕',sans-serif;color-scheme:light}
*{box-sizing:border-box}body{margin:0;color:var(--ink);background:var(--canvas);font-family:var(--font);font-size:15px;line-height:1.5}button,input,textarea{font:inherit}button{cursor:pointer}button:disabled{cursor:not-allowed;opacity:.45}input,textarea{width:100%;min-width:0;background:white;border:1px solid #d3d8ce;border-radius:7px;padding:11px 12px;color:var(--ink);transition:border-color .15s,box-shadow .15s}input{min-height:46px}textarea{resize:vertical;line-height:1.65}input:focus,textarea:focus{outline:none;border-color:var(--pine);box-shadow:0 0 0 3px #203c3112}input::placeholder,textarea::placeholder{color:#92978e}button:focus-visible,a:focus-visible{outline:3px solid #9b7737;outline-offset:3px}button svg{width:19px;height:19px}button{touch-action:manipulation}a{color:inherit}.topbar{height:78px;padding:0 40px;display:flex;align-items:center;gap:30px;background:var(--pine);color:#eff2e6}.brand{display:inline-flex;align-items:center;gap:10px;color:inherit;text-decoration:none}.brand svg{height:27px;width:27px}.brand span{font-family:Georgia,serif;font-size:28px;letter-spacing:-1px}.topbar-label{padding-left:28px;border-left:1px solid #ffffff30;font-size:14px}.local-note{margin-left:auto;font-size:12px;color:#d2dccb;display:flex;align-items:center;gap:8px}.status-dot{display:inline-block;width:6px;height:6px;border-radius:50%;background:#c4d2ac}.workspace{display:grid;grid-template-columns:390px minmax(0,1fr);max-width:1800px;margin:auto;min-height:calc(100vh - 78px)}.editor{padding:34px 28px 30px;background:var(--cream);border-right:1px solid #d7d9ce}.intro{margin-bottom:28px}.eyebrow{font-size:12px;letter-spacing:.04em;color:var(--muted);margin:0 0 8px}.intro h1{font-size:28px;letter-spacing:-1.1px;line-height:1.25;margin:0 0 12px;font-weight:750}.intro>p:last-child{font-size:14px;color:var(--muted);margin:0;line-height:1.65}.edit-section{padding-top:24px;margin-top:23px;border-top:1px solid var(--line)}.section-heading{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:18px}.section-heading h2{font-size:16px;letter-spacing:-.5px;margin:0;display:flex;align-items:baseline;gap:8px}.section-heading h2>span:first-child{font-family:Georgia,serif;font-size:13px;font-weight:normal;color:#87957e}.section-heading h2 .plain{font-size:16px;font-family:var(--font);font-weight:700;color:var(--ink)}.text-button{border:0;background:transparent;font-size:12px;white-space:nowrap;padding:5px 0;color:#5c7058;text-decoration:underline;text-underline-offset:3px}.text-button:hover{color:#162d20}.danger{color:#97715f}.field{margin-top:14px}.field label,dialog label{display:block;font-size:13px;font-weight:600;margin-bottom:7px;color:#465044}.field-pair{display:grid;grid-template-columns:.85fr 1.15fr;gap:12px}.field-help{font-size:12px;color:var(--muted);margin:9px 0 0;line-height:1.6}.trade-tabs{display:flex;flex-wrap:wrap;gap:7px}.trade-tab{background:#fff;border:1px solid #d7dcd1;border-radius:6px;color:#586250;padding:8px 12px;min-height:40px;font-size:14px;display:inline-flex;align-items:center;gap:6px}.trade-tab:hover{background:#edf0e7}.trade-tab[aria-pressed=true]{background:var(--pine);border-color:var(--pine);color:#fff}.filled-dot{display:inline-block;width:5px;height:5px;background:#8a9b77;border-radius:50%}.trade-tab[aria-pressed=true] .filled-dot{background:#e2eabe}.label-row{display:flex;justify-content:space-between;align-items:baseline}.label-row label{margin-bottom:7px}.label-row button{padding:0}.button{border:1px solid transparent;display:inline-flex;justify-content:center;align-items:center;gap:8px;border-radius:7px;padding:11px 15px;min-height:44px;font-size:13px;font-weight:600;white-space:nowrap;transition:background .15s}.button.primary{background:var(--pine);color:white;border-color:var(--pine)}.button.primary:hover{background:#142c21}.button.secondary{background:#fafbf5;border-color:#cbd1c3;color:#46533f}.button.secondary:hover{background:#edf0e5}.file-actions{display:flex;gap:8px;margin-top:26px}.file-actions>*{flex:1;padding-left:9px;padding-right:9px}.storage-help{font-size:12px;color:var(--muted);line-height:1.7;margin:13px 0 0}.preview-pane{padding:34px 35px 40px;min-width:0}.preview-toolbar{display:flex;align-items:center;justify-content:space-between;gap:18px;max-width:1000px;margin:auto auto 24px}.preview-toolbar .eyebrow{margin:0 0 3px;font-size:11px}.preview-toolbar h2{font-size:19px;margin:0;letter-spacing:-.5px}.print-actions{display:flex;gap:8px;flex-wrap:wrap;justify-content:flex-end}.paper-meta{display:flex;justify-content:space-between;gap:12px;max-width:794px;margin:0 auto 12px;font-size:11px;color:#788071}.paper-meta span:first-child{color:#516348}.paper-stage{overflow:visible;display:flex;justify-content:center}.paper-frame{width:100%;max-width:794px;position:relative}.paper-frame>#preview-paper{transform-origin:top left}.sheet{width:210mm;height:296mm;padding:14mm 15mm 13mm;background:white;color:#111;font-family:var(--font);font-size:12pt;line-height:1.5;display:flex;flex-direction:column;box-shadow:0 4px 22px #1e302112;overflow:visible}.sheet-head{display:flex;justify-content:space-between;align-items:flex-end;margin-bottom:8mm;gap:7mm}.sheet-kicker{font-size:9pt;letter-spacing:.06em;margin-bottom:2mm;color:#505050}.sheet-title{font-size:30pt;font-weight:750;letter-spacing:-1.5px;line-height:1.2;overflow-wrap:anywhere;margin:0}.sheet-project{font-size:12pt;max-width:85mm;text-align:right;white-space:pre-wrap;overflow-wrap:anywhere;font-weight:600}.sheet-table{border:1.3pt solid #222;flex:1;display:flex;flex-direction:column;min-height:0}.sheet-row{display:grid;grid-template-columns:31mm minmax(0,1fr);border-bottom:1pt solid #333;flex-shrink:0;min-height:15mm}.sheet-row dt,.sheet-row dd{margin:0;padding:3.3mm 4mm;overflow-wrap:anywhere;white-space:pre-wrap}.sheet-row dt{font-weight:650;border-right:1pt solid #333;background:#f7f7f3}.sheet-row dd{min-width:0}.sheet-contact{font-size:10pt}.sheet-notes{flex:1;min-height:0;display:flex;flex-direction:column;padding:4mm 5mm 5mm}.sheet-notes-title{font-size:12pt;font-weight:650;padding-bottom:4mm;flex-shrink:0}.notes-text{font-size:13pt;line-height:1.7;white-space:pre-wrap;overflow-wrap:anywhere;flex:1;min-height:0}.empty-notes{color:#9b9b91;font-size:11pt}.sheet-footer{margin-top:4mm;display:flex;justify-content:space-between;gap:5mm;font-size:8pt;color:#777;flex-shrink:0}.print-help{font-size:12px;color:#7b8177;max-width:794px;margin:22px auto 0;text-align:center;line-height:1.9}.print-help strong{font-weight:600;color:#63705b}.warning{max-width:794px;margin:0 auto 14px;background:#fff2e6;border:1px solid #dbaf83;color:#884b1a;padding:12px 15px;font-size:13px;border-radius:6px}.toast{position:fixed;bottom:28px;left:50%;transform:translateX(-50%);max-width:calc(100% - 40px);padding:12px 20px;background:var(--pine);color:white;border-radius:8px;box-shadow:0 5px 25px #0002;z-index:20;font-size:14px}dialog{border:1px solid var(--line);border-radius:12px;padding:26px;width:min(420px,calc(100% - 32px));color:var(--ink)}dialog::backdrop{background:#15261c66}dialog h2{font-size:21px;margin:0 0 22px}.dialog-actions{display:flex;justify-content:flex-end;gap:8px;margin-top:24px}#print-root{display:none}[hidden]{display:none!important}
@media(min-width:1600px){.preview-pane{padding:40px 55px}.editor{padding-left:36px;padding-right:36px}.workspace{grid-template-columns:420px minmax(0,1fr)}}
@media(max-width:1180px){.workspace{grid-template-columns:350px minmax(0,1fr)}.editor{padding:28px 24px}.preview-pane{padding:28px 24px}.preview-toolbar{display:block}.print-actions{margin-top:16px;justify-content:flex-start}.paper-meta>span:last-child{display:none}.button{font-size:12px;padding:10px 12px}}
@media(max-width:760px){.topbar{height:64px;padding:0 20px;gap:16px}.brand span{font-size:25px}.topbar-label{padding-left:16px;font-size:12px}.local-note{display:none}.workspace{display:flex;flex-direction:column}.editor{border-right:0;padding:27px 22px}.intro h1{font-size:27px}.intro br{display:none}.intro>p:last-child{max-width:100%}.preview-pane{padding:26px 16px 30px;border-top:1px solid var(--line)}.preview-toolbar{display:flex;align-items:flex-start;flex-direction:column;gap:12px;margin-bottom:18px}.print-actions{margin:0;width:100%;display:grid;grid-template-columns:1fr 1fr;gap:8px}.print-actions .button{font-size:12px;padding:12px 8px}.preview-toolbar h2{font-size:20px}.edit-section{padding-top:22px;margin-top:22px}.trade-tab{padding:9px 14px}.paper-meta{font-size:11px}.file-actions .button{font-size:13px;min-height:47px}}
@media print{@page{size:A4 portrait;margin:0}html,body{margin:0!important;padding:0!important;background:white!important}body>.topbar,body>.workspace,body>.toast,body>dialog{display:none!important}#print-root{display:block!important}#print-root .sheet{box-shadow:none;margin:0;width:210mm;height:296mm;break-after:page;page-break-after:always;print-color-adjust:exact;-webkit-print-color-adjust:exact}#print-root .sheet:last-child{break-after:auto;page-break-after:auto}}

@media(min-width:761px){.workspace{height:calc(100vh - 78px);min-height:0}.editor,.preview-pane{overflow-y:auto;overscroll-behavior:contain}.preview-pane{scrollbar-gutter:stable}.editor{scrollbar-gutter:stable}}

/* Phone workflow: persistent process picker, separate editing and A4 views. */
.mobile-navigation,.mobile-dock{display:none}
select{font:inherit;color:var(--ink);background:#fff;border:1px solid #cbd1c3;border-radius:7px;padding:10px 12px;min-width:0;min-height:46px}
select:focus-visible{outline:3px solid #9b7737;outline-offset:2px}
.save-dialog{width:min(480px,calc(100% - 28px));max-height:calc(100dvh - 32px);overflow-y:auto;padding:24px}
.save-dialog-heading{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:14px}
.save-dialog-heading h2{font-size:21px;margin:0;overflow-wrap:anywhere}
.save-dialog-heading>button{flex-shrink:0;border:0;background:#edf0e7;border-radius:50%;width:44px;height:44px;font-size:27px;color:var(--pine)}
.save-intro{font-size:14px;color:#64705f;line-height:1.7;margin:0 0 20px}
.wide{width:100%}.save-other-actions{display:grid;gap:10px;margin:22px 0 16px;padding-top:20px;border-top:1px solid var(--line)}
.save-other-actions>.button{white-space:normal}
#image-result{margin-top:14px}#export-image{display:block;width:100%;max-height:48dvh;object-fit:contain;background:#e9e8e0;border:1px solid var(--line)}
.image-actions{display:flex;gap:10px;margin-top:14px}.image-actions>*{flex:1;text-decoration:none}
.inapp-help{padding:12px;background:#f0f2e8;border-radius:7px;font-size:13px;line-height:1.6}
.export-host{position:fixed;left:-10000px;top:0;width:210mm;pointer-events:none;z-index:-1}
@media screen and (max-width:760px){
  body{font-size:16px;padding-bottom:calc(88px + env(safe-area-inset-bottom));-webkit-text-size-adjust:100%}
  .topbar{height:60px;padding:0 18px;gap:12px}.brand span{font-size:25px}.brand svg{width:23px;height:23px}.topbar-label{font-size:12px;padding-left:12px}
  .mobile-navigation{display:block;position:sticky;top:0;z-index:5;background:var(--cream);box-shadow:0 2px 7px #203c310a}
  .mobile-tabs{display:grid;grid-template-columns:1fr 1fr;padding:6px 18px 0;border-bottom:1px solid var(--line)}
  .mobile-tabs button{min-height:48px;font-size:15px;font-weight:650;border:0;border-bottom:3px solid transparent;background:none;color:#788071}
  .mobile-tabs button[aria-selected=true]{border-bottom-color:var(--pine);color:var(--pine)}
  .mobile-trade-picker{display:flex;align-items:center;gap:10px;padding:12px 18px;background:#eef1e7;border-bottom:1px solid #d7dece}
  .mobile-trade-picker label{font-size:13px;font-weight:650;white-space:nowrap;color:#55634b}
  .mobile-trade-picker select{flex:1;width:0;font-size:16px;font-weight:650;padding-right:8px;background:#fff;min-height:46px}
  .mobile-trade-picker button{font-size:14px;font-weight:600;min-height:46px;min-width:54px;border:1px solid #cbd1c3;border-radius:7px;background:#f9faf5;color:var(--pine)}
  body[data-mobile-view=edit] .preview-pane,body[data-mobile-view=preview] .editor{display:none}
  .editor{padding:23px 20px 28px}.intro{margin-bottom:18px}.intro .eyebrow{display:none}.intro h1{font-size:25px;margin-bottom:8px}.intro>p:last-child{font-size:14px}
  .trade-section{display:none}.edit-section{margin-top:20px;padding-top:20px}.section-heading{margin-bottom:14px;gap:8px}
  .section-heading h2{font-size:17px;flex-wrap:wrap;gap:6px}.section-heading h2>span:first-child{display:none}.section-heading h2 .plain{font-size:17px}
  .text-button{min-height:44px;padding:10px 3px;font-size:13px}.label-row .text-button{padding:10px 3px}.section-heading .text-button{margin:-10px 0}
  .field{margin-top:18px}.field label,dialog label{font-size:15px;margin-bottom:8px}input,textarea{font-size:16px!important;padding:13px 12px;border-radius:8px}input{min-height:50px}
  input[type=date]{display:block;max-width:100%;min-width:0;-webkit-appearance:none;appearance:none}
  input[type=date]::-webkit-date-and-time-value{text-align:left}
  .field-pair{grid-template-columns:minmax(0,.9fr) minmax(0,1.1fr);gap:10px}
  textarea#notes{min-height:250px;line-height:1.8}.field-help{font-size:13px;line-height:1.65}.storage-help{font-size:13px}
  .preview-pane{border:0;padding:22px 14px 28px;min-height:calc(100dvh - 280px)}
  .preview-toolbar{margin-bottom:20px}.preview-toolbar .eyebrow{display:none}.preview-toolbar h2{font-size:20px}.preview-toolbar .print-actions{display:none}
  .paper-meta>span:last-child{display:none}.print-help{font-size:12px;margin-top:18px}
  .mobile-dock{display:grid;grid-template-columns:minmax(0,.8fr) minmax(0,1.2fr);gap:10px;position:fixed;z-index:6;left:0;right:0;bottom:0;padding:12px 18px calc(12px + env(safe-area-inset-bottom));background:#f8f8f2f5;border-top:1px solid var(--line);backdrop-filter:blur(10px)}
  .mobile-dock .button{font-size:16px;min-height:50px;padding:12px 10px}
  .file-actions{margin-top:26px}.file-actions .button{font-size:14px;min-height:50px;padding:12px 8px}
  .save-dialog{border-radius:16px;width:calc(100% - 24px);max-height:calc(100dvh - 28px);padding:20px}
  .save-dialog .button{font-size:15px;min-height:50px}.save-dialog .field-help{font-size:13px}
  .toast{bottom:calc(91px + env(safe-area-inset-bottom));width:calc(100% - 36px);max-width:440px;font-size:14px;text-align:center}
  dialog input{font-size:16px}input,textarea,select{scroll-margin-top:145px;scroll-margin-bottom:110px}
}
@media screen and (max-width:350px){.field-pair{grid-template-columns:1fr}.topbar-label{font-size:11px}.brand span{font-size:23px}.mobile-trade-picker{gap:7px;padding-left:14px;padding-right:14px}}
@media print{body{padding-bottom:0!important}.mobile-navigation,.mobile-dock,.export-host{display:none!important}}
.save-dialog-heading{position:sticky;top:0;z-index:2;background:white;padding:10px 0;margin-top:-10px}
