
:root {
  --font-base: 16px;
  --font-small: 14px;
  --font-caption: 12px;
  --background: #f5f5f4;
  --surface: #ffffff;
  --surface-soft: #fafaf9;
  --foreground: #1c1917;
  --muted: #78716c;
  --muted-soft: #a8a29e;
  --border: #e7e5e4;
  --border-strong: #d6d3d1;
  --primary: #292524;
  --primary-strong: #1c1917;
  --primary-soft: #44403c;
  --success: #15803d;
  --success-bg: #dcfce7;
  --danger: #b91c1c;
  --danger-bg: #fee2e2;
  --warning: #a16207;
  --warning-bg: #fef3c7;
  --radius: 18px;
  --radius-sm: 11px;
  --shadow: 0 1px 2px rgba(28,25,23,.04), 0 12px 34px rgba(28,25,23,.045);
  color: var(--foreground);
  font-family: Inter, Pretendard, "Noto Sans KR", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--background); }
body { margin: 0; min-height: 100vh; background: var(--background); color: var(--foreground); }
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:focus-visible, a:focus-visible, input:focus-visible { outline: 3px solid rgba(41,37,36,.18); outline-offset: 2px; }
svg { width: 20px; height: 20px; display: block; flex: 0 0 auto; }
form { margin: 0; }

.grain-texture::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: .07;
  background: url("/assets/texture-background.jpg") center / cover no-repeat;
  mix-blend-mode: multiply;
}

.app-body {
  position: relative;
  display: grid;
  grid-template-columns: 292px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  z-index: 2;
  height: 100vh;
  padding: 30px 22px 22px;
  display: flex;
  flex-direction: column;
  background: rgba(250,250,249,.80);
  border-right: 1px solid rgba(214,211,209,.72);
  backdrop-filter: blur(14px);
}

.brand {
  min-height: 46px;
  padding: 0 10px;
  display: flex;
  align-items: center;
  gap: 11px;
  color: var(--foreground);
  text-decoration: none;
  font-size: 20px;
  font-weight: 750;
  letter-spacing: -.03em;
}

.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 11px;
  display: inline-grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(145deg, #44403c, #1c1917);
  box-shadow: inset 0 1px rgba(255,255,255,.2), 0 6px 16px rgba(28,25,23,.16);
}
.brand-mark svg { width: 20px; height: 20px; }

.sidebar-nav {
  display: grid;
  grid-auto-rows: min-content;
  align-content: start;
  gap: 5px;
  flex: 1;
  padding-top: 30px;
}

.nav-group-label {
  margin: 23px 12px 7px;
  color: #8f8985;
  font-size: 10px;
  font-weight: 750;
  letter-spacing: .12em;
}
.nav-group-label:first-child { margin-top: 0; }

