/* VSaaS portal theme — white & orange primary, black secondary. */
:root {
  --orange: #f97316;
  --orange-strong: #ea580c;
  --orange-soft: #fff3ea;
  --orange-line: #fed7b8;
  --black: #111111;
  --black-soft: #1f1f1f;
  --white: #ffffff;
  --paper: #fafaf9;
  --ink: #171717;
  --muted: #6b6560;
  --line: #e9e4df;
  --danger: #c2261d;
  --danger-soft: #fdecea;
  --success: #15803d;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(17, 17, 17, 0.06), 0 4px 16px rgba(17, 17, 17, 0.06);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

html, body { margin: 0; }

body {
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}

[hidden] { display: none !important; }

a { color: var(--orange-strong); }

h1, h2, h3 { margin: 0; line-height: 1.25; letter-spacing: -0.01em; }

/* ---------- Header ---------- */

.topbar {
  background: var(--black);
  color: var(--white);
  border-bottom: 3px solid var(--orange);
}

.topbar-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  height: 60px;
  display: flex;
  align-items: center;
  gap: 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 18px;
  letter-spacing: -0.02em;
  color: var(--white);
  text-decoration: none;
  white-space: nowrap;
}

.brand-mark {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: var(--orange);
  display: grid;
  place-items: center;
}

.brand-mark svg { width: 16px; height: 16px; fill: var(--black); }

.brand small {
  font-weight: 600;
  font-size: 12px;
  color: var(--orange);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.nav { display: flex; gap: 4px; height: 100%; }

.nav button {
  background: none;
  border: 0;
  color: #bdbdbd;
  font: inherit;
  font-weight: 600;
  padding: 0 14px;
  cursor: pointer;
  border-bottom: 3px solid transparent;
  margin-bottom: -3px;
}

.nav button:hover { color: var(--white); }
.nav button[aria-selected="true"] { color: var(--white); border-bottom-color: var(--orange); }

.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }

.who { color: #d4d4d4; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 200px; }

/* ---------- Layout ---------- */

.page { max-width: 1200px; margin: 0 auto; padding: 28px 20px 60px; }

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.page-head h1 { font-size: 26px; font-weight: 800; }
.page-head p { margin: 4px 0 0; color: var(--muted); }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }

.card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font: inherit;
  font-weight: 700;
  font-size: 14px;
  border-radius: 8px;
  border: 1px solid transparent;
  padding: 8px 14px;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 0.12s, border-color 0.12s, color 0.12s;
}

.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn:focus-visible, input:focus-visible, select:focus-visible, .nav button:focus-visible {
  outline: 3px solid var(--orange-line);
  outline-offset: 2px;
}

.btn-primary { background: var(--orange); color: var(--black); }
.btn-primary:hover:not(:disabled) { background: var(--orange-strong); }

.btn-dark { background: var(--black); color: var(--white); }
.btn-dark:hover:not(:disabled) { background: var(--black-soft); }

.btn-outline { background: var(--white); color: var(--ink); border-color: var(--line); }
.btn-outline:hover:not(:disabled) { border-color: var(--orange); color: var(--orange-strong); }

