/* ==========================================================================
   CarMsg design system
   ========================================================================== */

:root {
  color-scheme: light;
  --bg: #f5f7fb;
  --bg-soft: #eef2f9;
  --surface: rgba(255, 255, 255, 0.72);
  --surface-strong: #ffffff;
  --surface-2: rgba(255, 255, 255, 0.56);
  --surface-3: #f7f9fc;
  --border: rgba(15, 23, 42, 0.08);
  --border-strong: rgba(15, 23, 42, 0.14);
  --text: #0b1220;
  --text-2: #3f4a5c;
  --muted: #5f6b7f;
  --brand: #1d4ed8;
  --amber: #f59e0b;
  --accent-grad: linear-gradient(135deg, #2563eb 0%, #1d4ed8 58%, #0e7490 100%);
  --success: #059669;
  --danger: #dc2626;
  --warning: #d97706;
  --ring: rgba(29, 78, 216, 0.16);
  --grid-dot: rgba(15, 23, 42, 0.12);
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05), 0 4px 12px -6px rgba(15, 23, 42, 0.08);
  --shadow-md: 0 1px 2px rgba(15, 23, 42, 0.04), 0 18px 40px -24px rgba(15, 23, 42, 0.22);
  --shadow-lg: 0 30px 70px -40px rgba(15, 23, 42, 0.4), 0 12px 28px -18px rgba(15, 23, 42, 0.18);
  --radius-xl: 30px;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", "Geeza Pro",
    "Noto Naskh Arabic", "Noto Sans Arabic", sans-serif;
  --font-mono: ui-monospace, "SF Mono", "SFMono-Regular", "Cascadia Code",
    "Roboto Mono", Menlo, Consolas, monospace;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #070b14;
  --bg-soft: #0a1020;
  --surface: rgba(17, 25, 41, 0.72);
  --surface-strong: #101827;
  --surface-2: rgba(255, 255, 255, 0.045);
  --surface-3: rgba(255, 255, 255, 0.055);
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.15);
  --text: #e9eef8;
  --text-2: #bcc6d6;
  --muted: #8b98ad;
  --brand: #60a5fa;
  --amber: #fbbf24;
  --accent-grad: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 58%, #0e7490 100%);
  --success: #34d399;
  --danger: #f87171;
  --ring: rgba(96, 165, 250, 0.2);
  --grid-dot: rgba(255, 255, 255, 0.1);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.25), 0 4px 14px -6px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 1px 2px rgba(0, 0, 0, 0.2), 0 22px 48px -28px rgba(0, 0, 0, 0.6);
  --shadow-lg: 0 40px 90px -45px rgba(0, 0, 0, 0.8), 0 14px 32px -20px rgba(0, 0, 0, 0.5);
}

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

* {
  margin: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(96px + env(safe-area-inset-top));
  scroll-padding-bottom: 24px;
}

body {
  min-height: 100svh;
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
  overflow-x: hidden;
  overscroll-behavior-y: contain;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body.is-locked {
  overflow: hidden;
}

h1,
h2,
h3,
h4 {
  font-weight: 750;
  letter-spacing: -0.025em;
  line-height: 1.24;
  text-wrap: balance;
}

p {
  text-wrap: pretty;
}

img,
svg,
canvas {
  display: block;
  max-width: 100%;
}

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

button {
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
}

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

ul,
ol {
  list-style: none;
  padding: 0;
}

[hidden] {
  display: none !important;
}

::selection {
  background: rgba(37, 99, 235, 0.2);
}

:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 3px;
  border-radius: 4px;
}

/* --------------------------------------------------------------------------
   Background
   -------------------------------------------------------------------------- */

.page-bg {
  position: fixed;
  z-index: -2;
  inset: 0;
  overflow: hidden;
  background: linear-gradient(180deg, var(--bg) 0%, var(--bg-soft) 100%);
  pointer-events: none;
}

