:root {
  --bg: #08090B;
  --bg-panel: #0D0F13;
  --bg-hover: #13161C;
  --topbar-bg: rgba(8, 9, 11, 0.72);
  --bottombar-bg: rgba(8, 9, 11, 0.82);
  --switch-bg: rgba(13, 15, 19, 0.85);
  --studio-glow: rgba(255, 255, 255, 0.048);
  --dot-color: rgba(255, 255, 255, 0.055);
  --ink: #F5F6F8;
  --ink-2: #A2A8B3;
  --ink-3: #7A8291;
  --line: rgba(255, 255, 255, 0.10);
  --line-mid: rgba(255, 255, 255, 0.16);
  --line-strong: rgba(255, 255, 255, 0.30);
  --btn-primary-hover: #DCE0E6;
  --hover-subtle: rgba(255, 255, 255, 0.05);
  --tile-hover-border: rgba(255, 255, 255, 0.18);
  --price-bg: rgba(255, 255, 255, 0.04);
  --retainer-border: rgba(16, 185, 129, 0.35);
  --retainer-ink: #B7F4D8;
  --retainer-bg: rgba(16, 185, 129, 0.07);
  --chip-checked-bg: rgba(255, 255, 255, 0.06);
  --modal-backdrop: rgba(4, 5, 7, 0.78);
  --modal-shadow: 0 32px 80px rgba(0, 0, 0, 0.65);
  --live: #10B981;
  --reserve: #D9A036;
  --danger: #E56358;
  --radius: 2px;
  --stage-max: 1320px;
  --font-sans: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Inter", "Segoe UI", "Helvetica Neue", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans", sans-serif;
  --font-mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Monaco, Consolas, monospace;
  color-scheme: dark;
}

:root[data-theme="light"] {
  --bg: #F4F5F7;
  --bg-panel: #FFFFFF;
  --bg-hover: #E9ECF1;
  --topbar-bg: rgba(244, 245, 247, 0.84);
  --bottombar-bg: rgba(244, 245, 247, 0.90);
  --switch-bg: rgba(255, 255, 255, 0.92);
  --studio-glow: rgba(255, 255, 255, 0.85);
  --dot-color: rgba(11, 13, 17, 0.09);
  --ink: #0B0D11;
  --ink-2: #4B5260;
  --ink-3: #6C7484;
  --line: rgba(11, 13, 17, 0.10);
  --line-mid: rgba(11, 13, 17, 0.16);
  --line-strong: rgba(11, 13, 17, 0.32);
  --btn-primary-hover: #232833;
  --hover-subtle: rgba(11, 13, 17, 0.05);
  --tile-hover-border: rgba(11, 13, 17, 0.24);
  --price-bg: rgba(11, 13, 17, 0.04);
  --retainer-border: rgba(5, 150, 105, 0.35);
  --retainer-ink: #047857;
  --retainer-bg: rgba(16, 185, 129, 0.09);
  --chip-checked-bg: rgba(11, 13, 17, 0.06);
  --modal-backdrop: rgba(11, 13, 17, 0.46);
  --modal-shadow: 0 28px 72px rgba(11, 13, 17, 0.18);
  --live: #059669;
  --danger: #C93B32;
  color-scheme: light;
}