.btn-ghost-light { background: transparent; color: var(--white); border-color: #3a3a3a; }
.btn-ghost-light:hover { border-color: var(--orange); color: var(--orange); }

.btn-danger { background: var(--white); color: var(--danger); border-color: #f1c3bf; }
.btn-danger:hover:not(:disabled) { background: var(--danger); color: var(--white); border-color: var(--danger); }
.btn-danger-solid { background: var(--danger); color: var(--white); }

.btn-sm { padding: 5px 10px; font-size: 13px; }
.btn-block { width: 100%; padding: 11px 14px; }

/* ---------- Forms ---------- */

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label { font-weight: 600; font-size: 13px; }
.field .hint { font-size: 12px; color: var(--muted); }

input, select {
  font: inherit;
  width: 100%;
  padding: 9px 12px;
  border: 1px solid #d6d0ca;
  border-radius: 8px;
  background: var(--white);
  color: var(--ink);
}

input:focus, select:focus { border-color: var(--orange); }

.input-row { display: flex; gap: 8px; }
.input-row input { flex: 1; min-width: 0; }

.form-error {
  background: var(--danger-soft);
  color: var(--danger);
  border-radius: 8px;
  padding: 9px 12px;
  font-size: 14px;
  margin-bottom: 14px;
}

/* ---------- Login ---------- */

.login-wrap {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

.login-side {
  background: var(--black);
  color: var(--white);
  padding: 48px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}

.login-side::after {
  content: "";
  position: absolute;
  right: -120px;
  bottom: -120px;
  width: 360px;
  height: 360px;
  border-radius: 50%;
  border: 48px solid var(--orange);
  opacity: 0.9;
}

.login-side h2 { font-size: 34px; font-weight: 800; max-width: 420px; position: relative; z-index: 1; }
.login-side h2 span { color: var(--orange); }
.login-side p { color: #bdbdbd; max-width: 380px; position: relative; z-index: 1; }

.login-main { display: grid; place-items: center; padding: 40px 20px; background: var(--white); }
.login-card { width: 100%; max-width: 380px; }
.login-card h1 { font-size: 26px; font-weight: 800; margin-bottom: 6px; }
.login-card > p { color: var(--muted); margin: 0 0 24px; }

@media (max-width: 820px) {
  .login-wrap { grid-template-columns: 1fr; }
  .login-side { padding: 24px 20px; min-height: 0; }
  .login-side h2, .login-side p { display: none; }
  .login-side::after { width: 160px; height: 160px; border-width: 24px; right: -60px; bottom: -80px; }
}

/* ---------- Stats ---------- */

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 20px; }
.stat { padding: 14px 16px; border-left: 4px solid var(--orange); }
.stat .label { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
.stat .value { font-size: 26px; font-weight: 800; }
.stat.dark { background: var(--black); color: var(--white); border-color: var(--black); border-left-color: var(--orange); }
.stat.dark .label { color: #a3a3a3; }

/* ---------- Tables ---------- */

.table-wrap { overflow-x: auto; }

table { width: 100%; min-width: 720px; border-collapse: collapse; font-size: 14px; }
th {
  text-align: left;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  padding: 12px 16px;
  background: #f6f3f0;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
td { padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
/* Buttons wrap onto a second line when labels are long (e.g. Portuguese) instead of squeezing the row. */
td.actions-cell { text-align: right; min-width: 200px; }
td.actions-cell .btn { margin: 2px 0 2px 6px; }
td strong { white-space: nowrap; }
.cell-sub { color: var(--muted); font-size: 12px; }
code, .mono { font-family: var(--mono); font-size: 13px; }

.empty { text-align: center; color: var(--muted); padding: 40px 20px; }
.empty strong { display: block; color: var(--ink); font-size: 16px; margin-bottom: 4px; }

/* ---------- Status pills ---------- */

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
}
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill-online { background: var(--orange); color: var(--black); }
.pill-offline { background: #eeeae6; color: #6b6560; }
.pill-unknown { background: #fff; color: #6b6560; border: 1px dashed #cfc8c1; }

/* ---------- Camera grid ---------- */

.camera-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 18px; }

.camera { overflow: hidden; }
.camera-screen { position: relative; aspect-ratio: 16 / 9; background: var(--black); }
.camera-screen video { width: 100%; height: 100%; object-fit: contain; display: block; background: var(--black); }
.camera-screen .pill { position: absolute; top: 10px; left: 10px; }

.camera-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: #d4d4d4;
  font-size: 14px;
  text-align: center;
  padding: 16px;
}

.camera-overlay svg { width: 34px; height: 34px; fill: #3f3f3f; }

.camera-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 14px; }
.camera-foot h3 { font-size: 15px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.spinner {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 3px solid #333;
  border-top-color: var(--orange);
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Dialogs ---------- */

dialog {
  border: 0;
  border-radius: 14px;
  padding: 0;
  width: min(480px, calc(100vw - 32px));
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  color: var(--ink);
}
dialog.wide { width: min(820px, calc(100vw - 32px)); }
dialog::backdrop { background: rgba(17, 17, 17, 0.6); }

.dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
}
.dialog-head h2 { font-size: 18px; font-weight: 800; }
.dialog-body { padding: 20px; }
.dialog-foot {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 14px 20px;
  border-top: 1px solid var(--line);
  background: #fbfaf9;
}

.icon-btn {
  background: none;
  border: 0;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
  color: var(--muted);
}
.icon-btn:hover { background: var(--orange-soft); color: var(--orange-strong); }

.copy-field { margin-bottom: 14px; }
.copy-field label { display: block; font-weight: 600; font-size: 13px; margin-bottom: 6px; }
.copy-field input { font-family: var(--mono); font-size: 13px; background: #f8f6f4; }

.callout {
  background: var(--orange-soft);
  border: 1px solid var(--orange-line);
  border-radius: 8px;
  padding: 12px 14px;
  font-size: 14px;
  margin-bottom: 16px;
}
.callout.dark { background: var(--black); color: #e5e5e5; border-color: var(--black); }

/* ---------- Toast ---------- */

.toast-stack { position: fixed; bottom: 20px; right: 20px; left: 20px; display: flex; flex-direction: column; align-items: flex-end; gap: 8px; z-index: 100; pointer-events: none; }
.toast {
  background: var(--black);
  color: var(--white);
  border-left: 4px solid var(--orange);
  padding: 11px 16px;
  border-radius: 8px;
  box-shadow: var(--shadow);
  font-size: 14px;
  max-width: 420px;
  pointer-events: auto;
  animation: toast-in 0.18s ease-out;
}
.toast.error { border-left-color: #ef4444; }
@keyframes toast-in { from { transform: translateY(8px); opacity: 0; } }

.show-sm { display: none; }

@media (max-width: 640px) {
  .topbar-inner { gap: 8px 12px; padding: 10px 16px 0; height: auto; flex-wrap: wrap; }
  .topbar-inner > .brand, .topbar-right { height: 40px; margin-bottom: 10px; }
  .nav { order: 3; width: 100%; height: 42px; margin: 0 -8px; }
  .brand small, .who, .hide-sm { display: none; }
  .show-sm { display: inline; }
  .page { padding: 20px 16px 48px; }
  .camera-grid { grid-template-columns: 1fr; }
  .nav button { padding: 0 8px; }
}

/* ---------- PTZ controls ---------- */

.camera-foot-actions { display: flex; gap: 6px; flex-shrink: 0; }
.camera-foot-actions .btn[aria-pressed="true"] { background: var(--orange); border-color: var(--orange); color: var(--black); }

/* Strip under the video: never covers the picture, fits any tile size. */
.ptz-panel {
  background: var(--black);
  color: var(--white);
  border-top: 3px solid var(--orange);
  padding: 12px 14px;
  font-size: 12px;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
.ptz-status { font-size: 13px; color: #d4d4d4; line-height: 1.4; }
.ptz-status.error { color: #fca5a5; }

.ptz-controls { display: flex; gap: 16px; align-items: center; }

.ptz-pad { display: grid; grid-template-columns: repeat(3, 40px); grid-auto-rows: 40px; gap: 4px; flex-shrink: 0; }
.ptz-btn {
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 8px;
  background: #262626;
  color: var(--orange);
  cursor: pointer;
  padding: 0;
  font: inherit;
  transition: background-color 0.1s, color 0.1s;
}
.ptz-btn svg { width: 20px; height: 20px; fill: currentColor; transition: none; }
.ptz-btn:hover { background: #3a2415; }
.ptz-btn.active, .ptz-btn:active { background: var(--orange); color: var(--black); }
.ptz-btn:focus-visible { outline: 2px solid var(--orange); outline-offset: 1px; }
.ptz-stop { color: #a3a3a3; font-size: 12px; }
.ptz-text { font-size: 18px; font-weight: 700; width: 40px; height: 34px; }

.ptz-side { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.ptz-speed { display: flex; align-items: center; gap: 10px; color: #bdbdbd; font-weight: 600; }
.ptz-speed input { padding: 0; border: 0; background: none; accent-color: var(--orange); flex: 1; min-width: 0; }
.ptz-zoom { display: flex; align-items: center; gap: 8px; color: #bdbdbd; font-weight: 600; }
.ptz-presets { display: flex; gap: 6px; }
.ptz-preset-select { padding: 5px 8px; font-size: 12px; min-width: 0; flex: 1; }

.pill-ptz { margin-left: 8px; font-size: 10px; padding: 2px 8px; vertical-align: middle; }
.ptz-link-status { display: flex; align-items: center; gap: 4px; margin: 0 0 16px; font-size: 14px; }

.camera-grid { align-items: start; }

/* ---------- Recordings ---------- */

.page-head p.storage-summary { margin-top: 2px; font-size: 13px; }
.storage-summary:empty { display: none; }

.rec-player { margin-bottom: 16px; border-radius: var(--radius); overflow: hidden; background: var(--black); }
.rec-video-wrap { position: relative; aspect-ratio: 16 / 9; max-height: 55vh; background: var(--black); }
.rec-player video { display: block; width: 100%; height: 100%; object-fit: contain; background: var(--black); }
.rec-empty { position: absolute; inset: 0; display: grid; place-items: center; color: #a3a3a3; font-size: 14px; pointer-events: none; }
.rec-empty[hidden] { display: none; }
.rec-player-bar #rec-player-label { font-variant-numeric: tabular-nums; }
.rec-player-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  padding: 10px 12px;
  color: var(--white);
  font-size: 14px;
  border-top: 3px solid var(--orange);
}
.rec-player-bar .btn-outline { background: transparent; color: var(--white); border-color: #3a3a3a; }
.rec-player-bar .btn-outline:hover { border-color: var(--orange); color: var(--orange); }


.usage-bar { height: 4px; border-radius: 2px; background: #eeeae6; margin-top: 5px; max-width: 140px; overflow: hidden; }
.usage-bar span { display: block; height: 100%; background: var(--orange); }

/* ---------- Language switch (sign-in screens) ---------- */

.login-main { position: relative; }
.lang-switch {
  position: absolute;
  top: 20px;
  right: 20px;
  display: inline-flex;
  padding: 3px;
  gap: 2px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--white);
}
.lang-switch button {
  border: 0;
  background: none;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  padding: 5px 12px;
  border-radius: 999px;
  cursor: pointer;
}
.lang-switch button:hover { color: var(--ink); }
.lang-switch button[aria-pressed="true"] { background: var(--orange); color: var(--black); }
.lang-switch button:focus-visible { outline: 3px solid var(--orange-line); outline-offset: 1px; }

@media (max-width: 820px) {
  .lang-switch { position: static; margin: 0 0 20px auto; justify-self: end; }
  .login-main { place-items: start center; grid-template-rows: auto 1fr; }
}

.rec-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 6px; }
.rec-mode { display: inline-flex; align-items: center; gap: 2px; padding: 3px; border: 1px solid var(--line); border-radius: 999px; }
.rec-mode-label { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; padding: 0 8px 0 6px; }
.rec-mode button {
  border: 0; background: none; font: inherit; font-size: 13px; font-weight: 700; color: var(--muted);
  padding: 5px 14px; border-radius: 999px; cursor: pointer;
}
.rec-mode button:hover:not(:disabled) { color: var(--ink); }
.rec-mode button[aria-checked="true"] { background: var(--orange); color: var(--black); }
.rec-mode button:disabled { opacity: 0.45; cursor: not-allowed; }
.rec-mode button:focus-visible { outline: 3px solid var(--orange-line); outline-offset: 1px; }
.rec-day { display: flex; align-items: center; gap: 6px; }
.rec-day input { width: auto; padding: 6px 10px; }
.rec-mode-hint { margin: 0 0 14px; font-size: 13px; color: var(--muted); }

/* ---------- Day timeline ---------- */

.tl { margin: 4px 0 18px; }
.tl-track {
  position: relative;
  height: 46px;
  border-radius: 8px;
  background: #eeeae6;
  cursor: pointer;
  overflow: visible;
  touch-action: manipulation;
  /* hour grid */
  background-image: linear-gradient(to right, rgba(17, 17, 17, 0.08) 1px, transparent 1px);
  background-size: calc(100% / 24) 100%;
}
.tl-track:focus-visible { outline: 3px solid var(--orange-line); outline-offset: 2px; }
.tl-layer { position: absolute; inset: 0; pointer-events: none; }
.tl-range { position: absolute; top: 10px; bottom: 10px; min-width: 2px; border-radius: 3px; }
.tl-range-continuous { background: #3a3a3a; }
.tl-range-motion { background: var(--orange); }
.tl-event { position: absolute; top: 2px; height: 6px; min-width: 3px; border-radius: 2px; background: var(--orange-strong); }
.tl-future {
  position: absolute; top: 0; bottom: 0; right: 0; border-radius: 0 8px 8px 0; pointer-events: none;
  background: repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.7) 0 4px, transparent 4px 8px);
}
.tl-playhead { position: absolute; top: -4px; bottom: -4px; width: 2px; margin-left: -1px; background: var(--danger); pointer-events: none; }
.tl-playhead::before { content: ""; position: absolute; top: -4px; left: -4px; width: 10px; height: 10px; border-radius: 50%; background: var(--danger); }
.tl-hover {
  position: absolute; bottom: calc(100% + 8px); transform: translateX(-50%); z-index: 3; pointer-events: none;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 4px; border-radius: 8px; background: var(--black); color: var(--white);
  font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap;
  box-shadow: var(--shadow);
}
.tl-hover img { width: 160px; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 5px; background: #222; }
.tl-hover img[hidden] { display: none; }
.tl-hover span { padding: 0 6px 2px; }
.tl-hours { position: relative; height: 18px; margin-top: 4px; font-size: 11px; color: var(--muted); }
.tl-hours span { position: absolute; transform: translateX(-50%); }
.tl-hours span:first-child { transform: none; }
.tl-hours span:last-child { transform: translateX(-100%); }
.tl-legend { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 6px; font-size: 12px; color: var(--muted); }
.tl-legend span { display: inline-flex; align-items: center; gap: 6px; }
.sw { display: inline-block; width: 14px; height: 8px; border-radius: 2px; }
.sw-continuous { background: #3a3a3a; }
.sw-motion-clip { background: var(--orange); }
.sw-event { background: var(--orange-strong); height: 4px; }

.rec-events h3 { font-size: 14px; font-weight: 800; margin-bottom: 8px; }
.rec-event-list { display: flex; flex-wrap: wrap; gap: 6px; max-height: 128px; overflow-y: auto; }
.rec-event {
  border: 1px solid var(--orange-line); background: var(--orange-soft); color: var(--ink);
  border-radius: 999px; padding: 3px 10px; font: inherit; font-size: 12px; font-weight: 700;
  font-variant-numeric: tabular-nums; cursor: pointer;
}
.rec-event:hover:not(:disabled) { border-color: var(--orange); background: var(--orange); color: var(--black); }
.rec-event:disabled { opacity: 0.5; cursor: not-allowed; }
.rec-events-empty { font-size: 13px; color: var(--muted); }

@media (max-width: 640px) {
  .tl-hours span:nth-child(even) { display: none; }
  .tl-hover img { width: 120px; }
}
.tl-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 6px; }
.tl-foot .tl-legend { margin-top: 0; }
.tl-zoom { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; }
.tl-zoom .btn { width: 30px; padding: 3px 0; font-size: 16px; line-height: 1; }
.tl-zoom span { min-width: 44px; text-align: center; }
.tl-track { user-select: none; -webkit-user-select: none; }
.tl-track:active { cursor: grabbing; }
.tl-range-saving { background: repeating-linear-gradient(135deg, #3a3a3a 0 5px, #6b6560 5px 10px); }
.sw-saving { background: repeating-linear-gradient(135deg, #3a3a3a 0 3px, #6b6560 3px 6px); }

/* ---------- Email / account ---------- */

.login-alt { margin: 14px 0 0; text-align: center; }
.link-btn {
  background: none; border: 0; padding: 0; font: inherit; font-size: 14px; font-weight: 600;
  color: var(--orange-strong); cursor: pointer; text-decoration: underline; text-underline-offset: 3px;
}
.link-btn:hover { color: var(--ink); }
.link-btn:focus-visible { outline: 3px solid var(--orange-line); outline-offset: 2px; border-radius: 4px; }
.link-btn.link-sm { font-size: 12px; margin-left: 6px; }
.account-msg { color: var(--ink); line-height: 1.6; }
.login-card .btn-block + .btn-block, .login-card p + .btn-block { margin-top: 8px; }

.settings-card { padding: 20px; margin-bottom: 16px; max-width: 760px; }
.settings-card h3 { font-size: 15px; font-weight: 800; margin-bottom: 12px; }
.settings-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0 14px; }
.settings-grid .span-2 { grid-column: span 2; }
.settings-grid .span-4 { grid-column: span 4; }
.settings-actions { display: flex; justify-content: flex-end; }
#tab-email > .callout { max-width: 760px; }
.callout.callout-ok { background: #eefaf1; border-color: #bfe6cb; }
@media (max-width: 640px) {
  .settings-grid { grid-template-columns: 1fr; }
  .settings-grid .span-2, .settings-grid .span-4 { grid-column: auto; }
}

.email-cell { display: flex; flex-direction: column; gap: 3px; max-width: 220px; }
.email-addr { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.pill.pill-xs { font-size: 10px; padding: 1px 7px; }

.reset-option { background: var(--orange-soft); border: 1px solid var(--orange-line); border-radius: 8px; padding: 14px; margin-bottom: 14px; }
.reset-or { display: flex; align-items: center; gap: 10px; margin: 16px -14px -6px; padding: 0 14px; font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; }
.reset-or::before, .reset-or::after { content: ""; flex: 1; border-top: 1px solid var(--orange-line); }
.email-current { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 0 0 14px; font-size: 15px; }
