/* Same design tokens as the website. */
:root {
  --navy: #000066;
  --blue: #2140ff;
  --ink: #070b2b;
  --soft: #f4f5f8;
  --line: #e3e5ee;
  --txt: #0b0f2e;
  --mut: #5a5f7a;
  --sky: #a9b6ff;
  --danger: #c0264a;
  --ok: #12855a;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; overscroll-behavior: none; }
body {
  margin: 0;
  background: var(--soft);
  color: var(--txt);
  font: 15px/1.5 'Hanken Grotesk', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
}
a { color: inherit; text-decoration: none; }
h1, h2 { margin: 0; font-weight: 600; letter-spacing: -0.02em; }
h2 { font-size: 19px; }
code { padding: 2px 8px; border-radius: 6px; background: #e8ebff; color: var(--navy); font-size: 13px; }
img { max-width: 100%; }
.muted { color: var(--mut); }
.nowrap { white-space: nowrap; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.lead { margin: 0 0 22px; max-width: 760px; color: var(--mut); font-size: 16px; }

/* Layout */
.shell { display: grid; grid-template-columns: 264px minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 24px 16px 18px;
  background: linear-gradient(170deg, var(--ink) 0%, var(--navy) 100%);
  color: #fff;
  overflow-y: auto;
}
.brand { display: block; padding: 0 12px; }
.brand img { display: block; height: 28px; filter: brightness(0) invert(1); }
.brand-tag { margin: 10px 12px 22px; font-weight: 600; font-size: 11px; letter-spacing: 0.14em; color: var(--sky); }
.nav { display: grid; gap: 4px; }
.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 46px;
  padding: 0 14px;
  border-radius: 14px;
  color: rgba(255, 255, 255, 0.72);
  font-weight: 500;
  transition: background 0.25s, color 0.25s;
}
.nav-link:hover { background: rgba(255, 255, 255, 0.08); color: #fff; }
.nav-link.is-active { background: #fff; color: var(--navy); font-weight: 600; }
.nav-group-head { cursor: pointer; list-style: none; user-select: none; }
.nav-group-head::-webkit-details-marker { display: none; }
.nav-group-head > svg:last-child { margin-left: auto; flex: none; opacity: 0.7; transition: transform 0.25s; }
.nav-group[open] > .nav-group-head > svg:last-child { transform: rotate(180deg); }
.nav-group-head.has-active { color: #fff; }
.nav-group-badge { margin-left: auto; }
.nav-group:not([open]) .nav-group-badge:not([hidden]) + svg { margin-left: 8px; }
.nav-group[open] .nav-group-badge { display: none; }
.nav-group-items { display: grid; gap: 2px; margin: 4px 0 6px 22px; padding-left: 10px; border-left: 1px solid rgba(255, 255, 255, 0.14); }
.nav-group-items .nav-link { height: 40px; font-size: 14px; }
.main { min-width: 0; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 76px;
  padding: 14px 36px;
  background: rgba(244, 245, 248, 0.92);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.topbar h1 { font-size: 26px; }
.topbar-actions { margin-left: auto; }
.content { padding: 28px 36px 60px; max-width: 1280px; }
.menu-button, .scrim { display: none; }

/* Buttons and links */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 44px;
  padding: 0 22px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--txt);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.25s, border-color 0.25s, color 0.25s;
}
.button:hover { border-color: var(--navy); }
.button-primary { border-color: var(--navy); background: var(--navy); color: #fff; }
.button-primary:hover { border-color: var(--blue); background: var(--blue); }
.button-small { height: 36px; padding: 0 16px; font-size: 14px; }
.button-danger { color: var(--danger); }
.button-danger:hover { border-color: var(--danger); background: var(--danger); color: #fff; }
.button-wide { width: 100%; height: 50px; margin-top: 8px; }
.link { border: 0; background: none; padding: 0; color: var(--blue); font: inherit; font-weight: 600; cursor: pointer; }
.link:hover { text-decoration: underline; }
.link-danger { color: var(--danger); font-size: 14px; }
.icon-button { display: grid; place-items: center; width: 40px; height: 40px; flex: none; border: 0; border-radius: 50%; background: var(--soft); color: var(--mut); cursor: pointer; }
.icon-button:hover { background: #fde7ec; color: var(--danger); }

/* Dashboard */
.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 22px; }
.stat { display: grid; gap: 4px; padding: 22px; border-radius: 22px; background: #fff; transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1); }
.stat:hover { transform: translateY(-3px); }
.stat-label { font-weight: 600; }
.stat-value { font-weight: 600; font-size: 46px; line-height: 1.1; letter-spacing: -0.04em; }
.stat-hint { font-size: 14px; color: var(--mut); }
.stat-navy { background: var(--navy); color: #fff; }
.stat-blue { background: var(--blue); color: #fff; }
.stat-navy .stat-hint, .stat-blue .stat-hint { color: rgba(255, 255, 255, 0.75); }
.plain-list { margin: 0; padding: 0; list-style: none; }
.plain-list li { display: flex; justify-content: space-between; gap: 16px; padding: 12px 0; border-top: 1px solid var(--line); }
.plain-list li:first-child { border-top: 0; }
.plain-list a { font-weight: 500; }
.plain-list a:hover { color: var(--blue); }
.plain-list .muted { white-space: nowrap; font-size: 14px; }

/* Panels and tables */
.panel { margin-bottom: 16px; padding: 24px; border-radius: 22px; background: #fff; }
.panel > h2 { margin-bottom: 16px; }
.panel-narrow { max-width: 620px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.table-card { border-radius: 22px; background: #fff; overflow: hidden; }
table { width: 100%; border-collapse: collapse; }
th { padding: 14px 18px; background: #fafbfe; color: var(--mut); font-size: 12px; font-weight: 600; letter-spacing: 0.08em; text-align: left; text-transform: uppercase; }
td { padding: 14px 18px; border-top: 1px solid var(--line); vertical-align: middle; }
.row-title { font-weight: 600; }
.row-title:hover { color: var(--blue); }
.row-media { display: flex; align-items: center; gap: 14px; }
.row-media img { width: 72px; height: 48px; flex: none; border-radius: 10px; object-fit: cover; }
.row-media-logo img { object-fit: contain; background: #fff; }
.row-media-person img { width: 48px; object-position: top; }
.team-section { margin-bottom: 32px; }
.team-section h2 { margin: 0; }
.team-section .muted { margin: 2px 0 0; }
.cell-url { max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cell-actions { width: 1%; white-space: nowrap; }
.row-actions { display: flex; justify-content: flex-end; gap: 8px; }
/* Sortable lists */
.order-hint { margin: 0 0 10px; font-size: 14px; }
.cell-order { width: 1%; white-space: nowrap; }
.order-controls { display: flex; align-items: center; gap: 4px; }
.drag-handle { display: grid; place-items: center; width: 30px; height: 36px; border-radius: 10px; color: var(--mut); cursor: grab; touch-action: none; }
.drag-handle:hover { background: var(--soft); color: var(--navy); }
.order-number { min-width: 24px; color: var(--navy); font-weight: 700; text-align: center; }
.is-sorting, .is-sorting * { cursor: grabbing !important; user-select: none; -webkit-user-select: none; }
tr.is-dragging, tr.is-dragging td { background: #eef1ff; }
tr.is-dragging { box-shadow: 0 10px 30px rgba(0, 0, 102, 0.18); }
.toast-error { background: var(--danger); }
.toast-error .toast-body span { color: #fff; }
.status { display: inline-block; padding: 3px 12px; border-radius: 999px; background: var(--soft); color: var(--mut); font-size: 13px; font-weight: 600; }
.status.is-on { background: #e4f7ee; color: var(--ok); }
.empty { padding: 56px 24px; border-radius: 22px; background: #fff; text-align: center; }
.empty strong { font-size: 19px; }
.empty p { margin: 6px 0 18px; }

/* Forms */
.form-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; align-items: start; }
.form-side { position: sticky; top: 92px; }
.settings-grid { grid-template-columns: minmax(0, 1fr) 380px; }
.settings-grid .panel-head h2 { margin: 0; }
.settings-side > .panel:last-child { margin-bottom: 0; }
.field-row.field-row-server { grid-template-columns: minmax(0, 2fr) minmax(0, 0.8fr) minmax(0, 1.4fr); }
.settings-tip { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); font-size: 13px; }
.field { display: block; margin-bottom: 16px; }
.field > span { display: block; margin-bottom: 6px; font-weight: 600; font-size: 14px; }
.field small { display: block; margin-top: 5px; color: var(--mut); font-size: 13px; }
.panel h3 { margin: 24px 0 12px; padding-top: 18px; border-top: 1px solid var(--line); font-size: 16px; }
.field-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
input:not([type='checkbox']), textarea, select {
  width: 100%;
  min-height: 46px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--soft);
  color: var(--txt);
  font: inherit;
  outline: none;
  transition: border-color 0.25s, box-shadow 0.25s, background 0.25s;
}
textarea { resize: vertical; line-height: 1.55; }
input[readonly] { color: var(--mut); }
input:focus, textarea:focus, select:focus { border-color: var(--blue); background: #fff; box-shadow: 0 0 0 4px rgba(33, 64, 255, 0.12); }
input[type='file'] { padding: 9px 12px; }
.field-error { display: block; margin-top: 5px; color: var(--danger); font-size: 13px; font-weight: 600; }
.panel > .field-error { margin: -6px 0 12px; }
.alert { margin: 16px 0 0; padding: 12px 16px; border-radius: 14px; background: #fde7ec; color: var(--danger); font-weight: 600; font-size: 14px; }
.flash { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; padding: 12px 18px; border-radius: 14px; background: #e4f7ee; color: var(--ok); font-weight: 600; }
.form-foot { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 6px; }
.repeat-card { margin-bottom: 14px; padding: 16px; border: 1px solid var(--line); border-radius: 16px; }
.repeat-row { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr) 40px; gap: 8px; align-items: center; margin-bottom: 8px; }
.image-preview { display: block; width: 100%; aspect-ratio: 16 / 10; margin-bottom: 14px; border-radius: 14px; object-fit: cover; }
.image-preview[hidden] { display: none; }
.image-preview-logo { object-fit: contain; background: #fff; border: 1px solid var(--line, #e3e6f3); }
.image-preview-person { aspect-ratio: 4 / 5; object-position: top; }
[data-for-section][hidden] { display: none; }
.or { margin: -4px 0 12px; color: var(--mut); font-size: 13px; font-weight: 600; text-transform: uppercase; }
.toggle { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; font-weight: 500; cursor: pointer; }
.toggle input { position: absolute; opacity: 0; }
.toggle-track { position: relative; width: 44px; height: 26px; flex: none; border-radius: 999px; background: #d5d9e8; transition: background 0.3s; }
.toggle-track::after { content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(11, 15, 46, 0.2); transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1); }
.toggle input:checked + .toggle-track { background: var(--blue); }
.toggle input:checked + .toggle-track::after { transform: translateX(18px); }
.toggle input:focus-visible + .toggle-track { box-shadow: 0 0 0 4px rgba(33, 64, 255, 0.25); }

/* Sign-in */
.auth-body {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 100vh;
  min-height: 100svh;
  margin: 0;
  padding: 28px 20px;
  overflow-x: hidden;
  background: radial-gradient(70% 70% at 8% 45%, rgba(18, 56, 230, 0.75) 0%, transparent 70%), linear-gradient(160deg, #010846 0%, #03108a 58%, #0a2bd8 100%);
}
.auth-bg { position: fixed; inset: 0; overflow: hidden; pointer-events: none; }
.auth-bg-building {
  position: absolute;
  left: -4%;
  top: 8%;
  width: 34%;
  height: 80%;
  background-size: cover;
  background-position: 50% 30%;
  filter: saturate(0.2) brightness(0.8);
  mix-blend-mode: luminosity;
  opacity: 0.42;
  -webkit-mask-image: linear-gradient(90deg, #000 40%, transparent 96%), linear-gradient(180deg, transparent 0%, #000 22%, #000 58%, transparent 92%);
  -webkit-mask-composite: source-in;
  mask-image: linear-gradient(90deg, #000 40%, transparent 96%), linear-gradient(180deg, transparent 0%, #000 22%, #000 58%, transparent 92%);
  mask-composite: intersect;
}
.auth-bg-map { position: absolute; right: -3%; top: 3%; width: 42%; }
.auth-bg-map img { display: block; width: 100%; opacity: 0.5; filter: brightness(0.55) sepia(1) hue-rotate(185deg) saturate(7); -webkit-user-drag: none; }
.auth-bg-map svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.auth-arc { stroke: #a9c8ff; stroke-width: 1.6; filter: drop-shadow(0 0 4px #6d9bff); }
.auth-node { fill: #fff; filter: drop-shadow(0 0 5px #8fb4ff); }
.auth-bg-dots {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 44%;
  height: 34%;
  background-image: radial-gradient(rgba(150, 190, 255, 0.5) 1px, transparent 1.5px);
  background-size: 14px 14px;
  -webkit-mask-image: linear-gradient(315deg, #000 15%, transparent 70%);
  mask-image: linear-gradient(315deg, #000 15%, transparent 70%);
}
.auth-bg-waves { position: absolute; inset: 0; width: 100%; height: 100%; }
.auth-wave { filter: drop-shadow(0 0 7px rgba(150, 190, 255, 0.9)); }
.auth-wave-2 { opacity: 0.7; }

.auth-card {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 0.86fr) minmax(0, 1fr);
  width: min(975px, 100%);
  min-height: 588px;
  border-radius: 28px;
  background: linear-gradient(180deg, #fff 0%, #f6f8ff 100%);
  box-shadow: 0 0 0 1.5px rgba(255, 255, 255, 0.75), 0 40px 90px rgba(0, 4, 60, 0.55);
  overflow: hidden;
  animation: auth-enter 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}
.auth-visual { position: relative; overflow: hidden; color: #fff; }
.auth-visual-strip {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, #a9c4ff 0%, #2d6bff 100%);
  clip-path: polygon(0 0, 100% 0, 78% 100%, 0 100%);
}
.auth-visual-photo {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: 42% 22%;
  clip-path: polygon(0 0, 96% 0, 74% 100%, 0 100%);
}
.auth-visual-photo::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 16, 110, 0.32) 0%, rgba(0, 16, 110, 0.12) 34%, rgba(2, 10, 70, 0.82) 72%, #020a46 100%);
}
.auth-visual-swoosh { position: absolute; inset: 0; width: 100%; height: 100%; }
.auth-visual-text { position: absolute; left: 40px; right: 28%; bottom: 72px; }
.auth-visual-company { font-weight: 600; font-size: 18px; line-height: 1.25; }
.auth-visual-title { margin-top: 8px; font-weight: 600; font-size: 36px; line-height: 1.1; letter-spacing: -0.02em; }
.auth-visual-text p { margin: 14px 0 0; color: rgba(255, 255, 255, 0.86); font-size: 15px; line-height: 1.5; }
.auth-visual-bar { display: block; width: 58px; height: 5px; margin-top: 24px; border-radius: 5px; background: linear-gradient(90deg, #5fa8ff, #2d7bff); }

.auth-panel { display: flex; flex-direction: column; justify-content: center; padding: 44px 44px 44px 30px; }
.auth-logo { display: block; width: auto; height: 42px; align-self: flex-start; margin: 0 0 40px 16px; }
.kicker { font-weight: 600; font-size: 15px; letter-spacing: 0.22em; color: #4d7fff; }
.auth-panel h1 { margin-top: 8px; font-size: 34px; line-height: 1.15; letter-spacing: -0.02em; color: var(--txt); }
.auth-panel form { margin-top: 28px; }
.auth-field { position: relative; display: block; margin-bottom: 20px; }
.auth-field > svg { position: absolute; left: 18px; top: 50%; color: var(--navy); transform: translateY(-50%); pointer-events: none; }
.auth-field input:not([type='checkbox']) {
  min-height: 56px;
  padding: 12px 54px;
  border: 1.5px solid #d9dee9;
  border-radius: 14px;
  background: #fff;
  font-size: 16px;
}
.auth-field input::placeholder { color: var(--mut); }
.password-toggle { position: absolute; right: 8px; top: 50%; display: grid; place-items: center; width: 42px; height: 42px; border: 0; border-radius: 50%; background: none; color: var(--navy); cursor: pointer; transform: translateY(-50%); transition: background 0.25s; }
.password-toggle:hover { background: #e8ebff; }
.password-toggle span { display: grid; }
.password-toggle .icon-shown, .password-toggle[aria-pressed='true'] .icon-hidden { display: none; }
.password-toggle[aria-pressed='true'] .icon-shown { display: grid; }
.auth-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; margin: -2px 0 26px; }
.auth-check { display: flex; align-items: center; gap: 10px; font-weight: 500; cursor: pointer; }
.auth-check input { position: absolute; opacity: 0; }
.auth-check-box { display: grid; place-items: center; width: 22px; height: 22px; border: 1.5px solid #8a93ad; border-radius: 6px; background: #fff; color: transparent; transition: background 0.2s, border-color 0.2s; }
.auth-check input:checked + .auth-check-box { border-color: var(--blue); background: var(--blue); color: #fff; }
.auth-check input:focus-visible + .auth-check-box { box-shadow: 0 0 0 4px rgba(33, 64, 255, 0.2); }
.auth-submit {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  height: 58px;
  border: 0;
  border-radius: 14px;
  background: linear-gradient(180deg, #1238c8 0%, #06127e 100%);
  color: #fff;
  font: inherit;
  font-weight: 600;
  font-size: 18px;
  cursor: pointer;
  transition: filter 0.25s, transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}
.auth-submit:hover { filter: brightness(1.2); }
.auth-submit svg { transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1); }
.auth-submit:hover svg { transform: translateX(4px); }
.auth-submit[disabled] { cursor: progress; opacity: 0.8; }
.auth-alert, .auth-alert svg { flex: none; margin-top: 1px; }
.auth-notice { background: #e4f7ee; color: var(--ok); }
.auth-note { margin: 0 0 18px; color: var(--muted, #5a5f7a); font-size: 14px; line-height: 1.55; }
.auth-note a { color: var(--blue, #2140ff); font-weight: 600; }
@keyframes auth-enter { from { opacity: 0; transform: translateY(18px) scale(0.985); } }

/* Smaller screens */
@media (max-width: 1100px) {
  .auth-bg-building, .auth-bg-map { opacity: 0.25; }
}
@media (max-width: 860px) {
  /* Sign-in: the photo becomes a banner above the form. */
  .auth-body { place-items: start center; padding: 16px; }
  .auth-bg-building, .auth-bg-map, .auth-bg-dots { display: none; }
  .auth-card { grid-template-columns: minmax(0, 1fr); width: min(520px, 100%); min-height: 0; border-radius: 24px; }
  .auth-visual { min-height: 190px; }
  .auth-visual-strip, .auth-visual-swoosh { display: none; }
  .auth-visual-photo { clip-path: none; background-position: 50% 26%; }
  .auth-visual-text { left: 22px; right: 22px; bottom: 18px; }
  .auth-visual-company { font-size: 15px; }
  .auth-visual-title { margin-top: 2px; font-size: 27px; }
  .auth-visual-text p, .auth-visual-bar { display: none; }
  .auth-panel { padding: 26px 22px 28px; }
  .auth-logo { height: 32px; margin: 0 0 22px; }
  .kicker { font-size: 13px; }
  .auth-panel h1 { font-size: 26px; }
  .auth-panel form { margin-top: 20px; }
  .auth-field { margin-bottom: 14px; }
  .auth-row { margin-bottom: 20px; }
  .auth-submit { height: 54px; font-size: 17px; }
}
/* Messages and notifications */
[hidden] { display: none !important; }
.nav-badge { display: grid; place-items: center; min-width: 22px; height: 22px; margin-left: auto; padding: 0 6px; border-radius: 999px; background: var(--blue); color: #fff; font-size: 12px; font-weight: 700; line-height: 1; }
.nav-link.is-active .nav-badge { background: var(--navy); }
.notify { position: relative; flex: none; }
.notify-button { position: relative; display: grid; place-items: center; width: 44px; height: 44px; border: 1px solid var(--line); border-radius: 50%; background: #fff; color: var(--navy); cursor: pointer; transition: border-color 0.2s; }
.notify-button:hover { border-color: var(--navy); }
.notify-count { position: absolute; top: -5px; right: -5px; display: grid; place-items: center; min-width: 10px; height: 16px; padding: 0 3px; border: 2px solid #fff; border-radius: 999px; background: var(--danger); color: #fff; font-size: 11px; font-weight: 700; line-height: 1; box-sizing: content-box; }
.notify-panel { position: absolute; top: calc(100% + 10px); right: 0; z-index: 30; width: min(360px, calc(100vw - 32px)); overflow: hidden; border: 1px solid var(--line); border-radius: 18px; background: #fff; box-shadow: 0 20px 50px rgba(7, 11, 43, 0.18); }
.notify-head { padding: 14px 18px; border-bottom: 1px solid var(--line); font-weight: 600; font-size: 16px; }
.notify-list { max-height: 340px; margin: 0; padding: 0; overflow-y: auto; list-style: none; }
.notify-list a { display: grid; gap: 2px; padding: 12px 18px; border-bottom: 1px solid var(--line); }
.notify-list a:hover { background: var(--soft); }
.notify-list strong { font-weight: 600; overflow-wrap: anywhere; }
.notify-list span { color: var(--mut); font-size: 14px; overflow-wrap: anywhere; }
.notify-list small { color: var(--mut); font-size: 12px; }
.account-menu { position: relative; flex: none; }
.account-button { display: flex; align-items: center; gap: 10px; height: 44px; padding: 0 12px 0 4px; border: 1px solid var(--line); border-radius: 999px; background: #fff; color: var(--navy); font: inherit; font-weight: 600; cursor: pointer; transition: border-color 0.2s; }
.account-button:hover, .account-button[aria-expanded='true'] { border-color: var(--navy); }
.account-button > svg { opacity: 0.7; transition: transform 0.25s; }
.account-button[aria-expanded='true'] > svg { transform: rotate(180deg); }
.account-avatar { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--navy); color: #fff; font-size: 14px; }
.account-name { max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-panel { position: absolute; top: calc(100% + 10px); right: 0; z-index: 30; width: min(280px, calc(100vw - 32px)); padding: 8px; border: 1px solid var(--line); border-radius: 18px; background: #fff; box-shadow: 0 20px 50px rgba(7, 11, 43, 0.18); }
.account-who { display: grid; gap: 2px; padding: 10px 12px 12px; margin-bottom: 6px; border-bottom: 1px solid var(--line); }
.account-who strong { font-weight: 600; overflow-wrap: anywhere; }
.account-who span { color: var(--mut); font-size: 13px; overflow-wrap: anywhere; }
.account-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; border: 0; border-radius: 12px; background: none; color: var(--txt); font: inherit; font-size: 15px; text-align: left; cursor: pointer; }
.account-item:hover { background: var(--soft); }
.account-signout { color: var(--danger); font-weight: 600; }
.notify-empty { margin: 0; padding: 24px 18px; text-align: center; }
.notify-all { display: block; padding: 13px 18px; color: var(--blue); font-weight: 600; text-align: center; }
.notify-all:hover { background: var(--soft); }
.toasts { position: fixed; top: 88px; right: 24px; z-index: 60; display: grid; gap: 10px; width: min(360px, calc(100vw - 32px)); }
.toast { display: flex; align-items: flex-start; gap: 8px; padding: 14px 12px 14px 18px; border-radius: 16px; background: var(--navy); color: #fff; box-shadow: 0 18px 44px rgba(0, 0, 102, 0.35); animation: toast-in 0.35s cubic-bezier(0.22, 1, 0.36, 1); }
.toast-body { display: grid; flex: 1; gap: 2px; min-width: 0; }
.toast-body strong { font-weight: 600; }
.toast-body span { color: var(--sky); font-size: 14px; overflow-wrap: anywhere; }
.toast-close { flex: none; width: 28px; height: 28px; border: 0; border-radius: 50%; background: none; color: #fff; font-size: 20px; line-height: 1; cursor: pointer; }
.toast-close:hover { background: rgba(255, 255, 255, 0.16); }
@keyframes toast-in { from { opacity: 0; transform: translateY(-10px); } }
.tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.tab { padding: 8px 18px; border: 1px solid var(--line); border-radius: 999px; background: #fff; font-weight: 600; font-size: 14px; }
.tab:hover { border-color: var(--navy); }
.tab.is-active { border-color: var(--navy); background: var(--navy); color: #fff; }
.is-unread { background: #f7f8ff; }
.unread-dot { display: inline-block; width: 8px; height: 8px; margin-right: 8px; border-radius: 50%; background: var(--blue); vertical-align: 2px; }
.cell-excerpt { max-width: 340px; color: var(--mut); overflow-wrap: anywhere; }
.pager { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
.message-body { font-size: 16px; line-height: 1.65; overflow-wrap: anywhere; }
.message-contact { display: grid; gap: 2px; margin: 0 0 16px; }
.message-contact dt { margin-top: 8px; color: var(--mut); font-size: 13px; }
.message-contact dd { margin: 0; overflow-wrap: anywhere; }
.message-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }

@media (max-width: 1100px) {
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .form-grid, .settings-grid { grid-template-columns: minmax(0, 1fr); }
  .form-side { position: static; }
}
@media (max-width: 860px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: fixed; inset: 0 auto 0 0; z-index: 50; width: 280px; transform: translateX(-100%); transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1); }
  .menu-open .sidebar { transform: none; }
  .scrim { position: fixed; inset: 0; z-index: 40; display: block; background: rgba(7, 11, 43, 0.5); opacity: 0; pointer-events: none; transition: opacity 0.3s; }
  .menu-open .scrim { opacity: 1; pointer-events: auto; }
  .menu-button { display: grid; place-items: center; width: 44px; height: 44px; flex: none; border: 0; border-radius: 50%; background: #fff; color: var(--navy); cursor: pointer; }
  .topbar { min-height: 68px; padding: 12px 16px; }
  .topbar h1 { font-size: 21px; }
  .account-name, .account-button > svg { display: none; }
  .account-button { padding: 0 4px; }
  .content { padding: 18px 16px 44px; }
  .panel { padding: 18px; }
  .field-row, .field-row.field-row-server { grid-template-columns: minmax(0, 1fr); gap: 0; }
  input:not([type='checkbox']), textarea, select { font-size: 16px; }
  /* Tables become stacked cards. */
  .table-card { background: none; border-radius: 0; }
  thead { display: none; }
  table, tbody, tr, td { display: block; }
  tr { margin-bottom: 12px; padding: 14px 16px; border-radius: 18px; background: #fff; }
  td { display: flex; justify-content: space-between; gap: 14px; padding: 6px 0; border: 0; text-align: right; }
  td[data-label]::before { content: attr(data-label); flex: none; color: var(--mut); font-size: 13px; font-weight: 600; }
  td > .row-title, td > .row-media { text-align: right; }
  .cell-url { max-width: none; white-space: normal; overflow-wrap: anywhere; }
  .cell-actions { width: auto; padding-top: 10px; white-space: normal; }
  .row-actions { width: 100%; }
}
@media (max-width: 600px) {
  .toasts { top: auto; right: 16px; bottom: 16px; }
}
@media (max-width: 420px) {
  .stat-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  * { transition-duration: 0.01ms !important; animation: none !important; }
}

.flash-error { background: #fdecec; color: #a12626; }
.menu-choices { margin: 0 0 18px; padding: 0; border: 0; }
.menu-choices[hidden] { display: none; }
.menu-choices legend { margin-bottom: 10px; padding: 0; font-weight: 600; }
.menu-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; margin-bottom: 10px; }
.menu-choice { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; background: var(--soft); font-weight: 500; cursor: pointer; }
.menu-choice input { width: 18px; height: 18px; flex: none; accent-color: var(--blue); }

/* English | 日本語 switch on content forms. */
.lang-tabs { margin-bottom: 4px; }
.lang-tabs .tabs { margin-bottom: 10px; }
.lang-note { margin: 0 0 14px; font-size: 13px; }
.form-grid > .lang-tabs { grid-column: 1 / -1; }
[data-lang][hidden] { display: none !important; }

/* Security scans */
.scan-strip { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); }
.scan-strip-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.scan-running { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; padding: 14px 18px; border-radius: 14px; background: #e8ebff; color: var(--navy); font-weight: 600; }
.scan-spinner { width: 18px; height: 18px; flex: none; border-radius: 50%; border: 2.5px solid rgba(0, 0, 102, 0.2); border-top-color: var(--navy); animation: scan-spin 0.8s linear infinite; }
@keyframes scan-spin { to { transform: rotate(360deg); } }
.scan-counts { display: flex; flex-wrap: wrap; gap: 6px; }
.scan-badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.scan-badge.is-fail { background: #fde7ec; color: var(--danger); }
.scan-badge.is-warn { background: #fff3dc; color: #8a5300; }
.scan-badge.is-pass { background: #e4f7ee; color: var(--ok); }
.scan-badge.is-info { background: var(--soft); color: var(--mut); }
.scan-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.scan-stat { padding: 18px 20px; border-radius: 18px; background: #fff; }
.scan-stat strong { display: block; font-size: 32px; line-height: 1.1; }
.scan-stat span { color: var(--mut); font-weight: 600; }
.scan-stat.is-fail strong { color: var(--danger); }
.scan-stat.is-warn strong { color: #b26a00; }
.scan-stat.is-pass strong { color: var(--ok); }
.scan-group h2 { margin-bottom: 8px; }
.finding { display: flex; gap: 14px; align-items: flex-start; padding: 14px 0; border-top: 1px solid var(--line); }
.finding:first-of-type { border-top: 0; }
.finding .scan-badge { flex: none; min-width: 74px; text-align: center; margin-top: 2px; }
.finding-body { min-width: 0; }
.finding-body p { margin: 4px 0 0; color: var(--mut); }
.finding-body .finding-fix { color: var(--txt); }
.finding-body details { margin-top: 8px; }
.finding-body summary { cursor: pointer; color: var(--blue); font-weight: 600; font-size: 14px; }
.finding-body ul { margin: 8px 0 0; padding-left: 18px; font-size: 14px; overflow-wrap: anywhere; }
.scan-note { margin-top: 8px; font-size: 13px; }
@media (max-width: 600px) {
  .scan-summary { grid-template-columns: 1fr; }
  .finding { flex-direction: column; gap: 8px; }
}