.page-bg::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle at 1px 1px, var(--grid-dot) 1px, transparent 0);
  background-size: 28px 28px;
  opacity: 0.5;
  -webkit-mask-image: radial-gradient(ellipse 95% 65% at 50% 0%, #000 0%, transparent 74%);
  mask-image: radial-gradient(ellipse 95% 65% at 50% 0%, #000 0%, transparent 74%);
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.42;
  animation: orb-float 22s ease-in-out infinite alternate;
}

.orb-a {
  top: -280px;
  left: -180px;
  width: 640px;
  height: 640px;
  background: radial-gradient(circle, #93c5fd 0%, rgba(147, 197, 253, 0) 68%);
}

.orb-b {
  top: -40px;
  right: -200px;
  width: 620px;
  height: 620px;
  background: radial-gradient(circle, #99f6e4 0%, rgba(153, 246, 228, 0) 68%);
  animation-delay: -9s;
}

[data-theme="dark"] .orb {
  opacity: 0.16;
}

@keyframes orb-float {
  to {
    transform: translate3d(70px, 50px, 0) scale(1.08);
  }
}

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

.container {
  width: min(1180px, calc(100% - 48px));
  margin-inline: auto;
}

.skip-link {
  position: fixed;
  top: calc(12px + env(safe-area-inset-top));
  left: calc(12px + env(safe-area-inset-left));
  z-index: 200;
  padding: 10px 16px;
  border-radius: 10px;
  background: var(--text);
  color: var(--bg);
  font-size: 13px;
  font-weight: 600;
  transform: translateY(-160%);
  transition: transform 0.2s var(--ease);
}

.skip-link:focus {
  transform: translateY(0);
}

.svg-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  padding-top: env(safe-area-inset-top);
}

.site-header::before {
  content: "";
  position: absolute;
  inset: 0;
  border-bottom: 1px solid transparent;
  background: rgba(245, 247, 251, 0.78);
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  -webkit-backdrop-filter: blur(18px) saturate(1.4);
  backdrop-filter: blur(18px) saturate(1.4);
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

[data-theme="dark"] .site-header::before {
  background: rgba(7, 11, 20, 0.78);
  background: color-mix(in srgb, var(--bg) 72%, transparent);
}

.site-header.is-scrolled::before {
  border-bottom-color: var(--border);
  box-shadow: 0 12px 32px -28px rgba(15, 23, 42, 0.4);
}

.header-inner {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  height: 72px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
  font-weight: 800;
}

.brand-mark {
  display: grid;
  flex: none;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: var(--accent-grad);
  box-shadow: 0 8px 18px -8px rgba(29, 78, 216, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.28);
}

.brand-mark svg {
  width: 22px;
  height: 22px;
  color: #fff;
}

.brand-copy {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.brand-name {
  font-size: 16.5px;
  letter-spacing: -0.02em;
}

.brand-sub {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 550;
  letter-spacing: 0.02em;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ui-lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 2px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}

.ui-lang-btn {
  display: grid;
  place-items: center;
  min-width: 32px;
  height: 34px;
  padding: 0 5px;
  border-radius: 9px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1;
  transition: color 0.18s ease, background-color 0.18s ease, box-shadow 0.18s ease;
}

.ui-lang-btn:hover {
  background: var(--surface-2);
  color: var(--text);
}

.ui-lang-btn[aria-pressed="true"] {
  background: var(--surface-strong);
  box-shadow: var(--shadow-sm);
  color: var(--text);
}

.icon-btn {
  display: grid;
  position: relative;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text-2);
  transition: transform 0.2s var(--ease), color 0.2s ease, box-shadow 0.2s ease,
    border-color 0.2s ease;
}

.icon-btn:hover {
  transform: translateY(-1px);
  border-color: var(--border-strong);
  color: var(--text);
  box-shadow: var(--shadow-sm);
}

.icon-btn:active {
  transform: scale(0.96);
}

.icon-btn svg {
  width: 19px;
  height: 19px;
}

.theme-toggle .icon-sun {
  display: none;
}

.theme-toggle .icon-moon {
  display: block;
}

[data-theme="dark"] .theme-toggle .icon-sun {
  display: block;
}

[data-theme="dark"] .theme-toggle .icon-moon {
  display: none;
}

.theme-toggle.is-turning svg {
  animation: theme-turn 0.45s var(--ease);
}

@keyframes theme-turn {
  from {
    transform: rotate(-35deg) scale(0.7);
    opacity: 0;
  }
  to {
    transform: none;
    opacity: 1;
  }
}

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

.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 52px;
  padding: 0 22px;
  overflow: hidden;
  border-radius: 15px;
  font-size: 14.5px;
  font-weight: 650;
  letter-spacing: 0.01em;
  white-space: nowrap;
  transition: transform 0.22s var(--ease), box-shadow 0.22s ease, background-color 0.2s ease,
    border-color 0.2s ease, color 0.2s ease, opacity 0.2s ease;
}

.btn svg {
  flex: none;
  width: 18px;
  height: 18px;
}

.btn-primary {
  background: var(--accent-grad);
  color: #fff;
  box-shadow: 0 14px 26px -14px rgba(37, 99, 235, 0.8), inset 0 1px 0 rgba(255, 255, 255, 0.26);
}

.btn-primary::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 28%, rgba(255, 255, 255, 0.3) 50%, transparent 72%);
  transform: translateX(-130%);
  transition: transform 0.75s var(--ease);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 20px 34px -16px rgba(37, 99, 235, 0.85), inset 0 1px 0 rgba(255, 255, 255, 0.26);
}

