/* 번개 저장소. Ink sidebar and paper work area stay quiet; the one loud thing is 번개, a pixel poodle, with lightning yellow as its mark. */
:root {
  --ink: #141722; --ink-2: #1d2130; --ink-line: #2b3044; --on-ink: #eef0f6; --on-ink-muted: #8f97ad;
  --bg: #f3f4f7; --surface: #ffffff; --line: #e2e5ec; --line-strong: #cfd4de;
  --text: #161a25; --muted: #667085;
  --accent: #d1186b; --accent-hover: #b3125a; --accent-soft: #fce8f1; --on-accent: #ffffff;
  --c: #1aa3d9; --m: #d1186b; --y: #f2c200; --k: #0c0e14;
  --ok: #107a48; --ok-soft: #e3f4ea; --warn: #a45a05; --warn-soft: #fdf0d9; --off: #667085; --off-soft: #eceef2; --danger: #c22a2a;
  --radius: 10px; --shadow: 0 1px 2px rgba(16, 20, 34, .06);
  --bolt: #f2c200; --lcd: #d3dcc2; --lcd-ink: #46553d; --bezel: #141722;
  --s1: #2a78d6; --s2: #eb6834; --s3: #1baf7a; --s4: #eda100; --s-other: #9aa1b0;
}
@media (prefers-color-scheme: dark) {
  :root {
    --ink: #0b0d13; --ink-2: #141722; --ink-line: #232838;
    --bg: #10131a; --surface: #171b25; --line: #262b39; --line-strong: #343a4c;
    --text: #e8ebf2; --muted: #98a0b3;
    --accent: #f0498f; --accent-hover: #f56aa4; --accent-soft: #3a1528; --on-accent: #1a0710;
    --ok: #55c98b; --ok-soft: #12301f; --warn: #f0b157; --warn-soft: #36270d; --off: #98a0b3; --off-soft: #222735; --danger: #ff7b72;
    --shadow: none;
    --lcd: #232b20; --lcd-ink: #a9bb98; --bezel: #05060a;
    --s1: #3987e5; --s2: #d95926; --s3: #199e70; --s4: #c98500; --s-other: #6f7687;
  }
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.5 "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic", "Segoe UI", system-ui, sans-serif; -webkit-font-smoothing: antialiased; }
.hidden { display: none !important; }
.vh { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; pointer-events: none; }
label.btn { margin: 0; font-size: inherit; }
label.btn.primary { color: var(--on-accent); }
.grow { flex: 1; min-width: 0; }
.muted { color: var(--muted); }
h1, h2 { margin: 0; letter-spacing: -.015em; }
h1 { font-size: 22px; font-weight: 700; } h2 { font-size: 16px; font-weight: 650; }
svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; flex: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* brand mark and pixel sprites */
.brand { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 17px; letter-spacing: -.01em; color: var(--on-ink); }
.brand .bolt { width: 20px; height: 20px; fill: var(--bolt); stroke: var(--bolt); stroke-width: 1; }
.px { image-rendering: pixelated; display: block; }
.px2 { width: 50px; height: 36px; } .px3 { width: 75px; height: 54px; } .px4 { width: 100px; height: 72px; }

/* buttons and inputs */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 36px; padding: 0 14px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface); color: var(--text); font: inherit; font-weight: 550; cursor: pointer; white-space: nowrap; }
.btn:hover { border-color: var(--muted); }
.btn:disabled { opacity: .45; cursor: default; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn.danger { color: var(--danger); }
.btn.block { width: 100%; height: 42px; margin-top: 20px; }
.btn.icon { width: 36px; padding: 0; }
.btn.small { height: 30px; padding: 0 10px; font-size: 13px; }
.link { background: none; border: 0; padding: 0; color: var(--on-ink-muted); font: inherit; font-size: 13px; cursor: pointer; }
.link:hover { color: var(--on-ink); text-decoration: underline; }
label { display: block; margin-top: 14px; font-size: 13px; font-weight: 550; color: var(--muted); }
input[type=text], input[type=password], input[type=search], textarea, select { width: 100%; height: 40px; padding: 0 12px; margin-top: 6px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface); color: var(--text); font: inherit; }
textarea { height: auto; padding: 10px 12px; resize: vertical; }
input:focus, textarea:focus, select:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: var(--accent); }
.err { color: var(--danger); min-height: 1.3em; margin: 10px 0 0; font-size: 13px; }
.hint { color: var(--muted); font-size: 13px; margin: 10px 0 0; }
.actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 16px; }
.notice { margin: 14px 0 0; padding: 12px 14px; border-radius: 8px; background: var(--accent-soft); border: 1px solid var(--accent); word-break: break-all; font-size: 13px; }

