:root { --slate:#26303a; --slate-2:#34404c; --ink:#1d2329; --muted:#66707a; --line:#e3e6ea; --bg:#f3f4f6; --card:#fff;
        --rust:#a9582f; --rust-soft:#f7e6db; --ok:#2f7d4f; --ok-soft:#e5f3ea; --warn:#9a6200; --warn-soft:#fff4dc; --warn-line:#f0d08a;
        --info:#35607f; --info-soft:#e8f0f6; --stop:#a4302a; --stop-soft:#fbe6e4; }
* { box-sizing:border-box; }
html, body { margin:0; background:var(--bg); color:var(--ink); font:14px/1.45 Inter, system-ui, sans-serif; }
.app-bar { height:52px; background:var(--slate); color:#fff; display:flex; align-items:center; justify-content:space-between; padding:0 18px; }
.app-brand { display:flex; align-items:center; gap:10px; }
.app-brand .mark { width:28px; height:22px; }
.app-name { font-weight:600; font-size:16px; letter-spacing:.01em; }
.pill { font-size:11px; font-weight:600; background:rgba(255,255,255,.14); padding:3px 8px; border-radius:20px; letter-spacing:.03em; }
.app-user { font-size:12.5px; color:#c9d0d7; }
.app { display:grid; grid-template-columns:290px 1fr; min-height:calc(100vh - 52px - 38px - 40px); }
.inbox { background:var(--card); border-right:1px solid var(--line); }
.inbox-head, .pane-head { font-size:12px; font-weight:600; text-transform:uppercase; letter-spacing:.06em; color:var(--muted); padding:14px 16px 10px; }
#inbox-count { background:var(--rust); color:#fff; border-radius:10px; padding:1px 7px; margin-left:6px; font-size:11px; }
#inbox-list { list-style:none; margin:0; padding:0; }
.msg { padding:12px 16px; border-bottom:1px solid var(--line); cursor:pointer; border-left:3px solid transparent; }
.msg:hover { background:#fafbfc; }
.msg.active { background:#f6f1ec; border-left-color:var(--rust); }
.msg .from { font-weight:600; display:flex; justify-content:space-between; gap:8px; }
.msg .time { font-weight:400; color:var(--muted); font-size:12px; white-space:nowrap; }
.msg .subj { font-size:13px; }
.msg .snip { font-size:12.5px; color:var(--muted); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.msg .status { display:inline-block; margin-top:6px; font-size:11px; font-weight:600; padding:2px 8px; border-radius:10px; background:#eef0f2; color:var(--muted); }
.msg .status.ready { background:var(--warn-soft); color:var(--warn); }
.msg .status.done { background:var(--ok-soft); color:var(--ok); }
.work { display:grid; grid-template-columns:minmax(0, 0.9fr) minmax(0, 1.25fr); gap:16px; padding:16px; align-items:start; }
.source, .draft { background:var(--card); border:1px solid var(--line); border-radius:10px; min-width:0; }
.email { padding:0 18px 18px; }
.email .meta { font-size:13px; color:var(--muted); border-bottom:1px solid var(--line); padding-bottom:10px; margin-bottom:12px; }
.email .meta b { color:var(--ink); font-weight:600; }
.email .body { white-space:pre-wrap; font-size:14px; }
.attach { margin-top:14px; border:1px solid var(--line); border-radius:8px; overflow:hidden; }
.attach-name { font-size:12.5px; padding:8px 10px; background:#fafbfc; border-bottom:1px solid var(--line); color:var(--muted); }
.attach img { display:block; width:100%; height:auto; }
#draft { padding:0 18px 18px; }
.empty { text-align:center; padding:48px 12px; color:var(--muted); }
.btn { font:inherit; font-weight:600; border:0; border-radius:8px; padding:11px 20px; cursor:pointer; }
.btn-primary { background:var(--slate); color:#fff; } .btn-primary:hover { background:var(--slate-2); }
.btn-approve { background:var(--ok); color:#fff; } .btn-approve:disabled { background:#b9c2bc; cursor:not-allowed; }
.steps { list-style:none; padding:24px 6px; margin:0; }
.steps li { display:flex; align-items:center; gap:10px; padding:7px 0; color:var(--muted); }
.steps li.on { color:var(--ink); } .steps li.done { color:var(--ink); }
.dot { width:18px; height:18px; border-radius:50%; border:2px solid #cfd5da; flex:none; display:grid; place-items:center; font-size:11px; }
.steps li.on .dot { border-color:var(--rust); border-top-color:transparent; animation:spin .8s linear infinite; }
.steps li.done .dot { border-color:var(--ok); background:var(--ok); color:#fff; }
@keyframes spin { to { transform:rotate(360deg); } }
.hdr { display:grid; grid-template-columns:repeat(3, minmax(0,1fr)); gap:10px 16px; padding:4px 0 12px; border-bottom:1px solid var(--line); }
.f .k { font-size:11px; text-transform:uppercase; letter-spacing:.05em; color:var(--muted); }
.f .v { font-weight:600; font-size:13.5px; }
.f .v small { display:block; font-weight:400; color:var(--muted); font-size:12px; }
.f.wide { grid-column:span 3; }
.note { margin:10px 0 0; padding:8px 10px; border-radius:7px; font-size:13px; }
.note.info { background:var(--info-soft); color:var(--info); }
.note.cust { background:#f4f5f7; color:var(--ink); }
.done-time { font-size:12.5px; color:var(--muted); margin:10px 0 0; }
.lines { width:100%; border-collapse:collapse; margin-top:12px; font-size:13px; }
.lines th { text-align:left; font-size:11px; text-transform:uppercase; letter-spacing:.05em; color:var(--muted); font-weight:600; padding:6px 6px; border-bottom:1px solid var(--line); }
.lines td { padding:8px 6px; border-bottom:1px solid var(--line); vertical-align:top; }
.lines .r { text-align:right; white-space:nowrap; }
.lines .sku { font-weight:600; font-size:12.5px; }
.lines .desc { color:var(--muted); font-size:12px; }
.lines .wrote { font-size:12px; color:var(--muted); font-style:italic; margin-top:3px; }
.lines tr.flagged td { background:var(--warn-soft); }
.lines tr.flagged.checked td { background:#fbf8ef; }
.badge { display:inline-block; font-size:10.5px; font-weight:600; padding:1px 6px; border-radius:8px; background:#eef0f2; color:var(--muted); margin-top:4px; }
.ok-mark { color:var(--ok); font-weight:700; }
.flag { margin-top:6px; font-size:12.5px; display:flex; gap:8px; align-items:flex-start; }
.flag.warn { color:var(--warn); } .flag.info { color:var(--info); } .flag.stop { color:var(--stop); }
.flag label { display:flex; gap:6px; align-items:center; font-weight:600; color:var(--ink); white-space:nowrap; cursor:pointer; }
.foot { display:flex; justify-content:space-between; align-items:center; gap:12px; margin-top:14px; flex-wrap:wrap; }
.total { font-size:15px; } .total b { font-size:18px; }
.left { font-size:12.5px; color:var(--warn); }
.toast { margin-top:14px; background:var(--ok-soft); color:var(--ok); border-radius:8px; padding:12px 14px; font-weight:600; }
.app-foot { font-size:12px; color:var(--muted); padding:10px 18px; border-top:1px solid var(--line); background:var(--card); }
@media (max-width: 1100px) { .work { grid-template-columns:1fr; } }
@media (max-width: 760px) {
  .app { grid-template-columns:1fr; } .inbox { border-right:0; border-bottom:1px solid var(--line); }
  .app-user { display:none; } .work { padding:12px; } .hdr { grid-template-columns:1fr 1fr; } .f.wide { grid-column:span 2; }
  .draft { overflow-x:auto; } .lines { min-width:560px; }
}
.clip { width:14px; height:14px; vertical-align:-2px; color:var(--muted); }
.zoom-hint { float:right; font-size:11.5px; }
.attach img { cursor:zoom-in; }
.lightbox { position:fixed; inset:0; background:rgba(20,24,28,.78); display:grid; place-items:center; z-index:10; cursor:zoom-out; padding:24px; }
.lightbox img { max-width:min(900px, 100%); max-height:100%; width:auto; height:auto; background:#fff; box-shadow:0 10px 40px rgba(0,0,0,.4); border-radius:4px; }
.site-strip { min-height:40px; background:#f4efe6; border-bottom:1px solid #e2d9ca; display:flex; align-items:center; justify-content:space-between; gap:12px; padding:6px 18px; font-size:13px; }
.site-strip a { color:var(--ink); }
.strip-note a { font-weight:600; }
.strip-actions { display:flex; align-items:center; gap:16px; white-space:nowrap; }
.strip-back { color:var(--muted) !important; }
.strip-book { background:var(--rust); color:#fff !important; font-weight:600; text-decoration:none; padding:6px 12px; border-radius:6px; }
.strip-book:hover { background:#8f4524; }
.next { margin-top:14px; background:#f6f1ec; border:1px solid #ead9cb; border-radius:10px; padding:16px 18px; display:flex; align-items:center; gap:16px; }
.next p { margin:0; font-size:14.5px; }
.next .btn { text-decoration:none; white-space:nowrap; }
@media (max-width: 760px) {
  .strip-note { display:none; } .site-strip { justify-content:flex-end; padding:6px 12px; }
  .next { flex-direction:column; align-items:stretch; text-align:left; } .next .btn { text-align:center; }
}