.btn-primary:hover::after {
  transform: translateX(130%);
}

.btn-primary:active {
  transform: translateY(0) scale(0.995);
}

.btn-ghost {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-2);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}

.btn-ghost:hover {
  transform: translateY(-1px);
  border-color: var(--border-strong);
  color: var(--text);
  box-shadow: var(--shadow-sm);
}

.btn-ghost:active {
  transform: scale(0.985);
}

.btn-quiet {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 40px;
  padding: 0 13px;
  border-radius: 11px;
  color: var(--muted);
  font-size: 12.5px;
  white-space: nowrap;
}

.btn-quiet svg {
  width: 15px;
  height: 15px;
}

.btn-quiet:hover {
  background: var(--surface-2);
  color: var(--text);
  transform: none;
  box-shadow: none;
}

.btn-quiet.is-danger {
  color: var(--danger);
}

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none;
}

.btn[aria-busy="true"] {
  cursor: progress;
  opacity: 0.9;
}

.btn:disabled::after {
  display: none;
}

.btn-sm {
  min-height: 42px;
  padding: 0 16px;
  border-radius: 12px;
  font-size: 13px;
}

.btn-block {
  width: 100%;
}

/* --------------------------------------------------------------------------
   Surfaces, badges and typography helpers
   -------------------------------------------------------------------------- */

.panel {
  position: relative;
  padding: clamp(22px, 3vw, 34px);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  background: var(--surface);
  box-shadow: var(--shadow-md);
  -webkit-backdrop-filter: blur(24px) saturate(1.25);
  backdrop-filter: blur(24px) saturate(1.25);
}

.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}

.panel-title {
  font-size: clamp(20px, 2.2vw, 23px);
  letter-spacing: -0.03em;
}

.panel-sub {
  margin-top: 5px;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.6;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 11px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.pill-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--success);
}

.pill-dot.is-live {
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.45);
  animation: ping 2.2s cubic-bezier(0, 0, 0.2, 1) infinite;
}

@keyframes ping {
  60%,
  100% {
    box-shadow: 0 0 0 7px rgba(16, 185, 129, 0);
  }
}

.section {
  margin-top: clamp(52px, 8vw, 92px);
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
}

.section-head h2 {
  font-size: clamp(24px, 3.2vw, 34px);
  letter-spacing: -0.035em;
}

.section-head p {
  max-width: 520px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.75;
}

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

.field {
  min-width: 0;
}

.field + .field {
  margin-top: 18px;
}

.field-label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.field-label label {
  color: var(--text);
  font-size: 13.5px;
  font-weight: 650;
}

.field-hint {
  color: var(--muted);
  font-size: 12px;
  font-weight: 450;
}

