:root {
  color-scheme: light;
  --canvas: #f3f6fb;
  --canvas-deep: #eaf0f8;
  --panel: #ffffff;
  --ink: #152039;
  --muted: #6f7890;
  --line: #dce3ef;
  --line-strong: #c7d1e2;
  --nav: #0c1830;
  --nav-soft: #142441;
  --brand: #286be8;
  --brand-2: #164fbf;
  --brand-soft: #edf4ff;
  --warm: #ffb45f;
  --ok: #14845e;
  --warn: #ad6a12;
  --danger: #bc3f4d;
  --shadow: 0 14px 38px rgba(24, 43, 77, .08);
  --shadow-deep: 0 28px 80px rgba(7, 18, 39, .2);
  font-family: "BIZ UDPGothic", "Yu Gothic UI", "Hiragino Kaku Gothic ProN", Meiryo, sans-serif;
}

.runtime-card {max-width:880px;padding:clamp(18px,3vw,32px);color:var(--ink);background:var(--panel);border:1px solid var(--line);border-radius:14px}
.runtime-card .panel-head p,.runtime-note,.runtime-checks p {color:var(--muted);line-height:1.65}
.runtime-facts {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:20px;margin:24px 0;padding:20px 0;border-block:1px solid var(--line)}
.runtime-facts dt {font-size:12px;color:var(--muted);margin-bottom:8px}
.runtime-facts dd {margin:0;font-size:16px;font-weight:650;overflow-wrap:anywhere}
.runtime-card form label {display:grid;gap:10px;max-width:480px}
.runtime-movement{border-top:1px solid var(--line);margin-top:24px;padding-top:20px}
.runtime-operation-title{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap}
.runtime-operation-title h3{margin:0;font-size:16px}.runtime-device-state{font-size:12px;color:var(--muted)}
.runtime-steps{list-style:none;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;padding:0;margin:18px 0}
.runtime-steps li{display:flex;align-items:center;gap:8px;padding:10px;border:1px solid var(--line);border-radius:8px;font-size:12px;color:var(--muted)}
.runtime-steps li>span{display:grid;place-items:center;width:22px;height:22px;flex:0 0 22px;border-radius:50%;background:#f0f3f8;color:var(--ink);font-variant-numeric:tabular-nums}
.runtime-steps .current{border-color:var(--brand);color:var(--ink);background:var(--brand-soft)}
.runtime-steps .complete>span{background:var(--brand);color:#fff}
.runtime-actions{display:flex;gap:10px;flex-wrap:wrap;align-items:center}
.runtime-actions button{min-height:44px;padding:10px 16px;white-space:normal}
.runtime-cancel{background:#fff;border:1px solid var(--danger);color:var(--danger);border-radius:9px}
.runtime-feedback{font-size:13px;line-height:1.6;overflow-wrap:anywhere;min-height:1.6em}
.runtime-checks summary{font-weight:600;cursor:pointer;padding:6px 0}
@media(max-width:600px){.runtime-steps{grid-template-columns:repeat(2,minmax(0,1fr))}.runtime-facts{grid-template-columns:1fr}.runtime-actions{align-items:stretch}.runtime-actions button{flex:1 1 160px}}
.runtime-card select {width:100%;min-width:0;color:var(--ink);background:var(--panel)}
.runtime-checks {margin-top:28px;border-top:1px solid var(--line);padding-top:20px}
.runtime-checks ul {padding-left:22px;line-height:1.9}
.runtime-card [data-runtime-result] {font-size:13px;color:var(--muted);line-height:1.6}
@media(max-width:600px){.runtime-facts{grid-template-columns:1fr}.runtime-card .section-actions{flex-wrap:wrap}}

* { box-sizing: border-box; }

html { background: var(--canvas); }

body {
  margin: 0;
  min-width: 320px;
  background: var(--canvas);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

button { cursor: pointer; }

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible {
  outline: 3px solid rgba(40, 107, 232, .28);
  outline-offset: 2px;
}

.hidden { display: none !important; }
.locked { overflow: hidden; }

/* Login */
.login-screen {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1.34fr) minmax(420px, .86fr);
  background: var(--nav);
}

.login-visual {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
  isolation: isolate;
  background: #07152d;
}

.login-visual::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(rgba(102, 152, 239, .055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(102, 152, 239, .055) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, .9), transparent 76%);
}

.login-visual::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(180deg, rgba(7, 21, 45, .02) 38%, rgba(7, 21, 45, .96) 92%);
  pointer-events: none;
}

.login-brand,
.side-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.login-brand {
  position: absolute;
  top: 38px;
  left: 46px;
  z-index: 4;
  color: #fff;
}

.login-brand div,
.side-brand div { display: grid; }

.brand-mark {
  display: grid;
  place-items: center;
  width: 43px;
  height: 43px;
  border-radius: 13px;
  background: var(--brand);
  color: #fff;
  font-weight: 900;
  letter-spacing: -.04em;
  box-shadow: 0 8px 24px rgba(40, 107, 232, .3);
}

.brand-mark img {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  object-fit: contain;
}

.login-brand strong,
.side-brand strong { letter-spacing: .04em; }

.login-brand small,
.side-brand small {
  color: rgba(231, 240, 255, .6);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .2em;
}

.login-visual-copy {
  position: absolute;
  z-index: 4;
  left: clamp(46px, 6vw, 92px);
  bottom: clamp(54px, 8vh, 100px);
  width: min(540px, calc(100% - 92px));
  color: #fff;
}

.login-visual-copy > p,
.hq-overview-copy > p {
  margin: 0 0 13px;
  color: #77a9ff;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .2em;
}

.login-visual-copy h2 {
  margin: 0;
  font-size: clamp(34px, 4.1vw, 62px);
  line-height: 1.2;
  letter-spacing: -.055em;
}

.login-visual-copy > span {
  display: block;
  max-width: 470px;
  margin-top: 21px;
  color: rgba(224, 234, 251, .75);
  font-size: 14px;
  line-height: 1.9;
}

.login-flow {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 22px;
  margin-top: 29px;
  color: rgba(235, 242, 255, .8);
  font-size: 11px;
  font-weight: 700;
}

.login-flow span { display: inline-flex; align-items: center; gap: 7px; }
.login-flow b { color: var(--warm); font: 800 10px/1 ui-monospace, SFMono-Regular, Consolas, monospace; }

.login-illustration {
  position: absolute;
  z-index: 0;
  top: 4%;
  right: -17%;
  width: 116%;
  height: 75%;
  object-fit: cover;
  object-position: center;
  opacity: .92;
}

.login-form-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px clamp(30px, 5vw, 78px) 30px;
  background: #fff;
}