.nav-link {
  min-height: 48px;
  padding: 0 13px;
  display: flex;
  align-items: center;
  gap: 13px;
  border: 1px solid transparent;
  border-radius: 13px;
  color: #57534e;
  text-decoration: none;
  font-size: 14px;
  font-weight: 520;
  transition: color .16s ease, background .16s ease, transform .16s ease, box-shadow .16s ease;
}
.nav-link svg { color: #69635f; }
.nav-link:hover { color: var(--foreground); background: rgba(255,255,255,.72); border-color: rgba(231,229,228,.8); transform: translateX(2px); }
.nav-link.active {
  color: #fff;
  background: linear-gradient(145deg, #44403c, #292524);
  border-color: #1c1917;
  box-shadow: inset 0 1px rgba(255,255,255,.14), 0 7px 18px rgba(28,25,23,.16);
}
.nav-link.active svg { color: #fff; }

.sidebar-footer {
  padding: 15px 8px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-top: 1px solid var(--border);
}
.sidebar-user { display: flex; align-items: center; gap: 10px; min-width: 0; }
.sidebar-user > span:last-child { display: grid; gap: 2px; min-width: 0; }
.sidebar-user b { overflow: hidden; color: #292524; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-user small { color: var(--muted); font-size: 10px; }
.avatar {
  width: 36px;
  height: 36px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid var(--border-strong);
  border-radius: 50%;
  color: #44403c;
  background: linear-gradient(145deg,#fff,#e7e5e4);
  font-size: 11px;
  font-weight: 750;
}
.avatar.small { width: 32px; height: 32px; }
.icon-button {
  width: 38px;
  height: 38px;
  padding: 0;
  display: inline-grid;
  place-items: center;
  color: #57534e;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 11px;
}
.icon-button:hover { color: var(--danger); border-color: #fecaca; background: #fff7f7; }
.icon-button svg { width: 17px; height: 17px; }

.workspace {
  position: relative;
  z-index: 1;
  min-width: 0;
  padding: 24px 24px 14px;
}
.content-shell {
  min-height: calc(100vh - 66px);
  overflow: hidden;
  background: rgba(255,255,255,.94);
  border: 1px solid rgba(231,229,228,.9);
  border-radius: 22px;
  box-shadow: var(--shadow);
}
.page-heading {
  min-height: 135px;
  padding: 28px 34px 23px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border-bottom: 1px solid var(--border);
}
.page-heading h1 { margin: 4px 0 6px; font-size: clamp(25px,2vw,32px); line-height: 1.15; letter-spacing: -.04em; }
.page-heading p { margin: 0; color: var(--muted); font-size: 14px; }
.eyebrow { display: block; color: #8b8580; font-size: 9px; font-weight: 800; letter-spacing: .15em; }
.eyebrow.light { color: rgba(255,255,255,.58); }
.status-chip {
  min-width: 158px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--border);
  border-radius: 13px;
  color: var(--muted);
  background: var(--surface-soft);
  font-size: 11px;
  line-height: 1.45;
}
.status-chip b { color: var(--foreground); font-size: 12px; }
.status-dot { width: 9px; height: 9px; flex: 0 0 auto; border-radius: 50%; box-shadow: 0 0 0 4px rgba(120,113,108,.12); }
.status-dot.online { background: #22c55e; box-shadow: 0 0 0 4px rgba(34,197,94,.12); }
.status-dot.offline { background: #ef4444; box-shadow: 0 0 0 4px rgba(239,68,68,.12); }
.page-content { padding: 28px 34px 34px; }

.hero-panel, .settings-hero {
  min-height: 190px;
  margin-bottom: 20px;
  padding: 30px 34px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
  overflow: hidden;
  position: relative;
  color: #fff;
  background: linear-gradient(128deg, #1c1917 0%, #292524 57%, #44403c 100%);
  border: 1px solid #1c1917;
  border-radius: 18px;
  box-shadow: inset 0 1px rgba(255,255,255,.1), 0 14px 32px rgba(28,25,23,.12);
}
.hero-panel::after, .settings-hero::after { content: ""; position: absolute; width: 260px; height: 260px; right: -85px; top: -105px; border: 1px solid rgba(255,255,255,.08); border-radius: 50%; box-shadow: 0 0 0 45px rgba(255,255,255,.025), 0 0 0 90px rgba(255,255,255,.018); }
.hero-panel h2, .settings-hero h2 { position: relative; z-index: 1; margin: 10px 0 9px; font-size: clamp(23px,2.2vw,32px); letter-spacing: -.04em; }
.hero-panel p, .settings-hero p { position: relative; z-index: 1; max-width: 630px; margin: 0; color: rgba(255,255,255,.66); font-size: 13px; line-height: 1.7; }
.hero-state { position: relative; z-index: 1; min-width: 190px; padding: 16px 18px; display: flex; align-items: center; gap: 10px; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.12); border-radius: 14px; font-size: 12px; backdrop-filter: blur(6px); }
.hero-state svg { width: 22px; height: 22px; color: #86efac; }

.stats-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 14px; margin-bottom: 20px; }
.stat-card { min-height: 108px; padding: 20px; display: flex; align-items: center; gap: 15px; background: #fff; border: 1px solid var(--border); border-radius: 15px; box-shadow: 0 1px 2px rgba(28,25,23,.025); }
.stat-icon, .panel-icon, .setting-symbol { width: 42px; height: 42px; display: inline-grid; place-items: center; flex: 0 0 auto; color: #57534e; background: #f5f5f4; border: 1px solid var(--border); border-radius: 12px; }
.stat-icon.positive { color: var(--success); background: #f0fdf4; border-color: #bbf7d0; }
.stat-icon.negative { color: var(--danger); background: #fef2f2; border-color: #fecaca; }
.stat-card > div { display: flex; flex-direction: column-reverse; gap: 2px; }
.stat-card small { color: var(--muted); font-size: 11px; }
.stat-card strong { font-size: 25px; line-height: 1; letter-spacing: -.04em; }

.panel { margin-bottom: 20px; overflow: hidden; background: #fff; border: 1px solid var(--border); border-radius: 16px; box-shadow: 0 1px 2px rgba(28,25,23,.025); }
.panel-heading { min-height: 81px; padding: 18px 20px; display: flex; align-items: center; justify-content: space-between; gap: 18px; border-bottom: 1px solid var(--border); }
.panel-heading > div { display: flex; align-items: center; gap: 12px; }
.panel-heading h2 { margin: 0 0 3px; font-size: 15px; letter-spacing: -.02em; }
.panel-heading p { margin: 0; color: var(--muted); font-size: 11px; }
.panel-icon { width: 40px; height: 40px; }
.panel-icon.dark { color: #fff; background: var(--primary); border-color: var(--primary-strong); }
.count-pill { padding: 6px 10px; color: var(--muted); background: var(--surface-soft); border: 1px solid var(--border); border-radius: 999px; font-size: 10px; }
.table-wrap { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 12px; }
th, td { padding: 15px 18px; text-align: left; vertical-align: middle; white-space: nowrap; border-bottom: 1px solid #f0efed; }
th { color: #8b8580; background: #fafaf9; font-size: 9px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
tbody tr { transition: background .14s ease; }
tbody tr:hover { background: #fcfcfb; }
tbody tr:last-child td { border-bottom: 0; }
td code, .path-box code { color: #57534e; font-family: "SFMono-Regular", Consolas, monospace; font-size: 10px; background: #f5f5f4; border: 1px solid var(--border); border-radius: 6px; padding: 4px 6px; }
.domain-cell, .user-cell { display: inline-flex; align-items: center; gap: 9px; }
.domain-icon { width: 30px; height: 30px; display: inline-grid; place-items: center; color: #57534e; background: #f5f5f4; border-radius: 8px; }
.domain-icon svg { width: 15px; height: 15px; }
.muted-text { color: var(--muted-soft); }

button { border: 0; }
.primary-button, .secondary-button, .icon-text-button {
  min-height: 38px;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 680;
  transition: transform .14s ease, background .14s ease, box-shadow .14s ease;
}
.primary-button { color: #fff; background: linear-gradient(145deg, #44403c, #292524); border: 1px solid #1c1917; box-shadow: inset 0 1px rgba(255,255,255,.12), 0 5px 12px rgba(28,25,23,.12); }
.secondary-button, .icon-text-button { color: #44403c; background: #fff; border: 1px solid var(--border-strong); }
.primary-button:hover, .secondary-button:hover, .icon-text-button:hover { transform: translateY(-1px); box-shadow: 0 6px 14px rgba(28,25,23,.09); }
.secondary-button:disabled { color: var(--muted-soft); background: #f5f5f4; border-color: var(--border); cursor: not-allowed; transform: none; box-shadow: none; }
.primary-button svg, .secondary-button svg, .icon-text-button svg { width: 15px; height: 15px; }
.full-button { width: 100%; min-height: 46px; justify-content: space-between; padding: 0 17px; }

.switch-button { min-width: 59px; height: 28px; padding: 3px 7px 3px 4px; display: inline-flex; align-items: center; gap: 5px; color: #57534e; background: #e7e5e4; border: 1px solid #d6d3d1; border-radius: 999px; font-size: 9px; font-weight: 800; }
.switch-button span { width: 19px; height: 19px; display: block; background: #fff; border-radius: 50%; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.switch-button.on { padding: 3px 4px 3px 7px; flex-direction: row-reverse; color: #166534; background: #dcfce7; border-color: #86efac; }

.badge { padding: 5px 8px; display: inline-flex; align-items: center; gap: 6px; color: #57534e; background: #f5f5f4; border: 1px solid var(--border); border-radius: 999px; font-size: 9px; font-weight: 750; text-transform: uppercase; }
.badge i { width: 5px; height: 5px; background: #a8a29e; border-radius: 50%; }
.badge.success, .badge.discovered { color: #166534; background: #f0fdf4; border-color: #bbf7d0; }
.badge.success i, .badge.discovered i { background: #22c55e; }
.badge.failed { color: #991b1b; background: #fef2f2; border-color: #fecaca; }
.badge.failed i { background: #ef4444; }
.badge.pending, .badge.running { color: #854d0e; background: #fffbeb; border-color: #fde68a; }
.badge.pending i, .badge.running i { background: #eab308; }

.history-panel { overflow: visible; }
.history-panel .table-wrap { overflow: visible; }
.history-duration { color: #44403c; font-variant-numeric: tabular-nums; white-space: nowrap; }
.history-status-tooltip { position: relative; z-index: 4; display: inline-flex; border-radius: 999px; outline: none; }
.history-status-tooltip .badge { cursor: help; box-shadow: 0 1px 2px rgba(22,101,52,.08); transition: transform .16s ease, box-shadow .16s ease; }
.history-status-tooltip:hover .badge,
.history-status-tooltip:focus .badge { transform: translateY(-1px); box-shadow: 0 5px 14px rgba(22,101,52,.16); }
.history-tooltip-card {
  position: absolute;
  z-index: 80;
  left: 50%;
  bottom: calc(100% + 13px);
  width: 292px;
  padding: 16px;
  display: grid;
  gap: 10px;
  color: #1c1917;
  background: #f5f5f4;
  border: 1px solid #d6d3d1;
  border-radius: 14px;
  box-shadow: 0 18px 45px rgba(28,25,23,.16), inset 0 1px rgba(255,255,255,.9);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translate(-50%, 8px) scale(.98);
  transform-origin: center bottom;
  transition: opacity .16s ease, transform .16s ease, visibility .16s ease;
}
.history-tooltip-card::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -7px;
  width: 13px;
  height: 13px;
  background: #f5f5f4;
  border-right: 1px solid #d6d3d1;
  border-bottom: 1px solid #d6d3d1;
  transform: translateX(-50%) rotate(45deg);
}
.history-status-tooltip:hover .history-tooltip-card,
.history-status-tooltip:focus .history-tooltip-card,
.history-status-tooltip:focus-within .history-tooltip-card {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0) scale(1);
}
.history-tooltip-card > strong { color: #1c1917; font-size: 15px; }
.history-tooltip-row { padding-top: 9px; display: grid; grid-template-columns: 86px 1fr; gap: 10px; border-top: 1px solid #d6d3d1; }
.history-tooltip-row > span { color: #57534e; font-size: 11px; }
.history-tooltip-row > b { color: #1c1917; font-family: "SFMono-Regular",Consolas,monospace; font-size: 11px; font-weight: 650; text-align: right; }
.history-tooltip-row.duration > b { color: #1c1917; font-family: inherit; font-size: 12px; }

@media (max-width: 720px) {
  /* Mobile history tooltip */
  .history-panel .table-wrap { overflow-x: auto; }
  .history-tooltip-card {
    position: fixed;
    z-index: 200;
    right: 14px;
    bottom: 14px;
    left: 14px;
    width: auto;
    transform: translateY(10px) scale(.98);
    transform-origin: center bottom;
  }
  .history-tooltip-card::after { display: none; }
  .history-status-tooltip:hover .history-tooltip-card,
  .history-status-tooltip:focus .history-tooltip-card,
  .history-status-tooltip:focus-within .history-tooltip-card { transform: translateY(0) scale(1); }
}

.two-column { display: grid; grid-template-columns: minmax(0,1.35fr) minmax(280px,.65fr); gap: 20px; }
.form-panel { padding-bottom: 22px; }
.form-panel .stack-form { padding: 20px; }
.stack-form { display: grid; gap: 16px; }
.stack-form label { display: grid; gap: 7px; color: #57534e; font-size: 11px; font-weight: 650; }
.stack-form input, .password-row input { width: 100%; min-height: 44px; padding: 0 13px; color: var(--foreground); background: #fff; border: 1px solid var(--border-strong); border-radius: 10px; font-size: 13px; transition: border .14s ease, box-shadow .14s ease; }
.stack-form input::placeholder, .password-row input::placeholder { color: #b5b0ac; }
.stack-form input:focus, .password-row input:focus { outline: 0; border-color: #78716c; box-shadow: 0 0 0 3px rgba(120,113,108,.1); }
.form-hint { margin: -3px 0 0; display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 10px; }
.form-hint svg { width: 14px; height: 14px; }
.password-row { display: grid; grid-template-columns: minmax(150px,1fr) minmax(150px,1fr) auto; gap: 7px; align-items: center; min-width: 480px; }
.password-row input { min-height: 38px; font-size: 11px; }
.account-summary { min-height: 300px; padding: 28px; display: flex; flex-direction: column; justify-content: center; color: #fff; background: linear-gradient(145deg,#292524,#1c1917); border-color: #1c1917; }
.summary-icon { width: 52px; height: 52px; margin-bottom: 34px; display: grid; place-items: center; color: #fff; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.12); border-radius: 15px; }
.account-summary .eyebrow { color: rgba(255,255,255,.5); }
.account-summary strong { margin: 6px 0; font-size: 48px; line-height: 1; letter-spacing: -.06em; }
.account-summary p { margin: 4px 0 0; color: rgba(255,255,255,.58); font-size: 11px; }

.settings-hero { min-height: 150px; justify-content: flex-start; }
.settings-icon { width: 60px; height: 60px; display: grid; place-items: center; flex: 0 0 auto; color: #fff; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.13); border-radius: 17px; }
.settings-icon svg { width: 28px; height: 28px; }
.settings-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 14px; margin-bottom: 20px; }
.setting-card { min-height: 188px; padding: 21px; display: flex; flex-direction: column; background: #fff; border: 1px solid var(--border); border-radius: 15px; }
.setting-symbol { margin-bottom: 24px; }
.setting-card small { color: #8b8580; font-size: 9px; font-weight: 800; letter-spacing: .1em; }
.setting-card strong { margin: 5px 0 3px; font-size: 20px; letter-spacing: -.03em; }
.setting-card p { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.5; }
.text-ok { color: var(--success); }
.text-bad { color: var(--danger); }
.path-box { margin: 20px; padding: 17px; background: #fafaf9; border: 1px dashed var(--border-strong); border-radius: 11px; }
.path-box code { padding: 0; background: none; border: 0; font-size: 12px; }

.alert { margin-bottom: 18px; padding: 12px 14px; display: flex; align-items: center; gap: 9px; border: 1px solid; border-radius: 11px; font-size: 12px; }
.alert svg { width: 17px; height: 17px; }
.alert.success { color: #166534; background: #f0fdf4; border-color: #bbf7d0; }
.alert.error { color: #991b1b; background: #fef2f2; border-color: #fecaca; }
.workspace-footer { padding: 12px 5px 0; display: flex; justify-content: space-between; color: #8b8580; font-size: 9px; letter-spacing: .04em; }

.login-body { position: relative; min-height: 100vh; display: grid; place-items: center; padding: 28px; }
.login-layout { position: relative; z-index: 1; width: min(980px,100%); min-height: 610px; display: grid; grid-template-columns: 1.08fr .92fr; overflow: hidden; background: rgba(255,255,255,.96); border: 1px solid var(--border); border-radius: 24px; box-shadow: 0 24px 70px rgba(28,25,23,.13); }
.login-showcase { padding: 42px; display: flex; flex-direction: column; justify-content: space-between; color: #fff; background: linear-gradient(135deg,#1c1917,#292524 65%,#44403c); }
.login-showcase h1 { margin: 14px 0 17px; font-size: clamp(38px,4vw,58px); line-height: .98; letter-spacing: -.065em; }
.login-showcase p { max-width: 410px; margin: 0; color: rgba(255,255,255,.58); font-size: 13px; line-height: 1.75; }
.showcase-foot { color: rgba(255,255,255,.38); font-size: 10px; }
.login-card { padding: 60px 52px; display: flex; flex-direction: column; justify-content: center; }
.login-heading { margin-bottom: 28px; }
.login-heading h2 { margin: 8px 0 7px; font-size: 27px; letter-spacing: -.04em; }
.login-heading p { margin: 0; color: var(--muted); font-size: 12px; }



.nav-link.sub-link { width: calc(100% - 16px); margin-left: 16px; }
.nav-link.sub-link::before { content: ""; width: 7px; height: 1px; margin-left: -4px; background: #c7c2be; }
.nav-link.sub-link.active::before { background: rgba(255,255,255,.7); }

.route-overview { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)) minmax(230px,1.2fr); gap: 14px; margin-bottom: 20px; }
.route-overview > article, .route-sync { min-height: 102px; padding: 18px; display: flex; align-items: center; gap: 14px; background: #fff; border: 1px solid var(--border); border-radius: 15px; }
.route-overview article > div { display: flex; flex-direction: column-reverse; gap: 3px; }
.route-overview small { color: var(--muted); font-size: var(--font-caption); font-weight: 750; letter-spacing: .06em; }
.route-overview strong { font-size: 28px; letter-spacing: -.04em; }
.route-sync { color: var(--muted); font-size: 12px; line-height: 1.55; }
.route-sync b { color: var(--foreground); font-size: 12px; }

.route-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 18px; }
.route-card { min-width: 0; overflow: hidden; background: #fff; border: 1px solid var(--border); border-radius: 17px; box-shadow: 0 1px 2px rgba(28,25,23,.025); }
.route-card-head { min-height: 86px; padding: 18px 20px; display: grid; grid-template-columns: auto minmax(0,1fr) auto; align-items: center; gap: 13px; border-bottom: 1px solid var(--border); }
.route-site-icon { width: 43px; height: 43px; display: grid; place-items: center; color: #fff; background: linear-gradient(145deg,#44403c,#292524); border: 1px solid transparent; border-radius: 12px; }
.route-site-icon svg { width: 21px; height: 21px; }
.route-site-icon.nas { color: #854d0e; background: #fffbeb; border-color: #fde68a; }
.route-site-icon.docker { color: #166534; background: #f0fdf4; border-color: #bbf7d0; }
.route-card-head > div { min-width: 0; display: grid; gap: 4px; }
.route-card-head a { min-width: 0; display: inline-flex; align-items: center; gap: 7px; color: var(--foreground); font-size: 16px; font-weight: 750; text-decoration: none; overflow-wrap: anywhere; }
.route-card-head a:hover { text-decoration: underline; text-underline-offset: 3px; }
.route-card-head a svg { width: 15px; height: 15px; }
.route-card-head small { color: var(--muted); font-size: 11px; }
.backend-pill { padding: 6px 9px; border: 1px solid; border-radius: 999px; font-size: 11px; font-weight: 750; white-space: nowrap; }
.backend-pill.nas { color: #854d0e; background: #fffbeb; border-color: #fde68a; }
.backend-pill.docker { color: #166534; background: #f0fdf4; border-color: #bbf7d0; }

.route-flow { padding: 18px 20px; display: grid; grid-template-columns: minmax(0,1fr) auto minmax(0,1fr); align-items: center; gap: 12px; background: #fafaf9; border-bottom: 1px solid var(--border); }
.route-flow > div { min-width: 0; display: grid; gap: 6px; }
.route-flow > span { color: #a8a29e; }
.route-flow > span svg { width: 17px; height: 17px; }
.root-detail small { color: #8b8580; font-size: 10px; font-weight: 800; letter-spacing: .09em; }
.route-flow .route-url { min-width: 0; color: #44403c; font-family: "SFMono-Regular",Consolas,monospace; font-size: 11px; overflow-wrap: anywhere; white-space: normal; }

.root-detail { margin: 18px 20px; padding: 16px; display: flex; align-items: flex-start; gap: 12px; color: #fff; background: linear-gradient(145deg,#292524,#1c1917); border-radius: 13px; }
.root-icon { width: 35px; height: 35px; display: grid; place-items: center; flex: 0 0 auto; color: #fff; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.12); border-radius: 9px; }
.root-icon svg { width: 17px; height: 17px; }
.root-detail > div { min-width: 0; display: grid; gap: 7px; }
.root-detail small { color: rgba(255,255,255,.5); }
.root-detail code { color: #fff; font-family: "SFMono-Regular",Consolas,monospace; font-size: 13px; overflow-wrap: anywhere; }
.root-detail p { margin: 2px 0 0; color: rgba(255,255,255,.56); font-size: 11px; }
.root-detail p code { color: rgba(255,255,255,.75); font-size: 11px; }

.route-meta { min-height: 57px; padding: 0 20px 18px; display: flex; align-items: center; flex-wrap: wrap; gap: 7px; }
.route-flag { padding: 5px 7px; color: #a8a29e; background: #fafaf9; border: 1px solid var(--border); border-radius: 7px; font-size: 10px; font-weight: 700; }
.route-flag.active { color: #166534; background: #f0fdf4; border-color: #bbf7d0; }
.route-flag svg { width: 12px; height: 12px; display: inline-block; vertical-align: -2px; margin-right: 3px; }
.certificate-expiry { margin-left: auto; color: var(--muted); font-size: 10px; }


/* Inline route text */
.route-flow { padding: 20px 22px; }
.route-flow > div { display: flex; align-items: center; gap: 13px; white-space: normal; }
.route-flow .route-url { flex: 1 1 auto; min-width: 0; font-size: 15px; font-weight: 650; }
.route-flow > span svg { width: 21px; height: 21px; }
.root-detail { padding: 18px; align-items: center; overflow-x: auto; }
.root-detail > div { min-width: max-content; display: flex; align-items: center; gap: 13px; }
.root-detail small { flex: 0 0 auto; font-size: 15px; }
.root-detail > div > code { font-size: 16px; font-weight: 750; white-space: nowrap; }
.root-detail p { margin: 0 0 0 8px; display: inline-flex; align-items: center; gap: 5px; font-size: 14px; white-space: nowrap; }
.root-detail p code { font-size: 14px; font-weight: 700; white-space: nowrap; }


/* Larger route metadata */
.route-meta { min-height: 66px; padding: 0 20px 20px; gap: 9px; }
.route-flag { padding: 7px 10px; font-size: 14px; font-weight: 700; }
.route-flag svg { width: 15px; height: 15px; margin-right: 4px; }
.certificate-expiry { font-size: 14px; font-weight: 600; }

/* Readability scale */
body { font-size: var(--font-base); }
.brand { font-size: 22px; }
.sidebar { width: auto; }
.nav-group-label { font-size: var(--font-caption); }
.nav-link { min-height: 52px; font-size: var(--font-base); }
.sidebar-user b { font-size: var(--font-small); }
.sidebar-user small { font-size: var(--font-caption); }
.page-heading p { font-size: var(--font-base); }
.eyebrow { font-size: 11px; }
.status-chip { min-width: 175px; font-size: 13px; }
.status-chip b { font-size: var(--font-small); }
.hero-panel p, .settings-hero p { font-size: 15px; }
.hero-state { font-size: var(--font-small); }
.stat-card { min-height: 118px; }
.stat-card small { font-size: var(--font-small); }
.stat-card strong { font-size: 30px; }
.panel-heading { min-height: 88px; }
.panel-heading h2 { font-size: 18px; }
.panel-heading p { font-size: 13px; }
.count-pill { font-size: var(--font-caption); }
table { font-size: var(--font-small); }
th, td { padding: 17px 18px; }
th { font-size: 11px; }
td code, .path-box code { font-size: var(--font-caption); }
.primary-button, .secondary-button, .icon-text-button { min-height: 42px; font-size: var(--font-small); }
.switch-button { min-width: 64px; height: 31px; font-size: 11px; }
.badge { padding: 6px 9px; font-size: 11px; }
.stack-form label { font-size: var(--font-small); }
.stack-form input, .password-row input { min-height: 47px; font-size: 15px; }
.form-hint { font-size: var(--font-caption); }
.password-row input { min-height: 42px; font-size: 13px; }
.account-summary p { font-size: 13px; }
.setting-card small { font-size: 11px; }
.setting-card strong { font-size: 23px; }
.setting-card p { font-size: var(--font-caption); }
.path-box code { font-size: var(--font-small); }
.alert { font-size: var(--font-small); }
.workspace-footer { font-size: 11px; }
.login-showcase p { font-size: 15px; }
.showcase-foot { font-size: var(--font-caption); }
.login-heading h2 { font-size: 30px; }
.login-heading p { font-size: var(--font-small); }

@media (max-width: 1180px) {
  .app-body { grid-template-columns: 260px minmax(0,1fr); }
  .sidebar { padding-inline: 16px; }
  .page-heading, .page-content { padding-left: 24px; padding-right: 24px; }
  .stats-grid, .settings-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .route-overview { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .route-grid { grid-template-columns: 1fr; }
  .two-column { grid-template-columns: 1fr; }
  .account-summary { min-height: 220px; }
}

@media (max-width: 820px) {
  .app-body { display: block; }
  .sidebar { position: relative; width: 100%; height: auto; min-height: 0; padding: 14px 16px; border-right: 0; border-bottom: 1px solid var(--border); }
  .brand { min-height: 42px; }
  .sidebar-nav { padding-top: 14px; display: flex; overflow-x: auto; gap: 7px; scrollbar-width: none; }
  .nav-link.sub-link { width: auto; margin-left: 0; }
  .nav-link.sub-link::before { display: none; }
  .sidebar-nav::-webkit-scrollbar { display: none; }
  .nav-group-label { display: none; }
  .nav-link { min-width: max-content; min-height: 42px; padding-inline: 12px; }
  .nav-link span { white-space: nowrap; }
  .sidebar-footer { display: none; }
  .workspace { padding: 14px; }
  .content-shell { min-height: calc(100vh - 110px); border-radius: 17px; }
  .page-heading { min-height: 112px; padding: 21px; }
  .page-content { padding: 20px; }
  .status-chip { display: none; }
  .hero-panel { min-height: 170px; padding: 25px; }
  .hero-state { display: none; }
  .login-layout { grid-template-columns: 1fr; min-height: 0; }
  .login-showcase { min-height: 260px; padding: 30px; }
  .login-showcase h1 { font-size: 40px; }
  .showcase-foot { display: none; }
  .login-card { padding: 38px 30px; }
}

@media (max-width: 560px) {
  .nav-link svg { display: none; }
  .page-heading h1 { font-size: 24px; }
  .page-heading p { font-size: var(--font-small); }
  .page-content { padding: 15px; }
  .stats-grid, .settings-grid { grid-template-columns: 1fr; }
  .route-overview { grid-template-columns: 1fr; }
  .route-card-head { grid-template-columns: auto minmax(0,1fr); }
  .backend-pill { grid-column: 2; justify-self: start; }
  .route-flow { grid-template-columns: 1fr; }
  .route-flow > span { transform: rotate(90deg); justify-self: center; }
  .certificate-expiry { width: 100%; margin-left: 0; }
  .hero-panel, .settings-hero { padding: 23px; }
  .hero-panel h2, .settings-hero h2 { font-size: 23px; }
  .settings-icon { display: none; }
  .panel-heading { padding: 15px; }
  th, td { padding: 13px 14px; }
  .workspace-footer { display: none; }
  .login-body { padding: 14px; }
  .login-showcase { min-height: 230px; }
  .login-card { padding: 32px 24px; }
}
/* Protected full-site restore layers */
.restore-layer { position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; padding: 24px; background: rgba(15,23,42,.62); backdrop-filter: blur(8px); }
.restore-dialog { width: min(560px,100%); max-height: calc(100vh - 48px); overflow: auto; padding: 30px; border: 1px solid #e2e8f0; border-radius: 22px; background: #fff; color: #172033; box-shadow: 0 28px 80px rgba(15,23,42,.34); }
.restore-dialog h2 { margin: 8px 0 10px; font-size: 26px; }
.restore-dialog p { color: #64748b; line-height: 1.65; }
.restore-step { color: #7c3aed; font-size: 13px; font-weight: 800; letter-spacing: .06em; }
.restore-summary { display: grid; grid-template-columns: 120px 1fr; gap: 10px 16px; margin: 22px 0; padding: 18px; border-radius: 14px; background: #f8fafc; }
.restore-summary dt { color: #64748b; font-weight: 700; }.restore-summary dd { margin: 0; font-weight: 800; overflow-wrap: anywhere; }
.restore-form { display: grid; gap: 16px; }.restore-form label:not(.restore-check) { display: grid; gap: 7px; font-weight: 800; }.restore-form input[type="text"],.restore-form input[type="password"] { min-height: 46px; padding: 0 13px; border: 1px solid #cbd5e1; border-radius: 10px; font: inherit; }
.restore-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 8px; }.restore-actions a { text-decoration: none; }
.danger-button { min-height: 44px; padding: 0 18px; border: 0; border-radius: 10px; color: #fff; background: #b91c1c; font-weight: 800; cursor: pointer; }.danger-button:hover { background: #991b1b; }
.restore-warning { padding: 16px; border: 1px solid #fecaca; border-radius: 12px; color: #991b1b!important; background: #fff1f2; font-weight: 700; }
.restore-check { display: flex; gap: 10px; align-items: flex-start; padding: 15px; border-radius: 12px; background: #f8fafc; font-weight: 700; line-height: 1.5; }.restore-check input { margin-top: 4px; }
.verification-state { display: inline-flex; align-items: center; min-height: 28px; padding: 0 10px; border-radius: 999px; font-size: 12px; font-weight: 800; background: #f1f5f9; color: #475569; }.verification-pass { background: #ecfdf5; color: #047857; }.verification-fail { background: #fff1f2; color: #be123c; }.verification-running { background: #eff6ff; color: #1d4ed8; }
.restore-history-panel { margin-top: 18px; }.restore-error { display: block; max-width: 320px; margin-top: 6px; color: #be123c; overflow-wrap: anywhere; }

/* NPM route mapping states */
.status-dot.warning { background: #f59e0b; box-shadow: 0 0 0 4px rgba(245,158,11,.14); }
.backend-pill.unmapped { color: #57534e; background: #f5f5f4; border-color: #d6d3d1; }
.route-site-icon.unmapped { color: #57534e; background: #f5f5f4; border-color: #d6d3d1; }
.route-sync-warning, .route-mapping-warning { display: flex; align-items: center; gap: 8px; color: #92400e; background: #fffbeb; border: 1px solid #fde68a; }
.route-sync-warning { margin-bottom: 18px; padding: 12px 14px; border-radius: 12px; font-size: 13px; font-weight: 700; }
.route-mapping-warning { padding: 10px 20px; border-width: 1px 0 0; font-size: 12px; overflow-wrap: anywhere; }
.route-sync-warning svg, .route-mapping-warning svg { width: 16px; height: 16px; flex: 0 0 auto; }