/* sign-in */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); }
.auth-brand { background: var(--ink); color: var(--on-ink); display: flex; flex-direction: column; justify-content: space-between; padding: 40px 48px 0; }
.auth-copy h1 { font-size: clamp(26px, 3.2vw, 40px); line-height: 1.25; font-weight: 700; }
.auth-copy ul { margin: 28px 0 0; padding: 0; list-style: none; color: var(--on-ink-muted); font-size: 15px; }
.auth-copy li { padding: 10px 0; border-top: 1px solid var(--ink-line); }
.yard { margin: 40px -48px 0; height: 78px; border-bottom: 6px solid var(--bolt); overflow: hidden; display: flex; align-items: flex-end; }
.auth-form { display: flex; align-items: center; justify-content: center; padding: 32px 24px; background: var(--surface); }
.auth-form form { width: 100%; max-width: 340px; }
.auth-form h2 { font-size: 22px; }
.center { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 16px; }
.narrow { width: 100%; max-width: 400px; }

/* app shell */
.app { display: grid; grid-template-columns: 232px minmax(0, 1fr); min-height: 100vh; }
.side { background: var(--ink); color: var(--on-ink); display: flex; flex-direction: column; padding: 20px 12px 16px; position: sticky; top: 0; height: 100vh; }
.side .brand { padding: 4px 10px 20px; }
nav { display: flex; flex-direction: column; gap: 2px; }
.nav { display: flex; align-items: center; gap: 10px; height: 38px; padding: 0 10px; border: 0; border-radius: 8px; background: none; color: var(--on-ink-muted); font: inherit; font-weight: 550; cursor: pointer; text-align: left; }
.nav:hover { color: var(--on-ink); background: var(--ink-2); }
.nav.on { color: var(--on-ink); background: var(--ink-2); box-shadow: inset 3px 0 0 var(--bolt); }
.nav span { flex: 1; }
.nav em { font-style: normal; font-size: 12px; font-variant-numeric: tabular-nums; color: var(--on-ink-muted); }
.side-foot { margin-top: auto; padding: 0 10px; }
.usage { display: flex; flex-direction: column; padding: 14px 0; border-top: 1px solid var(--ink-line); border-bottom: 1px solid var(--ink-line); }
.usage b { font-size: 20px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.muted-on-dark { color: var(--on-ink-muted); font-size: 12px; }
.me { display: flex; align-items: center; gap: 10px; padding-top: 14px; }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--m); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 13px; text-transform: uppercase; flex: none; }
.who { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 550; }
.me-actions { display: flex; gap: 14px; padding: 8px 0 0 40px; }

.content { padding: 24px 32px 96px; min-width: 0; }
.topbar { display: flex; align-items: center; gap: 10px; margin-bottom: 20px; }
.topbar input[type=search] { width: 240px; margin: 0; height: 36px; }

