/* GATEONE Cloud console. Colors and shapes from brand/tokens.json (copied by hand: the console does not read that file),
   in the same design language as the GATEONE screens: a navy menu on the left, a light page, white cards.
   Under 900px the menu becomes a top bar with a drawer. */
:root {
  --bg: #F7F7F5; --panel: #FFFFFF; --line: #E5E7EB; --line2: #EDEFF2; --line3: #F1F3F6; --sel: #E6EBF2; --cell: #F1F3F6;
  --btnline: #B4BCC8; --btnhover: #F1F3F6; --tx: #0F1B2D; --strong: #000000; --muted: #4A5568; --faint: #8B95A5;
  --red: #B42318; --redbg: #FDECEA; --amber: #8A5A0C; --amberbg: #FDF3DC; --amberdot: #B7791F; --green: #17784F; --greenbg: #E3F4EC;
  --brand: #E8590C; --brandfill: #C24A0A; --onbrand: #FFFFFF; --focus: #E8590C;
  --side: #0F1B2D; --side-tx: #EEF1F5; --side-muted: #AEB6C2; --side-faint: #8B95A5; --side-card: #1A2638; --side-on: #1F2C42;
  --side-dot: #3B4658; --side-line: #1F2C42; --side-brand: #FF7A3D; --side-ok: #4ADE80; --side-red: #F87171;
  --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: #0B1220; --panel: #141C2B; --line: #263142; --line2: #1C2536; --line3: #182133; --sel: #1F2A3C; --cell: #182133;
    --btnline: #3B4658; --btnhover: #182133; --tx: #EEF1F5; --strong: #FFFFFF; --muted: #AEB6C2; --faint: #6B7585;
    --red: #F87171; --redbg: #3A1D24; --amber: #FBBF24; --amberbg: #3A3020; --amberdot: #FBBF24; --green: #4ADE80; --greenbg: #16301F;
    --brand: #FF7A3D; --brandfill: #C24A0A; --onbrand: #FFFFFF; --focus: #FF7A3D;
    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;
  /* No single word left alone on a paragraph's last line, as in GATEONE. */
  text-wrap: pretty; }