.optional {
  margin-left: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

.input-wrap {
  position: relative;
  display: flex;
  align-items: center;
  height: 54px;
  border: 1px solid var(--border-strong);
  border-radius: 14px;
  background: var(--surface-3);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.input-wrap:hover {
  border-color: rgba(15, 23, 42, 0.22);
}

[data-theme="dark"] .input-wrap:hover {
  border-color: rgba(255, 255, 255, 0.22);
}

.input-wrap:focus-within {
  border-color: var(--brand);
  border-color: color-mix(in srgb, var(--brand) 62%, transparent);
  background: var(--surface-strong);
  box-shadow: 0 0 0 4px var(--ring);
}

.input-wrap.is-invalid {
  border-color: var(--danger);
  border-color: color-mix(in srgb, var(--danger) 70%, transparent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--danger) 12%, transparent);
}

.input-wrap.is-valid {
  border-color: var(--success);
  border-color: color-mix(in srgb, var(--success) 48%, transparent);
}

.input-icon {
  position: absolute;
  left: 16px;
  width: 19px;
  height: 19px;
  color: var(--muted);
  pointer-events: none;
  transition: color 0.2s ease;
}

.input-wrap:focus-within .input-icon {
  color: var(--brand);
}

.input-wrap input {
  width: 100%;
  height: 100%;
  padding: 0 16px 0 46px;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 15.5px;
  font-weight: 550;
  letter-spacing: 0.015em;
}

.input-wrap input::placeholder {
  color: var(--muted);
  font-weight: 400;
  opacity: 0.66;
}

.input-wrap input:-webkit-autofill,
.input-wrap input:-webkit-autofill:hover,
.input-wrap input:-webkit-autofill:focus,
.textarea-wrap textarea:-webkit-autofill {
  -webkit-text-fill-color: var(--text);
  -webkit-box-shadow: 0 0 0 1000px var(--surface-strong) inset;
  transition: background-color 5000s ease-in-out 0s;
}

.input-wrap.has-prefix input {
  padding-left: 67px;
}

.input-prefix {
  position: absolute;
  left: 15px;
  padding-right: 11px;
  border-right: 1px solid var(--border);
  color: var(--muted);
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  pointer-events: none;
}

.plate-region {
  margin-top: 7px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.plate-region svg {
  display: inline-block;
  width: 14px;
  height: 14px;
  margin-right: 3px;
  vertical-align: -2px;
  color: var(--brand);
}

.plate-region span {
  margin-right: 4px;
}

.plate-region strong {
  color: var(--brand);
  font-weight: 600;
  overflow-wrap: anywhere;
}

.field-msg {
  display: none;
  align-items: center;
  gap: 6px;
  margin-top: 7px;
  color: var(--danger);
  font-size: 11.5px;
  line-height: 1.5;
}

.field-msg.is-visible {
  display: flex;
  animation: msg-in 0.2s var(--ease);
}

.field-msg svg {
  flex: none;
  width: 13px;
  height: 13px;
}

@keyframes msg-in {
  from {
    opacity: 0;
    transform: translateY(-3px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.textarea-wrap {
  position: relative;
  padding: 12px 14px;
  border: 1px solid var(--border-strong);
  border-radius: 14px;
  background: var(--surface-3);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.textarea-wrap:focus-within {
  border-color: color-mix(in srgb, var(--brand) 62%, transparent);
  background: var(--surface-strong);
  box-shadow: 0 0 0 4px var(--ring);
}

.textarea-wrap textarea {
  display: block;
  width: 100%;
  height: 54px;
  padding: 0;
  resize: none;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 13.5px;
  line-height: 1.7;
}

.textarea-wrap textarea::placeholder {
  color: var(--muted);
  opacity: 0.66;
}

.chips {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-top: 9px;
}

.chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 6px 11px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  transition: color 0.18s ease, border-color 0.18s ease, background-color 0.18s ease,
    transform 0.18s var(--ease);
}

.chip:active {
  transform: scale(0.97);
}

.chip:hover {
  border-color: var(--border-strong);
  color: var(--text);
}

.chip.is-active {
  border-color: color-mix(in srgb, var(--brand) 30%, transparent);
  background: color-mix(in srgb, var(--brand) 9%, transparent);
  color: var(--brand);
}

.counter {
  color: var(--muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
}

.counter.is-full {
  color: var(--warning);
}

/* --------------------------------------------------------------------------
   Feedback
   -------------------------------------------------------------------------- */

.toast-region {
  position: fixed;
  z-index: 120;
  bottom: calc(26px + env(safe-area-inset-bottom));
  left: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: max-content;
  max-width: calc(100% - 32px);
  pointer-events: none;
  transform: translateX(-50%);
}

.toast {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 11px 17px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 13px;
  background: rgba(12, 18, 32, 0.92);
  box-shadow: 0 22px 46px -22px rgba(0, 0, 0, 0.65);
  color: #fff;
  font-size: 13px;
  line-height: 1.45;
  opacity: 0;
  transform: translateY(12px) scale(0.97);
  transition: opacity 0.28s var(--ease), transform 0.28s var(--ease);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}

.toast.is-visible {
  opacity: 1;
  transform: none;
}

.toast-icon {
  display: grid;
  flex: none;
  place-items: center;
  width: 17px;
  height: 17px;
  color: #6ee7b7;
}

.toast-icon svg {
  width: 17px;
  height: 17px;
}

.toast-error .toast-icon {
  color: #fca5a5;
}

.toast-info .toast-icon {
  color: #93c5fd;
}

[data-theme="dark"] .toast {
  border-color: rgba(15, 23, 42, 0.08);
  background: rgba(248, 250, 252, 0.95);
  color: #0f172a;
}

[data-theme="dark"] .toast-icon {
  color: #059669;
}

[data-theme="dark"] .toast-error .toast-icon {
  color: #dc2626;
}

[data-theme="dark"] .toast-info .toast-icon {
  color: #2563eb;
}

.offline-banner {
  position: fixed;
  z-index: 90;
  top: calc(84px + env(safe-area-inset-top));
  left: 50%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 15px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-strong);
  box-shadow: var(--shadow-md);
  color: var(--text-2);
  font-size: 12px;
  font-weight: 550;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -8px);
  transition: opacity 0.25s ease, transform 0.25s var(--ease);
}

.offline-banner.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.offline-banner svg {
  width: 15px;
  height: 15px;
  color: var(--warning);
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */

.site-footer {
  margin-top: clamp(48px, 6vw, 72px);
  border-top: 1px solid var(--border);
  padding: 32px 0 max(36px, env(safe-area-inset-bottom));
}

.footer-inner {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 28px;
  flex-wrap: wrap;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.footer-brand .brand-mark {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  box-shadow: none;
}

.footer-brand .brand-mark svg {
  width: 18px;
  height: 18px;
}

.footer-brand strong {
  font-size: 14px;
  letter-spacing: -0.01em;
}

.footer-links {
  display: flex;
  align-items: center;
  gap: 18px;
  color: var(--muted);
  font-size: 12.5px;
}

.footer-links a {
  transition: color 0.2s ease;
}

.footer-links a:hover {
  color: var(--text);
}

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px dashed var(--border);
  color: var(--muted);
  font-size: 12px;
}

/* --------------------------------------------------------------------------
   Motion utilities
   -------------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */

@media (max-width: 760px) {
  .container {
    width: calc(100% - 32px);
  }

  .orb {
    filter: blur(64px);
    opacity: 0.3;
    animation: none;
  }

  .header-inner {
    height: 64px;
  }

  .brand-sub {
    display: none;
  }

  .brand-mark {
    width: 34px;
    height: 34px;
    border-radius: 11px;
  }

  .brand-name {
    font-size: 15.5px;
  }

  .icon-btn {
    width: 38px;
    height: 38px;
  }

  .section-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
  }

  .footer-inner {
    flex-direction: column;
    gap: 18px;
  }

  .footer-bottom {
    margin-top: 20px;
  }
}

@media (max-width: 360px) {
  .header-inner {
    gap: 8px;
  }

  .header-actions {
    gap: 6px;
  }

  .ui-lang-btn {
    min-width: 29px;
  }
}