/* figures row */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); display: flex; flex-direction: column; min-width: 0; }
.kpi-label { color: var(--muted); font-size: 13px; font-weight: 550; }
.kpi b { font-size: 28px; line-height: 1.25; font-weight: 700; letter-spacing: -.025em; font-variant-numeric: tabular-nums; margin-top: 4px; }
.kpi-sub { color: var(--muted); font-size: 12px; min-height: 18px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* overview */
.home-top { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 16px; margin-bottom: 16px; align-items: stretch; }
.home-top .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 0; }
.home-top .panel { margin: 0; }
.home-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 16px; }
.home-grid .panel { margin: 0; min-width: 0; }
.panel h2 + .muted:empty { display: none; }
.pet { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; align-items: center; }
.lcd { background: var(--bezel); border-radius: 18px; padding: 12px; }
.lcd canvas { display: block; width: 100%; height: auto; image-rendering: pixelated; background: var(--lcd); border-radius: 8px; box-shadow: inset 0 2px 6px rgba(0, 0, 0, .28); }
.pet-name { display: flex; align-items: center; gap: 8px; } .pet-name h2 { font-size: 20px; }
.lv { height: 22px; padding: 0 8px; border-radius: 6px; background: var(--bolt); color: #1c1700; font-size: 12px; font-weight: 700; display: inline-flex; align-items: center; font-variant-numeric: tabular-nums; }
.pet-line { margin: 6px 0 0; font-weight: 550; min-height: 3em; }
.pet-info progress { margin-top: 4px; } .pet-info progress::-webkit-progress-value { background: var(--bolt); } .pet-info progress::-moz-progress-bar { background: var(--bolt); }
.pet-info .hint { margin-top: 6px; font-size: 12px; } .pet-info .actions { margin-top: 12px; }
.pet-links { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 8px; }
.textlink { background: none; border: 0; padding: 0; color: var(--muted); font: inherit; font-size: 12px; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.textlink:hover { color: var(--text); }

/* charts: thin marks, text in text colours, colour only on the mark */
.chart { position: relative; margin-top: 8px; }
.chart svg { width: 100%; height: auto; display: block; stroke: none; }
.chart .gridline { stroke: var(--line); stroke-width: 1; } .chart .axis { fill: var(--muted); stroke: none; font-size: 12px; font-variant-numeric: tabular-nums; }
.chart .line { fill: none; stroke: var(--s1); stroke-width: 2; stroke-linejoin: round; } .chart .area { fill: var(--s1); opacity: .12; }
.chart .cross { stroke: var(--line-strong); stroke-width: 1; } .chart .dot { fill: var(--s1); stroke: var(--surface); stroke-width: 2; } .chart .hit { fill: transparent; }
.tip { position: absolute; transform: translate(-50%, -100%); background: var(--ink); color: var(--on-ink); border-radius: 8px; padding: 6px 10px; font-size: 12px; white-space: pre; pointer-events: none; font-variant-numeric: tabular-nums; z-index: 2; }
.stack { display: flex; gap: 2px; height: 18px; margin-top: 12px; } .stack i { display: block; min-width: 3px; border-radius: 4px; flex-basis: 0; }
.k-indesign { background: var(--s1); } .k-image { background: var(--s2); } .k-pdf { background: var(--s3); } .k-font { background: var(--s4); } .k-other { background: var(--s-other); }
.legend { margin-top: 10px; } .legend th, .legend td { padding: 7px 0 7px 12px; font-size: 13px; background: none; } .legend th:first-child, .legend td:first-child { padding-left: 0; }
.sw { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 8px; }
.ranks { margin-top: 6px; }
.rank { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; width: 100%; padding: 9px 0; border: 0; border-top: 1px solid var(--line); background: none; color: inherit; font: inherit; text-align: left; }
.rank:first-child { border-top: 0; } button.rank { cursor: pointer; } button.rank:hover .rank-label { text-decoration: underline; }
.rank-label { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .rank-val { font-variant-numeric: tabular-nums; font-weight: 600; }
.rank-bar { grid-column: 1 / -1; height: 6px; border-radius: 3px; background: var(--off-soft); overflow: hidden; } .rank-bar i { display: block; height: 100%; border-radius: 3px; background: var(--s1); }
.rank-sub { grid-column: 1 / -1; font-size: 12px; color: var(--muted); }

/* 번개 on the loose: sits above the page, under the transfer dock, and only the dog itself takes clicks */
.pet-layer { position: fixed; left: 232px; right: 0; bottom: 0; height: 40px; z-index: 30; pointer-events: none; }
.pet-dog { position: absolute; left: 4px; bottom: 2px; padding: 0; border: 0; background: none; cursor: pointer; pointer-events: auto; line-height: 0; border-radius: 8px; }
.pet-bubble { position: absolute; left: 4px; bottom: 46px; max-width: 220px; padding: 7px 11px; border-radius: 12px 12px 12px 3px; background: var(--ink); color: var(--on-ink); font-size: 13px; font-weight: 550; box-shadow: 0 6px 18px rgba(8, 10, 18, .25); }
.runway { height: 36px; margin-top: 8px; position: relative; } .runway + progress { margin-top: 0; }
.runway canvas { position: absolute; left: 0; bottom: -2px; }
.jobs { margin-top: 12px; max-height: 172px; overflow-y: auto; display: grid; gap: 9px; }
.job { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; font-size: 13px; }
.job-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .job-note { font-variant-numeric: tabular-nums; opacity: .78; }
.job progress { grid-column: 1 / -1; height: 4px; margin-top: 0; } .job[data-state="wait"] { opacity: .6; }
.job[data-state="ok"] progress::-webkit-progress-value { background: var(--s3); } .job[data-state="ok"] progress::-moz-progress-bar { background: var(--s3); }
.job[data-state="bad"] .job-note { opacity: 1; font-weight: 600; }
.jobs { margin-top: 12px; max-height: 172px; overflow-y: auto; display: grid; gap: 9px; }
.job { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; font-size: 13px; }
.job-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .job-note { font-variant-numeric: tabular-nums; opacity: .78; }
.job progress { grid-column: 1 / -1; height: 4px; margin-top: 0; } .job[data-state="wait"] { opacity: .6; }
.job[data-state="ok"] progress::-webkit-progress-value { background: var(--s3); } .job[data-state="ok"] progress::-moz-progress-bar { background: var(--s3); }
.job[data-state="bad"] .job-note { opacity: 1; font-weight: 600; }

/* panels and tables */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin-bottom: 16px; box-shadow: var(--shadow); }
.panel.flush { padding: 0; overflow: hidden; }
.panel.accent { border-color: var(--accent); }
.panel h2 + .muted { margin: 4px 0 12px; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 11px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: 12px; font-weight: 600; color: var(--muted); white-space: nowrap; background: var(--bg); }
tbody tr:last-child td { border-bottom: 0; }
td { overflow-wrap: anywhere; }
.name { word-break: keep-all; }
.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.grid tbody tr.click { cursor: pointer; }
.grid tbody tr.click:hover { background: var(--bg); }
.name b { font-weight: 600; } .name small { display: block; color: var(--muted); font-size: 12px; }
.col-bar { width: 120px; } .bar { height: 6px; border-radius: 3px; background: var(--off-soft); overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: 3px; background: var(--c); }
.col-who, .col-date { white-space: nowrap; color: var(--muted); }
.badge { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.ok { color: var(--ok); background: var(--ok-soft); } .badge.warn { color: var(--warn); background: var(--warn-soft); } .badge.off { color: var(--off); background: var(--off-soft); }
.empty { padding: 56px 16px; text-align: center; }
.empty canvas { margin: 0 auto 6px; }
.empty p { margin: 6px 0 0; } #emptyTitle { font-weight: 600; font-size: 15px; }
.drophint { text-align: center; font-size: 13px; margin: 4px 0 0; }
.inline-form { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.inline-form input, .inline-form select { margin: 0; height: 36px; width: auto; }
.inline-form input { min-width: 220px; }

/* whole-window drop target */
.overlay { position: fixed; inset: 0; z-index: 50; background: rgba(20, 23, 34, .82); display: grid; place-items: center; color: #fff; pointer-events: none; }
.overlay div { border: 2px dashed var(--m); border-radius: 16px; padding: 40px 64px; text-align: center; font-size: 18px; font-weight: 650; }
.overlay canvas { margin: 0 auto; }
.overlay p { margin: 8px 0 0; }

/* transfer dock */
.dock { position: fixed; right: 24px; bottom: 24px; z-index: 40; width: min(420px, calc(100vw - 32px)); background: var(--ink); color: var(--on-ink); border-radius: 12px; padding: 16px 18px; box-shadow: 0 12px 32px rgba(8, 10, 18, .35); }
.dock h2 { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dock-text { margin: 8px 0 0; font-size: 13px; color: var(--on-ink-muted); white-space: pre-line; font-variant-numeric: tabular-nums; }
.dock .err { color: #ff9a92; min-height: 0; }
.dock .btn:not(.primary) { background: var(--ink-2); border-color: var(--ink-line); color: var(--on-ink); }
.dock .actions { margin-top: 12px; }
progress { appearance: none; -webkit-appearance: none; width: 100%; height: 6px; border: 0; border-radius: 3px; background: var(--off-soft); overflow: hidden; margin-top: 12px; display: block; }
progress::-webkit-progress-bar { background: var(--off-soft); border-radius: 3px; }
progress::-webkit-progress-value { background: var(--m); border-radius: 3px; }
progress::-moz-progress-bar { background: var(--m); border-radius: 3px; }
.dock progress, .dock progress::-webkit-progress-bar { background: var(--ink-line); }

/* package drawer */
dialog.drawer { margin: 0 0 0 auto; width: min(640px, 100vw); height: 100vh; max-height: 100vh; border: 0; border-left: 1px solid var(--line); border-radius: 0; background: var(--surface); color: var(--text); padding: 24px 24px 0; }
dialog.drawer[open] { display: flex; flex-direction: column; }
dialog::backdrop { background: rgba(12, 14, 20, .5); }
.drawer-head { display: flex; gap: 12px; align-items: flex-start; }
.drawer-head h2 { font-size: 19px; word-break: break-all; margin-bottom: 6px; }
.meta { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; margin: 18px 0 0; background: var(--line); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.meta div { background: var(--surface); padding: 10px 12px; min-width: 0; }
.meta div:nth-child(5):last-child { grid-column: span 2; }
.meta dt { font-size: 12px; color: var(--muted); } .meta dd { margin: 2px 0 0; font-weight: 600; font-variant-numeric: tabular-nums; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.scroll { flex: 1; min-height: 120px; overflow: auto; margin: 14px -24px 0; border-top: 1px solid var(--line); }
.scroll th { position: sticky; top: 0; }
.scroll th, .scroll td { padding: 8px 24px; font-size: 13px; }

@media (prefers-reduced-motion: no-preference) {
  .trot { animation: trot 14s linear infinite; }
  @keyframes trot { from { transform: translateX(-80px); } to { transform: translateX(min(60vw, 900px)); } }
  .pet-bubble { animation: pop .16s ease-out; }
  @keyframes pop { from { transform-origin: 20px 100%; scale: .7; opacity: 0; } to { scale: 1; opacity: 1; } }
  dialog.drawer[open] { animation: slide .18s ease-out; }
  @keyframes slide { from { transform: translateX(24px); opacity: .6; } to { transform: none; opacity: 1; } }
}
@media (max-width: 980px) {
  .home-top, .home-grid { grid-template-columns: 1fr; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .col-bar, .col-who { display: none; }
}
@media (max-width: 760px) {
  .pet { grid-template-columns: 1fr; }
  .auth { grid-template-columns: 1fr; } .auth-brand { padding: 24px 24px 0; } .auth-copy { margin-top: 32px; } .yard { margin: 24px -24px 0; }
  .app { grid-template-columns: 1fr; }
  .side { position: static; height: auto; padding: 12px 16px; }
  .side .brand { padding: 0 0 10px; } nav { flex-direction: row; overflow-x: auto; } .nav { flex: none; } .nav.on { box-shadow: inset 0 -3px 0 var(--bolt); }
  .side-foot { margin-top: 10px; padding: 0; } .usage { display: none; } .pet-layer { display: none; } .me { padding-top: 0; } .me-actions { padding-left: 40px; }
  .content { padding: 16px 16px 96px; }
  .topbar { flex-wrap: wrap; } .topbar input[type=search] { width: 100%; order: 3; }
  .col-date { display: none; } th, td { padding: 10px 12px; }
  .meta { grid-template-columns: repeat(2, minmax(0, 1fr)); } .meta div:nth-child(5):last-child { grid-column: span 2; }
  .dock { right: 16px; bottom: 16px; }
}