.login-card {
  width: min(430px, 100%);
  display: grid;
  gap: 17px;
}

.login-card-brand {
  display: none;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.login-card-brand .brand-mark { width: 38px; height: 38px; border-radius: 11px; }

.login-card > p,
.panel-head p,
.topbar p,
.dialog-head p {
  margin: 0;
  color: var(--brand);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .17em;
}

.login-card h1 {
  margin: -7px 0 0;
  font-size: clamp(27px, 3vw, 34px);
  line-height: 1.35;
  letter-spacing: -.035em;
}

.login-card > span,
.login-card > small { color: var(--muted); }

.login-card > small { line-height: 1.75; }

.login-footnote {
  width: min(430px, 100%);
  margin: auto 0 0;
  padding-top: 36px;
  color: #a1a9b8;
  font: 700 9px/1.4 ui-monospace, SFMono-Regular, Consolas, monospace;
  letter-spacing: .16em;
}

label { display: grid; gap: 7px; }

label > span {
  color: #505c73;
  font-size: 12px;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  outline: none;
  background: #fff;
  color: var(--ink);
  transition: border-color .18s ease, box-shadow .18s ease;
}

textarea {
  height: 84px;
  padding-top: 10px;
  resize: vertical;
}

input::placeholder,
textarea::placeholder { color: #aab2c1; }

input:focus,
select:focus,
textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(40, 107, 232, .1);
}

.check {
  display: flex;
  align-items: center;
  gap: 9px;
}

.check input,
.feature-item input {
  width: 17px;
  height: 17px;
  accent-color: var(--brand);
}

.primary,
.secondary,
.danger,
.text-button,
.icon-button {
  min-height: 40px;
  border: 0;
  border-radius: 9px;
  padding: 9px 15px;
  font-weight: 800;
  transition: transform .18s ease, background .18s ease, box-shadow .18s ease;
}

.primary {
  background: var(--brand);
  color: #fff;
  box-shadow: 0 8px 20px rgba(40, 107, 232, .2);
}

.primary:hover { background: var(--brand-2); transform: translateY(-1px); }
.primary:disabled { cursor: not-allowed; opacity: .55; transform: none; }

.login-submit { min-height: 48px; margin-top: 3px; }

.secondary {
  border: 1px solid var(--line);
  background: #f4f7fb;
  color: #34425d;
}

.secondary:hover { background: #eaf0f8; }
.danger { background: #fff0f2; color: var(--danger); }
.danger:hover { background: #ffe4e8; }
.text-button { min-height: auto; background: transparent; color: inherit; padding: 4px; }

.icon-button {
  width: 40px;
  height: 40px;
  padding: 0;
  background: #edf1f7;
  color: var(--ink);
  font-size: 19px;
}

.message {
  padding: 11px 13px;
  border: 1px solid #f2cbd1;
  border-radius: 9px;
  background: #fff3f5;
  color: var(--danger);
}

/* Headquarters shell */
.app {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 10;
  width: 248px;
  display: flex;
  flex-direction: column;
  padding: 28px 17px 19px;
  overflow-y: auto;
  background: var(--nav);
  color: #e8effb;
}

.side-brand { padding: 0 9px 28px; }
.side-brand .brand-mark { background: #fff; color: var(--brand); box-shadow: none; }

.sidebar nav {
  display: grid;
  gap: 7px;
}

.nav {
  width: 100%;
  min-height: 58px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 12px;
  border: 1px solid transparent;
  border-radius: 11px;
  background: transparent;
  color: #9faec5;
  text-align: left;
}

.nav:hover { color: #fff; background: rgba(255, 255, 255, .055); }

.nav.active {
  border-color: rgba(104, 159, 255, .2);
  background: #1a3159;
  color: #fff;
  box-shadow: inset 3px 0 0 #67a0ff;
}

.nav-icon {
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: rgba(255, 255, 255, .06);
}

.nav.active .nav-icon { background: rgba(101, 157, 255, .18); }

.nav-icon svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.nav:first-child .nav-icon svg { fill: currentColor; stroke: none; }

.nav-copy { display: grid; line-height: 1.2; }
.nav-mobile-label { display: none; }
.nav-copy strong { font-size: 13px; }
.nav-copy small { margin-top: 5px; color: #71819a; font-size: 8px; font-weight: 800; letter-spacing: .16em; }
.nav.active .nav-copy small { color: #89b4ff; }

.side-status {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: auto;
  padding: 14px 10px;
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 11px;
  background: rgba(255, 255, 255, .035);
}

.status-dot {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #4bd6a1;
  box-shadow: 0 0 0 5px rgba(75, 214, 161, .11);
}

.side-status div { display: grid; line-height: 1.35; }
.side-status strong { font-size: 9px; letter-spacing: .14em; }
.side-status small { color: #8292aa; font-size: 10px; }

.side-bottom {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  padding: 14px 8px 0;
  border-top: 1px solid rgba(255, 255, 255, .08);
  color: #c9d4e4;
}

.side-bottom > div { min-width: 0; display: grid; }
.side-bottom small { color: #65748d; font-size: 8px; font-weight: 800; letter-spacing: .12em; }
.side-bottom span { overflow: hidden; font-size: 11px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.side-bottom .text-button { color: #8da0ba; font-size: 10px; }
.side-bottom .text-button:hover { color: #fff; }

.app main {
  grid-column: 2;
  min-width: 0;
  padding: 0 clamp(22px, 3vw, 42px) 46px;
}

.topbar {
  height: 96px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.topbar h1 {
  margin: 1px 0 0;
  font-size: 25px;
  line-height: 1.35;
  letter-spacing: -.035em;
}

.top-actions { display: flex; align-items: center; gap: 10px; }

.key-chip {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 7px 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, .7);
  color: #5f6b81;
  font: 700 10px/1.3 ui-monospace, SFMono-Regular, Consolas, monospace;
}

.view { display: none; }
.view.active { display: block; }

.hq-overview-hero {
  position: relative;
  min-height: 265px;
  display: grid;
  grid-template-columns: minmax(320px, .82fr) 1.18fr;
  overflow: hidden;
  margin-bottom: 16px;
  border: 1px solid rgba(59, 105, 180, .2);
  border-radius: 18px;
  background: #0a1933;
  box-shadow: var(--shadow-deep);
  color: #fff;
}

.hq-overview-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(90deg, #0a1933 0%, rgba(10, 25, 51, .94) 38%, rgba(10, 25, 51, .1) 72%);
}

.hq-overview-copy {
  position: relative;
  z-index: 3;
  align-self: center;
  padding: 35px 0 35px 38px;
}

.hq-overview-copy h2 {
  margin: 0;
  font-size: clamp(26px, 3.2vw, 43px);
  line-height: 1.25;
  letter-spacing: -.045em;
}

.hq-overview-copy > span {
  display: block;
  max-width: 470px;
  margin-top: 14px;
  color: rgba(226, 235, 250, .73);
  font-size: 12px;
}

.hero-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 20px;
}

.hero-chips span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 9px;
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 7px;
  background: rgba(255, 255, 255, .055);
  color: #c9d7ed;
  font-size: 9px;
  font-weight: 700;
}

.hero-chips i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #4bd6a1;
}

.hq-overview-art { position: absolute; inset: 0 0 0 34%; }

.hq-overview-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 61% 50%;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(145px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.summary-card {
  position: relative;
  min-height: 116px;
  overflow: hidden;
  padding: 18px 18px 16px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.summary-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 18px;
  width: 34px;
  height: 3px;
  border-radius: 0 0 4px 4px;
  background: var(--brand);
}

.summary-card::after {
  content: attr(data-index);
  position: absolute;
  right: 14px;
  bottom: -7px;
  color: #f0f4fa;
  font: 900 47px/1 ui-monospace, SFMono-Regular, Consolas, monospace;
}

.summary-card span {
  position: relative;
  z-index: 1;
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.summary-card strong {
  position: relative;
  z-index: 1;
  display: block;
  margin-top: 8px;
  font-size: 29px;
  line-height: 1.2;
  letter-spacing: -.04em;
}

.summary-card.warn::before { background: var(--warn); }
.summary-card.warn strong { color: var(--warn); }
.summary-card.danger::before { background: var(--danger); }
.summary-card.danger strong { color: var(--danger); }

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

.panel {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 17px;
}

.panel-head h2,
.dialog-head h2 {
  margin: 2px 0 0;
  font-size: 18px;
  line-height: 1.45;
  letter-spacing: -.025em;
}

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

.form-grid .wide { grid-column: 1 / -1; }
.compact-form button { align-self: end; min-height: 44px; }
.recent-panel { margin-top: 16px; }

.store-list { display: grid; gap: 8px; }

.store-row {
  width: 100%;
  min-height: 62px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 13px;
  padding: 12px 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  text-align: left;
  transition: border-color .18s ease, background .18s ease, transform .18s ease;
}

.store-row:hover,
.store-row.active {
  border-color: #9bbcf4;
  background: #f4f8ff;
  transform: translateX(2px);
}

.store-row strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.store-row small { grid-column: 1; color: var(--muted); }

.status {
  grid-column: 2;
  grid-row: 1 / 3;
  align-self: center;
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  white-space: nowrap;
}

.status.active { background: #e5f7f0; color: var(--ok); }
.status.grace { background: #fff3dc; color: var(--warn); }
.status.suspended { background: #fce9ec; color: var(--danger); }

.store-layout {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 16px;
}

.store-index {
  position: sticky;
  top: 96px;
  height: calc(100vh - 122px);
  overflow: auto;
}

.search { margin-bottom: 12px; }
.store-detail { display: grid; gap: 16px; }
.store-detail.empty { min-height: 450px; place-items: center; }

.empty-state {
  display: grid;
  gap: 7px;
  padding: 30px;
  color: var(--muted);
  text-align: center;
}

.detail-hero { display: flex; justify-content: space-between; align-items: flex-start; gap: 15px; }
.detail-hero p { margin: 0; color: var(--brand); font-size: 10px; font-weight: 800; letter-spacing: .1em; }
.detail-hero h2 { margin: 2px 0 0; font-size: 25px; letter-spacing: -.035em; }
.detail-hero span { color: var(--muted); }
.detail-hero-actions { display: grid; justify-items: end; gap: 7px; }
.detail-hero-actions > small { color: var(--muted); font-size: 10px; font-weight: 700; }
.remote-view-action { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; }
.detail-hero .remote-view-action { color: #fff; }
.remote-view-dot { width: 7px; height: 7px; border-radius: 50%; background: #f59e0b; box-shadow: 0 0 0 4px rgba(245, 158, 11, .18); }
.remote-view-dot[data-state="online"] { background: #4ade80; box-shadow: 0 0 0 4px rgba(74, 222, 128, .16); }
.store-view-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.cloud-report-action { text-decoration: none; }
.technical-meta { margin-top: 8px; color: #71819a; font-size: 10px; }
.technical-meta summary { cursor: pointer; }
.technical-meta code { display: inline-block; margin-top: 6px; }
.form-section-title { display: flex; align-items: baseline; gap: 10px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.form-section-title span,.advanced-contract summary span { color: var(--muted); font-size: 11px; }
.advanced-contract { padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: #f8fafc; }
.advanced-contract>summary { display: flex; justify-content: space-between; gap: 10px; cursor: pointer; }
.advanced-contract>.form-grid { margin-top: 16px; }

.detail-tabs {
  display: flex;
  gap: 5px;
  margin-top: 18px;
  padding-bottom: 10px;
  overflow-x: auto;
  border-bottom: 1px solid var(--line);
}

.detail-tab {
  min-height: 38px;
  padding: 8px 12px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
  white-space: nowrap;
}

.detail-tab.active { background: var(--brand-soft); color: var(--brand); }
.detail-section { display: none; }
.detail-section.active { display: block; }
.feature-groups { display: grid; gap: 16px; }
.feature-group h3 { margin: 0 0 9px; font-size: 13px; }

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

.feature-item {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 43px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fbfcfe;
}

.feature-item > span { display: grid; gap: 2px; min-width: 0; }
.feature-item > span strong { font-size: 12px; }
.feature-item > span small { color: var(--muted); font-size: 9px; line-height: 1.35; }
.feature-item.is-addon { border-color: #d7e2f5; background: #f7faff; }
.feature-item.is-addon > span small { color: #42699f; }

.section-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 15px; }
.user-grid { display: grid; gap: 10px; }

.user-card {
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fff;
}

.user-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 10px; }
.user-head small { color: var(--muted); }
.user-permissions { margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line); }
.user-permissions .feature-grid { margin-top: 8px; }

.device-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 10px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
}

.device-row small { color: var(--muted); }
.device-row .status { margin-left: 7px; min-height: 22px; padding: 2px 7px; vertical-align: middle; }

.release-guide {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 12px;
  align-items: center;
  margin: 0;
}
.release-guide span { grid-column: 1; }
.release-guide button { grid-column: 2; grid-row: 1 / 3; }

.client-explanation {
  margin: -3px 0 17px;
  padding: 12px 14px;
  border-left: 3px solid var(--brand);
  border-radius: 7px;
  background: var(--brand-soft);
  color: #3d5680;
}

.client-list { display: grid; gap: 12px; }

.client-card {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

.client-card.is-suspended { border-color: #edb7be; background: #fffafa; }
.client-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 13px; }
.client-card-head h3 { margin: 2px 0 3px; font-size: 18px; }
.client-card-head p { margin: 0; color: var(--muted); font-size: 12px; }
.client-state-actions { display: flex; align-items: center; gap: 8px; }
.client-stop-note { margin-top: 10px; color: var(--danger); font-size: 12px; font-weight: 700; }
.client-card .form-grid { grid-template-columns: minmax(180px, 1fr) minmax(220px, 2fr) auto; }
.client-card .section-actions { align-self: end; margin: 0; }

.account-create {
  margin-top: 18px;
  border: 1px dashed var(--line-strong);
  border-radius: 11px;
  background: #f8faff;
}

.account-create summary {
  padding: 14px 15px;
  color: var(--brand);
  font-weight: 800;
  cursor: pointer;
  list-style-position: inside;
}

.account-create[open] summary { border-bottom: 1px solid var(--line); }
.account-create-body { padding: 15px; }
.account-create-body > p { margin: 0 0 13px; color: var(--muted); font-size: 12px; }
.account-create .user-permissions { margin-top: 0; }

.internal-meta {
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--muted);
}

.internal-meta summary { cursor: pointer; font-weight: 700; }
.internal-meta small { display: block; margin-top: 10px; }
.internal-meta code { margin-top: 5px; padding: 10px; font-size: 12px; }

.table-wrap { overflow: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 11px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
th { background: #f7f9fc; color: var(--muted); font-size: 10px; letter-spacing: .04em; }
tbody tr:hover { background: #f8faff; }

.toast {
  position: fixed;
  right: 24px;
  bottom: 22px;
  z-index: 30;
  max-width: min(420px, calc(100% - 48px));
  padding: 12px 16px;
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 10px;
  background: var(--nav);
  color: #fff;
  box-shadow: var(--shadow-deep);
}

dialog {
  width: min(630px, calc(100% - 32px));
  padding: 22px;
  border: 0;
  border-radius: 15px;
  color: var(--ink);
  box-shadow: 0 30px 90px rgba(5, 15, 34, .3);
}

dialog::backdrop { background: rgba(7, 18, 39, .68); backdrop-filter: blur(4px); }
.dialog-head { display: flex; justify-content: space-between; gap: 14px; }
.warning { padding: 11px 12px; border-radius: 8px; background: #fff3df; color: #805315; }
.dialog-actions { display: flex; justify-content: flex-end; margin-top: 16px; }
dialog code { display: block; padding: 14px; border-radius: 8px; background: #eef3fa; color: #293a58; font-size: 13px; word-break: break-all; }

.view.active > .panel,
.view.active > .store-layout,
.hq-overview-hero,
.summary-card { animation: rise-in .38s ease both; }

.summary-card:nth-child(2) { animation-delay: .04s; }
.summary-card:nth-child(3) { animation-delay: .08s; }
.summary-card:nth-child(4) { animation-delay: .12s; }

@keyframes rise-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 1100px) {
  .summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .two-column,
  .store-layout { grid-template-columns: 1fr; }
  .store-index { position: static; height: auto; }
  .feature-grid { grid-template-columns: 1fr; }
  .client-card .form-grid { grid-template-columns: 1fr; }
  .hq-overview-hero { grid-template-columns: 1fr; }
  .hq-overview-art { inset: 0 0 0 24%; }
}

@media (max-width: 820px) {
  .login-screen { grid-template-columns: 1fr; }
  .login-visual { min-height: 300px; }
  .login-brand { top: 25px; left: 25px; }
  .login-visual-copy { left: 25px; bottom: 29px; width: calc(100% - 50px); }
  .login-visual-copy h2 { font-size: clamp(30px, 8vw, 45px); }
  .login-visual-copy > span,
  .login-flow { display: none; }
  .login-illustration { top: -12%; right: -20%; width: 120%; height: 118%; opacity: .75; }
  .login-form-shell { min-height: auto; padding: 44px 25px 30px; }
  .login-footnote { margin-top: 40px; }
}

@media (max-width: 720px) {
  .app { display: block; }
  .sidebar {
    position: sticky;
    top: 0;
    width: 100%;
    height: auto;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    padding: 10px 12px;
    overflow: hidden;
  }
  .side-brand { padding: 0; }
  .side-brand .brand-mark { width: 36px; height: 36px; border-radius: 10px; }
  .side-brand div,
  .side-status,
  .side-bottom { display: none; }
  .sidebar nav { display: flex; justify-content: flex-end; gap: 3px; overflow-x: auto; }
  .nav { width: auto; min-height: 48px; flex: 0 0 auto; gap: 2px; padding: 5px 7px; flex-direction: column; }
  .nav-icon { width: 30px; height: 30px; background: transparent; }
  .nav-copy { display: none; }
  .nav-mobile-label { display: block; color: #dbe8ff; font-size: 9px; font-weight: 800; line-height: 1; }
  .nav.active { box-shadow: inset 0 -2px 0 #67a0ff; }
  .app main { padding: 0 12px 28px; }
  .topbar { height: auto; min-height: 78px; padding: 12px 0; }
  .topbar h1 { font-size: 21px; }
  .top-actions .key-chip { display: none; }
  .top-actions .secondary { padding: 8px 10px; font-size: 11px; }
  .hq-overview-hero { min-height: 310px; }
  .hq-overview-hero::after { background: linear-gradient(180deg, rgba(10, 25, 51, .2), #0a1933 74%); }
  .hq-overview-copy { align-self: end; padding: 30px 22px; }
  .hq-overview-copy h2 { font-size: 28px; }
  .hq-overview-art { inset: 0 0 34% 0; }
  .hq-overview-art img { object-position: center; }
  .summary-grid,
  .two-column,
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .wide { grid-column: auto; }
  .client-card-head { display: grid; }
  .client-state-actions { flex-wrap: wrap; }
  .detail-hero { align-items: stretch; flex-direction: column; }
  .detail-hero-actions { justify-items: stretch; }
  .remote-view-action { justify-content: center; }
}

@media (max-width: 440px) {
  .login-visual { min-height: 255px; }
  .login-card-brand { display: flex; }
  .login-brand { display: none; }
  .login-visual-copy h2 { font-size: 30px; }
  .login-visual-copy > p { margin-bottom: 8px; }
  .login-form-shell { padding-top: 34px; }
  .summary-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .summary-card { min-height: 104px; padding: 15px 13px; }
  .summary-card strong { font-size: 23px; }
  .panel { padding: 16px; }
  .panel-head { align-items: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
:root { --hq-phone-font: "Yu Gothic UI", "Meiryo", system-ui, sans-serif; }
.hq-phone-settings { max-width: 920px; min-width: 0; font-family: var(--hq-phone-font); }
.hq-phone-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 24px; }
.hq-phone-heading h3 { margin: 0 0 8px; font-size: 18px; }
.hq-phone-heading p { margin: 0; line-height: 1.7; color: #526775; }
.hq-phone-heading > .status { flex-shrink: 0; }
.hq-phone-settings label { display: grid; gap: 8px; min-width: 0; font-weight: 600; }
.hq-phone-settings :is(input,select,button) { min-width: 0; max-width: 100%; font-family: var(--hq-phone-font); }
.hq-phone-settings :is(input,select) { width: 100%; color: #223441; background: #fff; }
.hq-phone-fields { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 20px 24px; margin-top: 20px; }
.hq-phone-fields .hq-phone-check { display: flex; align-items: center; gap: 10px; }
.hq-phone-fields input[type="checkbox"] { width: 18px; }
.hq-phone-result { font-size: 13px; line-height: 1.6; }
@media (max-width: 700px) { .hq-phone-heading { flex-direction: column; } .hq-phone-fields { grid-template-columns: minmax(0,1fr); } }
.runtime-sync { margin-top: 20px; border-top: 1px solid var(--line, #dbe4e3); padding-top: 16px; }
.runtime-sync summary { cursor: pointer; font-weight: 650; }
.runtime-sync [data-sync-content] { padding-top: 12px; }
.runtime-conflict { padding: 16px; margin: 12px 0; border: 1px solid var(--line, #dbe4e3); border-radius: 10px; background: #fff; }
.runtime-conflict h4, .runtime-conflict h5 { margin: 0 0 8px; }
.runtime-record { font-size: 12px; color: #586b6b; overflow-wrap: anywhere; }
.runtime-comparison { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; }
.runtime-comparison pre { white-space: pre-wrap; overflow-wrap: anywhere; max-height: 220px; overflow: auto; padding: 10px; margin: 0 0 10px; background: #f3f6f6; border-radius: 6px; font-family: inherit; font-size: 13px; line-height: 1.6; }
.runtime-comparison button { white-space: normal; min-height: 44px; width: 100%; }
@media (max-width: 600px) { .runtime-comparison { grid-template-columns: minmax(0, 1fr); } .runtime-conflict { padding: 12px; } }