*, *::before, *::after {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

:lang(ja) {
  font-family: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic", "Meiryo", "Noto Sans JP", var(--font-sans);
}

:lang(ko) {
  font-family: "Apple SD Gothic Neo", "Pretendard", "Malgun Gothic", "Noto Sans KR", var(--font-sans);
}

:lang(zh) {
  font-family: "SF Pro Display", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
}

a {
  color: inherit;
  text-decoration: none;
}

button, input, textarea {
  font: inherit;
  color: inherit;
}

h1, h2, h3, p {
  margin: 0;
}

/* ===== Full-Bleed Single-Screen Shell ===== */
body.page-home {
  height: 100dvh;
  width: 100vw;
  overflow: hidden;
  background:
    radial-gradient(ellipse 75% 48% at 50% -6%, var(--studio-glow), transparent 68%),
    var(--bg);
}

.viewport-shell {
  position: relative;
  height: 100dvh;
  width: 100%;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
}

.ambient-grid {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image: radial-gradient(var(--dot-color) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: radial-gradient(ellipse 90% 80% at 50% 45%, rgba(0, 0, 0, 0.55), transparent 85%);
  -webkit-mask-image: radial-gradient(ellipse 90% 80% at 50% 45%, rgba(0, 0, 0, 0.55), transparent 85%);
}

.topbar,
.main-band,
.bottombar {
  position: relative;
  z-index: 1;
  width: 100%;
}

.stage {
  width: min(var(--stage-max), 100%);
  margin-inline: auto;
}

@media (min-width: 1322px) {
  .stage {
    border-inline: 1px solid var(--line);
  }
}

/* ===== Top Bar ===== */
.topbar {
  border-bottom: 1px solid var(--line);
  background: var(--topbar-bg);
  backdrop-filter: blur(12px);
}

.topbar-inner {
  height: clamp(54px, 7vh, 68px);
  padding-inline: clamp(20px, 3vw, 44px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.topbar-controls {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  letter-spacing: -0.025em;
}

.brand-mark {
  width: 28px;
  height: 28px;
  color: var(--ink);
  flex-shrink: 0;
}

.brand-name {
  font-size: 16px;
  font-weight: 500;
  color: var(--ink);
  letter-spacing: -0.02em;
}

.brand-entity {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  color: var(--ink-3);
  border: 1px solid var(--line-mid);
  padding: 2px 6px;
  border-radius: var(--radius);
}

.lang-switch,
.theme-switch {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line-mid);
  border-radius: var(--radius);
  background: var(--switch-bg);
  padding: 2px;
  gap: 2px;
}

.lang-switch button,
.theme-switch button {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--ink-2);
  font-size: 12px;
  line-height: 1;
  height: 26px;
  padding: 0 10px;
  border-radius: 1px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: color 140ms ease, background-color 140ms ease;
  white-space: nowrap;
}

.theme-switch button {
  padding: 0 8px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.06em;
}

.theme-switch svg {
  width: 13px;
  height: 13px;
  display: block;
}

.lang-switch button:hover,
.theme-switch button:hover {
  color: var(--ink);
  background: var(--hover-subtle);
}

.lang-switch button[aria-pressed="true"],
.theme-switch button[aria-pressed="true"] {
  background: var(--ink);
  color: var(--bg);
  font-weight: 500;
}

.lang-switch button:focus-visible,
.theme-switch button:focus-visible {
  outline: 1px solid var(--ink);
  outline-offset: 1px;
}

/* ===== Main Single-Screen Architectural Split ===== */
.main-band {
  min-height: 0;
  display: grid;
  grid-template-rows: minmax(0, 1fr);
}

.main-grid {
  height: 100%;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
}

/* Left Column: Identity + Capabilities + Actions */
.pane-identity {
  min-height: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: clamp(16px, 2.8vh, 34px);
  padding: clamp(22px, 4.2vh, 52px) clamp(20px, 3vw, 44px);
  border-inline-end: 1px solid var(--line);
}

.identity-top {
  display: flex;
  flex-direction: column;
  gap: clamp(10px, 1.8vh, 18px);
}

.kicker {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  color: var(--ink-3);
  text-transform: uppercase;
}

h1 {
  font-size: clamp(26px, min(3.2vw, 5.0vh), 48px);
  line-height: 1.1;
  font-weight: 500;
  letter-spacing: -0.036em;
  color: var(--ink);
  white-space: pre-line;
}

:lang(zh) h1,
:lang(ja) h1 {
  line-height: 1.22;
  letter-spacing: -0.02em;
}

:lang(ja) h1 {
  font-size: clamp(24px, min(2.85vw, 4.5vh), 42px);
}

:lang(ko) h1 {
  line-height: 1.2;
  letter-spacing: -0.025em;
  word-break: keep-all;
}

.lead {
  font-size: clamp(13.5px, min(1.15vw, 1.95vh), 16px);
  line-height: 1.58;
  color: var(--ink-2);
  max-width: 44ch;
}

:lang(ko) .lead,
:lang(ko) .cap-body span,
:lang(ko) .tile-mid p {
  word-break: keep-all;
}

/* Capabilities Ledger */
.cap-list {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  display: flex;
  flex-direction: column;
}

.cap-row {
  appearance: none;
  border: 0;
  background: transparent;
  width: 100%;
  text-align: start;
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) auto;
  align-items: start;
  gap: 14px;
  padding: clamp(12px, 2vh, 20px) 4px;
  cursor: pointer;
  transition: background-color 160ms ease, padding-inline 160ms ease;
}

.cap-row + .cap-row {
  border-top: 1px solid var(--line);
}

.cap-row:hover {
  background: rgba(255, 255, 255, 0.028);
  padding-inline: 10px;
}

.cap-row.is-static {
  grid-template-columns: 32px minmax(0, 1fr);
  cursor: default;
}

.cap-row.is-static:hover {
  background: transparent;
  padding-inline: 4px;
}

.cap-row:focus-visible {
  outline: 1px solid var(--line-strong);
  outline-offset: -1px;
}

.cap-idx {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-3);
  padding-top: 3px;
}

