/* GATEONE Cloud console. Colors and shapes from brand/tokens.json, in the same design language as the GATEONE screens:
   a dark menu on the left, a warm page, white cards. Under 900px the menu becomes a top bar with a drawer. */
:root {
  --bg: #F7F6F3; --panel: #FFFFFF; --line: #DEDBD4; --line2: #E7E5E0; --line3: #EEECE7; --sel: #E9E6DF; --cell: #F2F0EC;
  --btnline: #DEDBD4; --btnhover: #F2F0EC; --tx: #1C1C1A; --strong: #000000; --muted: #5E5C56; --faint: #8E8B84;
  --red: #B4233A; --redbg: #FBE3DD; --amber: #7F5300; --amberbg: #FBF0D6; --amberdot: #C98A1B; --green: #2C6C3C; --greenbg: #E2F0E4;
  --brand: #E2551F; --brandfill: #CC4714; --onbrand: #FFFFFF; --focus: #E2551F;
  --side: #1C1C1A; --side-tx: #E8E6E1; --side-muted: #C9C6BF; --side-faint: #8A8882; --side-card: #2B2D2F; --side-on: #2E2E2B;
  --side-dot: #45484B; --side-line: #2B2D2F;
  --r-sm: 6px; --r-md: 8px; --r-lg: 10px;
  --side-w: 232px;
  --font: 'Pretendard Variable', Pretendard, 'Noto Sans KR', 'Malgun Gothic', 'Apple SD Gothic Neo', -apple-system, sans-serif;
  --mono: ui-monospace, 'SF Mono', Consolas, 'Liberation Mono', monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #151617; --panel: #1A1B1D; --line: #2B2D2F; --line2: #2B2D2F; --line3: #232527; --sel: #26282A; --cell: #1F2022;
    --btnline: #3A3D40; --btnhover: #232527; --tx: #E8E6E1; --strong: #FFFFFF; --muted: #A3A19B; --faint: #6E6C67;
    --red: #F58C9B; --redbg: #3A1E25; --amber: #E9C46A; --amberbg: #3A3220; --amberdot: #E9C46A; --green: #9CC9A3; --greenbg: #1F2B22;
    --brand: #F26B38; --brandfill: #CC4714; --onbrand: #FFFFFF; --focus: #F26B38;
    --side: #101112; --side-card: #1F2022; --side-on: #26282A; --side-line: #222426;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; }
html { -webkit-text-size-adjust: 100%; }
body { background: var(--bg); color: var(--tx); font: 14px/1.5 var(--font); font-variant-numeric: tabular-nums; min-height: 100vh; }
a { color: inherit; }
h1 { font-size: 28px; font-weight: 700; letter-spacing: -0.01em; line-height: 1.25; margin: 0; color: var(--strong); }
h2 { font-size: 16px; font-weight: 700; margin: 0 0 14px; color: var(--strong); }
p { margin: 0 0 8px; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.mono { font-family: var(--mono); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Left menu */
.side { position: fixed; inset: 0 auto 0 0; width: var(--side-w); background: var(--side); color: var(--side-tx);
  display: flex; flex-direction: column; z-index: 20; }
.side-bar { padding: 22px 22px 0; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.side-logo { display: block; text-decoration: none; }
.side-logo img { display: block; height: 30px; width: auto; }
.side-logo img.parking, .side-logo img.console { height: 40px; }
.menu-btn { display: none; }
.side-menu { flex: 1; min-height: 0; overflow-y: auto; padding: 20px 14px 18px; display: flex; flex-direction: column; gap: 22px; }
.side-card { display: flex; flex-direction: column; gap: 2px; padding: 12px; border-radius: var(--r-md); background: var(--side-card); }
.side-card b { font-size: 15px; font-weight: 600; }
.side-card span { font-size: 12px; color: #9CC9A3; display: flex; align-items: center; gap: 6px; }
.side-card span::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex: none; }
.side nav { display: flex; flex-direction: column; gap: 18px; }
.nav-group { display: flex; flex-direction: column; gap: 2px; }
.nav-label { font-size: 11px; letter-spacing: 0.08em; color: var(--side-faint); padding: 0 10px 6px; }
.nav-group a { display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 0 10px; border-radius: var(--r-sm);
  text-decoration: none; color: var(--side-muted); }
.nav-group a::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--side-dot); flex: none; }
.nav-group a:hover { background: var(--side-on); color: #FFFFFF; }
.nav-group a.on { background: var(--side-on); color: #FFFFFF; font-weight: 600; }
.nav-group a.on::before { background: #E2551F; }
.nav-count { margin-left: auto; min-width: 22px; padding: 0 7px; border-radius: 999px; background: #E2551F; color: #FFFFFF;
  font-size: 12px; font-weight: 700; line-height: 20px; text-align: center; }
.nav-group a:focus-visible, .side .btn:focus-visible, .menu-btn:focus-visible { outline-color: #F26B38; outline-offset: -2px; }
.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 14px; }
.who { display: flex; flex-direction: column; gap: 8px; padding: 14px 4px 0; border-top: 1px solid var(--side-line); min-width: 0; }
.who .mail { font-size: 13px; font-weight: 600; color: var(--side-tx); overflow-wrap: anywhere; }
.who dl.session { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 3px 8px; margin: 0; font-size: 11.5px; }
.who dl.session dt { color: var(--side-faint); }
.who dl.session dd { margin: 0; color: var(--side-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.who .idle.soon { color: #F58C9B; font-weight: 700; }
.who dd.idle-row { display: flex; align-items: center; gap: 8px; overflow: visible; }
.who .extend { font: inherit; font-size: 11.5px; font-weight: 600; color: var(--side-tx); background: var(--side-card);
  border: 1px solid var(--side-dot); border-radius: 6px; padding: 2px 8px; cursor: pointer; }
.who .extend:hover { background: var(--side-on); color: #FFFFFF; }
.who .extend:focus-visible { outline: 2px solid #F26B38; outline-offset: 2px; }
dialog.idle-warn { width: min(420px, calc(100vw - 32px)); }
dialog.idle-warn p { margin: 12px 0 20px; line-height: 1.6; }
dialog.idle-warn .idle-left { color: var(--red); font-variant-numeric: tabular-nums; }
dialog.idle-warn .actions { display: flex; gap: 8px; justify-content: flex-end; }
.who form { margin: 0; }
.who .logout { font: inherit; font-size: 13px; background: none; border: 0; padding: 4px 0; color: var(--side-muted);
  text-decoration: underline; text-underline-offset: 3px; cursor: pointer; min-height: 32px; }
.who .logout:hover { color: #FFFFFF; }
.who .logout:focus-visible { outline: 2px solid #F26B38; outline-offset: 2px; }
.side .btn { min-height: 36px; padding: 0 12px; font-size: 13px; background: transparent; color: var(--side-tx); border-color: #45484B; }
.side .btn:hover { background: var(--side-on); }
.credit { margin: 0; padding: 0 10px; font-size: 12px; color: var(--side-faint); line-height: 1.6; display: flex; flex-direction: column; }
.credit a { text-decoration: none; }
.credit a:hover { text-decoration: underline; }
.scrim { display: none; }
/* The menu column stays dark down the whole page, also when the page is longer than the window. */
body:has(> .side) { background: linear-gradient(to right, var(--side) var(--side-w), var(--bg) var(--side-w)); }

/* Page */
.side ~ .page, .side ~ .foot { margin-left: var(--side-w); }
.page { max-width: calc(1240px + var(--side-w)); padding: 28px 36px 40px; min-width: 0; }
.side ~ .page { max-width: none; }
.page > * { max-width: 1240px; }
.head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.head > div:first-child { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.head p { margin: 0; font-size: 13px; }
.head h1 { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; overflow-wrap: anywhere; }
.head h1 .badge { font-size: 13px; letter-spacing: 0; }
.crumb { font-size: 13px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.crumb a { text-decoration: none; }
.crumb a:hover { text-decoration: underline; color: var(--tx); }

.panel { background: var(--panel); border: 1px solid var(--line2); border-radius: var(--r-lg); padding: 20px; margin-bottom: 20px; min-width: 0; }
.panel > h2:first-child { margin-top: -2px; }
.grid2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; margin-bottom: 20px; }
.grid2 > .panel { margin-bottom: 0; }
@media (max-width: 1180px) { .grid2 { grid-template-columns: minmax(0, 1fr); } }

/* Summary cards */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin-bottom: 20px; }
.stat { background: var(--panel); border: 1px solid var(--line2); border-radius: var(--r-lg); padding: 18px 20px; text-decoration: none;
  display: flex; flex-direction: column; gap: 6px; min-height: 44px; }
.stat:hover { border-color: var(--line); box-shadow: 0 1px 0 var(--line); }
.stat .lbl { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.stat .lbl::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--faint); flex: none; }
.stat.ok .lbl::before { background: var(--green); }
.stat.warn .lbl::before { background: var(--amberdot); }
.stat.bad .lbl::before { background: var(--red); }
.stat b { font-size: 34px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; color: var(--strong); }
.stat b small { font-size: 16px; font-weight: 500; color: var(--muted); margin-left: 4px; letter-spacing: 0; }
.stat .sub { font-size: 12px; color: var(--muted); }

/* Tables: they run to the card's edges and scroll inside the card on narrow screens */
.tablewrap { position: relative; overflow-x: auto; margin: 0 -20px; -webkit-overflow-scrolling: touch; }
.panel > .tablewrap:last-child { margin-bottom: -20px; }
.panel > h2:first-child + .tablewrap { margin-top: -4px; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line3); vertical-align: middle; white-space: nowrap; }
th:first-child, td:first-child { padding-left: 20px; }
th:last-child, td:last-child { padding-right: 20px; }
td.wrap { white-space: normal; min-width: 220px; }
th { font-weight: 500; color: var(--muted); border-bottom-color: var(--line2); }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: color-mix(in srgb, var(--cell) 60%, transparent); }
td a.row { text-decoration: none; font-weight: 600; font-size: 14px; color: var(--strong); display: inline-flex; align-items: center; min-height: 28px; }
td a.row:hover { text-decoration: underline; }
tr[data-href] { cursor: pointer; }
tr[data-href]:hover a.row { text-decoration: underline; }
td .actions { gap: 6px; flex-wrap: nowrap; }
.empty { padding: 28px 12px; text-align: center; color: var(--muted); }
.empty > img { display: block; width: 112px; height: 112px; margin: 0 auto 8px; }

/* A site's admin accounts: 운영 관리자 sit under the system administrators. */
.admin-tree { display: grid; gap: 4px; }
.admin-row { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; }
.admin-row.sub { margin-left: 22px; padding-left: 12px; border-left: 2px solid var(--btnline); }
.admin-sub-head { margin: 4px 0 0 22px; font-size: 12px; color: var(--muted); }

/* Status pills */
/* Which product a request or license is for: GATEONE or GATEONE Call. */
.product { display: inline-flex; align-items: center; padding: 1px 8px; border-radius: 4px; font-size: 12px; font-weight: 700;
  letter-spacing: 0; vertical-align: middle; border: 1px solid currentColor; white-space: nowrap; }
.product.gateone { color: var(--brand); }
.product.call { color: var(--green); }
.head h1 .product { font-size: 13px; }
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 600;
  background: var(--cell); color: var(--muted); white-space: nowrap; line-height: 1.6; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; }
.badge.ACTIVE { background: var(--greenbg); color: var(--green); }
.badge.ENDING { background: var(--amberbg); color: var(--amber); }
.badge.EXPIRED, .badge.SUSPENDED { background: var(--redbg); color: var(--red); }
.badge.PENDING { background: var(--amberbg); color: var(--amber); }
.badge.ISSUED { background: var(--greenbg); color: var(--green); }
.badge.REJECTED, .badge.DRAFT { background: var(--cell); color: var(--muted); }
.badge.TRIAL { background: color-mix(in srgb, var(--brand) 14%, var(--panel)); color: var(--brand); }
.badge.TRIAL_ENDED { background: var(--redbg); color: var(--red); }
.badge.NOT_STARTED, .badge.NO_LICENSE { background: var(--cell); color: var(--muted); }

/* Site list: status tabs with counts, a filter grid, a waiting row stands out */
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.tabs a { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 14px; border-radius: 999px;
  border: 1px solid var(--line2); background: var(--panel); text-decoration: none; color: var(--muted); font-size: 13px; }
.tabs a b { color: var(--strong); font-weight: 700; }
.tabs a:hover { border-color: var(--line); color: var(--tx); }
.tabs a.on { background: var(--strong); border-color: var(--strong); color: var(--panel); }
.tabs a.on b { color: var(--panel); }
.tabs .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--faint); }
.tabs .dot.ACTIVE, .tabs .dot.ISSUED { background: var(--green); }
.tabs .dot.ENDING, .tabs .dot.PENDING { background: var(--amberdot); }
.tabs .dot.EXPIRED, .tabs .dot.SUSPENDED, .tabs .dot.TRIAL_ENDED { background: var(--red); }
.tabs .dot.TRIAL { background: var(--brand); }
.filters { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: -4px 0 18px; align-items: end; }
.filters .wide { grid-column: span 2; }
.filters .actions { grid-column: span 2; justify-content: flex-end; }
@media (max-width: 1180px) { .filters { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 720px) { .filters { grid-template-columns: minmax(0, 1fr); } .filters .wide, .filters .actions { grid-column: auto; } }
table.sites td.site-cell { white-space: normal; min-width: 140px; }
table.sites td.site-cell > * { display: block; }
table.sites td.site-cell > a.row { display: inline-flex; }
table.sites td.site-cell .sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
table.sites td.soon { color: var(--red); font-weight: 600; }
table.sites tr.waiting td { background: color-mix(in srgb, var(--amberbg) 55%, transparent); }
/* One search box, the trial switch beside it, and column headers that sort like a board */
.listbar { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin: -4px 0 16px; }
.listbar .search { flex: 1 1 360px; margin: 0; max-width: 560px; }
.search.compact { flex: 0 1 300px; flex-wrap: nowrap; gap: 6px; }
.search.compact input { flex: 1 1 auto; min-width: 0; }
.search .icon-btn, .listbar .icon-btn { width: 44px; min-height: 44px; }
.listbar-end { margin-left: auto; display: flex; gap: 8px; align-items: center; }
a.icon-btn { text-decoration: none; }
.icon-btn.excel:hover { color: #1D6F42; }
.toggle { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px; border-radius: var(--r-md);
  border: 1px solid var(--btnline); background: var(--panel); color: var(--tx); text-decoration: none; font-size: 13px; white-space: nowrap; }
.toggle:hover { background: var(--btnhover); }
.toggle b { color: var(--muted); font-weight: 600; }
.toggle .box { width: 16px; height: 16px; border-radius: 4px; border: 1.5px solid var(--faint); display: grid; place-items: center; flex: none; }
.toggle.on { border-color: var(--brand); background: color-mix(in srgb, var(--brand) 10%, var(--panel)); }
.toggle.on .box { background: var(--brand); border-color: var(--brand); }
.toggle.on .box::after { content: ""; width: 8px; height: 4px; border: 2px solid #fff; border-top: 0; border-right: 0; transform: rotate(-45deg) translate(1px, -1px); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin: -6px 0 14px; }
.chip { display: inline-flex; align-items: center; min-height: 32px; padding: 0 12px; border-radius: 999px; background: var(--cell);
  color: var(--tx); text-decoration: none; font-size: 13px; }
.chip:hover { background: var(--sel); }
th a.sort { display: inline-flex; align-items: center; gap: 4px; color: inherit; text-decoration: none; min-height: 28px; }
th a.sort:hover { color: var(--tx); }
th a.sort .arrow { width: 0; height: 0; border-left: 4px solid transparent; border-right: 4px solid transparent; opacity: .35;
  border-top: 5px solid currentColor; }
th a.sort:hover .arrow { opacity: .7; }
th a.sort.ascending, th a.sort.descending { color: var(--strong); font-weight: 600; }
th a.sort.ascending .arrow { border-top: 0; border-bottom: 5px solid currentColor; opacity: 1; }
th a.sort.descending .arrow { opacity: 1; }
table.board th.num, table.board td.num { width: 1%; text-align: right; color: var(--faint); padding-right: 12px; }
table.board td.ask { white-space: normal; min-width: 96px; max-width: 200px; font-size: 12.5px; }
table.board td.ask > div > span:first-child { white-space: nowrap; }
table.board td.ask > div > span { display: block; }
table.board td.code-cell { font-size: 12px; letter-spacing: -.2px; }
table.sites td.code-cell a { text-decoration: none; color: var(--tx); font-size: 12.5px; }
table.sites td.code-cell a:hover { text-decoration: underline; }
table.sites td .days { display: block; font-size: 12px; color: var(--muted); font-weight: 400; }
table.sites td.soon .days { color: var(--red); font-weight: 600; }

/* Site page: the license code up top, the rest folded */
.license-now { display: grid; grid-template-columns: minmax(0, auto) minmax(0, 1fr); gap: 24px; align-items: start; }
.license-now .lbl { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
@media (max-width: 900px) { .license-now { grid-template-columns: minmax(0, 1fr); gap: 14px; } }
details.fold > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; min-height: 28px; }
details.fold > summary::-webkit-details-marker { display: none; }
details.fold > summary h2 { margin: 0; display: inline-flex; align-items: center; gap: 10px; }
details.fold > summary h2::before { content: ""; width: 7px; height: 7px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor;
  transform: rotate(-45deg); transition: transform .15s; }
details.fold[open] > summary h2::before { transform: rotate(45deg); }
details.fold[open] > summary { margin-bottom: 16px; }
ul.links { margin: 0; padding: 0; list-style: none; display: grid; gap: 2px; }
ul.links a { display: inline-flex; min-height: 36px; align-items: center; font-weight: 600; text-decoration: none; }
ul.links a:hover { text-decoration: underline; }
.panel.narrow { max-width: 860px; }

/* Staff roles: masters invite; other staff see the invite form greyed out */
.role { display: inline-flex; align-items: center; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 600;
  background: var(--cell); color: var(--muted); }
.role.master { background: color-mix(in srgb, var(--brand) 14%, var(--panel)); color: var(--brand); }
/* A master picks each account's right in the table: the right and [변경] on one line. */
.role-pick { display: flex; gap: 6px; align-items: center; margin: 0; }
.role-pick select.small { width: auto; min-height: 36px; font-size: 13px; padding-left: 10px; }
@media (pointer: coarse) { .role-pick select.small { min-height: 44px; } }
fieldset.bare { border: 0; padding: 0; margin: 0; display: contents; }
.invite.locked > .search, .invite.locked > p.muted { opacity: .45; filter: grayscale(1); }
.invite.locked > .search input, .invite.locked > .search .btn { cursor: not-allowed; background: var(--cell); }
.locked-note { display: inline-flex; align-items: center; gap: 8px; margin: -6px 0 0; padding: 8px 12px; border-radius: var(--r-md);
  background: var(--cell); color: var(--muted); font-size: 13px; font-weight: 600; }

.pager { display: flex; gap: 12px; align-items: center; justify-content: center; padding-top: 16px; color: var(--muted); }
.actions.end { justify-content: flex-end; }

dialog { border: 1px solid var(--line2); border-radius: 14px; background: var(--panel); color: var(--tx); padding: 24px;
  width: min(640px, calc(100vw - 32px)); max-height: calc(100vh - 48px); overflow-y: auto; }
dialog::backdrop { background: rgba(0, 0, 0, .45); }
/* A click outside a dialog keeps it open; the box nudges so the click is not lost on the user */
@keyframes nudge { 25% { transform: scale(1.015); } 60% { transform: scale(.995); } }
dialog.nudge { animation: nudge .22s ease-out; }
@media (prefers-reduced-motion: reduce) { dialog.nudge { animation: none; } }
dialog h2 { margin: 0; }

/* Forms */
form.stack { display: grid; gap: 14px; }
.fields { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; align-items: start; }
.period { display: grid; gap: 8px; }
/* Start and end date side by side on one line, each box only as wide as a date. */
.period .dates { display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap; }
.period .dates label { flex: 0 0 auto; }
.period .dates input { width: 11.5em; }
.period .tilde { padding-bottom: 10px; color: var(--muted); }
label { display: grid; align-content: start; gap: 6px; font-size: 13px; color: var(--muted); font-weight: 500; min-width: 0; }
label.check { display: flex; align-items: center; gap: 10px; font-weight: 400; font-size: 14px; color: var(--tx); min-height: 40px; cursor: pointer; }
label.check input { width: 18px; height: 18px; margin: 0; accent-color: var(--brand); flex: none; }
input[type=text], input[type=password], input[type=number], input[type=date], input[type=search], input[type=email], select, textarea {
  font: inherit; font-size: 14px; color: var(--tx); background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-md);
  padding: 0 14px; min-height: 44px; width: 100%; min-width: 0;
}
textarea { min-height: 84px; padding: 10px 14px; resize: vertical; }
select { padding-right: 32px; }
input::placeholder, textarea::placeholder { color: var(--faint); }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--focus); outline-offset: -1px; border-color: var(--focus); }
fieldset { border: 1px solid var(--line2); border-radius: var(--r-md); padding: 12px 14px; margin: 0; min-width: 0; }
legend { font-size: 13px; color: var(--muted); font-weight: 500; padding: 0 6px; }
.checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 2px 14px; }
.radios { display: flex; gap: 4px 20px; flex-wrap: wrap; }
.hint { font-size: 12px; color: var(--faint); font-weight: 400; }

.btn { font: inherit; display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 16px;
  border-radius: var(--r-md); border: 1px solid var(--btnline); background: var(--panel); color: var(--tx); cursor: pointer;
  text-decoration: none; white-space: nowrap; }
.btn:hover { background: var(--btnhover); }
.btn.primary { background: var(--brandfill); border-color: var(--brandfill); color: var(--onbrand); font-weight: 700; padding: 0 18px; }
.btn.primary:hover { filter: brightness(1.06); background: var(--brandfill); }
.btn.danger { color: var(--red); border-color: color-mix(in srgb, var(--red) 55%, transparent); }
.btn.danger:hover { background: var(--redbg); }
.btn.xs { min-height: 28px; padding: 0 10px; font-size: 12px; border-radius: var(--r-sm); font-weight: 600; }
@media (pointer: coarse) { .btn.xs { min-height: 36px; } }
.btn.small { min-height: 36px; padding: 0 12px; font-size: 13px; border-radius: var(--r-sm); }
@media (pointer: coarse) { .btn.small { min-height: 44px; } }
.btn.link { border: 0; background: none; padding: 0; color: var(--muted); text-decoration: underline; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.inline { display: inline; margin: 0; }
.remote-approve { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.remote-approve input[type=text] { width: 12em; min-width: 0; flex: 1 1 8em; max-width: 16em; }

.search { display: flex; gap: 10px; flex-wrap: wrap; margin: -4px 0 16px; }
.search input { flex: 1 1 240px; width: auto; }
.search select { width: auto; flex: 0 1 auto; }

.flash { border-radius: var(--r-lg); padding: 12px 16px; margin-bottom: 20px; border: 1px solid transparent; max-width: 1240px; }
.flash.info { background: var(--greenbg); color: var(--green); }
.flash.error { background: var(--redbg); color: var(--red); }
.flash.warn { background: var(--amberbg); color: var(--amber); }
.flash .mono { overflow-wrap: anywhere; }
a.flash { display: block; text-decoration: none; font-weight: 600; }
a.flash:hover { text-decoration: underline; }

dl.info { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 0; margin: 0; border-top: 1px solid var(--line3); }
dl.info dt, dl.info dd { padding: 9px 0; border-bottom: 1px solid var(--line3); }
dl.info dt { color: var(--muted); }
dl.info dd { margin: 0; overflow-wrap: anywhere; }

.code { font-family: var(--mono); font-size: 22px; font-weight: 700; letter-spacing: 1px; color: var(--strong); background: var(--cell);
  border: 1px dashed var(--line); border-radius: var(--r-md); padding: 12px 16px; display: inline-block; max-width: 100%;
  overflow-wrap: anywhere; user-select: all; }
.key { font-family: var(--mono); font-size: 13px; background: var(--cell); padding: 12px; border-radius: var(--r-md); overflow-wrap: anywhere;
  word-break: break-all; user-select: all; }

/* Sign-in */
.auth { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; padding: 32px 16px; }
.auth .box { width: 100%; max-width: 420px; background: var(--panel); border: 1px solid var(--line2); border-radius: 14px; padding: 32px; }
.auth .box.wide { max-width: 580px; }
.policy h2 { font-size: 15px; margin: 18px 0 6px; }
.policy ul { padding-left: 20px; display: grid; gap: 6px; }
.policy p, .policy li { line-height: 1.6; }
.auth .box > h1 { font-size: 22px; margin-bottom: 8px; }
.auth .box > .btn { margin-top: 16px; }
.auth .brand { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; margin-bottom: 24px; }
.auth .brand img { height: 44px; width: auto; display: block; }
.auth .brand img.console { height: 56px; }
.auth .brand div { color: var(--muted); font-size: 14px; }
.auth .btn.primary { width: 100%; min-height: 48px; font-size: 15px; }
.auth a.hint { justify-self: center; display: inline-flex; align-items: center; min-height: 44px; }
.auth-foot { font-size: 12px; color: var(--faint); text-align: center; }
/* QR 출입증 문자: the page a texted link opens, on a phone held up to the door's camera. */
.pass { text-align: center; display: grid; gap: 10px; justify-items: center; }
.pass-site { color: var(--muted); font-size: 14px; }
.pass-name { font-size: 16px; font-weight: 600; }
.pass-qr { width: min(240px, 70vw); height: auto; aspect-ratio: 1; background: #fff; padding: 8px; border-radius: 10px; border: 1px solid var(--line2); image-rendering: pixelated; }
.pass-period { display: grid; gap: 2px; }
.pass-period dt { font-size: 12px; color: var(--faint); }
.pass-period dd { margin: 0; font-size: 15px; font-variant-numeric: tabular-nums; }
.pass .muted { line-height: 1.6; word-break: keep-all; overflow-wrap: anywhere; }
.pass .muted span { display: block; }
.pass-foot { font-size: 12px; }
/* The cloud-and-sites drawing beside the sign-in box on wide screens; it has a clear background for both themes. */
.auth-row { width: 100%; display: flex; align-items: center; justify-content: center; gap: 56px; }
.auth-row > .box { flex: 0 1 420px; }
.auth-art { flex: 0 1 520px; min-width: 0; }
.auth-art img { display: block; width: 100%; height: auto; }
@media (max-width: 960px) { .auth-art { display: none; } }
.auth-foot a { text-decoration: none; }
/* The two sign-in steps, so the code page reads as the second half of the same sign-in */
.auth-steps { list-style: none; padding: 0; margin: -8px 0 20px; display: flex; gap: 8px; counter-reset: step; }
.auth-steps li { flex: 1; display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--faint); padding-top: 8px;
  border-top: 3px solid var(--line2); counter-increment: step; }
.auth-steps li::before { content: counter(step); width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center;
  background: var(--cell); color: var(--muted); font-size: 11px; font-weight: 700; flex: none; }
.auth-steps li.done { color: var(--muted); border-top-color: color-mix(in srgb, var(--brand) 45%, var(--line2)); }
.auth-steps li.done::before { content: "✓"; background: color-mix(in srgb, var(--brand) 20%, var(--panel)); color: var(--brand); }
.auth-steps li.on { color: var(--strong); font-weight: 600; border-top-color: var(--brand); }
.auth-steps li.on::before { background: var(--brand); color: #fff; }
.auth .lead { margin: 0; color: var(--tx); font-size: 14px; line-height: 1.6; }
.code-row { display: flex; gap: 8px; align-items: stretch; min-width: 0; }
.code-row input { flex: 1 1 0; width: auto; min-width: 0; }
.icon-btn { flex: none; width: 52px; min-height: 52px; display: grid; place-items: center; border-radius: var(--r-md);
  border: 1px solid var(--btnline); background: var(--panel); color: var(--muted); cursor: pointer; }
.icon-btn:hover { background: var(--btnhover); color: var(--brand); }
.qr { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.qr > div { flex: 1 1 200px; min-width: 0; display: grid; gap: 6px; }
.qr img { width: 160px; height: 160px; border-radius: var(--r-md); background: #fff; padding: 6px; border: 1px solid var(--line2); }
ol.steps { padding-left: 20px; margin: 4px 0 14px; color: var(--muted); display: grid; gap: 4px; }
input.otp { font-size: 24px; letter-spacing: 8px; text-align: center; font-family: var(--mono); min-height: 52px; }

.foot { display: none; }
.row-input { display: flex; gap: 8px; flex-wrap: wrap; }
.row-input input { flex: 1 1 200px; width: auto; }
h2.spaced { margin-top: 28px; }
.spaced-top { margin-top: 14px; }

/* Narrow screens: the menu is a top bar and opens as a drawer */
@media (max-width: 900px) {
  .side { position: sticky; top: 0; inset: auto; width: auto; height: auto; z-index: 30; }
  /* The button sits on the left, where the drawer opens. */
  .side-bar { padding: 0 16px 0 8px; min-height: 56px; justify-content: flex-start; }
  .side-bar .menu-btn { order: -1; }
  .side-logo img { height: 26px; }
  .menu-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-width: 44px; min-height: 44px; padding: 0 12px;
    border: 1px solid #45484B; border-radius: var(--r-md); background: transparent; color: var(--side-tx); font: inherit; font-size: 13px; cursor: pointer; }
  .menu-btn svg { display: block; }
  .menu-btn .x { display: none; }
  .side.open .menu-btn .x { display: block; }
  .side.open .menu-btn .bars { display: none; }
  .side-menu { padding: 8px 14px 18px; }
  /* Without the script the menu simply stays open under the bar. */
  .js .side-menu { position: fixed; top: 56px; left: 0; bottom: 0; width: min(300px, 86vw); background: var(--side); padding-top: 16px;
    transform: translateX(-100%); visibility: hidden; transition: transform .2s ease, visibility 0s linear .2s; z-index: 31;
    box-shadow: 8px 0 24px rgba(0, 0, 0, .25); }
  .js .side.open .side-menu { transform: none; visibility: visible; transition: transform .2s ease; }
  .js .side.open .scrim { display: block; position: fixed; inset: 56px 0 0 0; background: rgba(0, 0, 0, .4); z-index: 29; }
  .side ~ .page, .side ~ .foot { margin-left: 0; }
  body:has(> .side) { background: var(--bg); }
  .page { padding: 20px 16px 28px; }
  h1 { font-size: 24px; }
  .head { margin-bottom: 18px; align-items: flex-start; }
  .foot { display: flex; flex-direction: column; gap: 2px; padding: 0 16px 24px; color: var(--faint); font-size: 12px; }
  .foot a { text-decoration: none; }
}
@media (prefers-reduced-motion: reduce) { .js .side-menu, .js .side.open .side-menu { transition: none; } }
@media (max-width: 720px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 16px; }
  .stat { padding: 14px 16px; }
  .stat b { font-size: 28px; }
  .fields { grid-template-columns: minmax(0, 1fr); }
  .panel { padding: 16px; margin-bottom: 16px; }
  .grid2 { gap: 16px; margin-bottom: 16px; }
  .tablewrap { margin: 0 -16px; }
  .panel > .tablewrap:last-child { margin-bottom: -16px; }
  th:first-child, td:first-child { padding-left: 16px; }
  th:last-child, td:last-child { padding-right: 16px; }
  td.wrap { min-width: 240px; }
  form.stack > .actions > .btn { flex: 1 1 auto; }
  .head > .actions { width: 100%; }
  .head > .actions > .btn, .head > .actions > form { flex: 1 1 auto; }
  .head > .actions > form .btn { width: 100%; }
  .search input { flex-basis: 100%; }
  .search select, .search .btn { flex: 1 1 auto; }
  .listbar .search { flex-basis: 100%; }
  .listbar-end { margin-left: 0; flex: 0 0 auto; }
  .listbar .toggle { flex: 1 1 auto; justify-content: center; }
  .code { font-size: 18px; }
  dl.info { grid-template-columns: 84px minmax(0, 1fr); }
  .auth .box { padding: 24px 20px; }
}

/* Site page as a board post: label column, then everything known about the site */
.panel.post { display: grid; gap: 4px; }
.panel.post h2.spaced:first-child { margin-top: 0; }
dl.info.wide { grid-template-columns: 140px minmax(0, 1fr); }
@media (max-width: 640px) { dl.info.wide { grid-template-columns: 96px minmax(0, 1fr); } .code.small { font-size: 13px; letter-spacing: 0; } }
.code.small { font-size: 15px; letter-spacing: .5px; padding: 3px 8px; }
.post-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 18px; }
.post-actions .grow { flex: 1 1 auto; }

/* New site: three numbered steps in one form */
form.steps { display: grid; gap: 16px; max-width: 860px; }
form.steps .step { display: grid; gap: 14px; margin: 0; }
form.steps .step h2 { margin: 0; display: flex; align-items: center; gap: 10px; }
.step-no { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; font-size: 13px;
  background: var(--brand); color: #fff; }
.stack, fieldset.step-body { display: grid; gap: 14px; }
fieldset.step-body { border: 0; padding: 0; margin: 0; min-width: 0; }
fieldset.step-body[hidden] { display: none; }
form.steps .step p.hint { margin: -8px 0 0; }

/* Phones: each table row becomes a card, a label beside each value; the site list gets sort links instead of headers */
.card-sort { display: none; }
@media (max-width: 720px) {
  .tabs { flex-wrap: nowrap; overflow-x: auto; margin: 0 -16px 14px; padding: 0 16px 2px; scrollbar-width: none; }
  .tabs::-webkit-scrollbar { display: none; }
  .tabs a { flex: 0 0 auto; }
  .card-sort { display: flex; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; align-items: center; gap: 4px 14px;
    margin: -4px -16px 10px; padding: 0 16px; font-size: 13px; white-space: nowrap; }
  .card-sort::-webkit-scrollbar { display: none; }
  .card-sort a { display: inline-flex; align-items: center; gap: 4px; min-height: 36px; color: var(--muted); text-decoration: none; }
  .card-sort a.ascending, .card-sort a.descending { color: var(--strong); font-weight: 700; }
  .card-sort .arrow { width: 0; height: 0; border-left: 4px solid transparent; border-right: 4px solid transparent;
    border-top: 5px solid currentColor; opacity: .3; }
  .card-sort a.ascending .arrow { border-top: 0; border-bottom: 5px solid currentColor; opacity: 1; }
  .card-sort a.descending .arrow { opacity: 1; }
  .tablewrap:has(> table.cards) { overflow: visible; }
  table.cards, table.cards tbody, table.cards tr, table.cards td { display: block; width: auto; }
  table.cards thead { display: none; }
  table.cards tr { display: flex; flex-direction: column; padding: 12px 16px; border-bottom: 1px solid var(--line3); }
  table.cards tr:last-child { border-bottom: 0; }
  table.cards td { display: flex; gap: 12px; align-items: baseline; padding: 3px 0 !important; border: 0; white-space: normal;
    min-width: 0; max-width: none; font-size: 13.5px; overflow-wrap: anywhere; }
  table.cards td[data-label]::before { content: attr(data-label); flex: 0 0 84px; color: var(--muted); font-size: 12.5px; }
  table.cards td[data-label=""]::before { display: none; }
  table.cards td.num { display: none; }
  table.cards td.card-title { order: -1; padding-bottom: 6px !important; }
  table.cards td.card-title a.row { font-size: 16px; min-height: 32px; }
  table.cards td.empty-cell { display: none; }
  table.cards td.ask > div > span { display: inline; }
  table.cards td.ask > div > span + span::before { content: " · "; }
  table.cards td.blank { display: none; }
  table.cards tr.waiting td { background: transparent; }
  table.cards tr.waiting { background: color-mix(in srgb, var(--amberbg) 55%, transparent); }
  table.cards td.card-actions, table.cards td[data-label=""] { padding-top: 10px !important; }
  table.cards td .actions { flex-wrap: wrap; width: 100%; }
  table.cards td .actions > .btn, table.cards td .actions > form { flex: 1 1 auto; }
  table.cards td .actions > form .btn { width: 100%; }
  table.cards td.card-actions .btn.xs { min-height: 40px; font-size: 14px; }
}

/* Deleting: tick boxes in the list, and a warning dialog that asks once more */
th.pick, td.pick { width: 1%; padding-right: 0; }
th.pick input, td.pick input { width: 18px; height: 18px; margin: 0; accent-color: var(--brand); cursor: pointer; }
.btn.danger.solid { background: var(--red); border-color: var(--red); color: #fff; font-weight: 700; }
.btn.danger.solid:hover { background: color-mix(in srgb, var(--red) 85%, #000); }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.btn .picked-count:empty { display: none; }
dialog .danger-title { color: var(--red); }
dialog .warn { background: var(--redbg); border-radius: var(--r-md); padding: 12px 14px; font-size: 13.5px; }
dialog .warn p { margin: 0 0 6px; }
dialog .warn ul { margin: 0; padding-left: 18px; display: grid; gap: 4px; }
ul.picked-names { margin: 0; padding-left: 18px; max-height: 160px; overflow: auto; font-weight: 600; }
ul.picked-names:empty { display: none; }
@media (max-width: 720px) {
  table.cards tr { position: relative; }
  table.cards td.pick { position: absolute; top: 18px; right: 16px; padding: 0 !important; }
  table.cards td.pick input { width: 22px; height: 22px; }
  table.cards td.card-title { padding-right: 36px !important; }
}
.pick-all-m { display: none; }
@media (max-width: 720px) {
  .pick-all-m { display: inline-flex; align-items: center; gap: 8px; min-height: 36px; margin-right: 6px; font-weight: 600; color: var(--tx); }
  .pick-all-m input { width: 20px; height: 20px; margin: 0; accent-color: var(--brand); }
}

/* Phones: the line offering 홈 화면에 추가, above the page */
.install-banner { display: flex; align-items: center; gap: 10px; padding: 10px 12px; margin-bottom: 16px; border: 1px solid var(--line2);
  border-radius: var(--r-lg); background: var(--panel); font-size: 13.5px; }
.install-banner img { border-radius: 8px; flex: none; }
.install-banner .install-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; word-break: keep-all; }
.install-banner .install-how { font-size: 12.5px; color: var(--muted); }
.install-banner .icon-btn { width: 40px; min-height: 40px; }
.auth > .install-banner { width: 100%; max-width: 420px; margin: 0; }

/* New site: a note on what is not registered here, and type choices with a line each */
.note-box { max-width: 860px; margin-bottom: 16px; padding: 14px 16px; border-radius: var(--r-lg); background: var(--cell);
  border-left: 3px solid var(--brand); font-size: 13.5px; }
.note-box b { display: block; margin-bottom: 4px; color: var(--strong); }
.note-box p { margin: 0; color: var(--muted); }
.radios.stacked { flex-direction: column; gap: 4px; }
.radios.stacked label.check { align-items: flex-start; padding: 6px 0; }
.radios.stacked label.check input { margin-top: 2px; }
.hint.block { display: block; margin-top: 2px; }

/* Korean breaks between words, not inside them */
body { word-break: keep-all; overflow-wrap: break-word; }
.mono, .code, .who .mail { word-break: normal; }
/* The sign-in page makes its primary buttons full width; the install line keeps its own small one. */
.install-banner .btn.install-add { width: auto; min-height: 40px; font-size: 13px; flex: none; padding: 0 12px; }

/* The license box on a site page: its buttons follow the license's state. */
.license-actions { flex-wrap: wrap; margin-top: 12px; }
.sms-form { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; margin: 0; }
.sms-limit { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--tx); font-weight: 400; }
.sms-limit input { width: 6.5em; }
details.dev-info > summary { cursor: pointer; font-weight: 600; }

/* 게이트원 파킹 */
.badge.pk-ACTIVE { background: var(--greenbg); color: var(--green); }
.badge.pk-ENDING { background: var(--amberbg); color: var(--amber); }
.badge.pk-ENDED { background: var(--redbg); color: var(--red); }
.badge.pk-BEFORE { background: var(--cell); color: var(--muted); }
.tabs .dot.pk-ACTIVE { background: var(--green); }
.tabs .dot.pk-ENDING { background: var(--amberdot); }
.tabs .dot.pk-ENDED { background: var(--red); }
.tabs .dot.pk-BEFORE { background: var(--faint); }
.parking-form textarea { min-height: 96px; }
.url-row { display: flex; align-items: stretch; }
.url-row .prefix { padding: 0 10px 0 14px; display: inline-flex; align-items: center; border: 1px solid var(--line);
  border-right: 0; border-radius: var(--r-md) 0 0 var(--r-md); background: var(--cell); color: var(--muted);
  font-size: 13px; white-space: nowrap; }
.url-row input { border-radius: 0 var(--r-md) var(--r-md) 0; }
.parking-hero { width: 100%; max-width: 600px; height: auto; display: block; }
@media (prefers-color-scheme: dark) { .parking-hero { opacity: .85; } }

/* 게이트원 파킹 at the menu's foot: the logo is the button that opens its links. */
.parking-menu { border-top: 1px solid var(--side-line, rgba(255,255,255,.12)); padding-top: 12px; }
.parking-menu summary { display: flex; align-items: center; justify-content: space-between; min-height: 44px; padding: 0 10px;
  border-radius: var(--r-sm); cursor: pointer; list-style: none; }
.parking-menu summary::-webkit-details-marker { display: none; }
.parking-menu summary::after { content: ""; width: 8px; height: 8px; border-right: 2px solid var(--side-faint); border-bottom: 2px solid var(--side-faint);
  transform: rotate(45deg); margin-top: -4px; transition: transform .15s; }
.parking-menu[open] summary::after { transform: rotate(-135deg); margin-top: 4px; }
.parking-menu summary:hover { background: var(--side-on); }
.parking-menu summary:focus-visible { outline: 2px solid #F26B38; outline-offset: -2px; }
.parking-menu summary img { display: block; height: 30px; width: auto; }
.parking-menu .nav-group { padding-top: 6px; }