a { color: inherit; }
h1 { font-size: 28px; font-weight: 600; letter-spacing: -0.01em; line-height: 1.25; margin: 0; color: var(--strong); }
h2 { font-size: 16px; font-weight: 600; margin: 0 0 14px; color: var(--strong); }
p { margin: 0 0 8px; }
.muted { color: var(--muted); }
/* --faint is for marks and lines only: as text on white it is 3.3:1, under the 4.5:1 small text needs. */
.faint { color: var(--muted); }
.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: 26px; }
.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: var(--side-ok); 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: 12px; 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); }
/* Each entry carries GATEONE's icon for it (templates/icons.html); the one in use is a filled row, no edge bar or dot. */
.nav-group a .ico { color: var(--side-faint); --ico-tint: var(--side-faint); }
.nav-group a:hover { background: var(--side-on); color: #FFFFFF; }
.nav-group a.on { background: var(--side-on); color: #FFFFFF; font-weight: 600; box-shadow: inset 3px 0 0 var(--side-brand); }
.nav-group a:hover .ico, .nav-group a.on .ico { color: #FFFFFF; --ico-tint: var(--side-brand); --ico-tint-alpha: .55; }
.nav-count { margin-left: auto; min-width: 22px; padding: 0 7px; border-radius: 999px; background: var(--brandfill); color: #FFFFFF;
  font-size: 12px; font-weight: 600; line-height: 20px; text-align: center; }
.nav-group a:focus-visible, .side .btn:focus-visible, .menu-btn:focus-visible { outline-color: var(--side-brand); 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: 12px; }
.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: var(--side-red); font-weight: 600; }
.who dd.idle-row { display: flex; align-items: center; gap: 8px; overflow: visible; }
.who .extend { font: inherit; font-size: 12px; 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 var(--side-brand); 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-actions { display: flex; flex-wrap: wrap; gap: 4px 14px; }
.who .who-link, .who .logout { font: inherit; font-size: 13px; background: none; border: 0; padding: 4px 0; color: var(--side-muted);
  text-decoration: none; cursor: pointer; min-height: 32px; display: inline-flex; align-items: center; gap: 6px; }
.who .ico { --ico-tint: var(--side-faint); }
.who .who-link:hover, .who .logout:hover { color: #FFFFFF; text-decoration: underline; text-underline-offset: 3px; }
.who .who-link:focus-visible, .who .logout:focus-visible { outline: 2px solid var(--side-brand); outline-offset: 2px; }
.side .btn { min-height: 36px; padding: 0 12px; font-size: 13px; background: transparent; color: var(--side-tx); border-color: var(--side-dot); }
.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: 600; 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); }
/* What the empty list is about: its menu icon, large, in a soft circle (2.0, no drawings). */
.empty-ico { display: grid; place-items: center; width: 64px; height: 64px; margin: 0 auto 10px; border-radius: 50%; background: var(--line); color: var(--muted); --ico-tint: var(--muted); }
.empty-ico .ico { width: 32px; height: 32px; }

/* 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: 600;
  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.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: 8px;
  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: 600; }
.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 { background: var(--red); }
.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, 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: var(--tx); }
  border: 1px solid var(--btnline); background: var(--panel); color: var(--tx); text-decoration: none; font-size: 13px; white-space: nowrap; }
.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(--muted); 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: 0; }
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], input[type=tel], 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(--muted); 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: 600; 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: 600; 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 { height: 36px; width: auto; }
.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(--muted); 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(--muted); }
.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 sign-in pages: a soft abstract picture fills the page behind the box, the console's or GATEONE Parking's. */
.auth.login-bg { background: var(--bg) url(/img/login/console-light.jpg) center / cover no-repeat; }
.auth.login-bg.parking { background-image: url(/img/login/parking-light.jpg); }
@media (prefers-color-scheme: dark) {
  .auth.login-bg { background-image: url(/img/login/console-dark.jpg); }
  .auth.login-bg.parking { background-image: url(/img/login/parking-dark.jpg); }
}
.auth.login-bg .box { box-shadow: 0 1px 2px rgb(0 0 0 / .04), 0 12px 32px rgb(15 27 45 / .10); }
.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(--muted); 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: 12px; font-weight: 600; 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; }
/* Sign-in pages: each sentence starts its own line, and a long one wraps evenly, not mid-term. */
.auth .ln { display: block; }
.auth p { text-wrap: pretty; }
.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 var(--side-dot); 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(--muted); 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; }
  .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: 600; }
  .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: 600; }
.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; }

/* GATEONE Parking */
.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; }