.cap-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.cap-body strong {
  font-size: clamp(14px, min(1.1vw, 1.9vh), 15.5px);
  font-weight: 500;
  color: var(--ink);
  letter-spacing: -0.015em;
}

.cap-body span {
  font-size: clamp(12.5px, min(0.95vw, 1.65vh), 13.5px);
  line-height: 1.5;
  color: var(--ink-2);
}

.cap-arrow {
  color: var(--ink-3);
  font-size: 14px;
  padding-top: 2px;
  transition: color 160ms ease, transform 160ms ease;
}

.cap-row:hover .cap-arrow {
  color: var(--ink);
  transform: translateX(3px);
}

/* Primary Action Bar */
.action-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.btn-primary,
.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: clamp(40px, 5.2vh, 46px);
  padding-inline: 20px;
  border-radius: var(--radius);
  font-size: 13.5px;
  font-weight: 500;
  letter-spacing: -0.01em;
  cursor: pointer;
  transition: background-color 150ms ease, border-color 150ms ease, color 150ms ease;
  white-space: nowrap;
}

.btn-primary {
  background: var(--ink);
  color: var(--bg);
  border: 1px solid var(--ink);
}

.btn-primary:hover {
  background: var(--btn-primary-hover);
  border-color: var(--btn-primary-hover);
}

.btn-primary:disabled {
  opacity: 0.55;
  cursor: wait;
}

.btn-secondary {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line-mid);
}

.btn-secondary:hover {
  background: var(--bg-hover);
  border-color: var(--line-strong);
}

.btn-primary:focus-visible,
.btn-secondary:focus-visible {
  outline: 1px solid var(--ink);
  outline-offset: 2px;
}

/* Right Column: 2x2 Model Token Matrix */
.pane-matrix {
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.matrix-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: clamp(12px, 1.8vh, 18px) clamp(20px, 2.6vw, 36px);
  border-bottom: 1px solid var(--line);
}

.matrix-label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--ink-3);
  text-transform: uppercase;
}

.matrix-legend {
  display: inline-flex;
  align-items: center;
  gap: 16px;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  color: var(--ink-3);
}

.dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

.dot-live {
  background: var(--live);
}

.dot-reserve {
  background: var(--reserve);
}

.matrix-grid {
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: repeat(2, minmax(0, 1fr));
}

.tile {
  position: relative;
  appearance: none;
  border: 0;
  background: transparent;
  text-align: start;
  width: 100%;
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: clamp(10px, 2vh, 22px);
  padding: clamp(18px, 3.2vh, 36px) clamp(20px, 2.6vw, 36px);
  cursor: pointer;
  transition: background-color 180ms ease;
}

/* Crisp internal architectural hairlines for 2x2 matrix */
.tile:nth-child(odd) {
  border-inline-end: 1px solid var(--line);
}

.tile:nth-child(1),
.tile:nth-child(2) {
  border-bottom: 1px solid var(--line);
}

/* Micro precision reticle accent on hover */
.tile::after {
  content: "";
  position: absolute;
  inset: 0;
  border: 1px solid transparent;
  pointer-events: none;
  transition: border-color 180ms ease;
}

.tile:hover {
  background: var(--bg-panel);
}

.tile:hover::after {
  border-color: var(--tile-hover-border);
}

.tile:focus-visible {
  outline: none;
  background: var(--bg-panel);
}

.tile:focus-visible::after {
  border-color: var(--ink);
}

.tile-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.tile-code {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-3);
  letter-spacing: 0.08em;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.09em;
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink-2);
  background: rgba(255, 255, 255, 0.02);
}

.tile-mid {
  display: flex;
  flex-direction: column;
  gap: clamp(6px, 1.2vh, 12px);
}

.matrix-note {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.1em;
  color: var(--ink-3);
  text-transform: uppercase;
}

.price-pill {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.06em;
  padding: 4px 9px;
  border: 1px solid var(--line-mid);
  border-radius: var(--radius);
  color: var(--ink);
  background: var(--price-bg);
  white-space: nowrap;
}

.price-pill.is-retainer {
  border-color: var(--retainer-border);
  color: var(--retainer-ink);
  background: var(--retainer-bg);
}

.tile-mid h2 {
  font-size: clamp(19px, min(1.85vw, 3.0vh), 26px);
  font-weight: 500;
  letter-spacing: -0.025em;
  line-height: 1.18;
  color: var(--ink);
}

