/* Fab Box Web – Fab CC Design System */
@font-face { font-family: "Pretendard"; src: url("fonts/Pretendard-Regular.otf"); font-weight: 400; }
@font-face { font-family: "Pretendard"; src: url("fonts/Pretendard-Medium.otf"); font-weight: 500; }
@font-face { font-family: "Pretendard"; src: url("fonts/Pretendard-SemiBold.otf"); font-weight: 600; }
@font-face { font-family: "Pretendard"; src: url("fonts/Pretendard-Bold.otf"); font-weight: 700; }

:root {
  --blue: #0057FF; --blue-700: #0038A6; --blue-600: #0047D1; --blue-300: #7AA1FF; --blue-100: #D6E2FF; --blue-50: #EEF3FF;
  --ink-900: #0B0B0F; --ink-800: #16161C; --ink-700: #23232B; --ink-600: #3A3A45; --ink-500: #5C5C69; --ink-400: #8A8A97;
  --ink-300: #B9B9C4; --ink-200: #DADAE1; --ink-100: #ECECF0; --ink-50: #F4F4F7; --ink-25: #F9F9FB;
  --success: #00A25B; --warning: #FFB000; --danger: #E5342A;
  --paper: #FFFFFF; --surface: #FFFFFF; --surface-muted: #F4F4F7; --text: #0B0B0F; --text-2: #5C5C69; --text-3: #8A8A97;
  --border: #DADAE1; --hover: #ECECF0; --link: #0057FF; --blue-fill: #EEF3FF; --success-fill: #E6F6EE; --warning-fill: #FFF4D6; --danger-fill: #FCE7E5;
  --radius: 4px;
}
@media (prefers-color-scheme: dark) {
  :root { --paper: #0B0B0F; --surface: #16161C; --surface-muted: #1C1C24; --text: #F4F4F7; --text-2: #B9B9C4; --text-3: #8A8A97;
    --border: #2E2E38; --hover: #23232B; --link: #7AA1FF; --blue-fill: #0F1E44; --success-fill: #0F2A1D; --warning-fill: #332600; --danger-fill: #3A1210; }
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--paper); color: var(--text); font: 14px/1.45 "Pretendard", -apple-system, "Segoe UI", sans-serif; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--link); }
h1 { font-size: 26px; font-weight: 700; letter-spacing: -0.02em; margin: 0; }
h2 { font-size: 20px; font-weight: 700; letter-spacing: -0.02em; margin: 0; }
h3 { font-size: 16px; font-weight: 700; margin: 0; }
.eyebrow { font-size: 11px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-2); }
.eyebrow.blue { color: var(--link); }
.muted { color: var(--text-2); } .tiny { font-size: 11px; } .small { font-size: 12px; } .num { font-variant-numeric: tabular-nums; }
.code { font-weight: 500; letter-spacing: 0.03em; }
.row { display: flex; align-items: center; gap: 10px; } .col { display: flex; flex-direction: column; gap: 8px; }
.grow { flex: 1; } .right { margin-left: auto; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; }
.card.muted { background: var(--surface-muted); border-color: transparent; }
.section { display: flex; flex-direction: column; gap: 10px; }
.section .eyebrow { margin-bottom: 2px; }
.section .foot { font-size: 12px; color: var(--text-2); }

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: 6px; border: 0; border-radius: 999px; padding: 8px 16px; font-weight: 600; cursor: pointer; white-space: nowrap; background: transparent; color: var(--text); transition: background .12s; }
.btn:hover { background: var(--hover); }
.btn.primary { background: var(--blue); color: #fff; } .btn.primary:hover { background: var(--blue-600); } .btn.primary:active { background: var(--blue-700); }
.btn.secondary { box-shadow: inset 0 0 0 1.5px var(--text); } .btn.secondary:hover { background: var(--hover); }
.btn.white { background: #fff; color: var(--blue); } .btn.outline-white { color: #fff; box-shadow: inset 0 0 0 1.5px #fff; } .btn.outline-white:hover { background: rgba(255,255,255,.16); }
.btn.icon { width: 28px; height: 28px; padding: 0; justify-content: center; border-radius: 50%; box-shadow: inset 0 0 0 1px var(--border); }
.btn:disabled { opacity: .4; cursor: default; }
.btn.lg { padding: 12px 22px; font-size: 16px; }

/* Segmented */
.seg { display: inline-flex; background: var(--surface-muted); border-radius: 999px; padding: 3px; gap: 2px; }
.seg button { border: 0; background: transparent; border-radius: 999px; padding: 6px 14px; font-weight: 600; color: var(--text-2); cursor: pointer; }
.seg button.on { background: var(--blue); color: #fff; }
.seg.lg button { padding: 11px 26px; font-size: 16px; }

/* Tags */
.tag { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 999px; background: var(--hover); color: var(--text); white-space: nowrap; }
.tag.blue { background: var(--blue-fill); color: var(--link); } .tag.success { background: var(--success-fill); color: var(--success); }
.tag.warning { background: var(--warning-fill); color: #7A5200; } .tag.danger { background: var(--danger-fill); color: var(--danger); }

/* Fields */
.field { display: flex; align-items: center; gap: 12px; }
.field > label { width: 200px; flex: none; }
.field input, .field select, .field textarea, input.box, select.box { flex: 1; min-width: 0; padding: 8px 10px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface); outline: none; }
.field input:focus, input.box:focus, select.box:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(0,87,255,.18); }
.field .unit { color: var(--text-2); font-size: 12px; }
.stepper { display: inline-flex; align-items: center; gap: 8px; }
.stepper b { min-width: 60px; text-align: center; }
.toggle { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.toggle .sw { width: 40px; height: 22px; border-radius: 999px; background: var(--ink-300); position: relative; transition: background .12s; }
.toggle .sw::after { content: ""; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: left .12s; }
.toggle.on .sw { background: var(--blue); } .toggle.on .sw::after { left: 20px; }
.progress { height: 4px; background: var(--hover); border-radius: 2px; overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--blue); }

/* Layout */
#app { height: 100%; display: flex; }
.sidebar { width: 210px; flex: none; background: var(--surface-muted); display: flex; flex-direction: column; border-right: 1px solid var(--border); }
.sidebar .brand { padding: 16px; display: flex; flex-direction: column; gap: 8px; }
.sidebar nav { display: flex; flex-direction: column; padding: 4px 8px; gap: 2px; }
.sidebar nav a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 6px; color: var(--text); text-decoration: none; font-weight: 500; }
.sidebar nav a.on { background: var(--blue-fill); color: var(--link); }
.sidebar .foot { margin-top: auto; padding: 10px 12px; border-top: 1px solid var(--border); font-size: 12px; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; overflow: hidden; }
.main .body { flex: 1; overflow: auto; padding: 24px 28px; }
.banner { display: flex; align-items: center; gap: 12px; padding: 10px 20px; border-bottom: 1px solid var(--border); }
.banner.warn { background: var(--warning-fill); } .banner.blue { background: var(--blue-fill); }
.wordmark { display: inline-block; width: 5.04em; height: 1em; background: currentColor; -webkit-mask: url("logo.svg") no-repeat left center / contain; mask: url("logo.svg") no-repeat left center / contain; vertical-align: middle; }
.wordmark i { display: none; }

/* Blue full screens */
.blue-screen { position: fixed; inset: 0; background: var(--blue); color: #fff; overflow: auto; padding: 32px 48px; display: flex; flex-direction: column; }
.blue-screen .eyebrow { color: rgba(255,255,255,.75); }
.blue-screen h1.display { font-size: 48px; letter-spacing: -0.03em; color: #fff; }
.pill { display: inline-flex; align-items: center; gap: 8px; padding: 6px 16px 6px 6px; border-radius: 999px; color: #fff; box-shadow: inset 0 0 0 1.5px #fff; cursor: pointer; font-weight: 600; background: transparent; border: 0; }
.pill .av { width: 28px; height: 28px; border-radius: 50%; background: rgba(255,255,255,.2); display: inline-flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; }
.pill.on { background: #fff; color: var(--blue); box-shadow: none; } .pill.on .av { background: var(--blue); color: #fff; }
.mode-card { background: #fff; color: var(--ink-900); border-radius: 6px; padding: 32px; width: 460px; height: 280px; display: flex; flex-direction: column; gap: 16px; cursor: pointer; box-shadow: 0 6px 12px rgba(11,11,15,.12); transition: transform .18s, box-shadow .18s; border: 0; text-align: left; }
.mode-card:hover { transform: translateY(-3px); box-shadow: 0 12px 26px rgba(11,11,15,.28); }
.mode-card .ic { width: 60px; height: 60px; border-radius: 50%; background: var(--blue); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 26px; }
.mode-card h2 { font-size: 30px; letter-spacing: -0.02em; } .mode-card p { margin: 0; color: var(--ink-500); font-size: 15px; }
.mode-card .go { margin-top: auto; color: var(--blue); font-weight: 600; }

/* Scan */
.scan-wrap { max-width: 760px; margin: 0 auto; display: flex; flex-direction: column; gap: 22px; }
.scan-field { display: flex; align-items: center; gap: 14px; padding: 18px 22px; border-radius: 6px; background: var(--surface); border: 1px solid var(--border); }
.scan-field:focus-within { border-color: var(--blue); box-shadow: inset 0 0 0 1.5px var(--blue); }
.scan-field input { flex: 1; border: 0; outline: 0; background: transparent; font-size: 28px; font-weight: 500; }
.flash { display: flex; align-items: center; gap: 14px; padding: 16px 20px; border-radius: 6px; border: 1px solid; }
.flash.ok { background: var(--success-fill); border-color: var(--success); color: var(--success); }
.flash.bad { background: var(--danger-fill); border-color: var(--danger); color: var(--danger); }
.flash b { font-size: 24px; } .flash .d { color: var(--text); }
.bignum { font-size: 40px; font-weight: 700; line-height: 1; }

/* Rack */
.rack { display: flex; gap: 8px; align-items: flex-start; }
.rack .col { gap: 6px; }
.cell { width: 170px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface); padding: 8px; display: flex; flex-direction: column; gap: 2px; cursor: pointer; }
.cell.free { background: var(--surface-muted); border-style: dashed; color: var(--text-3); align-items: center; justify-content: center; }
.cell.small { height: 58px; } .cell.large { height: 92px; }
.cell.target { background: var(--blue); color: #fff; border-color: var(--blue); animation: pulse .75s ease-in-out infinite alternate; }
.cell.dim { opacity: .55; }
.cell.dragover { outline: 3px solid var(--blue); }
@keyframes pulse { from { transform: scale(1); box-shadow: 0 0 6px rgba(0,87,255,.15); } to { transform: scale(1.06); box-shadow: 0 0 22px rgba(0,87,255,.55); } }
.rowlabel { width: 44px; font-size: 12px; color: var(--text-2); display: flex; align-items: center; justify-content: center; }
.level { width: 290px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface-muted); padding: 8px; display: flex; flex-direction: column; gap: 6px; }
.level.target { background: var(--blue); color: #fff; animation: pulse .75s ease-in-out infinite alternate; }
.chip { display: inline-flex; flex-direction: column; min-width: 120px; padding: 6px; border-radius: 6px; background: var(--warning-fill); border: 1px solid rgba(255,176,0,.4); font-size: 12px; cursor: pointer; }
.chip.empty { background: var(--danger-fill); }

/* Overlay */
.overlay { position: fixed; inset: 0; background: rgba(11,11,15,.6); display: flex; align-items: center; justify-content: center; z-index: 50; padding: 24px; }
.overlay .box { background: var(--blue); color: #fff; border-radius: 8px; padding: 32px; display: flex; gap: 28px; max-width: 1400px; width: 100%; max-height: 100%; }
.overlay .box .rackpane { background: var(--paper); color: var(--text); border-radius: 6px; padding: 16px; flex: 1; overflow: auto; }
.guide { position: fixed; inset: 0; background: var(--paper); z-index: 40; display: flex; flex-direction: column; padding: 28px; gap: 16px; }
.guide .huge { font-size: 64px; font-weight: 700; letter-spacing: -0.03em; color: var(--link); line-height: 1; }
.guide .big { font-size: 40px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; }

/* Lists */
.list { display: flex; flex-direction: column; }
.list .item { display: flex; align-items: center; gap: 14px; padding: 10px 6px; border-bottom: 1px solid var(--border); }
table.tbl { width: 100%; border-collapse: collapse; }
table.tbl th { text-align: left; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--text-2); padding: 6px; border-bottom: 1px solid var(--text); }
table.tbl td { padding: 7px 6px; border-bottom: 1px solid var(--hover); }
.modal { position: fixed; inset: 0; background: rgba(11,11,15,.45); display: flex; align-items: center; justify-content: center; z-index: 60; }
.modal .win { background: var(--paper); border-radius: 8px; padding: 24px; width: 640px; max-height: 90vh; overflow: auto; display: flex; flex-direction: column; gap: 14px; }
.hidden { display: none !important; }
label.plain { display: flex; gap: 8px; align-items: center; }

/* Rundgang */
.tour { position: fixed; right: 24px; bottom: 24px; width: 520px; max-width: calc(100vw - 48px); background: var(--blue); color: #fff; border-radius: 8px; padding: 22px; display: flex; flex-direction: column; gap: 12px; box-shadow: 0 10px 24px rgba(11,11,15,.35); z-index: 70; }
.tour ul { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 6px; }