/* GATEONE Parking 현장 form: the QR code of the URL, with its type and download. */
.pk-qr { margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--line2); }
.pk-qr h3 { font-size: 15px; margin: 0 0 4px; color: var(--strong); }
.pk-qr-body { display: flex; gap: 20px; align-items: flex-start; flex-wrap: wrap; margin-top: 12px; }
.pk-qr-preview { width: 240px; height: auto; border: 1px solid var(--line2); border-radius: var(--r-md); background: #fff; display: block; }
.pk-qr-side { display: flex; flex-direction: column; gap: 12px; min-width: 0; flex: 1 1 220px; }
.pk-qr-types { border: 0; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; }
.pk-qr-types legend { font-size: 13px; font-weight: 600; margin-bottom: 6px; padding: 0; }
.pk-qr-types legend { grid-column: 1 / -1; }
.pk-qr-types label { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 8px; border: 1px solid var(--btnline); border-radius: var(--r-md); cursor: pointer; text-align: center; font-size: 13px; }
.pk-qr-types label:has(input:checked) { border-color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand); }
.pk-qr-types input { position: absolute; opacity: 0; pointer-events: none; }
.pk-qr-types label:has(input:focus-visible) { outline: 2px solid var(--focus); outline-offset: 2px; }
.pk-qr-thumb { width: 96px; height: auto; background: #fff; border-radius: 4px; }
.pk-qr-side .btn { align-self: flex-start; }
.pk-qr-side .hint { overflow-wrap: anywhere; }
form.steps .step .pk-qr p.hint { margin: 0; }

/* GATEONE's icons in buttons (templates/icons.html): lines in the text color, the soft fill in the brand color. */
:root { --ico-tint: var(--muted); }
.ico { flex: none; }
.btn.primary .ico { --ico-tint: var(--onbrand); --ico-tint-alpha: .3; --ico-knock: var(--brandfill); }
.btn.danger .ico { --ico-tint: var(--red); }
.btn.danger.solid .ico { --ico-tint: #FFFFFF; --ico-knock: var(--red); }

/* A date typed as YYYY-MM-DD, with the calendar behind the button beside it (console.js). */
.date-field { position: relative; display: flex; align-items: stretch; gap: 6px; min-width: 0; }
.date-field input[type="text"] { flex: 1; min-width: 9.5em; font-variant-numeric: tabular-nums; }
.date-btn { flex: none; display: inline-grid; place-items: center; width: 44px; min-height: 44px; border: 1px solid var(--btnline);
  border-radius: var(--r-sm); background: var(--panel); color: var(--tx); cursor: pointer; padding: 0; }
.date-btn:hover { background: var(--btnhover); }
.date-btn[disabled] { opacity: .45; cursor: not-allowed; }

/* [복사] beside an address. */
.copy-btn { display: inline-grid; place-items: center; width: 32px; height: 32px; margin-left: 4px; vertical-align: middle;
  border: 1px solid var(--btnline); border-radius: var(--r-sm); background: var(--panel); color: var(--tx); cursor: pointer; padding: 0; }
.copy-btn:hover { background: var(--btnhover); }
.copy-btn.copied { border-color: var(--green); color: var(--green); --ico-tint: var(--green); }
@media (pointer: coarse) { .copy-btn { width: 44px; height: 44px; } }

/* 위험 작업: a delete kept apart from the form's [취소] and [저장]. */
.danger-zone { margin-top: 28px; border-color: color-mix(in srgb, var(--red) 35%, var(--line)); }
.danger-zone h2 { color: var(--red); }
.danger-row { display: flex; align-items: center; justify-content: space-between; gap: 12px 16px; flex-wrap: wrap; }
.danger-row p { margin: 0; }
.url-cell { white-space: normal; min-width: 12em; }
.url-cell a span { white-space: nowrap; }
form + details.fold { margin-top: 28px; }

/* Result toasts at the lower right (console.js moves plain .flash.info lines here). */
.toaster { position: fixed; right: 20px; bottom: 20px; z-index: 90; display: flex; flex-direction: column; gap: 8px; align-items: flex-end;
  max-width: min(420px, calc(100vw - 40px)); }
.toast { padding: 10px 14px; border-radius: var(--r-md); background: var(--tx); color: var(--panel); font-size: 14px;
  box-shadow: 0 8px 24px rgb(0 0 0 / 0.2); animation: toast-in .2s ease-out; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }
@media (prefers-reduced-motion: reduce) { .toast { animation: none; } }

/* A dialog grows in a little over a fading backdrop; nothing moves when motion is turned down. */
dialog[open] { animation: dialog-in .18s ease-out; }
dialog[open]::backdrop { animation: backdrop-in .18s ease-out; }
@keyframes dialog-in { from { opacity: 0; transform: scale(.96); } }
@keyframes backdrop-in { from { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { dialog[open], dialog[open]::backdrop { animation: none; } }

/* A few choices shown at once, each with its explanation under it. */
fieldset.radios { border: 0; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
fieldset.radios legend { padding: 0; margin-bottom: 4px; font-size: 13px; color: var(--muted); }
fieldset.radios label { display: flex; align-items: flex-start; gap: 8px; min-height: 32px; cursor: pointer; }
fieldset.radios input { margin-top: 4px; }
fieldset.radios span { display: flex; flex-direction: column; }
fieldset.radios small { font-size: 12px; color: var(--muted); }
fieldset.radios input:disabled + span { color: var(--faint); cursor: not-allowed; }
.invite-form { max-width: 480px; }
.dim { opacity: .5; }
.dim input[readonly] { cursor: not-allowed; }
.year-buttons { display: inline-flex; gap: 4px; align-items: center; margin-left: 6px; }
.url-row .suffix { padding: 0 14px 0 10px; display: inline-flex; align-items: center; border: 1px solid var(--line); border-left: 0;
  border-radius: 0 var(--r-md) var(--r-md) 0; background: var(--cell); color: var(--muted); white-space: nowrap; }
.url-row input:has(+ .suffix) { border-radius: var(--r-md) 0 0 var(--r-md); }
.url-preview { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; overflow-wrap: anywhere; }

/* A page seen once (GATEONE Parking 첫 화면): its card rises in once. */
.rise-in { animation: rise-in .35s ease-out both; }
@keyframes rise-in { from { transform: translateY(12px); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .rise-in { animation: none; } }

/* 설정 → 로그인 보안: a row per setting with its switch at the right, as GATEONE's 로그인 보안 screen. */
.setting-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 14px 0; border-top: 1px solid var(--line2); }
.setting-row h3 { margin: 0 0 4px; font-size: 15px; font-weight: 600; color: var(--strong); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.setting-row .hint { margin: 0; line-height: 1.6; max-width: 72ch; }
.setting-row .state { font-size: 12px; font-weight: 500; padding: 2px 8px; border-radius: 999px; background: var(--cell); color: var(--muted); }
.setting-row .state.on { background: var(--greenbg); color: var(--green); }
.switch { appearance: none; -webkit-appearance: none; flex: none; position: relative; width: 44px; height: 24px; margin: 2px 0 0; padding: 0;
  border: 0; border-radius: 999px; background: var(--btnline); cursor: pointer; transition: background .15s; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .25); transition: transform .15s; }
.switch:checked, .switch[aria-checked=true] { background: var(--brand); }
.switch:checked::after, .switch[aria-checked=true]::after { transform: translateX(20px); }
.switch:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
@media (pointer: coarse) { .switch { box-sizing: content-box; border: 10px solid transparent; background-clip: padding-box !important; margin: -8px -10px 0 0; } }
.idle-fields { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px 16px; padding: 0 0 8px; }
.idle-fields label { display: grid; gap: 6px; font-size: 13px; color: var(--muted); }
.idle-fields .unit-row { display: inline-flex; align-items: center; gap: 6px; color: var(--tx); }
.idle-fields input[type=number] { width: 7em; }
.idle-fields[hidden], .idle-fields label[hidden], #login-security [hidden] { display: none; }
#login-security dialog { width: min(460px, calc(100vw - 32px)); }
#login-security dialog p { line-height: 1.6; }
@media (max-width: 520px) { .idle-fields { display: grid; } .idle-fields .btn { width: 100%; } }

/* Phones: names of items break only between words; on the narrowest screens a name sits above its value, so dates,
   addresses and codes keep to one piece. The status tabs show a shadow at the edge where more are, and 정렬 is a
   choice box. */
dl.info dt, table.cards td[data-label]::before { word-break: keep-all; }
.sort-select { display: none; }
@media (max-width: 640px) {
  .tabs { background:
      linear-gradient(270deg, var(--bg) 40%, transparent) right / 32px 100% no-repeat local,
      linear-gradient(270deg, rgba(0, 0, 0, .14), transparent) right / 12px 100% no-repeat scroll; }
}
@media (max-width: 420px) {
  dl.info, dl.info.wide { grid-template-columns: minmax(0, 1fr); }
  dl.info dt { border-bottom: 0; padding-bottom: 0; font-size: 12.5px; }
  dl.info dd { padding-top: 2px; overflow-wrap: break-word; }
  table.cards td { flex-direction: column; gap: 0; overflow-wrap: break-word; }
  table.cards td[data-label]::before { flex: none; }
  table.cards td[data-label=""] { flex-direction: row; }
  .card-sort > a, .card-sort > .faint { display: none; }
  .sort-select { display: inline-flex; align-items: center; gap: 8px; }
  .sort-select select { min-height: 44px; font-size: 16px; }
}
.idle-error { margin: 0 0 8px; color: var(--red); font-size: 13.5px; }

/* The calendar of [달력 열기]: a day chosen is only marked; [적용] at the lower right puts it in the field. Under the
   field on wide screens, a sheet from the bottom on phones. */
dialog.cal-pop { position: fixed; inset: auto; margin: 0; width: 304px; max-width: calc(100vw - 16px); padding: 12px;
  border-radius: 12px; box-shadow: 0 8px 28px rgba(0, 0, 0, .18); }
dialog.cal-pop::backdrop { background: transparent; }
.cal-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.cal-head .icon-btn { width: 40px; min-height: 40px; }
.cal-title { font-size: 15px; color: var(--strong); font-variant-numeric: tabular-nums; }
.cal-grid { display: grid; gap: 2px; }
.cal-row { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 2px; }
.cal-wd { text-align: center; font-size: 12px; color: var(--muted); padding: 4px 0; }
.cal-wd.sun, .cal-day.sun { color: var(--red); }
.cal-day { font: inherit; font-size: 14px; min-height: 38px; border: 1px solid transparent; border-radius: var(--r-md); background: none;
  color: var(--tx); cursor: pointer; font-variant-numeric: tabular-nums; }
.cal-day:hover { background: var(--btnhover); }
.cal-day.today { border-color: var(--btnline); font-weight: 600; }
.cal-day[aria-selected=true] { background: var(--brandfill); border-color: var(--brandfill); color: var(--onbrand); font-weight: 600; }
.cal-day:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
.cal-day[disabled] { color: var(--faint); opacity: .45; cursor: not-allowed; background: none; }
.cal-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 10px; padding-top: 10px;
  border-top: 1px solid var(--line2); }
.cal-picked { font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.cal-actions { display: flex; gap: 8px; margin-left: auto; }
.cal-actions .btn { min-height: 38px; padding: 0 14px; }
.cal-actions .btn[disabled] { opacity: .5; cursor: not-allowed; }
@media (max-width: 720px) {
  dialog.cal-pop { inset: auto 0 0 0; width: 100%; max-width: none; border-radius: 16px 16px 0 0;
    padding: 14px 16px calc(14px + env(safe-area-inset-bottom)); }
  dialog.cal-pop::backdrop { background: rgba(0, 0, 0, .45); }
  .cal-head .icon-btn, .cal-day { min-height: 44px; }
  .cal-head .icon-btn { width: 44px; }
  .cal-actions .btn { min-height: 44px; min-width: 88px; }
}

/* Long notes keep to about 45 characters a line (14px text 640px, 12-13px text 560px) however wide the screen, and
   sentences start on their own lines where the text puts them. A [button name] is not split at a line's end. */
.head p { max-width: 640px; }
.hint { max-width: 560px; }
.page p.muted, .panel > p.muted, .invite > p.muted { max-width: 640px; }
.setting-row .hint { max-width: 560px; }
.nobr { white-space: nowrap; }
.lines { white-space: pre-line; }
.hint-steps { margin: 4px 0; padding-left: 20px; display: grid; gap: 2px; }
dialog p.hint, dialog p.muted { max-width: none; }
#login-security .login-security-part + .login-security-part { margin-top: 18px; }
#login-security .part-title { margin: 0 0 4px; padding-top: 16px; border-top: 1px solid var(--line); font-size: 16px; color: var(--strong); }
#login-security .part-title + p.muted { margin: 0 0 6px; }

/* GATEONE Parking QR 형태: the card name on one line, what it holds in small type under it. */
.pk-qr-types { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
.pk-qr-types label > span { display: grid; gap: 2px; word-break: keep-all; }
.pk-qr-types label small { font-size: 11.5px; color: var(--muted); }

/* QR 출입증: GATEONE's logo at the foot, faint, far from the code (never in or around it). */
.pass-foot { display: grid; justify-items: center; gap: 4px; margin-top: 4px; opacity: .7; }
.pass-foot img { height: 20px; width: auto; display: block; }
.pass-foot span { font-size: 12px; }

/* Phones: the page description shows its first line, [자세히] opens the rest. */
.head-more { display: none; }
@media (max-width: 720px) {
  .head-desc:not(.open) { display: -webkit-box; -webkit-line-clamp: 1; line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
  .head-desc:not(.open) br { display: none; }
  .head-more { display: inline-flex; align-self: flex-start; align-items: center; min-height: 32px; padding: 0; border: 0;
    background: none; color: var(--brand); font: inherit; font-size: 13px; cursor: pointer; }
  .head-more[hidden] { display: none; }
  .install-banner .install-text > span:first-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
}
@media (max-width: 720px) and (pointer: coarse) { .head-more { min-height: 44px; } }

/* 사전방문: the members' and visitors' pages, opened on phones. */
.pv .box { max-width: 460px; }
.pv .box h2 { font-size: 16px; margin: 20px 0 10px; }
.pv .box h2:first-child { margin-top: 0; }
.pv-home { justify-content: flex-start; gap: 14px; }
.pv-head { width: 100%; max-width: 460px; display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.pv-head h1 { font-size: 20px; margin: 2px 0 0; }
.pv-place { margin: 0; color: var(--muted); font-size: 14px; }
.pv-places { width: 100%; max-width: 460px; display: flex; flex-wrap: wrap; gap: 8px; }
.pv-places a { padding: 8px 14px; border: 1px solid var(--line2); border-radius: 999px; font-size: 14px; color: var(--tx); text-decoration: none; }
.pv-places a.on { background: var(--tx); color: var(--panel); border-color: var(--tx); }
.pv-home > .flash { width: 100%; max-width: 460px; margin: 0; }
.pv-count { display: flex; align-items: baseline; justify-content: space-between; padding-bottom: 16px; border-bottom: 1px solid var(--line2); font-size: 14px; color: var(--muted); }
.pv-count b { font-size: 28px; color: var(--tx); font-variant-numeric: tabular-nums; }
.pv-count small { font-size: 14px; font-weight: 400; color: var(--muted); }
.pv-gap { margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--line2); }
.pv-list { list-style: none; margin: 0; padding: 0; display: grid; }
.pv-list li { padding: 12px 0; border-top: 1px solid var(--line2); display: grid; gap: 4px; font-size: 14px; }
.pv-list li:first-child { border-top: 0; padding-top: 0; }
.pv-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.pv-link { font-size: 12px; color: var(--muted); display: grid; gap: 4px; margin-top: 4px; }
.pv-link input { font-size: 13px; }
.pv-more { margin-top: 16px; }
.pv-more summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; font-size: 14px; color: var(--muted); }
.pv-more[open] summary { margin-bottom: 8px; }
.pv-consent { width: 100%; text-align: left; }
.pv-terms { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; font-size: 13px; padding: 12px; border: 1px solid var(--line2); border-radius: 10px; }
.pv-terms dt { color: var(--muted); white-space: nowrap; }
.pv-terms dd { margin: 0; }
.sms-limit input.owner-email { width: 18em; max-width: 60vw; }

/* 설치 통행증: one long line of letters, shown whole so it can be copied. */
.pass-text { width: 100%; max-width: 720px; font-family: var(--mono); font-size: 12px; line-height: 1.5; word-break: break-all; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--cell); color: var(--tx); resize: none; }

/* 부가기능: [모두 선택] sits above the add-ons it ticks. */
label.check.check-all { margin-bottom: 6px; padding-bottom: 6px; border-bottom: 1px solid var(--line, #e3e6ea); font-weight: 600; }

/* 진단 기록 */
.diag-summary, .diag-detail { margin: 8px 0 0; padding: 10px 12px; background: var(--cell); border-radius: 6px; font-size: 12px;
  line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; max-height: 420px; overflow: auto; }
.diag-table td { vertical-align: top; }
.diag-table td.wrap { overflow-wrap: anywhere; }
.diag-table details summary { cursor: pointer; font-size: 12px; }