.tile-mid p {
  font-size: clamp(12.5px, min(0.98vw, 1.75vh), 14px);
  line-height: 1.52;
  color: var(--ink-2);
  max-width: 28ch;
}

.tile-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: clamp(10px, 1.5vh, 16px);
  border-top: 1px solid var(--line);
}

.tile-meta {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-3);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tile-cta {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
  white-space: nowrap;
}

.tile-cta .arrow-icon {
  display: inline-block;
  transition: transform 160ms ease;
}

.tile:hover .tile-cta .arrow-icon {
  transform: translateX(3px);
}

.tile-live:hover .tile-cta .arrow-icon {
  transform: translate(2px, -2px);
}

/* ===== Bottom Bar ===== */
.bottombar {
  border-top: 1px solid var(--line);
  background: var(--bottombar-bg);
}

.bottombar-inner {
  height: clamp(40px, 5.2vh, 50px);
  padding-inline: clamp(20px, 3vw, 44px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-3);
}

.foot-nav {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 18px;
}

.foot-email {
  color: var(--ink-2);
}

.locale-badge {
  color: var(--ink-3);
  letter-spacing: 0.08em;
}

.foot-link {
  color: var(--ink-2);
  transition: color 140ms ease;
}

.foot-link:hover {
  color: var(--ink);
}

/* ===== Legal Policy Pages (/terms, /privacy, /refund) ===== */
body.page-legal {
  min-height: 100dvh;
  background: var(--bg);
  color: var(--ink);
  display: flex;
  flex-direction: column;
}

.legal-main {
  flex: 1;
  width: min(860px, calc(100% - 40px));
  margin: 0 auto;
  padding: 52px 0 72px;
}

.legal-kicker {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--ink-3);
  text-transform: uppercase;
  margin-bottom: 12px;
}

.legal-main h1 {
  font-size: clamp(28px, 4vw, 40px);
  line-height: 1.15;
  margin-bottom: 12px;
  white-space: normal;
}

.legal-meta {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-3);
  padding-bottom: 24px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 32px;
}

.legal-section {
  margin-bottom: 28px;
}

.legal-section h2 {
  font-size: 17px;
  font-weight: 500;
  color: var(--ink);
  letter-spacing: -0.015em;
  margin-bottom: 10px;
}

.legal-section p,
.legal-section li {
  font-size: 14.5px;
  line-height: 1.72;
  color: var(--ink-2);
}

.legal-section p + p {
  margin-top: 10px;
}

.legal-section ul {
  margin: 8px 0 0;
  padding-left: 20px;
  display: grid;
  gap: 6px;
}

.legal-section a {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.legal-back {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-2);
}

.legal-back:hover {
  color: var(--ink);
}

/* ===== RTL Directional Polishing ===== */
html[dir="rtl"] .cap-arrow,
html[dir="rtl"] .btn-primary .arrow-icon,
html[dir="rtl"] .tile-reserve .arrow-icon {
  display: inline-block;
  transform: scaleX(-1);
}

html[dir="rtl"] .cap-row:hover .cap-arrow,
html[dir="rtl"] .tile-reserve:hover .arrow-icon {
  transform: scaleX(-1) translateX(3px);
}

html[dir="rtl"] .tile-mid h2 {
  text-align: start;
}

/* ===== Reservation Modal ===== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: var(--modal-backdrop);
  backdrop-filter: blur(8px);
  display: grid;
  place-items: center;
  padding: 20px;
}

.modal-backdrop[hidden] {
  display: none;
}

.modal-panel {
  width: min(560px, 100%);
  max-height: calc(100dvh - 40px);
  overflow-y: auto;
  background: var(--bg-panel);
  border: 1px solid var(--line-mid);
  border-radius: var(--radius);
  padding: clamp(22px, 3vw, 32px);
  box-shadow: var(--modal-shadow);
}

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.modal-kicker {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  color: var(--ink-3);
  margin-bottom: 6px;
}

.modal-head h2 {
  font-size: 22px;
  font-weight: 500;
  letter-spacing: -0.025em;
  color: var(--ink);
}

.modal-close {
  appearance: none;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-mid);
  border-radius: var(--radius);
  background: transparent;
  color: var(--ink-2);
  cursor: pointer;
  font-size: 14px;
  transition: color 140ms ease, border-color 140ms ease, background-color 140ms ease;
}

.modal-close:hover {
  color: var(--ink);
  border-color: var(--line-strong);
  background: var(--bg-hover);
}

.modal-sub {
  margin-top: 10px;
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--ink-2);
}

.modal-form {
  margin-top: 22px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

fieldset.field {
  border: 0;
  margin: 0;
  padding: 0;
  min-width: 0;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.field > span,
.field > legend {
  font-size: 12px;
  color: var(--ink-2);
  padding: 0;
}

.field input,
.field textarea {
  width: 100%;
  border: 1px solid var(--line-mid);
  background: var(--bg);
  color: var(--ink);
  border-radius: var(--radius);
  padding: 10px 12px;
  font-size: 14px;
  outline: none;
  transition: border-color 140ms ease;
}

.field textarea {
  resize: vertical;
  min-height: 78px;
}

.field input:focus,
.field textarea:focus {
  border-color: var(--ink);
}

.field input::placeholder,
.field textarea::placeholder {
  color: var(--ink-3);
}

.chip-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.chip {
  display: flex;
  align-items: center;
  gap: 9px;
  border: 1px solid var(--line-mid);
  border-radius: var(--radius);
  padding: 9px 12px;
  background: var(--bg);
  color: var(--ink-2);
  font-size: 13.5px;
  cursor: pointer;
  transition: border-color 140ms ease, background-color 140ms ease, color 140ms ease;
}

.chip input {
  width: 15px;
  height: 15px;
  margin: 0;
  accent-color: var(--ink);
  flex-shrink: 0;
}

.chip:has(input:checked) {
  border-color: var(--ink);
  background: var(--chip-checked-bg);
  color: var(--ink);
}

.hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.modal-foot {
  margin-top: 4px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

#form-status {
  font-size: 13px;
  color: var(--ink-2);
  min-height: 1.2em;
}

#form-status.ok {
  color: var(--live);
}

#form-status.bad {
  color: var(--danger);
}

/* ===== Admin Desk Page ===== */
body.page-desk {
  min-height: 100dvh;
  background: var(--bg);
}

.desk {
  width: min(1020px, calc(100% - 40px));
  margin: 40px auto 64px;
}

.desk h1 {
  font-size: 32px;
  max-width: none;
  margin: 18px 0 8px;
}

.desk-sub {
  color: var(--ink-2);
  font-size: 14px;
}

.desk-bar {
  display: flex;
  gap: 10px;
  margin: 22px 0;
  padding: 12px;
  background: var(--bg-panel);
  border: 1px solid var(--line-mid);
  border-radius: var(--radius);
}

.desk-bar input {
  flex: 1;
  border: 1px solid var(--line-mid);
  background: var(--bg);
  color: var(--ink);
  border-radius: var(--radius);
  padding: 10px 14px;
  outline: none;
}

.desk-bar input:focus {
  border-color: var(--ink);
}

.desk-table {
  margin-top: 16px;
  background: var(--bg-panel);
  border: 1px solid var(--line-mid);
  border-radius: var(--radius);
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}

th, td {
  text-align: start;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

th {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-3);
  font-weight: 500;
  letter-spacing: 0.08em;
}

/* ===== Responsive Safeguards ===== */
@media (max-height: 640px) and (min-width: 860px) {
  .topbar-inner { height: 50px; }
  .bottombar-inner { height: 36px; }
  .pane-identity { padding: 16px 28px; gap: 12px; }
  .cap-row { padding: 9px 4px; }
  .tile { padding: 14px 22px; gap: 8px; }
}

@media (max-width: 859px) {
  body.page-home {
    height: auto;
    min-height: 100dvh;
    overflow-x: hidden;
    overflow-y: auto;
  }

  .viewport-shell {
    height: auto;
    min-height: 100dvh;
    overflow: visible;
  }

  .topbar-inner {
    height: auto;
    padding-block: 12px;
    flex-wrap: wrap;
  }

  .topbar-controls {
    width: 100%;
    justify-content: space-between;
  }

  .lang-switch {
    flex: 1;
    justify-content: space-between;
  }

  .lang-switch button {
    flex: 1;
    text-align: center;
    padding: 0 6px;
  }

  .main-grid {
    grid-template-columns: 1fr;
  }

  .pane-identity {
    border-inline-end: 0;
    border-bottom: 1px solid var(--line);
    padding: 28px 20px;
    gap: 24px;
  }

  .matrix-grid {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
  }

  .tile:nth-child(odd) {
    border-inline-end: 0;
  }

  .tile {
    border-bottom: 1px solid var(--line);
    padding: 22px 20px;
  }

  .tile:last-child {
    border-bottom: 0;
  }

  .field-row,
  .chip-grid {
    grid-template-columns: 1fr;
  }

  .modal-foot {
    flex-direction: column;
    align-items: stretch;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition-duration: 0.01ms !important;
  }
}
