:root {
  color-scheme: light;
  --font-main: "Manrope", "Inter", "Segoe UI", Arial, sans-serif;
  --bg: #f4f7f9;
  --panel: #ffffff;
  --panel-soft: #f8fbfc;
  --text: #17202a;
  --muted: #64717f;
  --line: #d8e1e8;
  --accent: #168777;
  --accent-dark: #0f675c;
  --accent-soft: #dff6f1;
  --accent-contrast: #ffffff;
  --gold: #d3a348;
  --ink: #101820;
  --danger: #b42318;
  --shadow-lg: 0 24px 70px rgba(12, 25, 38, 0.18);
  --shadow-sm: 0 10px 28px rgba(12, 25, 38, 0.08);
  --sidebar-bg: color-mix(in srgb, var(--panel) 78%, var(--bg));
  --sidebar-veil: color-mix(in srgb, var(--panel-soft) 70%, transparent);
  --sidebar-text: var(--text);
  --sidebar-muted: var(--muted);
  --sidebar-line: var(--line);
  --sidebar-hover: color-mix(in srgb, var(--accent) 10%, var(--panel-soft));
  --sidebar-active: color-mix(in srgb, var(--accent) 18%, var(--panel-soft));
  --sidebar-user-bg: color-mix(in srgb, var(--panel-soft) 82%, var(--panel));
  --surface-page: var(--bg);
  --surface-page-tint: color-mix(in srgb, var(--bg) 82%, var(--accent));
  --surface-card: var(--panel);
  --surface-card-soft: var(--panel-soft);
  --surface-card-raised: color-mix(in srgb, var(--panel) 88%, var(--bg));
  --surface-control: color-mix(in srgb, var(--panel) 84%, var(--panel-soft));
  --surface-control-hover: color-mix(in srgb, var(--accent) 10%, var(--panel-soft));
  --surface-overlay: color-mix(in srgb, var(--bg) 72%, transparent);
  --text-primary: var(--text);
  --text-secondary: var(--muted);
  --text-inverse: #ffffff;
  --border-subtle: var(--line);
  --border-strong: color-mix(in srgb, var(--line) 74%, var(--text));
  --border-accent: color-mix(in srgb, var(--accent) 42%, transparent);
  --control-primary-bg: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent-dark) 74%, var(--gold)));
  --control-primary-bg-hover: linear-gradient(135deg, color-mix(in srgb, var(--accent-dark) 82%, var(--gold)), var(--accent));
  --control-primary-text: var(--accent-contrast);
  --control-secondary-bg: var(--surface-control);
  --control-secondary-text: var(--text-primary);
  --status-success: #16a34a;
  --status-success-bg: color-mix(in srgb, var(--status-success) 13%, var(--surface-card));
  --status-success-border: color-mix(in srgb, var(--status-success) 38%, transparent);
  --status-warning: #d08a22;
  --status-warning-bg: color-mix(in srgb, var(--status-warning) 14%, var(--surface-card));
  --status-warning-border: color-mix(in srgb, var(--status-warning) 36%, transparent);
  --status-danger: var(--danger);
  --status-danger-bg: color-mix(in srgb, var(--danger) 12%, var(--surface-card));
  --status-danger-border: color-mix(in srgb, var(--danger) 34%, transparent);
  --seat-female: #d9468f;
  --seat-male: #2563eb;
}

.theme-aurora {
  color-scheme: dark;
  --bg: #08131c;
  --panel: rgba(16, 34, 45, 0.78);
  --panel-soft: rgba(255, 255, 255, 0.08);
  --text: #f4fbff;
  --muted: rgba(218, 231, 237, 0.72);
  --line: rgba(255, 255, 255, 0.22);
  --accent: #18a891;
  --accent-dark: #0d766b;
  --accent-soft: #dff8f3;
  --gold: #d7a84e;
  --sidebar-bg: #0a1b25;
  --sidebar-veil: rgba(24, 168, 145, 0.13);
  --sidebar-text: #f4fbff;
  --sidebar-muted: rgba(218, 231, 237, 0.72);
  --sidebar-line: rgba(255, 255, 255, 0.16);
  --sidebar-hover: rgba(24, 168, 145, 0.13);
  --sidebar-active: rgba(24, 168, 145, 0.22);
  --sidebar-user-bg: rgba(255, 255, 255, 0.07);
}

.theme-midnight {
  color-scheme: dark;
  --bg: #070b16;
  --panel: rgba(18, 23, 38, 0.82);
  --panel-soft: rgba(255, 255, 255, 0.075);
  --text: #f5f7ff;
  --muted: rgba(222, 228, 244, 0.72);
  --line: rgba(255, 255, 255, 0.18);
  --gold: #c9b26a;
  --shadow-lg: 0 24px 70px rgba(0, 0, 0, 0.36);
  --shadow-sm: 0 10px 28px rgba(0, 0, 0, 0.2);
  --sidebar-bg: #0b1020;
  --sidebar-veil: rgba(51, 120, 212, 0.12);
  --sidebar-text: #f5f7ff;
  --sidebar-muted: rgba(222, 228, 244, 0.7);
  --sidebar-line: rgba(255, 255, 255, 0.15);
  --sidebar-hover: rgba(51, 120, 212, 0.13);
  --sidebar-active: rgba(51, 120, 212, 0.2);
  --sidebar-user-bg: rgba(255, 255, 255, 0.065);
}

.theme-graphite {
  color-scheme: dark;
  --bg: #121311;
  --panel: rgba(33, 34, 31, 0.84);
  --panel-soft: rgba(255, 255, 255, 0.08);
  --text: #fffaf0;
  --muted: rgba(232, 225, 208, 0.72);
  --line: rgba(255, 248, 224, 0.18);
  --gold: #e0b85f;
  --shadow-lg: 0 24px 70px rgba(0, 0, 0, 0.34);
  --shadow-sm: 0 10px 28px rgba(0, 0, 0, 0.18);
  --sidebar-bg: #1c1c18;
  --sidebar-veil: rgba(224, 184, 95, 0.12);
  --sidebar-text: #fffaf0;
  --sidebar-muted: rgba(232, 225, 208, 0.7);
  --sidebar-line: rgba(255, 248, 224, 0.14);
  --sidebar-hover: rgba(224, 184, 95, 0.12);
  --sidebar-active: rgba(224, 184, 95, 0.2);
  --sidebar-user-bg: rgba(255, 248, 224, 0.06);
}

.theme-copper {
  color-scheme: dark;
  --bg: #130c12;
  --panel: rgba(35, 22, 28, 0.86);
  --panel-soft: rgba(255, 255, 255, 0.075);
  --text: #fff7ef;
  --muted: rgba(239, 221, 207, 0.72);
  --line: rgba(255, 222, 190, 0.18);
  --gold: #d7964a;
  --shadow-lg: 0 24px 70px rgba(28, 12, 18, 0.34);
  --shadow-sm: 0 10px 28px rgba(28, 12, 18, 0.2);
  --sidebar-bg: #170f17;
  --sidebar-veil: rgba(217, 117, 74, 0.12);
  --sidebar-text: #fff7ef;
  --sidebar-muted: rgba(239, 221, 207, 0.7);
  --sidebar-line: rgba(255, 222, 190, 0.14);
  --sidebar-hover: rgba(217, 117, 74, 0.13);
  --sidebar-active: rgba(217, 117, 74, 0.22);
  --sidebar-user-bg: rgba(255, 239, 224, 0.06);
}

.theme-alpine {
  color-scheme: light;
  --bg: #eef5f7;
  --panel: rgba(255, 255, 255, 0.88);
  --panel-soft: rgba(8, 33, 45, 0.055);
  --text: #16252d;
  --muted: rgba(51, 72, 82, 0.72);
  --line: rgba(30, 67, 82, 0.18);
  --gold: #b88a2f;
  --shadow-lg: 0 24px 70px rgba(50, 91, 108, 0.18);
  --shadow-sm: 0 10px 28px rgba(50, 91, 108, 0.09);
  --sidebar-bg: #e3eff3;
  --sidebar-veil: rgba(255, 255, 255, 0.74);
  --sidebar-text: #16252d;
  --sidebar-muted: rgba(51, 72, 82, 0.68);
  --sidebar-line: rgba(30, 67, 82, 0.16);
  --sidebar-hover: rgba(51, 120, 212, 0.12);
  --sidebar-active: rgba(51, 120, 212, 0.18);
  --sidebar-user-bg: rgba(255, 255, 255, 0.58);
}

.theme-porcelain {
  color-scheme: light;
  --bg: #f7f8f3;
  --panel: rgba(255, 255, 255, 0.9);
  --panel-soft: rgba(26, 74, 63, 0.06);
  --text: #1f2d29;
  --muted: rgba(68, 83, 78, 0.72);
  --line: rgba(41, 93, 81, 0.17);
  --gold: #bd9143;
  --shadow-lg: 0 24px 70px rgba(80, 103, 96, 0.16);
  --shadow-sm: 0 10px 28px rgba(80, 103, 96, 0.08);
  --sidebar-bg: #eef5ed;
  --sidebar-veil: rgba(255, 255, 255, 0.7);
  --sidebar-text: #1f2d29;
  --sidebar-muted: rgba(68, 83, 78, 0.68);
  --sidebar-line: rgba(41, 93, 81, 0.16);
  --sidebar-hover: rgba(47, 157, 104, 0.12);
  --sidebar-active: rgba(47, 157, 104, 0.18);
  --sidebar-user-bg: rgba(255, 255, 255, 0.6);
}

.theme-sunrise {
  color-scheme: light;
  --bg: #f8f1ea;
  --panel: rgba(255, 252, 247, 0.9);
  --panel-soft: rgba(135, 74, 32, 0.06);
  --text: #2b211b;
  --muted: rgba(86, 69, 57, 0.72);
  --line: rgba(132, 85, 45, 0.18);
  --gold: #c68c38;
  --shadow-lg: 0 24px 70px rgba(116, 82, 54, 0.16);
  --shadow-sm: 0 10px 28px rgba(116, 82, 54, 0.08);
  --sidebar-bg: #f3e5d8;
  --sidebar-veil: rgba(255, 252, 247, 0.7);
  --sidebar-text: #2b211b;
  --sidebar-muted: rgba(86, 69, 57, 0.68);
  --sidebar-line: rgba(132, 85, 45, 0.16);
  --sidebar-hover: rgba(199, 93, 119, 0.12);
  --sidebar-active: rgba(199, 93, 119, 0.18);
  --sidebar-user-bg: rgba(255, 252, 247, 0.62);
}

.theme-studio {
  color-scheme: light;
  --bg: #eef0fb;
  --panel: rgba(255, 255, 255, 0.9);
  --panel-soft: rgba(70, 76, 140, 0.07);
  --text: #1d2237;
  --muted: rgba(61, 68, 96, 0.72);
  --line: rgba(59, 69, 116, 0.17);
  --gold: #a57c33;
  --shadow-lg: 0 24px 70px rgba(70, 76, 140, 0.16);
  --shadow-sm: 0 10px 28px rgba(70, 76, 140, 0.08);
  --sidebar-bg: #e5e7f5;
  --sidebar-veil: rgba(255, 255, 255, 0.72);
  --sidebar-text: #1d2237;
  --sidebar-muted: rgba(61, 68, 96, 0.68);
  --sidebar-line: rgba(59, 69, 116, 0.15);
  --sidebar-hover: rgba(98, 91, 192, 0.12);
  --sidebar-active: rgba(98, 91, 192, 0.18);
  --sidebar-user-bg: rgba(255, 255, 255, 0.62);
}

.theme-aurora,
.theme-midnight,
.theme-graphite,
.theme-copper,
.theme-alpine,
.theme-porcelain,
.theme-sunrise,
.theme-studio {
  --sidebar-bg: color-mix(in srgb, var(--surface-card) 84%, var(--surface-page));
  --sidebar-veil: color-mix(in srgb, var(--accent) 8%, transparent);
  --sidebar-text: var(--text-primary);
  --sidebar-muted: var(--text-secondary);
  --sidebar-line: var(--border-subtle);
  --sidebar-hover: var(--surface-control-hover);
  --sidebar-active: color-mix(in srgb, var(--accent) 16%, var(--surface-card-soft));
  --sidebar-user-bg: var(--surface-card-soft);
}

.theme-aurora {
  --surface-page: #06141c;
  --surface-page-tint: #0b3034;
  --surface-card: rgba(13, 34, 45, 0.92);
  --surface-card-soft: rgba(24, 168, 145, 0.1);
  --surface-card-raised: #112d36;
  --surface-control: rgba(244, 251, 255, 0.1);
  --surface-control-hover: color-mix(in srgb, var(--accent) 18%, rgba(244, 251, 255, 0.08));
  --border-subtle: rgba(214, 239, 245, 0.18);
  --border-strong: rgba(214, 239, 245, 0.32);
  --surface-overlay: rgba(2, 9, 13, 0.72);
  --text-primary: #f4fbff;
  --text-secondary: rgba(218, 231, 237, 0.78);
  --control-secondary-text: #f4fbff;
}

.theme-midnight {
  --surface-page: #050815;
  --surface-page-tint: #111a3a;
  --surface-card: rgba(18, 24, 43, 0.94);
  --surface-card-soft: rgba(67, 112, 195, 0.11);
  --surface-card-raised: #172342;
  --surface-control: rgba(245, 247, 255, 0.1);
  --surface-control-hover: color-mix(in srgb, var(--accent) 18%, rgba(245, 247, 255, 0.08));
  --border-subtle: rgba(222, 228, 244, 0.16);
  --border-strong: rgba(222, 228, 244, 0.3);
  --surface-overlay: rgba(3, 6, 16, 0.74);
  --text-primary: #f5f7ff;
  --text-secondary: rgba(222, 228, 244, 0.78);
  --control-secondary-text: #f5f7ff;
}

.theme-graphite {
  --surface-page: #11110f;
  --surface-page-tint: #2b2922;
  --surface-card: rgba(35, 34, 29, 0.94);
  --surface-card-soft: rgba(224, 184, 95, 0.1);
  --surface-card-raised: #302d25;
  --surface-control: rgba(255, 250, 240, 0.1);
  --surface-control-hover: color-mix(in srgb, var(--gold) 16%, rgba(255, 250, 240, 0.08));
  --border-subtle: rgba(255, 248, 224, 0.16);
  --border-strong: rgba(255, 248, 224, 0.3);
  --surface-overlay: rgba(10, 10, 8, 0.74);
  --text-primary: #fffaf0;
  --text-secondary: rgba(232, 225, 208, 0.78);
  --control-secondary-text: #fffaf0;
}

.theme-copper {
  --surface-page: #120b12;
  --surface-page-tint: #321a25;
  --surface-card: rgba(35, 22, 30, 0.94);
  --surface-card-soft: rgba(217, 117, 74, 0.1);
  --surface-card-raised: #31202a;
  --surface-control: rgba(255, 247, 239, 0.1);
  --surface-control-hover: color-mix(in srgb, var(--accent) 18%, rgba(255, 247, 239, 0.08));
  --border-subtle: rgba(255, 222, 190, 0.16);
  --border-strong: rgba(255, 222, 190, 0.3);
  --surface-overlay: rgba(10, 5, 9, 0.74);
  --text-primary: #fff7ef;
  --text-secondary: rgba(239, 221, 207, 0.78);
  --control-secondary-text: #fff7ef;
}

.theme-alpine {
  --surface-page: #e5f0f6;
  --surface-page-tint: #cfe4ef;
  --surface-card: rgba(255, 255, 255, 0.96);
  --surface-card-soft: rgba(42, 112, 148, 0.09);
  --surface-card-raised: #f7fbfd;
  --surface-control: rgba(255, 255, 255, 0.78);
  --surface-control-hover: color-mix(in srgb, var(--accent) 12%, #f5fbff);
  --border-subtle: rgba(42, 83, 103, 0.18);
  --border-strong: rgba(42, 83, 103, 0.34);
  --surface-overlay: rgba(18, 42, 54, 0.34);
}

.theme-porcelain {
  --surface-page: #edf5ed;
  --surface-page-tint: #d8eddf;
  --surface-card: rgba(255, 255, 251, 0.96);
  --surface-card-soft: rgba(47, 157, 104, 0.1);
  --surface-card-raised: #fbfff9;
  --surface-control: rgba(255, 255, 251, 0.8);
  --surface-control-hover: color-mix(in srgb, var(--accent) 12%, #f8fff8);
  --border-subtle: rgba(49, 102, 82, 0.18);
  --border-strong: rgba(49, 102, 82, 0.34);
  --surface-overlay: rgba(22, 50, 39, 0.32);
}

.theme-sunrise {
  --surface-page: #f6eadf;
  --surface-page-tint: #efd6c2;
  --surface-card: rgba(255, 252, 247, 0.96);
  --surface-card-soft: rgba(199, 93, 119, 0.1);
  --surface-card-raised: #fff8ef;
  --surface-control: rgba(255, 252, 247, 0.78);
  --surface-control-hover: color-mix(in srgb, var(--accent) 12%, #fff8ef);
  --border-subtle: rgba(132, 85, 45, 0.2);
  --border-strong: rgba(132, 85, 45, 0.36);
  --surface-overlay: rgba(78, 46, 26, 0.32);
}

.theme-studio {
  --surface-page: #e8ebf8;
  --surface-page-tint: #dce0f3;
  --surface-card: rgba(255, 255, 255, 0.96);
  --surface-card-soft: rgba(98, 91, 192, 0.09);
  --surface-card-raised: #fbfbff;
  --surface-control: rgba(255, 255, 255, 0.78);
  --surface-control-hover: color-mix(in srgb, var(--accent) 12%, #f8f8ff);
  --border-subtle: rgba(59, 69, 116, 0.18);
  --border-strong: rgba(59, 69, 116, 0.34);
  --surface-overlay: rgba(35, 42, 76, 0.32);
}

.theme-nebula {
  color-scheme: dark;
  --bg: #070413;
  --panel: rgba(22, 13, 45, 0.86);
  --panel-soft: rgba(151, 105, 255, 0.11);
  --text: #fbf8ff;
  --muted: rgba(226, 220, 244, 0.8);
  --line: rgba(205, 190, 255, 0.18);
  --gold: #ffb86b;
  --surface-page: #070413;
  --surface-page-tint: #25114b;
  --surface-card: rgba(22, 13, 45, 0.86);
  --surface-card-soft: rgba(151, 105, 255, 0.11);
  --surface-card-raised: rgba(39, 23, 72, 0.94);
  --surface-control: rgba(246, 240, 255, 0.1);
  --surface-control-hover: color-mix(in srgb, var(--accent) 20%, rgba(246, 240, 255, 0.08));
  --surface-overlay: rgba(4, 1, 14, 0.78);
  --text-primary: #fbf8ff;
  --text-secondary: rgba(226, 220, 244, 0.8);
  --control-secondary-text: #fbf8ff;
  --border-subtle: rgba(205, 190, 255, 0.18);
  --border-strong: rgba(205, 190, 255, 0.34);
  --sidebar-bg: color-mix(in srgb, var(--surface-card) 84%, var(--surface-page));
  --sidebar-veil: color-mix(in srgb, var(--accent) 9%, transparent);
  --sidebar-text: var(--text-primary);
  --sidebar-muted: var(--text-secondary);
  --sidebar-line: var(--border-subtle);
  --sidebar-hover: var(--surface-control-hover);
  --sidebar-active: color-mix(in srgb, var(--accent) 18%, var(--surface-card-soft));
  --sidebar-user-bg: var(--surface-card-soft);
  --shadow-lg: 0 28px 80px rgba(2, 0, 18, 0.52);
  --shadow-sm: 0 12px 32px rgba(2, 0, 18, 0.3);
}

.theme-nebula.dashboard-page {
  background:
    radial-gradient(circle at 82% 8%, rgba(255, 63, 180, 0.18), transparent 31rem),
    radial-gradient(circle at 8% 72%, rgba(48, 214, 255, 0.15), transparent 34rem),
    radial-gradient(circle at 52% 108%, rgba(126, 74, 255, 0.2), transparent 40rem),
    #070413;
  background-attachment: fixed;
}

.theme-kyoto {
  color-scheme: light;
  --bg: #eee5d5;
  --panel: rgba(255, 252, 244, 0.95);
  --panel-soft: rgba(111, 47, 39, 0.075);
  --text: #211b18;
  --muted: rgba(69, 57, 50, 0.72);
  --line: rgba(77, 55, 43, 0.2);
  --gold: #a87a34;
  --surface-page: #eee5d5;
  --surface-page-tint: #dccbb2;
  --surface-card: rgba(255, 252, 244, 0.95);
  --surface-card-soft: rgba(111, 47, 39, 0.075);
  --surface-card-raised: #fffaf0;
  --surface-control: rgba(255, 252, 244, 0.82);
  --surface-control-hover: color-mix(in srgb, var(--accent) 10%, #fffaf0);
  --surface-overlay: rgba(48, 35, 28, 0.34);
  --border-subtle: rgba(77, 55, 43, 0.2);
  --border-strong: rgba(77, 55, 43, 0.36);
  --sidebar-bg: color-mix(in srgb, var(--surface-card) 84%, var(--surface-page));
  --sidebar-veil: color-mix(in srgb, var(--accent) 7%, transparent);
  --sidebar-text: var(--text-primary);
  --sidebar-muted: var(--text-secondary);
  --sidebar-line: var(--border-subtle);
  --sidebar-hover: var(--surface-control-hover);
  --sidebar-active: color-mix(in srgb, var(--accent) 16%, var(--surface-card-soft));
  --sidebar-user-bg: var(--surface-card-soft);
  --shadow-lg: 0 24px 65px rgba(76, 50, 34, 0.18);
  --shadow-sm: 0 10px 26px rgba(76, 50, 34, 0.1);
}

.theme-kyoto.dashboard-page {
  background:
    linear-gradient(90deg, rgba(89, 57, 38, 0.025) 1px, transparent 1px),
    linear-gradient(rgba(89, 57, 38, 0.025) 1px, transparent 1px),
    radial-gradient(circle at 92% 4%, rgba(163, 45, 43, 0.12), transparent 27rem),
    #eee5d5;
  background-size: 24px 24px, 24px 24px, auto, auto;
  background-attachment: fixed;
}

.accent-teal {
  --accent: #18a891;
  --accent-dark: #0d766b;
  --accent-soft: #dff8f3;
}

.accent-emerald {
  --accent: #2f9d68;
  --accent-dark: #21724c;
  --accent-soft: #e3f6eb;
}

.accent-sapphire {
  --accent: #3378d4;
  --accent-dark: #2459a4;
  --accent-soft: #e5efff;
}

.accent-amber {
  --accent: #c78b28;
  --accent-dark: #94661d;
  --accent-soft: #fff1d8;
}

.accent-rose {
  --accent: #c75d77;
  --accent-dark: #963f58;
  --accent-soft: #fde8ee;
}

.accent-violet {
  --accent: #7b68d8;
  --accent-dark: #5845a9;
  --accent-soft: #eeeafe;
}

.accent-coral {
  --accent: #df6f54;
  --accent-dark: #a84b38;
  --accent-soft: #fde9e3;
}

.accent-lime {
  --accent: #7aa62f;
  --accent-dark: #597722;
  --accent-soft: #edf7d8;
}

.accent-volt {
  --accent: #c8f43d;
  --accent-dark: #80ad00;
  --accent-soft: #efffc1;
  --accent-contrast: #101700;
}

.accent-plasma {
  --accent: #f23ca6;
  --accent-dark: #7b49ff;
  --accent-soft: #ffe3f5;
  --accent-contrast: #ffffff;
}

.accent-teal,
.accent-emerald,
.accent-sapphire,
.accent-amber,
.accent-rose,
.accent-violet,
.accent-coral,
.accent-lime,
.accent-volt,
.accent-plasma {
  --border-accent: color-mix(in srgb, var(--accent) 58%, transparent);
  --accent-ring: color-mix(in srgb, var(--accent) 22%, transparent);
  --control-primary-bg: linear-gradient(135deg, var(--accent), var(--accent-dark));
  --control-primary-bg-hover: linear-gradient(135deg, var(--accent-dark), var(--accent));
  --surface-control-hover: color-mix(in srgb, var(--accent) 16%, var(--surface-control));
  --sidebar-hover: color-mix(in srgb, var(--accent) 13%, var(--surface-control));
  --sidebar-active: color-mix(in srgb, var(--accent) 22%, var(--surface-card-soft));
}

.accent-volt {
  --control-primary-bg: linear-gradient(135deg, #dfff55, #8fc900 72%);
  --control-primary-bg-hover: linear-gradient(135deg, #efff8a, #a9df16 72%);
}

.accent-plasma {
  --control-primary-bg: linear-gradient(135deg, #ff3da6, #8a4dff 58%, #30cfff);
  --control-primary-bg-hover: linear-gradient(135deg, #ff63b9, #a66cff 58%, #57d9ff);
}

* {
  box-sizing: border-box;
}

.session-guard[hidden],
.session-warning[hidden] {
  display: none !important;
}

.audit-tabs {
  display: flex;
  gap: 8px;
  margin: 18px 0;
  padding: 6px;
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  background: var(--surface-card-soft);
}

.audit-tabs a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 8px;
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 700;
}

.audit-tabs a.is-active {
  background: var(--surface-card);
  color: var(--text-primary);
  box-shadow: var(--shadow-sm);
}

.audit-tabs b {
  min-width: 22px;
  padding: 2px 6px;
  border-radius: 999px;
  background: var(--status-danger);
  color: #fff;
  font-size: 11px;
  text-align: center;
}

.incident-list {
  display: grid;
  gap: 10px;
}

.incident-card {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  padding: 16px;
  border: 1px solid var(--border-subtle);
  border-left: 4px solid var(--status-danger);
  border-radius: 12px;
  background: var(--surface-card);
  color: var(--text-primary);
  text-decoration: none;
  transition: transform .18s ease, border-color .18s ease;
}

.incident-card:hover { transform: translateY(-2px); border-color: var(--border-accent); }
.incident-card--viewed { border-left-color: var(--status-warning); }
.incident-card--resolved { border-left-color: var(--status-success); opacity: .82; }
.incident-card__status { display: grid; gap: 8px; text-align: center; }
.incident-card__status span { text-transform: uppercase; color: var(--text-secondary); font-size: 10px; font-weight: 800; }
.incident-card__status strong { font-size: 24px; color: var(--accent); }
.incident-card p { margin: 0 0 7px; color: var(--text-secondary); font-size: 12px; }
.incident-card small { display: block; margin-top: 8px; color: var(--text-secondary); }
.incident-card time { display: grid; gap: 5px; color: var(--text-secondary); font-size: 11px; text-align: right; }
.incident-card time b { color: var(--text-primary); }

.incident-detail { display: grid; gap: 18px; }
.incident-detail__hero {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding: 24px;
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  background: var(--surface-card);
}
.incident-detail__hero a { color: var(--accent); text-decoration: none; }
.incident-detail__hero h1 { margin: 8px 0; overflow-wrap: anywhere; }
.incident-detail__hero p:last-child { color: var(--text-secondary); overflow-wrap: anywhere; }
.incident-detail__count { min-width: 120px; display: grid; place-content: center; text-align: center; }
.incident-detail__count span { color: var(--text-secondary); font-size: 12px; }
.incident-detail__count strong { font-size: 42px; color: var(--accent); }
.incident-detail__grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.incident-detail__grid article { min-width: 0; padding: 14px; border: 1px solid var(--border-subtle); border-radius: 10px; background: var(--surface-card-soft); }
.incident-detail__grid span { display: block; margin-bottom: 6px; color: var(--text-secondary); font-size: 11px; }
.incident-detail__grid strong { overflow-wrap: anywhere; font-size: 13px; }
.incident-status-form { display: flex; flex-wrap: wrap; gap: 8px; }
.incident-traceback { border: 1px solid var(--border-subtle); border-radius: 14px; overflow: hidden; background: #090d13; color: #d9e4ef; }
.incident-traceback > div { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 14px 16px; border-bottom: 1px solid rgba(255,255,255,.12); }
.incident-traceback h2 { margin: 0; font-size: 15px; }
.incident-traceback span { color: rgba(217,228,239,.64); font-size: 11px; }
.incident-traceback pre { max-height: 620px; margin: 0; padding: 18px; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; font: 12px/1.6 Consolas, monospace; }
.incident-user-agent { color: var(--text-secondary); font-size: 11px; }

@media (max-width: 760px) {
  .incident-card { grid-template-columns: 70px minmax(0, 1fr); }
  .incident-card time { grid-column: 1 / -1; text-align: left; }
  .incident-detail__hero { display: grid; }
  .incident-detail__count { justify-content: start; grid-auto-flow: column; gap: 10px; }
  .incident-detail__grid { grid-template-columns: 1fr 1fr; }
}

.session-guard {
  position: fixed;
  inset: 0;
  z-index: 2147483647;
  display: grid;
  place-items: center;
  padding: 20px;
}

.session-guard__backdrop {
  position: absolute;
  inset: 0;
  background: color-mix(in srgb, var(--surface-page) 72%, rgba(0, 0, 0, 0.72));
  backdrop-filter: blur(18px) saturate(0.7);
}

.session-guard__dialog {
  position: relative;
  width: min(440px, 100%);
  padding: 30px;
  border: 1px solid color-mix(in srgb, var(--accent) 38%, var(--border-subtle));
  border-radius: 18px;
  background: color-mix(in srgb, var(--surface-card) 95%, transparent);
  box-shadow: 0 32px 100px rgba(0, 0, 0, 0.46), 0 0 0 1px color-mix(in srgb, var(--accent) 12%, transparent);
  text-align: center;
}

.session-guard__icon {
  width: 64px;
  height: 64px;
  display: inline-grid;
  place-items: center;
  margin-bottom: 16px;
  border-radius: 20px;
  background: var(--control-primary-bg);
  color: var(--control-primary-text);
  box-shadow: 0 16px 36px color-mix(in srgb, var(--accent) 28%, transparent);
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -1px;
}

.session-guard__dialog h2 {
  margin: 5px 0 10px;
  font-size: clamp(25px, 5vw, 34px);
}

.session-guard__dialog > p:not(.eyebrow) {
  margin: 0 0 18px;
  color: var(--text-secondary);
  line-height: 1.55;
}

.session-guard__user {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
  padding: 12px 14px;
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  background: var(--surface-card-soft);
  text-align: left;
}

.session-guard__user span,
.session-guard__dialog label span {
  color: var(--text-secondary);
  font-size: 12px;
}

.session-guard__dialog label {
  display: grid;
  gap: 7px;
  text-align: left;
}

.session-guard__dialog input {
  width: 100%;
  min-height: 50px;
  padding: 0 14px;
  border: 1px solid var(--border-subtle);
  border-radius: 9px;
  background: var(--surface-control);
  color: var(--text-primary);
  outline: none;
}

.session-guard__dialog input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-ring);
}

.session-guard__dialog button {
  width: 100%;
  min-height: 48px;
  margin-top: 12px;
}

.session-guard__logout {
  border: 1px solid var(--border-subtle);
  background: var(--surface-control) !important;
  color: var(--text-secondary) !important;
}

.session-guard__error {
  margin: 9px 0 0;
  color: var(--status-danger);
  font-size: 13px;
  text-align: left;
}

.session-warning {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 2147483000;
  display: grid;
  gap: 3px;
  width: min(360px, calc(100vw - 32px));
  padding: 14px 16px;
  border: 1px solid var(--status-warning-border);
  border-radius: 12px;
  background: var(--status-warning-bg);
  color: var(--text-primary);
  box-shadow: var(--shadow-lg);
}

.session-warning span {
  color: var(--text-secondary);
  font-size: 12px;
}

body.session-is-locked {
  overflow: hidden !important;
}

@media (max-width: 560px) {
  .session-guard {
    align-items: end;
    padding: 10px;
  }

  .session-guard__dialog {
    padding: 24px 18px 18px;
    border-radius: 18px 18px 12px 12px;
  }

  .session-warning {
    right: 16px;
    bottom: 16px;
  }
}

body {
  margin: 0;
  background: var(--surface-page);
  color: var(--text-primary);
  font-family: var(--font-main);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: inherit;
}

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

button {
  min-height: 40px;
  border: 0;
  border-radius: 6px;
  background: var(--control-primary-bg);
  color: var(--control-primary-text);
  cursor: pointer;
  padding: 0 16px;
}

button:hover {
  background: var(--control-primary-bg-hover);
}

.topbar {
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 28px;
  background: var(--surface-card);
  border-bottom: 1px solid var(--border-subtle);
}

.brand {
  font-size: 20px;
  font-weight: 700;
  text-decoration: none;
}

.topbar__user {
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--text-secondary);
}

.page {
  width: min(1120px, calc(100% - 32px));
  margin: 32px auto;
}

.flash-list {
  display: grid;
  gap: 10px;
  margin-bottom: 20px;
}

.flash {
  padding: 12px 14px;
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  background: var(--surface-card);
  color: var(--text-primary);
}

.flash--error {
  border-color: var(--status-danger-border);
  background: var(--status-danger-bg);
  color: var(--status-danger);
}

.toast-stack {
  position: fixed;
  bottom: 18px;
  left: 50%;
  z-index: 2147483647;
  width: min(380px, calc(100vw - 32px));
  display: grid;
  gap: 10px;
  pointer-events: none;
  transform: translateX(-50%);
}

.toast-stack[popover] {
  top: auto;
  right: auto;
  margin: 0;
  padding: 0;
  border: 0;
  overflow: visible;
  background: transparent;
  color: inherit;
}

.toast-message {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) 30px;
  align-items: start;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--border-subtle);
  border-left-width: 3px;
  border-radius: 8px;
  background:
    linear-gradient(160deg, color-mix(in srgb, var(--surface-card) 82%, transparent), transparent),
    var(--surface-card);
  color: var(--text-primary);
  box-shadow: var(--shadow-lg);
  opacity: 0;
  pointer-events: auto;
  transform: translateY(10px) scale(0.98);
  transition: opacity 0.22s ease, transform 0.22s ease;
}

.toast-message.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.toast-message.is-leaving {
  opacity: 0;
  transform: translateY(8px) scale(0.98);
}

.toast-message--success {
  border-left-color: var(--accent);
}

.toast-message--error {
  border-left-color: var(--status-danger);
}

.toast-message--warning {
  border-left-color: var(--gold);
}

.toast-message--info {
  border-left-color: var(--accent);
}

.toast-message__icon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--surface-control);
  font-weight: 800;
}

.toast-message--success .toast-message__icon {
  color: var(--accent);
}

.toast-message--error .toast-message__icon {
  color: var(--status-danger);
}

.toast-message--warning .toast-message__icon {
  color: var(--gold);
}

.toast-message--info .toast-message__icon {
  color: var(--accent);
}

.toast-message__body {
  min-width: 0;
}

.toast-message__body strong,
.toast-message__body span {
  display: block;
}

.toast-message__body strong {
  font-size: 14px;
  line-height: 1.25;
}

.toast-message__body span {
  margin-top: 4px;
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.4;
}

.toast-message__close {
  width: 30px;
  min-height: 30px;
  display: grid;
  place-items: center;
  padding: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text-secondary);
}

.toast-message__close:hover {
  background: var(--surface-control-hover);
  color: var(--text-primary);
}

.auth-page {
  min-height: 100vh;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 18% 22%, rgba(24, 168, 145, 0.25), transparent 30%),
    radial-gradient(circle at 82% 18%, rgba(211, 163, 72, 0.22), transparent 28%),
    linear-gradient(135deg, #07121b 0%, #102839 48%, #0b181d 100%);
}

.dashboard-page {
  min-height: 100vh;
  overflow-x: hidden;
  color: var(--text-primary);
  background:
    radial-gradient(circle at 18% 16%, color-mix(in srgb, var(--accent) 22%, transparent), transparent 30%),
    radial-gradient(circle at 82% 24%, color-mix(in srgb, var(--gold) 16%, transparent), transparent 26%),
    linear-gradient(135deg, var(--surface-page) 0%, var(--surface-page-tint) 52%, var(--surface-page) 100%);
}

.dashboard-page input,
.dashboard-page select,
.dashboard-page textarea {
  color: var(--text-primary);
}

.dashboard-page :where(h1, h2, h3, label) {
  color: var(--text-primary);
}

.app-layout {
  width: 100%;
  min-height: 100vh;
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
}

.app-main {
  min-width: 0;
  min-height: 100vh;
  display: grid;
  align-items: center;
  justify-items: center;
  padding: 28px;
}

.app-sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 22px 16px;
  border-right: 1px solid var(--sidebar-line);
  background:
    linear-gradient(180deg, var(--sidebar-veil), transparent),
    var(--sidebar-bg);
  box-shadow: 18px 0 48px color-mix(in srgb, var(--bg) 34%, transparent);
  color: var(--sidebar-text);
  transition: width 0.28s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.28s ease, background 0.2s ease;
}

.sidebar-brand {
  min-height: 62px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
}

.sidebar-logo {
  flex: 0 0 auto;
  width: 46px;
  height: 46px;
  overflow: visible;
  filter: drop-shadow(0 8px 15px color-mix(in srgb, var(--accent) 20%, transparent));
  transition: transform 0.24s ease, filter 0.24s ease;
}

.sidebar-brand:hover .sidebar-logo {
  filter: drop-shadow(0 10px 18px color-mix(in srgb, var(--accent) 32%, transparent));
  transform: translateY(-1px);
}

.sidebar-logo__gradient-start {
  stop-color: var(--accent);
}

.sidebar-logo__gradient-end {
  stop-color: var(--gold);
}

.sidebar-logo__frame {
  fill: color-mix(in srgb, var(--sidebar-user-bg) 86%, transparent);
  stroke: url(#sidebarLogoGradient);
  stroke-width: 1.6;
}

.sidebar-logo__v,
.sidebar-logo__t,
.sidebar-logo__route {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sidebar-logo__v {
  stroke: var(--sidebar-text);
  stroke-width: 5.5;
}

.sidebar-logo__t {
  stroke: var(--accent);
  stroke-width: 5.5;
}

.sidebar-logo__route {
  stroke: color-mix(in srgb, var(--gold) 82%, var(--sidebar-text));
  stroke-width: 1.8;
  stroke-dasharray: 3 4;
}

.sidebar-logo__point {
  fill: var(--gold);
  stroke: var(--sidebar-bg);
  stroke-width: 1.4;
}

.sidebar-brand span,
.sidebar-brand strong {
  display: block;
}

.sidebar-brand span {
  font-size: 18px;
  font-weight: 800;
}

.sidebar-brand strong {
  margin-top: 2px;
  color: var(--sidebar-muted);
  font-size: 12px;
}

.sidebar-nav {
  min-width: 0;
  min-height: 0;
  flex: 1 1 auto;
  display: grid;
  align-content: start;
  gap: 6px;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-left: 4px;
  direction: rtl;
  scrollbar-color: color-mix(in srgb, var(--accent) 48%, transparent) transparent;
  scrollbar-width: thin;
}

.sidebar-nav > * {
  direction: ltr;
}

.sidebar-nav::-webkit-scrollbar {
  width: 6px;
}

.sidebar-nav::-webkit-scrollbar-track {
  background: transparent;
}

.sidebar-nav::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 48%, transparent);
}

.sidebar-nav::-webkit-scrollbar-thumb:hover {
  background: color-mix(in srgb, var(--accent) 72%, transparent);
}

.sidebar-link,
.sidebar-logout button {
  position: relative;
  box-sizing: border-box;
  width: 100%;
  min-height: 46px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: color-mix(in srgb, var(--sidebar-text) 76%, transparent);
  font-size: 14px;
  font-weight: 700;
  text-align: left;
  text-decoration: none;
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease, padding 0.22s ease;
}

.sidebar-link svg,
.sidebar-logout svg {
  width: 21px;
  height: 21px;
  flex: 0 0 auto;
  fill: currentColor;
  opacity: 0.92;
}

.sidebar-link:hover,
.sidebar-logout button:hover {
  border-color: color-mix(in srgb, var(--accent) 28%, transparent);
  background: var(--sidebar-hover);
  color: var(--sidebar-text);
}

.sidebar-link.is-active {
  border-color: color-mix(in srgb, var(--accent) 46%, transparent);
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--accent) 24%, transparent), transparent),
    var(--sidebar-active);
  color: var(--sidebar-text);
}

.sidebar-link.is-active::before {
  content: "";
  width: 3px;
  height: 24px;
  border-radius: 99px;
  background: var(--accent);
}

.sidebar-link.is-active svg {
  color: var(--accent);
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: auto;
  padding: 12px;
  border: 1px solid color-mix(in srgb, var(--sidebar-line) 88%, transparent);
  border-radius: 8px;
  background: var(--sidebar-user-bg);
}

.sidebar-user__avatar {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 8px;
  background:
    linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent-dark) 52%, transparent)),
    var(--panel-soft);
  color: var(--accent-contrast);
  font-weight: 800;
}

.sidebar-user__meta {
  min-width: 0;
}

.sidebar-user__meta span,
.sidebar-user__meta strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-user__meta span {
  color: var(--sidebar-text);
  font-size: 14px;
  font-weight: 800;
}

.sidebar-user__meta strong {
  margin-top: 3px;
  color: var(--sidebar-muted);
  font-size: 12px;
  font-weight: 700;
}

.sidebar-logout {
  margin: 0;
}

.sidebar-logout button {
  justify-content: flex-start;
  cursor: pointer;
}

.sidebar-more-toggle {
  display: none;
}

.sidebar-more-panel {
  display: grid;
  gap: 6px;
}

.sidebar-logout--mobile {
  display: none;
}

@media (min-width: 1025px) {
  .sidebar-collapsed .app-layout {
    grid-template-columns: 92px minmax(0, 1fr);
  }

  .sidebar-collapsed .app-sidebar {
    z-index: 20;
    width: 92px;
    overflow: hidden;
    padding-inline: 14px;
  }

  .sidebar-collapsed .app-sidebar:hover,
  .sidebar-collapsed .app-sidebar:focus-within {
    width: 280px;
    box-shadow: 24px 0 58px color-mix(in srgb, var(--bg) 42%, transparent);
  }

  .sidebar-collapsed .sidebar-brand div,
  .sidebar-collapsed .sidebar-link span,
  .sidebar-collapsed .sidebar-user__meta,
  .sidebar-collapsed .sidebar-logout span {
    max-width: 0;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateX(-8px);
    transition: max-width 0.28s ease, opacity 0.18s ease, transform 0.22s ease, visibility 0.18s ease;
    white-space: nowrap;
  }

  .sidebar-collapsed .app-sidebar:hover .sidebar-brand div,
  .sidebar-collapsed .app-sidebar:focus-within .sidebar-brand div,
  .sidebar-collapsed .app-sidebar:hover .sidebar-link span,
  .sidebar-collapsed .app-sidebar:focus-within .sidebar-link span,
  .sidebar-collapsed .app-sidebar:hover .sidebar-user__meta,
  .sidebar-collapsed .app-sidebar:focus-within .sidebar-user__meta,
  .sidebar-collapsed .app-sidebar:hover .sidebar-logout span,
  .sidebar-collapsed .app-sidebar:focus-within .sidebar-logout span {
    max-width: 190px;
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
  }

  .sidebar-collapsed .app-sidebar:not(:hover):not(:focus-within) .sidebar-brand {
    min-height: 72px;
    gap: 0;
  }

  .sidebar-collapsed .app-sidebar:not(:hover):not(:focus-within) .sidebar-logo {
    width: 48px;
    height: 48px;
  }

  .sidebar-collapsed .app-sidebar:not(:hover):not(:focus-within) .sidebar-nav {
    gap: 12px;
    padding-left: 0;
    scrollbar-width: none;
  }

  .sidebar-collapsed .app-sidebar:not(:hover):not(:focus-within) .sidebar-nav::-webkit-scrollbar {
    width: 0;
    display: none;
  }

  .sidebar-collapsed .app-sidebar:not(:hover):not(:focus-within) .sidebar-brand,
  .sidebar-collapsed .app-sidebar:not(:hover):not(:focus-within) .sidebar-user {
    justify-content: center;
    padding-inline: 0;
  }

  .sidebar-collapsed .app-sidebar:not(:hover):not(:focus-within) .sidebar-link,
  .sidebar-collapsed .app-sidebar:not(:hover):not(:focus-within) .sidebar-logout button {
    min-height: 52px;
    gap: 0;
    justify-content: center;
    padding-inline: 0;
  }

  .sidebar-collapsed .app-sidebar:not(:hover):not(:focus-within) .sidebar-user {
    gap: 0;
  }

  .sidebar-collapsed .app-sidebar:not(:hover):not(:focus-within) .sidebar-link svg,
  .sidebar-collapsed .app-sidebar:not(:hover):not(:focus-within) .sidebar-logout svg {
    width: 26px;
    height: 26px;
  }

  .sidebar-collapsed .app-sidebar:not(:hover):not(:focus-within) .sidebar-user__avatar {
    width: 46px;
    height: 46px;
    font-size: 17px;
  }

  .sidebar-collapsed .app-sidebar:not(:hover):not(:focus-within) .sidebar-link.is-active::before {
    position: absolute;
    left: 6px;
    width: 4px;
    height: 28px;
  }
}

.auth-shell {
  width: min(1180px, calc(100% - 32px));
  min-height: 100vh;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(360px, 440px);
  align-items: center;
  gap: 42px;
  padding: 42px 0;
}

.auth-hero {
  position: relative;
  min-height: 620px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 38px;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  background:
    linear-gradient(160deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.03)),
    rgba(255, 255, 255, 0.06);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.auth-hero::before {
  content: "";
  position: absolute;
  inset: 18px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  pointer-events: none;
}

.auth-brand,
.auth-copy,
.auth-safe-info {
  position: relative;
  z-index: 2;
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 16px;
}

.auth-brand img {
  width: 74px;
  height: 74px;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
}

.auth-brand span,
.auth-brand strong {
  display: block;
}

.auth-brand span {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: 0;
}

.auth-brand strong {
  margin-top: 4px;
  color: rgba(255, 255, 255, 0.68);
  font-size: 14px;
  font-weight: 600;
}

.auth-copy {
  width: min(610px, 100%);
  padding: 18px 20px 20px;
  border-left: 3px solid var(--gold);
  border-radius: 0 8px 8px 0;
  background:
    linear-gradient(90deg, rgba(7, 18, 27, 0.72), rgba(7, 18, 27, 0.42) 72%, transparent);
  box-shadow: -18px 0 46px rgba(0, 0, 0, 0.12);
}

.auth-copy h1 {
  margin: 0 0 18px;
  font-size: clamp(40px, 6vw, 76px);
  line-height: 0.95;
  letter-spacing: 0;
  text-shadow: 0 3px 22px rgba(0, 0, 0, 0.42);
}

.auth-copy h1 span {
  display: inline-block;
  color: var(--gold);
  text-shadow: 0 10px 34px rgba(215, 168, 78, 0.24);
}

.auth-copy p:not(.eyebrow) {
  width: min(520px, 100%);
  margin: 0;
  color: rgba(255, 255, 255, 0.9);
  font-size: 18px;
  line-height: 1.6;
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.32);
}

.route-map {
  position: absolute;
  inset: 0;
  z-index: 1;
}

.route-map::before {
  content: "";
  position: absolute;
  right: -80px;
  bottom: -110px;
  width: 430px;
  height: 430px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 50%;
  background:
    linear-gradient(rgba(255, 255, 255, 0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.07) 1px, transparent 1px);
  background-size: 42px 42px;
  opacity: 0.28;
}

.route-map__point {
  position: absolute;
  width: 72px;
  height: 72px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: 50%;
  background: rgba(8, 19, 28, 0.62);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  text-align: center;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.28);
  opacity: 0.78;
}

.route-map__point--spb {
  left: 40%;
  top: 9%;
}

.route-map__point--msk {
  left: 58%;
  top: 15%;
}

.route-map__point--tbs {
  right: 5%;
  top: 39%;
}

.route-map__point--batumi {
  right: 5%;
  bottom: 25%;
  background: var(--gold);
  color: #1d1a13;
}

.route-map__line {
  position: absolute;
  height: 2px;
  transform-origin: left center;
  background: linear-gradient(90deg, transparent, rgba(24, 168, 145, 0.86), rgba(215, 168, 78, 0.84));
  opacity: 0.28;
}

.route-map__line--one {
  left: 49%;
  top: 17%;
  width: 165px;
  transform: rotate(17deg);
}

.route-map__line--two {
  left: 66%;
  top: 24%;
  width: 210px;
  transform: rotate(31deg);
}

.route-map__line--three {
  right: 13%;
  top: 50%;
  width: 150px;
  transform: rotate(91deg);
}

.auth-safe-info {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.auth-safe-info div {
  min-height: 94px;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 8px;
  background: rgba(7, 18, 27, 0.34);
}

.auth-safe-info span,
.auth-safe-info strong {
  display: block;
}

.auth-safe-info span {
  color: rgba(255, 255, 255, 0.7);
  font-size: 12px;
}

.auth-safe-info strong {
  margin-top: 10px;
  color: #fff;
  font-size: 15px;
  line-height: 1.35;
}

.login-card {
  padding: 30px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  background:
    linear-gradient(160deg, rgba(255, 255, 255, 0.13), rgba(255, 255, 255, 0.04)),
    rgba(7, 18, 27, 0.72);
  box-shadow: var(--shadow-lg), inset 0 1px 0 rgba(255, 255, 255, 0.12);
  color: #fff;
}

.login-card__header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 28px;
}

.login-card__mark {
  width: 48px;
  height: 48px;
  flex: 0 0 auto;
  border-radius: 8px;
  background:
    linear-gradient(135deg, var(--accent), transparent 58%),
    linear-gradient(315deg, var(--gold), #f8e6b8);
  box-shadow: 0 14px 32px rgba(24, 168, 145, 0.22);
}

.login-card h2 {
  margin: 2px 0 0;
  font-size: 30px;
  line-height: 1.15;
  letter-spacing: 0;
}

.login-form {
  gap: 18px;
}

.login-form label {
  gap: 9px;
  color: rgba(244, 251, 255, 0.96);
  font-weight: 700;
}

.login-form label span {
  font-size: 14px;
}

.login-form input {
  min-height: 52px;
  border-color: rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.login-form input::placeholder {
  color: rgba(244, 251, 255, 0.7);
}

.login-form input:focus {
  outline: none;
  border-color: var(--accent);
  background: rgba(255, 255, 255, 0.15);
  box-shadow: 0 0 0 4px rgba(24, 168, 145, 0.18);
}

.login-button {
  min-height: 54px;
  margin-top: 4px;
  font-weight: 800;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
}

.login-note {
  margin: 18px 0 0;
  color: rgba(218, 231, 237, 0.82);
  font-size: 13px;
  line-height: 1.5;
}

.auth-panel {
  width: min(420px, 100%);
  margin: 72px auto 0;
  padding: 28px;
  background: var(--surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  color: var(--text-primary);
}

.auth-panel h1,
.dashboard h1 {
  margin: 0 0 20px;
}

.form {
  display: grid;
  gap: 16px;
}

.form label {
  display: grid;
  gap: 7px;
  color: var(--text-secondary);
  font-size: 14px;
}

.form input {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  padding: 0 12px;
  color: var(--text-primary);
  background: var(--surface-control);
}

.login-form input {
  min-height: 52px;
  border-color: rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
}

.dashboard {
  min-height: 280px;
  display: flex;
  align-items: center;
  padding: 32px;
  background: var(--surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  color: var(--text-primary);
}

.dashboard-shell {
  width: min(1180px, calc(100% - 32px));
  min-height: 100vh;
  margin: 0 auto;
  display: grid;
  place-items: center;
  padding: 28px 0;
}

.dashboard-board {
  position: relative;
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: 22px;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background:
    linear-gradient(160deg, color-mix(in srgb, var(--surface-card) 82%, transparent), transparent),
    var(--surface-card);
  box-shadow: var(--shadow-lg), inset 0 1px 0 color-mix(in srgb, var(--text-inverse) 8%, transparent);
  color: var(--text-primary);
  overflow: hidden;
}

.dashboard-board::before {
  content: "";
  position: absolute;
  right: -120px;
  top: -120px;
  width: 360px;
  height: 360px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  background:
    linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
  background-size: 38px 38px;
  opacity: 0.45;
}

.dashboard-board__header,
.stats-grid {
  position: relative;
  z-index: 1;
}

.dashboard-board__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-subtle);
}

.dashboard-board__header h1 {
  margin: 0;
  font-size: clamp(32px, 4vw, 50px);
  line-height: 1;
  letter-spacing: 0;
}

.dashboard-board__branch {
  min-width: 190px;
  padding: 14px 16px;
  border: 1px solid var(--border-subtle);
  border-left: 3px solid var(--gold);
  border-radius: 8px;
  background: var(--surface-card-soft);
}

.dashboard-board__branch span,
.dashboard-board__branch strong {
  display: block;
}

.dashboard-board__branch span {
  color: var(--text-secondary);
  font-size: 12px;
}

.dashboard-board__branch strong {
  margin-top: 6px;
  font-size: 16px;
}

.dashboard-home-page .app-main {
  align-items: start;
}

.dashboard-network {
  position: relative;
  z-index: 1;
  min-height: 290px;
  margin: 0 -22px 18px;
  overflow: hidden;
  border-bottom: 1px solid var(--border-subtle);
  background-image:
    linear-gradient(color-mix(in srgb, var(--border-subtle) 46%, transparent) 1px, transparent 1px),
    linear-gradient(90deg, color-mix(in srgb, var(--border-subtle) 46%, transparent) 1px, transparent 1px),
    linear-gradient(180deg, color-mix(in srgb, var(--accent) 6%, transparent), transparent 72%);
  background-size: 36px 36px, 36px 36px, auto;
  isolation: isolate;
}

.dashboard-network::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(90deg, var(--surface-card) 0%, transparent 14%, transparent 86%, var(--surface-card) 100%);
  opacity: 0.72;
  pointer-events: none;
}

.dashboard-network__title {
  position: absolute;
  top: 14px;
  left: 22px;
  z-index: 4;
}

.dashboard-network__title .eyebrow {
  margin-bottom: 4px;
}

.dashboard-network__title h2 {
  margin: 0;
  font-size: 21px;
  line-height: 1.15;
  letter-spacing: 0;
}

.dashboard-network__title h2 span {
  color: var(--accent);
}

.dashboard-network__status {
  position: absolute;
  top: 18px;
  right: 22px;
  z-index: 4;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 800;
}

.dashboard-network__status > span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--status-success);
  box-shadow: 0 0 0 5px color-mix(in srgb, var(--status-success) 14%, transparent);
  animation: dashboard-network-status 2.4s ease-in-out infinite;
}

.dashboard-route-scene {
  position: absolute;
  inset: 0;
}

.dashboard-route-map {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.dashboard-route-map--mobile {
  display: none;
}

.dashboard-route-road,
.dashboard-route-motion-path {
  fill: none;
}

.dashboard-route-road--base {
  stroke: color-mix(in srgb, var(--text-primary) 14%, var(--surface-card));
  stroke-width: 17;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.dashboard-route-road--flow {
  stroke: color-mix(in srgb, var(--accent) 66%, var(--gold));
  stroke-width: 5;
  stroke-linecap: round;
  stroke-dasharray: 2 15;
  animation: dashboard-road-flow 12s linear infinite;
}

.dashboard-route-motion-path {
  stroke: transparent;
}

.dashboard-lars-landscape {
  pointer-events: none;
}

.dashboard-lars-mountain--back {
  fill: color-mix(in srgb, var(--text-primary) 7%, var(--surface-card));
}

.dashboard-lars-mountain--front {
  fill: color-mix(in srgb, var(--accent) 9%, var(--surface-card));
}

.dashboard-lars-snow {
  fill: color-mix(in srgb, var(--accent-soft) 58%, var(--surface-card));
  opacity: 0.72;
}

.dashboard-lars-snow--east {
  opacity: 0.48;
}

.dashboard-lars-mist {
  fill: none;
  stroke: color-mix(in srgb, var(--text-secondary) 25%, transparent);
  stroke-width: 5;
  stroke-linecap: round;
  opacity: 0.5;
  transform-box: fill-box;
  transform-origin: center;
  animation: dashboard-lars-mist 14s ease-in-out infinite alternate;
}

.dashboard-lars-mist--two {
  stroke-width: 3;
  opacity: 0.34;
  animation-duration: 18s;
  animation-direction: alternate-reverse;
}

.dashboard-lars-gate {
  filter: drop-shadow(0 6px 7px color-mix(in srgb, var(--bg) 42%, transparent));
}

.dashboard-lars-gate__arch {
  fill: none;
  stroke: color-mix(in srgb, var(--gold) 74%, var(--accent));
  stroke-width: 3;
  stroke-linecap: round;
}

.dashboard-lars-gate__booth {
  fill: color-mix(in srgb, var(--surface-card) 86%, var(--gold));
  stroke: color-mix(in srgb, var(--gold) 58%, var(--border-subtle));
  stroke-width: 1.5;
}

.dashboard-lars-gate__window {
  fill: var(--accent);
  opacity: 0.48;
  animation: dashboard-lars-window 80s linear -13s infinite;
}

.dashboard-lars-gate__signal--stop {
  fill: var(--status-danger);
  animation: dashboard-lars-signal-stop 80s linear -13s infinite;
}

.dashboard-lars-gate__signal--go {
  fill: var(--status-success);
  opacity: 0.18;
  animation: dashboard-lars-status-open 80s linear -13s infinite;
}

.dashboard-lars-barrier__pivot {
  fill: var(--gold);
  stroke: var(--surface-card);
  stroke-width: 1.5;
}

.dashboard-lars-barrier__arm {
  fill: none;
  stroke: var(--gold);
  stroke-width: 5;
  stroke-linecap: square;
  stroke-dasharray: 8 4;
}

.dashboard-lars-scan {
  fill: color-mix(in srgb, var(--accent) 70%, var(--accent-contrast));
  filter: drop-shadow(0 0 5px var(--accent));
  opacity: 0;
  transform-box: fill-box;
  transform-origin: center;
  animation: dashboard-lars-scan 80s linear -13s infinite;
}

.dashboard-route-checkpoint {
  position: absolute;
  top: 49%;
  left: 51%;
  z-index: 2;
  display: grid;
  justify-items: center;
  gap: 7px;
  transform: translate(-50%, 0);
  pointer-events: none;
}

.dashboard-route-checkpoint__pin {
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  border: 2px solid color-mix(in srgb, var(--gold) 74%, var(--accent));
  border-radius: 5px;
  background: var(--surface-card);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--gold) 13%, transparent), var(--shadow-sm);
}

.dashboard-route-checkpoint__pin > span {
  width: 8px;
  height: 9px;
  border-right: 2px solid var(--gold);
  border-left: 2px solid var(--gold);
}

.dashboard-route-checkpoint__copy {
  min-width: 142px;
  display: grid;
  gap: 3px;
  padding: 7px 10px;
  border: 1px solid color-mix(in srgb, var(--gold) 48%, var(--border-subtle));
  border-radius: 7px;
  background: color-mix(in srgb, var(--surface-card) 92%, transparent);
  box-shadow: var(--shadow-sm);
  text-align: center;
  backdrop-filter: blur(10px);
}

.dashboard-route-checkpoint__copy strong {
  color: var(--text-primary);
  font-size: 12px;
  line-height: 1.2;
}

.dashboard-route-checkpoint__copy small {
  display: grid;
  color: var(--text-secondary);
  font-size: 9px;
  font-weight: 800;
  line-height: 1.2;
}

.dashboard-route-checkpoint__copy small > span {
  grid-area: 1 / 1;
}

.dashboard-route-checkpoint__idle {
  animation: dashboard-lars-status-idle 80s linear -13s infinite;
}

.dashboard-route-checkpoint__checking {
  opacity: 0;
  animation: dashboard-lars-status-check 80s linear -13s infinite;
}

.dashboard-route-checkpoint__open {
  color: var(--status-success);
  opacity: 0;
  animation: dashboard-lars-status-open 80s linear -13s infinite;
}

.dashboard-route-vehicle__body {
  fill: var(--accent);
  stroke: color-mix(in srgb, var(--accent-contrast) 70%, var(--accent));
  stroke-width: 1.2;
  stroke-linejoin: round;
}

.dashboard-route-vehicle--bus .dashboard-route-vehicle__body {
  fill: var(--gold);
  stroke: color-mix(in srgb, var(--text-primary) 28%, var(--gold));
}

.dashboard-route-vehicle__window {
  fill: color-mix(in srgb, var(--surface-card) 78%, var(--accent-soft));
  stroke: none;
}

.dashboard-route-vehicle__wheel {
  fill: color-mix(in srgb, var(--text-primary) 84%, #101010);
  stroke: var(--surface-card);
  stroke-width: 1.3;
}

.dashboard-route-stop {
  position: absolute;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 10px;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.dashboard-route-stop--spb {
  left: 11.8%;
  top: 38.5%;
}

.dashboard-route-stop--moscow {
  left: 31.8%;
  top: 50%;
}

.dashboard-route-stop--tbilisi {
  left: 67.5%;
  top: 50%;
}

.dashboard-route-stop--batumi {
  left: 88%;
  top: 82.5%;
}

.dashboard-route-stop__pin {
  position: relative;
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  border: 3px solid var(--surface-card);
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 56%, transparent), var(--shadow-sm);
}

.dashboard-route-stop__pin > span {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent-contrast);
}

.dashboard-route-stop__copy {
  min-width: 128px;
  display: grid;
  gap: 2px;
  padding: 8px 10px;
  border: 1px solid color-mix(in srgb, var(--border-subtle) 76%, var(--accent));
  border-radius: 7px;
  background: color-mix(in srgb, var(--surface-card) 91%, transparent);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(10px);
}

.dashboard-route-stop__copy strong {
  color: var(--text-primary);
  font-size: 12px;
  line-height: 1.2;
  white-space: nowrap;
}

.dashboard-route-stop__copy small {
  color: var(--text-secondary);
  font-size: 10px;
  font-weight: 700;
}

.dashboard-route-stop__copy small b {
  color: var(--accent);
  font-size: 11px;
}

.dashboard-route-stop__copy em {
  display: none;
  color: var(--accent);
  font-size: 9px;
  font-style: normal;
  font-weight: 800;
  text-transform: uppercase;
}

.dashboard-route-stop.is-current .dashboard-route-stop__pin::before,
.dashboard-route-stop.is-current .dashboard-route-stop__pin::after {
  content: "";
  position: absolute;
  inset: -9px;
  border: 1px solid color-mix(in srgb, var(--accent) 72%, transparent);
  border-radius: 50%;
  animation: dashboard-current-branch 2.8s ease-out infinite;
}

.dashboard-route-stop.is-current .dashboard-route-stop__pin::after {
  animation-delay: 1.4s;
}

.dashboard-route-stop.is-current .dashboard-route-stop__copy {
  border-color: color-mix(in srgb, var(--accent) 68%, var(--border-subtle));
  background: color-mix(in srgb, var(--accent) 12%, var(--surface-card));
}

.dashboard-route-stop.is-current .dashboard-route-stop__copy em {
  display: block;
}

@keyframes dashboard-road-flow {
  to {
    stroke-dashoffset: -170;
  }
}

@keyframes dashboard-network-status {
  0%, 100% {
    transform: scale(0.88);
    opacity: 0.72;
  }

  50% {
    transform: scale(1);
    opacity: 1;
  }
}

@keyframes dashboard-current-branch {
  0% {
    transform: scale(0.55);
    opacity: 0;
  }

  24% {
    opacity: 0.8;
  }

  100% {
    transform: scale(1.65);
    opacity: 0;
  }
}

@keyframes dashboard-lars-mist {
  from {
    transform: translateX(-14px);
  }

  to {
    transform: translateX(18px);
  }
}

@keyframes dashboard-lars-window {
  0%, 17.49%, 23.75%, 38.74%, 45%, 61.24%, 67.5%, 82.49%, 88.75%, 100% {
    opacity: 0.48;
  }

  17.5%, 19.99%, 38.75%, 41.24%, 61.25%, 63.74%, 82.5%, 84.99% {
    opacity: 1;
  }

  20%, 23.74%, 41.25%, 44.99%, 63.75%, 67.49%, 85%, 88.74% {
    opacity: 0.72;
  }
}

@keyframes dashboard-lars-signal-stop {
  0%, 19.99%, 23.75%, 41.24%, 45%, 63.74%, 67.5%, 84.99%, 88.75%, 100% {
    opacity: 1;
  }

  20%, 23.74%, 41.25%, 44.99%, 63.75%, 67.49%, 85%, 88.74% {
    opacity: 0.18;
  }
}

@keyframes dashboard-lars-status-idle {
  0%, 17.49%, 23.75%, 38.74%, 45%, 61.24%, 67.5%, 82.49%, 88.75%, 100% {
    opacity: 1;
  }

  17.5%, 23.74%, 38.75%, 44.99%, 61.25%, 67.49%, 82.5%, 88.74% {
    opacity: 0;
  }
}

@keyframes dashboard-lars-status-check {
  0%, 17.49%, 20%, 38.74%, 41.25%, 61.24%, 63.75%, 82.49%, 85%, 100% {
    opacity: 0;
  }

  17.5%, 19.99%, 38.75%, 41.24%, 61.25%, 63.74%, 82.5%, 84.99% {
    opacity: 1;
  }
}

@keyframes dashboard-lars-status-open {
  0%, 19.99%, 23.75%, 41.24%, 45%, 63.74%, 67.5%, 84.99%, 88.75%, 100% {
    opacity: 0;
  }

  20%, 23.74%, 41.25%, 44.99%, 63.75%, 67.49%, 85%, 88.74% {
    opacity: 1;
  }
}

@keyframes dashboard-lars-scan {
  0%, 17.49%, 20%, 38.74%, 41.25%, 61.24%, 63.75%, 82.49%, 85%, 100% {
    opacity: 0;
    transform: translateX(0);
  }

  18.7%, 39.95%, 62.45%, 83.7% {
    opacity: 0.9;
    transform: translateX(29px);
  }

  19.99%, 41.24%, 63.74%, 84.99% {
    opacity: 0;
    transform: translateX(58px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .dashboard-route-vehicle {
    display: none;
  }

  .dashboard-route-road--flow,
  .dashboard-network__status > span,
  .dashboard-lars-mist,
  .dashboard-lars-gate__window,
  .dashboard-lars-gate__signal,
  .dashboard-route-checkpoint__idle,
  .dashboard-route-checkpoint__checking,
  .dashboard-route-checkpoint__open,
  .dashboard-route-stop.is-current .dashboard-route-stop__pin::before,
  .dashboard-route-stop.is-current .dashboard-route-stop__pin::after {
    animation: none;
  }

  .dashboard-lars-barrier,
  .dashboard-lars-scan,
  .dashboard-route-checkpoint__open {
    display: none;
  }
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.stat-card {
  min-height: 154px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background:
    linear-gradient(160deg, color-mix(in srgb, var(--surface-card) 82%, transparent), transparent),
    var(--surface-card-soft);
  box-shadow: var(--shadow-sm);
}

.stat-card--wide {
  grid-column: span 2;
}

.stat-card--accent {
  border-color: var(--border-accent);
}

.stat-card--danger {
  border-color: var(--status-danger-border);
}

.stat-card__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.stat-card__top span {
  max-width: 230px;
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.35;
}

.stat-card__top strong {
  color: var(--text-primary);
  font-size: clamp(30px, 4vw, 46px);
  line-height: 0.95;
  white-space: nowrap;
}

.stat-card p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.45;
}

.warehouse-page {
  width: min(1180px, 100%);
  align-self: start;
  display: grid;
  gap: 14px;
}

.warehouse-hero,
.warehouse-entry,
.warehouse-issue-search,
.warehouse-tax-export {
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background:
    linear-gradient(160deg, color-mix(in srgb, var(--surface-card) 82%, transparent), transparent),
    var(--surface-card);
  box-shadow: var(--shadow-sm);
  color: var(--text-primary);
}

.warehouse-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 22px;
}

.warehouse-hero h1,
.warehouse-recent h2 {
  margin: 0;
  letter-spacing: 0;
}

.warehouse-hero h1 {
  font-size: clamp(34px, 5vw, 54px);
  line-height: 1;
}

.warehouse-hero__hint {
  min-width: 190px;
  padding: 14px 16px;
  border: 1px solid var(--border-accent);
  border-radius: 8px;
  background: color-mix(in srgb, var(--accent) 10%, var(--surface-card-soft));
  text-align: right;
}

.warehouse-hero__hint span,
.warehouse-hero__hint strong {
  display: block;
}

.warehouse-hero__hint span {
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.warehouse-hero__hint strong {
  margin-top: 5px;
  color: var(--text-primary);
  font-size: 16px;
}

.warehouse-entry {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.38fr);
  align-items: start;
  gap: 14px;
  padding: 16px;
}

.warehouse-form {
  display: grid;
  gap: 12px;
}

.warehouse-form label {
  display: grid;
  gap: 8px;
}

.warehouse-form label > span {
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.warehouse-form input,
.warehouse-form textarea {
  width: 100%;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: var(--surface-control);
  color: var(--text-primary);
  font: inherit;
  font-weight: 850;
  outline: none;
  transition: border-color 0.16s ease, background 0.16s ease, box-shadow 0.16s ease;
}

.warehouse-form input {
  min-height: 58px;
  padding: 0 16px;
  font-size: 24px;
}

.warehouse-form textarea {
  min-height: 300px;
  padding: 14px 16px;
  line-height: 1.55;
  resize: vertical;
}

.warehouse-form input:focus,
.warehouse-form textarea:focus {
  border-color: var(--border-accent);
  background: var(--surface-control-hover);
  box-shadow: 0 0 0 3px var(--accent-ring);
}

.warehouse-form input::placeholder,
.warehouse-form textarea::placeholder {
  color: var(--text-muted);
}

.warehouse-form__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.warehouse-form__status {
  min-height: 44px;
  display: flex;
  align-items: center;
  flex: 1 1 auto;
  padding: 10px 12px;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: var(--surface-card-soft);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 800;
}

.warehouse-form__status[data-tone="success"] {
  border-color: var(--status-success-border);
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--status-success) 11%, transparent), transparent 76%),
    var(--surface-card-raised);
  color: var(--status-success);
}

.warehouse-form__status[data-tone="error"] {
  border-color: var(--status-danger-border);
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--status-danger) 11%, transparent), transparent 76%),
    var(--surface-card-raised);
  color: var(--status-danger);
}

.warehouse-form__footer button {
  min-height: 48px;
  padding-inline: 18px;
  border-radius: 8px;
  font-weight: 900;
}

.warehouse-recent {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  align-content: start;
  gap: 12px;
  height: 438px;
  min-height: 0;
  padding: 14px;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: var(--surface-card-soft);
  overflow: hidden;
}

.warehouse-recent__list {
  display: grid;
  align-content: start;
  gap: 8px;
  max-height: 100%;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 4px;
}

.warehouse-recent__item {
  display: grid;
  gap: 4px;
  padding: 10px;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: var(--surface-control);
}

.warehouse-recent__item.is-new {
  border-color: var(--border-accent);
}

.warehouse-recent__item strong {
  color: var(--text-primary);
  font-size: 14px;
}

.warehouse-recent__item span,
.warehouse-empty {
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 800;
}

.warehouse-empty {
  padding: 14px;
  border: 1px dashed var(--border-subtle);
  border-radius: 8px;
  text-align: center;
}

.warehouse-issue-search {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(320px, 0.9fr);
  align-items: end;
  gap: 14px;
  padding: 16px;
}

.warehouse-issue-search h2 {
  margin: 0;
  color: var(--text-primary);
  font-size: 24px;
  letter-spacing: 0;
}

.warehouse-issue-search small {
  display: block;
  margin-top: 6px;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 750;
  line-height: 1.4;
}

.warehouse-issue-search form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.warehouse-issue-search input {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: var(--surface-control);
  color: var(--text-primary);
  padding: 0 14px;
  font: inherit;
  font-weight: 850;
  outline: none;
}

.warehouse-issue-search input:focus {
  border-color: var(--border-accent);
  background: var(--surface-control-hover);
  box-shadow: 0 0 0 3px var(--accent-ring);
}

.warehouse-issue-search button {
  min-height: 48px;
  border-radius: 8px;
  padding-inline: 18px;
  font-weight: 900;
}

.warehouse-issue-search [data-warehouse-issue-status] {
  grid-column: 1 / -1;
  min-height: 38px;
  display: flex;
  align-items: center;
  padding: 8px 12px;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: var(--surface-card-soft);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 850;
}

.warehouse-issue-search [data-warehouse-issue-status]:empty {
  display: none;
}

.warehouse-issue-search [data-warehouse-issue-status][data-tone="success"] {
  border-color: var(--status-success-border);
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--status-success) 11%, transparent), transparent 76%),
    var(--surface-card-raised);
  color: var(--status-success);
}

.warehouse-issue-search [data-warehouse-issue-status][data-tone="error"] {
  border-color: var(--status-danger-border);
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--status-danger) 11%, transparent), transparent 76%),
    var(--surface-card-raised);
  color: var(--status-danger);
}

.warehouse-issue-dialog {
  width: min(880px, calc(100vw - 28px));
  max-height: min(760px, calc(100vh - 28px));
  padding: 0;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: var(--surface-card);
  color: var(--text-primary);
  box-shadow: var(--shadow-lg);
}

.warehouse-issue-dialog::backdrop {
  background: rgba(0, 0, 0, 0.58);
}

.warehouse-tracking-check {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(420px, .95fr);
  align-items: end;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: var(--surface-card);
  box-shadow: var(--shadow-sm);
}

.warehouse-tracking-check h2 { margin: 0; color: var(--text-primary); font-size: 24px; }
.warehouse-tracking-check small { display: block; margin-top: 6px; color: var(--text-secondary); }
.warehouse-tracking-check form { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 10px; }
.warehouse-tracking-check__controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
  align-items: stretch;
}
.warehouse-tracking-check__controls > [data-warehouse-tracking-check-form] {
  grid-template-columns: minmax(0, 1fr) auto auto;
}
.warehouse-tracking-check input {
  min-width: 0;
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: var(--surface-control);
  color: var(--text-primary);
  font: inherit;
  font-weight: 850;
  outline: none;
}
.warehouse-tracking-check form button { min-height: 48px; padding-inline: 16px; border-radius: 8px; font-weight: 900; }
.warehouse-tracking-check__result {
  grid-column: 1 / -1;
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: var(--surface-card-soft);
}
.warehouse-tracking-check__result[hidden] { display: none; }
.warehouse-tracking-check__result[data-tone="success"] { border-color: var(--status-success-border); }
.warehouse-tracking-check__result[data-tone="error"] { border-color: var(--status-danger-border); color: var(--status-danger); }
.warehouse-tracking-check__result p { margin: 0; }
.warehouse-tracking-check__headline { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.warehouse-tracking-check__headline strong { font-size: 20px; }
.warehouse-tracking-check__headline span {
  padding: 6px 9px;
  border-radius: 999px;
  background: var(--status-success-bg);
  color: var(--status-success);
  font-size: 12px;
  font-weight: 900;
}
.warehouse-tracking-check__result[data-tone="error"] .warehouse-tracking-check__headline span { background: var(--status-danger-bg); color: var(--status-danger); }
.warehouse-tracking-check__grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.warehouse-tracking-check__grid section {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: var(--surface-control);
}
.warehouse-tracking-check__grid span { color: var(--text-secondary); font-size: 11px; font-weight: 850; }
.warehouse-tracking-check__grid strong { overflow-wrap: anywhere; }

@media (max-width: 640px) {
  .warehouse-tracking-check { grid-template-columns: minmax(0, 1fr); padding: 14px; }
  .warehouse-tracking-check__controls { grid-template-columns: minmax(0, 1fr); }
  .warehouse-tracking-check__controls > [data-warehouse-tracking-check-form] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .warehouse-tracking-check form input { grid-column: 1 / -1; width: 100%; font-size: 16px; }
  .warehouse-tracking-check form button { width: 100%; min-width: 0; padding-inline: 8px; }
  .warehouse-tracking-check__headline { align-items: flex-start; flex-direction: column; }
  .warehouse-tracking-check__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.warehouse-issue-search form {
  grid-template-columns: minmax(0, 1fr) auto auto;
}

.warehouse-scan-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--border-accent);
  background: var(--control-primary-bg);
  color: var(--control-primary-text);
  box-shadow: 0 8px 18px color-mix(in srgb, var(--accent) 18%, transparent);
  cursor: pointer;
}

.warehouse-scan-button:hover,
.warehouse-scan-button:focus-visible {
  background: var(--control-primary-bg-hover);
  color: var(--control-primary-text);
  outline: none;
}

.warehouse-scan-button span {
  font-size: 20px;
  line-height: 1;
}

.warehouse-scanner-dialog {
  width: min(620px, calc(100vw - 24px));
  max-height: calc(100dvh - 24px);
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  background: var(--surface-card);
  color: var(--text-primary);
  box-shadow: var(--shadow-lg);
}

.warehouse-scanner-dialog::backdrop {
  background: rgba(0, 0, 0, 0.78);
  backdrop-filter: blur(5px);
}

.warehouse-scanner {
  display: grid;
  gap: 12px;
  padding: 16px;
}

.warehouse-scanner__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.warehouse-scanner__header h2 {
  margin: 0;
  font-size: clamp(21px, 5vw, 28px);
}

.warehouse-scanner__viewport {
  min-height: 280px;
  overflow: hidden;
  border: 1px solid var(--border-accent);
  border-radius: 10px;
  background: #03080b;
}

.warehouse-scanner__viewport video,
.warehouse-scanner__viewport img {
  width: 100% !important;
  object-fit: cover;
}

.warehouse-scanner__status {
  min-height: 42px;
  margin: 0;
  padding: 10px 12px;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: var(--surface-card-soft);
  color: var(--text-secondary);
  font-weight: 800;
}

.warehouse-scanner__status[data-tone="success"] {
  border-color: var(--status-success-border);
  color: var(--status-success);
}

.warehouse-scanner__status[data-tone="error"] {
  border-color: var(--status-danger-border);
  color: var(--status-danger);
}

.warehouse-scanner__actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.warehouse-scanner__actions button {
  min-height: 46px;
  display: grid;
  place-items: center;
  padding: 10px 16px;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: var(--control-secondary-bg);
  color: var(--control-secondary-text);
  font-weight: 900;
  text-align: center;
  cursor: pointer;
}


@media (max-width: 640px) {
  .warehouse-issue-search form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .warehouse-issue-search form input {
    grid-column: 1 / -1;
    font-size: 16px;
  }

  .warehouse-issue-search form button {
    width: 100%;
    min-width: 0;
    padding-inline: 10px;
  }

  .warehouse-scanner-dialog {
    width: 100%;
    max-width: none;
    max-height: 100dvh;
    margin: auto 0 0;
    border-radius: 16px 16px 0 0;
  }

  .warehouse-scanner {
    padding: 14px 12px calc(14px + env(safe-area-inset-bottom));
  }

  .warehouse-scanner__viewport {
    min-height: min(48dvh, 380px);
  }

  .warehouse-scanner__actions {
    grid-template-columns: 1fr;
  }
}

.warehouse-issue-modal {
  display: grid;
  gap: 14px;
  padding: 18px;
}

.warehouse-issue-modal__header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 14px;
}

.warehouse-issue-modal__header h2 {
  margin: 0;
  color: var(--text-primary);
  font-size: 28px;
  letter-spacing: 0;
}

.warehouse-issue-close {
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: var(--surface-control);
  color: var(--text-secondary);
  font-size: 20px;
  font-weight: 900;
  line-height: 1;
  box-shadow: none;
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.warehouse-issue-close:hover,
.warehouse-issue-close:focus-visible {
  border-color: var(--border-accent);
  background: var(--accent-soft);
  color: var(--accent-primary);
  transform: translateY(-1px);
  outline: none;
}

.warehouse-issue-warning {
  padding: 11px 12px;
  border: 1px solid var(--status-warning-border);
  border-radius: 8px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--status-warning) 13%, transparent), transparent 74%),
    var(--surface-card-raised);
  color: var(--status-warning);
  font-size: 13px;
  font-weight: 900;
}

.warehouse-issue-summary {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) repeat(2, minmax(110px, 0.34fr)) minmax(210px, 0.75fr);
  gap: 10px;
}

.warehouse-issue-summary section,
.warehouse-issue-item,
.warehouse-issue-tax {
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: var(--surface-card-soft);
}

.warehouse-issue-summary section {
  display: grid;
  gap: 5px;
  padding: 11px 12px;
}

.warehouse-issue-summary span,
.warehouse-issue-item span,
.warehouse-issue-item small,
.warehouse-issue-tax span {
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 900;
}

.warehouse-issue-summary strong {
  min-width: 0;
  color: var(--text-primary);
  font-size: 15px;
  overflow-wrap: anywhere;
}

.warehouse-issue-payment.is-paid {
  border-color: var(--status-success-border);
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--status-success) 12%, transparent), transparent 74%),
    var(--surface-card-raised);
}

.warehouse-issue-payment.is-paid span,
.warehouse-issue-payment.is-paid strong {
  color: var(--status-success);
}

.warehouse-issue-payment.is-unpaid {
  border-color: var(--status-danger-border);
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--status-danger) 12%, transparent), transparent 74%),
    var(--surface-card-raised);
}

.warehouse-issue-payment.is-unpaid span,
.warehouse-issue-payment.is-unpaid strong {
  color: var(--status-danger);
}

.warehouse-issue-items {
  display: grid;
  gap: 8px;
  max-height: 260px;
  overflow: auto;
  padding-right: 4px;
}

.warehouse-issue-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(180px, 0.36fr);
  gap: 10px;
  padding: 12px;
  border-left: 4px solid var(--accent);
}

.warehouse-issue-item.is-missing {
  border-left-color: var(--status-danger);
}

.warehouse-issue-item.is-issued {
  border-left-color: var(--status-success);
  background: color-mix(in srgb, var(--status-success-bg) 58%, var(--surface-card-soft));
}

.warehouse-issue-item div {
  min-width: 0;
  display: grid;
  gap: 5px;
}

.warehouse-issue-item div:last-child {
  text-align: right;
}

.warehouse-issue-item strong,
.warehouse-issue-item b {
  color: var(--text-primary);
  overflow-wrap: anywhere;
}

.warehouse-issue-item b {
  color: var(--accent-strong);
  font-size: 18px;
}

.warehouse-issue-tax {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 12px;
  padding: 12px;
}

.warehouse-issue-tax label {
  display: grid;
  gap: 7px;
}

.warehouse-issue-tax input[type="text"] {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: var(--surface-control);
  color: var(--text-primary);
  padding: 0 12px;
  font: inherit;
  font-weight: 850;
  outline: none;
}

.warehouse-issue-tax input[type="text"]:focus {
  border-color: var(--border-accent);
  box-shadow: 0 0 0 3px var(--accent-ring);
}

.warehouse-issue-tax__mode {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.warehouse-issue-tax__mode label {
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 0 12px;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: var(--surface-control);
  color: var(--text-primary);
  font-weight: 850;
}

.warehouse-issue-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.warehouse-issue-actions button {
  min-height: 46px;
  border-radius: 8px;
  padding-inline: 16px;
  font-weight: 900;
}

.warehouse-tax-export {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto auto;
  align-items: center;
  gap: 14px;
  padding: 16px;
}

.warehouse-tax-export h2 {
  margin: 0;
  color: var(--text-primary);
  font-size: 24px;
  letter-spacing: 0;
}

.warehouse-tax-export small {
  display: block;
  margin-top: 6px;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 750;
}

.warehouse-tax-export__stats {
  display: flex;
  gap: 8px;
}

.warehouse-tax-export__stats section {
  min-width: 92px;
  padding: 10px 12px;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: var(--surface-card-soft);
  text-align: right;
}

.warehouse-tax-export__stats span,
.warehouse-tax-export__stats strong {
  display: block;
}

.warehouse-tax-export__stats span {
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.warehouse-tax-export__stats strong {
  margin-top: 4px;
  color: var(--text-primary);
  font-size: 22px;
}

.warehouse-tax-export__actions {
  display: flex;
  gap: 10px;
}

.warehouse-tax-export__actions a {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  border: 1px solid var(--border-accent);
  border-radius: 8px;
  background: var(--control-primary-bg);
  color: var(--control-primary-text);
  font-weight: 900;
  text-decoration: none;
}

.warehouse-tax-export__actions a:hover {
  background: var(--control-primary-bg-hover);
}

.branch-list,
.mini-list {
  display: grid;
  gap: 10px;
}

.branch-list {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.mini-list {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.branch-list div,
.mini-list div {
  min-height: 50px;
  padding: 9px;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: var(--surface-control);
}

.branch-list span,
.branch-list strong,
.mini-list span,
.mini-list strong {
  display: block;
}

.branch-list span,
.mini-list span {
  color: var(--text-secondary);
  font-size: 12px;
}

.branch-list strong,
.mini-list strong {
  margin-top: 5px;
  color: var(--text-primary);
  font-size: 17px;
}

.parcel-workspace {
  width: min(1280px, 100%);
  margin: 0 auto;
  display: grid;
  gap: 16px;
  align-self: start;
}

.parcel-workspace__header,
.latest-parcels,
.parcel-form,
.russia-date-panel,
.russia-date-confirm,
.direction-banner {
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background:
    linear-gradient(160deg, color-mix(in srgb, var(--surface-card) 82%, transparent), transparent),
    var(--surface-card);
  box-shadow: var(--shadow-sm);
  color: var(--text-primary);
}

.parcel-workspace__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 20px;
}

.parcel-workspace__header h1,
.latest-parcels__header h2,
.parcel-form__header h2 {
  margin: 0;
  letter-spacing: 0;
}

.parcel-workspace__header h1 {
  color: var(--text-primary);
  font-size: clamp(30px, 4vw, 46px);
  line-height: 1;
}

.parcel-primary-action,
.parcel-form__footer button {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border-radius: 8px;
  background: var(--control-primary-bg);
  color: var(--control-primary-text);
  font-weight: 800;
}

.parcel-primary-action span {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: color-mix(in srgb, var(--control-primary-text) 16%, transparent);
  font-size: 18px;
  line-height: 1;
  transition: background 180ms ease, transform 220ms cubic-bezier(.2, .8, .2, 1);
}

.parcel-primary-action b {
  font: inherit;
}

.parcel-primary-action.is-open {
  background: var(--control-primary-bg);
  color: var(--control-primary-text);
  box-shadow: 0 8px 22px color-mix(in srgb, var(--accent) 24%, transparent);
}

.parcel-primary-action.is-open:hover {
  background: var(--control-primary-bg-hover);
}

.parcel-primary-action.is-open span {
  background: color-mix(in srgb, #fff 18%, transparent);
  transform: rotate(90deg);
}

.direction-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-left: 3px solid var(--gold);
}

.direction-banner[hidden],
.parcel-form[hidden] {
  display: none;
}

.direction-banner span {
  color: var(--text-secondary);
  font-size: 12px;
}

.direction-banner strong {
  color: var(--text-primary);
}

.parcel-form {
  max-height: 0;
  overflow: hidden;
  padding: 0 20px;
  opacity: 0;
  transform: translateY(-12px);
  transition: max-height 0.42s ease, opacity 0.24s ease, padding 0.24s ease, transform 0.24s ease;
}

.parcel-form.is-open {
  max-height: 1800px;
  padding: 20px;
  opacity: 1;
  transform: translateY(0);
}

.parcel-form.is-settled {
  overflow: visible;
}

.parcel-form input.is-invalid {
  border-color: var(--status-danger);
  box-shadow: 0 0 0 3px var(--status-danger-bg);
}

.parcel-transfer-card {
  position: fixed;
  z-index: 1200;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 72px;
  padding: 14px 16px;
  pointer-events: none;
  border: 1px solid var(--border-accent);
  border-radius: 12px;
  background:
    linear-gradient(145deg, color-mix(in srgb, var(--accent) 12%, transparent), transparent),
    var(--surface-card-raised);
  box-shadow: 0 20px 54px color-mix(in srgb, var(--accent-dark) 28%, transparent);
  color: var(--text-primary);
  will-change: transform, opacity;
}

.parcel-transfer-card__icon {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  flex: 0 0 40px;
  border-radius: 50%;
  background: var(--control-primary-bg);
  color: var(--control-primary-text);
  font-size: 20px;
  font-weight: 900;
}

.parcel-transfer-card small,
.parcel-transfer-card strong {
  display: block;
}

.parcel-transfer-card small {
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 700;
}

.parcel-transfer-card strong {
  margin-top: 2px;
  color: var(--accent);
  font-size: 20px;
}

.parcel-form__header,
.latest-parcels__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border-subtle);
}

.parcel-form__hint,
.latest-parcels__header > span {
  color: var(--text-secondary);
  font-size: 13px;
}

.parcel-form__grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

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

.parcel-form-section {
  padding: 14px;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: var(--surface-card-soft);
}

.parcel-form-section:nth-child(n + 3) {
  grid-column: 1 / -1;
}

.parcel-form-section:nth-child(-n + 2) .parcel-form__grid--two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.parcel-form-section:nth-child(-n + 2) .parcel-form__grid--two label:first-child {
  grid-column: 1 / -1;
}

.parcel-form-section__title {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 14px;
}

.parcel-form-section__title > span {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 8px;
  background: color-mix(in srgb, var(--gold) 14%, var(--surface-card));
  color: var(--gold);
  font-size: 13px;
  font-weight: 800;
}

.parcel-form-section__title h3,
.parcel-form-section__title p {
  margin: 0;
}

.parcel-form-section__title h3 {
  color: var(--text-primary);
  font-size: 18px;
  line-height: 1.15;
}

.parcel-form-section__title p {
  margin-top: 4px;
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.35;
}

.parcel-form__grid--two {
  grid-template-columns: 1.3fr 1fr 1fr;
}

.parcel-form__grid--parcel {
  grid-template-columns: 1fr 2fr 1fr 1fr;
}

.parcel-primary-action--link {
  color: var(--control-primary-text);
  text-decoration: none;
}

.parcel-form-section:nth-child(3) .parcel-form__grid--parcel {
  grid-template-columns: minmax(140px, 0.7fr) minmax(150px, 0.8fr) minmax(150px, 0.8fr) minmax(240px, 1.25fr);
  grid-template-areas:
    "category weight count photo"
    "description description description photo";
  align-items: stretch;
}

.parcel-form-section:nth-child(3) .parcel-form__grid--parcel.is-document {
  grid-template-areas: "category description description photo";
}

.parcel-form-section:nth-child(3) .parcel-form__grid--parcel > label:nth-child(1) {
  grid-area: category;
}

.parcel-form-section:nth-child(3) .parcel-form__grid--parcel > label:nth-child(2) {
  grid-area: description;
}

.parcel-form-section:nth-child(3) .parcel-form__grid--parcel > label:nth-child(3) {
  grid-area: weight;
}

.parcel-form-section:nth-child(3) .parcel-form__grid--parcel > label:nth-child(4) {
  grid-area: count;
}

.parcel-form-section:nth-child(3) .parcel-form__grid--parcel > label:nth-child(5) {
  grid-area: photo;
}

.parcel-form-section:nth-child(3) .parcel-form__span-2 {
  grid-column: auto;
}

.parcel-form-section:nth-child(3) textarea {
  min-height: 96px;
}

.parcel-form-section:nth-child(3) .parcel-photo-input {
  grid-template-rows: auto 1fr;
}

.parcel-form-section:nth-child(3) .parcel-photo-input strong {
  min-height: 96px;
  height: 100%;
}

[data-document-hidden] {
  transition: opacity 0.18s ease, transform 0.18s ease;
}

[data-document-hidden].is-hidden {
  display: none;
}

.parcel-form__grid--four {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.parcel-form label {
  display: grid;
  gap: 8px;
  min-width: 0;
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 800;
}

.parcel-form__span-2 {
  grid-column: span 2;
}

.parcel-form input,
.parcel-form select,
.parcel-form textarea {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: var(--surface-control);
  color: var(--text-primary);
  padding: 0 12px;
}

.parcel-form textarea {
  min-height: 100px;
  padding-block: 12px;
  resize: vertical;
}

.parcel-form input::placeholder,
.parcel-form textarea::placeholder {
  color: color-mix(in srgb, var(--text-secondary) 72%, transparent);
}

.parcel-form select option {
  color: var(--text-primary);
  background: var(--surface-card);
}

.parcel-photo-input input {
  display: none;
}

.parcel-photo-input strong {
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px dashed var(--border-strong);
  border-radius: 8px;
  background: var(--surface-control);
  color: var(--text-secondary);
  overflow: hidden;
  text-align: center;
  text-overflow: ellipsis;
  transition: border-color 0.18s ease, background 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
  white-space: nowrap;
}

.parcel-photo-input.is-selected strong {
  border-color: var(--border-accent);
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--accent) 28%, transparent), transparent),
    var(--surface-control);
  color: var(--text-primary);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 18%, transparent);
}

.parcel-photo-input.is-selected strong::before {
  content: "✓";
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--control-primary-bg);
  color: var(--accent-contrast);
  font-size: 13px;
  font-weight: 800;
}

.parcel-form__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 18px;
}

.parcel-form__footer p {
  margin: 0;
  color: var(--text-secondary);
}

.parcel-form__actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
}

.parcel-form__footer .parcel-form__cancel-edit {
  border: 1px solid color-mix(in srgb, var(--accent) 52%, var(--border-subtle));
  background: color-mix(in srgb, var(--accent) 12%, var(--surface-card));
  color: var(--text-primary);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 8%, transparent);
}

.parcel-form__footer .parcel-form__cancel-edit:hover {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 20%, var(--surface-card));
  color: var(--text-primary);
}

.parcel-form__footer .parcel-form__cancel-edit[hidden] {
  display: none;
}

.latest-parcels {
  padding: 20px;
}

.russia-date-panel,
.russia-date-confirm {
  padding: 20px;
}

.russia-date-panel[hidden] {
  display: none;
}

.russia-date-panel__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border-subtle);
}

.russia-date-panel__header h2,
.russia-date-confirm h2 {
  margin: 0;
  color: var(--text-primary);
  font-size: clamp(24px, 3vw, 34px);
  line-height: 1.05;
}

.russia-date-panel__header > span {
  color: var(--text-secondary);
  font-size: 13px;
}

.russia-date-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(320px, 0.8fr);
  gap: 14px;
}

.russia-date-list {
  display: grid;
  gap: 10px;
  align-content: start;
}

.russia-date-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px 14px;
  min-height: 76px;
  padding: 14px;
  border: 1px solid var(--border-subtle);
  border-left: 3px solid var(--gold);
  border-radius: 8px;
  background: var(--surface-card-soft);
  color: var(--text-primary);
  transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}

.russia-date-card:hover {
  border-color: var(--border-accent);
  background: var(--surface-control-hover);
  transform: translateY(-1px);
}

.russia-date-card a {
  display: grid;
  grid-template-columns: minmax(110px, 0.5fr) minmax(0, 1fr);
  align-items: center;
  gap: 8px 14px;
  color: inherit;
  text-decoration: none;
}

.russia-date-card span,
.russia-date-card small {
  color: var(--text-secondary);
  font-size: 13px;
}

.russia-date-card strong {
  color: var(--text-primary);
  font-size: 22px;
}

.russia-date-card small {
  grid-column: 2;
}

.russia-date-card button {
  min-height: 36px;
  border: 1px solid var(--border-accent);
  border-radius: 8px;
  background: color-mix(in srgb, var(--accent) 14%, var(--surface-card));
  color: var(--text-primary);
  font-weight: 800;
}

.russia-date-card button:hover {
  border-color: var(--border-accent);
  background: var(--surface-control-hover);
}

.russia-date-dialog__footer button:first-child {
  border-color: var(--status-danger-border);
  background: var(--status-danger-bg);
  color: var(--status-danger);
}

.russia-date-create {
  display: grid;
  gap: 14px;
  align-content: start;
  padding: 16px;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: var(--surface-card-soft);
}

.russia-date-create h3,
.russia-date-create p {
  margin: 0;
}

.russia-date-create h3 {
  color: var(--text-primary);
  font-size: 20px;
}

.russia-date-create p {
  margin-top: 6px;
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.4;
}

.russia-date-create label {
  display: grid;
  gap: 8px;
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 800;
}

.russia-date-create input,
.russia-date-create select {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: var(--surface-control);
  color: var(--text-primary);
  padding: 0 12px;
}

.russia-date-create select option {
  color: var(--text-primary);
  background: var(--surface-card);
}

.russia-date-create button {
  min-height: 48px;
  border-radius: 8px;
  background: var(--control-primary-bg);
  color: var(--control-primary-text);
  font-weight: 800;
}

.russia-date-confirm {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.55fr);
  gap: 20px;
}

.russia-date-confirm p {
  max-width: 720px;
  margin: 12px 0 0;
  color: var(--text-secondary);
  line-height: 1.5;
}

.russia-date-confirm dl {
  display: grid;
  gap: 10px;
  margin: 0;
}

.russia-date-confirm dl div {
  padding: 12px;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: var(--surface-card-soft);
}

.russia-date-confirm dt,
.russia-date-confirm dd {
  margin: 0;
}

.russia-date-confirm dt {
  color: var(--text-secondary);
  font-size: 12px;
}

.russia-date-confirm dd {
  margin-top: 5px;
  color: var(--text-primary);
  font-size: 16px;
  font-weight: 800;
}

.russia-parcel-form {
  padding: 22px;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background:
    linear-gradient(160deg, color-mix(in srgb, var(--surface-card) 82%, transparent), transparent),
    var(--surface-card);
  box-shadow: var(--shadow-sm);
  color: var(--text-primary);
}

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

.russia-form-section {
  padding: 16px;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--surface-card) 76%, transparent), transparent),
    var(--surface-card-soft);
}

.russia-form-section .parcel-form-section__title {
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-subtle);
}

.russia-form-section--wide {
  grid-column: 1 / -1;
}

.russia-form-grid {
  display: grid;
  gap: 14px;
}

.russia-form-grid--three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.russia-form-section--identity .russia-form-grid--three {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.russia-form-section--identity .russia-form-grid--three label:nth-child(3) {
  grid-column: 1 / -1;
}

.russia-form-grid--four {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.russia-form-grid--parcel {
  grid-template-columns: minmax(320px, 1fr) minmax(210px, 0.34fr);
  align-items: stretch;
}

.russia-form-span-2 {
  grid-column: span 2;
}

.russia-parcel-form label {
  display: grid;
  gap: 8px;
  min-width: 0;
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 800;
}

.russia-parcel-form input,
.russia-parcel-form select,
.russia-parcel-form textarea {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: var(--surface-control);
  color: var(--text-primary);
  padding: 0 12px;
}

.russia-parcel-form input:focus,
.russia-parcel-form select:focus,
.russia-parcel-form textarea:focus {
  border-color: var(--border-accent);
  box-shadow: 0 0 0 3px var(--accent-ring);
  outline: none;
}

.russia-parcel-form textarea {
  min-height: 94px;
  padding-block: 12px;
  resize: vertical;
}

.russia-parcel-form select option {
  color: var(--text-primary);
  background: var(--surface-card);
}

.russia-weight-box {
  align-content: start;
  padding: 14px;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: var(--surface-card-soft);
}

.russia-weight-entry {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 126px;
  gap: 10px;
}

.russia-weight-entry button,
.russia-parcel-form .parcel-form__footer button {
  min-height: 44px;
  border-radius: 8px;
  background: var(--control-primary-bg);
  color: var(--control-primary-text);
  font-weight: 800;
}

.russia-weight-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 38px;
}

.russia-weight-chip {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 10px;
  border: 1px solid var(--border-accent);
  border-radius: 8px;
  background: color-mix(in srgb, var(--accent) 12%, var(--surface-card));
  color: var(--text-primary);
  font-weight: 800;
}

.russia-weight-chip span {
  color: var(--text-secondary);
}

.russia-weight-summary {
  align-self: stretch;
  display: grid;
  align-content: center;
  gap: 8px;
  min-height: 112px;
  padding: 16px;
  border: 1px solid var(--border-accent);
  border-radius: 8px;
  background:
    linear-gradient(145deg, color-mix(in srgb, var(--accent) 18%, transparent), color-mix(in srgb, var(--accent) 6%, transparent)),
    var(--surface-card-soft);
}

.russia-weight-summary span,
.russia-weight-summary small {
  color: var(--text-secondary);
}

.russia-weight-summary strong {
  color: var(--text-primary);
  font-size: 30px;
  line-height: 1;
}

.russia-form-grid--parcel .russia-form-span-2 {
  grid-column: 1 / -1;
}

.russia-form-grid--parcel textarea {
  min-height: 118px;
}

.russia-description-builder {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: var(--surface-card-soft);
}

.russia-description-builder__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.russia-description-builder__top span {
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 900;
}

.russia-description-builder__top small {
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 800;
  text-align: right;
}

.russia-description-builder__top small.is-ok {
  color: var(--status-success);
}

.russia-description-builder__top small.is-danger {
  color: var(--status-danger);
}

.russia-description-input {
  position: relative;
}

.russia-description-input input {
  padding-right: 16px;
}

.russia-description-suggestions {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  z-index: 12;
  display: grid;
  gap: 4px;
  padding: 6px;
  border: 1px solid var(--border-accent);
  border-radius: 8px;
  background: var(--surface-card-raised);
  box-shadow: var(--shadow-sm);
}

.russia-description-suggestions[hidden] {
  display: none;
}

.russia-description-suggestions button {
  min-height: 34px;
  justify-content: flex-start;
  padding: 0 10px;
  border-radius: 6px;
  background: color-mix(in srgb, var(--accent) 10%, var(--surface-card));
  color: var(--text-primary);
  font-weight: 800;
  text-align: left;
}

.russia-description-suggestions button:hover {
  background: var(--surface-control-hover);
}

.russia-description-items {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 38px;
}

.russia-description-chip {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 10px;
  border: 1px solid var(--border-accent);
  border-radius: 8px;
  background: color-mix(in srgb, var(--accent) 12%, var(--surface-card));
  color: var(--text-primary);
  font-weight: 900;
}

.russia-description-chip strong {
  color: var(--accent);
}

.russia-description-chip i {
  color: var(--text-secondary);
  font-style: normal;
}

.russia-finance-layout {
  display: grid;
  grid-template-columns: 0.85fr 1.25fr;
  gap: 14px;
}

.russia-finance-card {
  display: grid;
  align-content: start;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: var(--surface-card-soft);
}

.russia-finance-card--payment {
  border-color: var(--border-accent);
  background:
    linear-gradient(145deg, color-mix(in srgb, var(--accent) 8%, transparent), transparent),
    var(--surface-card-soft);
}

.russia-finance-card--notes {
  grid-column: 1 / -1;
}

.russia-finance-card > strong {
  color: var(--text-primary);
  font-size: 15px;
}

.russia-form-grid--money {
  grid-template-columns: 1fr 0.8fr;
}

.russia-form-grid--payment {
  grid-template-columns: 1fr 0.8fr 0.95fr;
}

.russia-form-grid--notes {
  grid-template-columns: 1fr 1.2fr;
}

.russia-form-grid--notes textarea {
  min-height: 92px;
}

.russia-weight-summary.is-danger {
  border-color: var(--status-danger-border);
  background: var(--status-danger-bg);
}

.russia-weight-summary.is-danger strong,
.russia-weight-summary.is-danger::after {
  color: var(--status-danger);
}

.russia-weight-summary.is-danger::after {
  content: attr(data-warning);
  font-size: 12px;
  line-height: 1.35;
}

.russia-common-toggle {
  width: 100%;
  max-width: 360px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 14px;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: var(--surface-card-soft);
  cursor: pointer;
}

.russia-common-toggle input {
  width: 20px;
  min-height: 20px;
  accent-color: var(--accent);
}

.russia-common-select {
  max-width: 520px;
  margin-top: 14px;
}

.russia-common-select[hidden] {
  display: none;
}

.russia-parcel-row .parcel-row__media span {
  color: var(--accent);
  font-size: 18px;
}

.latest-parcels__list {
  display: grid;
  gap: 9px;
}

.parcel-row {
  display: grid;
  grid-template-columns: 86px 1.3fr 1.3fr 1fr 1fr;
  gap: 12px;
  align-items: center;
  min-height: 72px;
  padding: 12px;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: var(--surface-card-soft);
}

.parcel-row.is-new {
  animation: parcelInsert 0.62s ease;
  border-color: color-mix(in srgb, var(--accent) 46%, transparent);
}

.parcel-row__number {
  display: grid;
  place-items: center;
  min-height: 48px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--accent) 14%, var(--surface-card));
  color: var(--accent);
  font-size: 18px;
  font-weight: 800;
}

.parcel-row strong,
.parcel-row span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.parcel-row strong {
  color: var(--text-primary);
  font-size: 14px;
}

.parcel-row span {
  margin-top: 4px;
  color: var(--text-secondary);
  font-size: 12px;
}

.parcel-row {
  grid-template-columns: 76px minmax(170px, 1.2fr) minmax(170px, 1fr) minmax(150px, 0.8fr) minmax(240px, 1fr);
  min-height: 96px;
  padding: 10px;
}

.parcel-row__media {
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--accent) 24%, transparent), color-mix(in srgb, var(--accent-dark) 10%, transparent)),
    var(--surface-control);
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
}

.parcel-row__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.parcel-row__title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 7px;
}

.parcel-row__title strong {
  color: var(--gold);
  font-size: 18px;
}

.parcel-row__main p {
  display: -webkit-box;
  max-width: 100%;
  margin: 0;
  overflow: hidden;
  color: var(--text-primary);
  font-size: 13px;
  line-height: 1.35;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.parcel-row__people,
.parcel-row__route,
.parcel-row__status {
  min-width: 0;
}

.parcel-row__people span,
.parcel-row__route span {
  margin-top: 0;
  color: color-mix(in srgb, var(--text-secondary) 78%, transparent);
  font-size: 11px;
  text-transform: uppercase;
}

.parcel-row__people strong + span {
  margin-top: 8px;
}

.parcel-row__route strong {
  color: var(--text-primary);
  font-size: 15px;
}

.parcel-row__route small {
  display: block;
  margin-top: 7px;
  color: var(--text-secondary);
  font-size: 12px;
}

.parcel-row__status {
  position: relative;
  justify-self: end;
  width: 100%;
  max-width: 320px;
  min-width: 0;
  padding: 8px;
  border: 1px solid var(--border-accent);
  border-radius: 8px;
  background: color-mix(in srgb, var(--accent) 8%, var(--surface-card));
  text-align: left;
}

.parcel-row__payment,
.parcel-row__payment-details,
.parcel-row__payment-part {
  display: grid;
  min-width: 0;
}

.parcel-row .parcel-row__payment {
  display: grid;
  gap: 6px;
  margin: 0;
  overflow: visible;
  color: var(--accent);
  white-space: normal;
}

.parcel-row .parcel-row__payment > strong {
  overflow: visible;
  color: currentColor;
  font-size: 11px;
  line-height: 1.2;
  text-overflow: clip;
  white-space: normal;
  padding-right: 88px;
}

.parcel-row .parcel-row__payment-details {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(68px, 1fr));
  gap: 5px;
  margin: 0;
  overflow: visible;
  white-space: normal;
}

.parcel-row .parcel-row__payment-part {
  display: grid;
  gap: 2px;
  margin: 0;
  padding: 5px 7px;
  overflow: visible;
  border: 1px solid color-mix(in srgb, currentColor 24%, transparent);
  border-radius: 6px;
  background: color-mix(in srgb, currentColor 8%, transparent);
  white-space: normal;
}

.parcel-row .parcel-row__payment-part small,
.parcel-row .parcel-row__payment-part b {
  display: block;
  min-width: 0;
  overflow: hidden;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.parcel-row .parcel-row__payment-part small {
  color: var(--text-secondary);
  font-size: 9px;
  font-weight: 700;
}

.parcel-row .parcel-row__payment-part b {
  color: var(--text-primary);
  font-size: 11px;
}

.parcel-row .parcel-row__payment-part--due {
  border-color: color-mix(in srgb, var(--status-danger) 62%, transparent);
  background: color-mix(in srgb, var(--status-danger) 16%, var(--surface-card-raised));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--status-danger) 12%, transparent);
}

.parcel-row .parcel-row__payment-part--due small,
.parcel-row .parcel-row__payment-part--due b {
  color: var(--status-danger);
}

.parcel-row .parcel-row__payment-part--due b {
  font-size: 12px;
  font-weight: 900;
}

.parcel-row .parcel-row__payment--paid {
  color: var(--status-success);
}

.parcel-row .parcel-row__payment--partial {
  color: var(--gold);
}

.parcel-row .parcel-row__payment--unpaid {
  color: var(--status-danger);
}

.parcel-row .parcel-row__issue-status {
  position: absolute;
  top: 8px;
  right: 8px;
  max-width: 82px;
  margin: 0;
  color: var(--text-secondary);
  font-size: 10px;
  line-height: 1.2;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.parcel-row__edit {
  width: 100%;
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  margin-top: 9px;
  padding: 0 10px;
  border: 1px solid color-mix(in srgb, var(--accent) 78%, var(--border-subtle));
  border-radius: 6px;
  background: var(--control-primary-bg);
  color: var(--control-primary-text);
  box-shadow: 0 5px 14px color-mix(in srgb, var(--accent) 18%, transparent);
  font-size: 12px;
  font-weight: 800;
}

.parcel-row__edit:hover {
  border-color: var(--accent);
  background: var(--control-primary-bg-hover);
  color: var(--control-primary-text);
  transform: translateY(-1px);
}

.parcel-row__edit span {
  margin: 0;
  color: inherit;
  font-size: 14px;
}

.parcel-row.is-editing {
  border-color: var(--border-accent);
  box-shadow: inset 3px 0 0 var(--accent);
}

.parcel-form__footer-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.empty-state {
  min-height: 110px;
  display: grid;
  place-items: center;
  border: 1px dashed var(--border-subtle);
  border-radius: 8px;
  color: var(--text-secondary);
}

.direction-modal {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: none;
  place-items: center;
  padding: 24px;
  pointer-events: none;
}

.direction-modal.is-open {
  display: grid;
}

.direction-modal__backdrop {
  position: absolute;
  inset: 0;
  background: var(--surface-overlay);
  pointer-events: none;
}

.direction-modal__panel {
  position: relative;
  width: min(560px, 100%);
  padding: 26px;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background:
    linear-gradient(160deg, color-mix(in srgb, var(--surface-card) 82%, transparent), transparent),
    var(--surface-card);
  color: var(--text-primary);
  box-shadow: var(--shadow-lg);
  animation: modalIn 0.24s ease;
  pointer-events: auto;
}

.choice-modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 38px;
  min-height: 38px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--border-accent);
  border-radius: 8px;
  background: color-mix(in srgb, var(--accent) 10%, var(--surface-card-soft));
  color: var(--accent);
  font-size: 22px;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
}

.choice-modal-close:hover {
  background: var(--surface-control-hover);
}

.direction-modal__panel h2 {
  margin: 0 0 10px;
  font-size: 34px;
}

.direction-modal__panel p:not(.eyebrow) {
  margin: 0 0 20px;
  color: var(--text-secondary);
  line-height: 1.5;
}

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

.direction-options button {
  min-height: 148px;
  display: grid;
  justify-items: start;
  gap: 8px;
  padding: 16px;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: var(--surface-control);
  color: var(--text-primary);
  text-align: left;
}

.direction-options button:not(:disabled):hover {
  border-color: var(--border-accent);
  background: var(--surface-control-hover);
}

.direction-options button:disabled {
  cursor: not-allowed;
  opacity: 0.52;
}

.direction-options span {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--accent), var(--gold));
  color: var(--accent-contrast);
  font-weight: 800;
}

.direction-options strong,
.direction-options small {
  display: block;
}

.direction-options small {
  color: var(--text-secondary);
}

.select2-container--default .select2-selection--single {
  min-height: 44px;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: var(--surface-control);
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
  color: var(--text-primary);
  line-height: 42px;
}

.select2-container--default .select2-selection--single .select2-selection__placeholder {
  color: color-mix(in srgb, var(--text-secondary) 72%, transparent);
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
  height: 42px;
}

.select2-container--default .select2-selection--single .select2-selection__clear {
  width: 24px;
  height: 24px;
  min-height: 0;
  margin: 9px 30px 0 6px;
  padding: 0;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: transparent;
  box-shadow: none;
  color: var(--text-secondary);
  font-size: 19px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  transition: color 0.16s ease, background-color 0.16s ease, transform 0.16s ease;
}

.select2-container--default .select2-selection--single .select2-selection__clear:hover,
.select2-container--default .select2-selection--single .select2-selection__clear:focus-visible {
  background: color-mix(in srgb, var(--status-danger) 14%, transparent);
  color: var(--status-danger);
  outline: none;
  transform: scale(1.06);
}

.select2-dropdown {
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: var(--surface-card-raised);
  color: var(--text-primary);
  overflow: hidden;
}

.select2-container--open {
  z-index: 90;
}

.select2-container--open .select2-dropdown {
  box-shadow: var(--shadow-lg);
}

.select2-container--default .select2-search--dropdown .select2-search__field {
  box-sizing: border-box;
  width: 100%;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
}

.select2-container--default .select2-results__option--highlighted.select2-results__option--selectable {
  background: var(--control-primary-bg);
  color: var(--accent-contrast);
}

.select2-container--default .select2-results__option--selectable {
  background: var(--surface-card-raised);
  color: var(--text-primary);
}

.select2-container--default .select2-results__option--selected {
  background: color-mix(in srgb, var(--accent) 16%, var(--surface-card-raised));
  color: var(--text-primary);
  font-weight: 750;
}

.select2-container--default .select2-results__option--highlighted.select2-results__option--selectable,
.select2-container--default .select2-results__option--selected.select2-results__option--highlighted {
  background: var(--control-primary-bg);
  color: var(--control-primary-text);
}

.select2-search__field {
  color: var(--text-primary);
  background: var(--surface-control);
}

@keyframes modalIn {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes parcelInsert {
  0% {
    opacity: 0;
    transform: translateY(-18px) scale(.985);
  }
  58% {
    opacity: 1;
    transform: translateY(3px) scale(1.004);
    box-shadow: 0 14px 34px color-mix(in srgb, var(--accent) 18%, transparent);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
    box-shadow: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .parcel-row.is-new {
    animation: none;
  }
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
}

.parcel-list-page {
  width: min(1440px, 100%);
  align-self: start;
  display: grid;
  gap: 14px;
  color: var(--text-primary);
}

.parcel-direction-page {
  width: min(980px, 100%);
  align-self: center;
  justify-self: center;
  display: grid;
  gap: 16px;
  color: var(--text-primary);
}

.parcel-direction-hero,
.parcel-direction-card {
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background:
    linear-gradient(160deg, color-mix(in srgb, var(--surface-card) 82%, transparent), transparent),
    var(--surface-card);
  box-shadow: var(--shadow-sm);
}

.parcel-direction-hero {
  padding: 24px;
}

.parcel-direction-hero h1 {
  margin: 0;
  font-size: clamp(34px, 5vw, 56px);
  line-height: 1;
  letter-spacing: 0;
}

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

.parcel-direction-card {
  min-height: 210px;
  display: grid;
  align-content: center;
  justify-items: start;
  gap: 12px;
  padding: 22px;
  color: var(--text-primary);
  text-decoration: none;
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.parcel-direction-card:hover {
  border-color: var(--border-accent);
  background:
    linear-gradient(160deg, color-mix(in srgb, var(--accent) 16%, transparent), transparent),
    var(--surface-card);
  transform: translateY(-2px);
}

.parcel-direction-card--static,
.parcel-direction-card--static:hover {
  cursor: default;
  transform: none;
}

.parcel-direction-card span {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--accent), var(--gold));
  color: var(--accent-contrast);
  font-weight: 900;
}

.parcel-direction-card strong {
  font-size: 24px;
  line-height: 1.15;
}

.parcel-direction-card small {
  color: var(--text-secondary);
  font-size: 14px;
}

.parcel-list-hero,
.parcel-list-toolbar,
.parcel-list-status,
.georgia-card-list,
.georgia-table-wrap {
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background:
    linear-gradient(160deg, color-mix(in srgb, var(--surface-card) 82%, transparent), transparent),
    var(--surface-card);
  box-shadow: var(--shadow-sm);
}

.parcel-list-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 20px;
}

.parcel-list-hero h1 {
  margin: 0;
  font-size: clamp(30px, 4vw, 48px);
  line-height: 1;
  letter-spacing: 0;
}

.parcel-list-summary {
  min-width: 132px;
  padding: 13px 15px;
  border: 1px solid color-mix(in srgb, var(--gold) 34%, transparent);
  border-radius: 8px;
  background: color-mix(in srgb, var(--gold) 9%, var(--surface-card));
  text-align: right;
}

.parcel-list-summary span,
.parcel-list-summary strong {
  display: block;
}

.parcel-list-summary span {
  color: var(--text-secondary);
  font-size: 12px;
}

.parcel-list-summary strong {
  margin-top: 4px;
  color: var(--gold);
  font-size: 28px;
  line-height: 1;
}

.parcel-list-toolbar {
  display: grid;
  gap: 14px;
  padding: 14px;
}

.parcel-list-toolbar__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.segmented-control {
  display: flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: var(--surface-control);
}

.segmented-control button {
  min-height: 36px;
  padding: 0 12px;
  border-radius: 6px;
  background: transparent;
  color: var(--text-secondary);
  font-weight: 800;
}

.segmented-control button:hover,
.segmented-control button.is-active {
  background: var(--control-primary-bg);
  color: var(--control-primary-text);
}

.parcel-list-filters {
  display: grid;
  grid-template-columns: minmax(230px, 1.4fr) repeat(5, minmax(130px, 0.7fr)) auto;
  gap: 10px;
  align-items: end;
}

@media (min-width: 981px) {
  .parcel-list-page[data-georgia-list-page] .parcel-list-filters:has(.custom-date-field:not([hidden])) {
    grid-template-columns:
      minmax(210px, 1.55fr)
      repeat(4, minmax(100px, 0.76fr))
      minmax(72px, 0.5fr)
      repeat(2, minmax(124px, 0.92fr))
      minmax(118px, 0.82fr);
  }
}

.parcel-list-page[data-georgia-list-page] .parcel-list-filters > button {
  width: 100%;
  padding-inline: 18px;
  white-space: nowrap;
}

.parcel-list-filters label,
.parcel-edit-form label {
  display: grid;
  gap: 7px;
  min-width: 0;
  color: var(--text-primary);
  font-size: 12px;
  font-weight: 800;
}

.parcel-list-filters .custom-date-field[hidden] {
  display: none;
}

.parcel-list-filters input,
.parcel-list-filters select,
.parcel-edit-form input,
.parcel-edit-form select,
.parcel-edit-form textarea {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: var(--surface-control);
  color: var(--text-primary);
  padding: 0 11px;
}

.parcel-list-filters select option,
.parcel-edit-form select option {
  color: var(--text-primary);
  background: var(--surface-card);
}

.parcel-list-filters textarea,
.parcel-edit-form textarea {
  min-height: 92px;
  padding-block: 10px;
  resize: vertical;
}

.parcel-list-filters button,
.parcel-list-footer button,
.parcel-edit-form__footer button[type="submit"] {
  min-height: 42px;
  border-radius: 8px;
  background: var(--control-primary-bg);
  color: var(--control-primary-text);
  font-weight: 800;
}

.parcel-list-status {
  min-height: 42px;
  display: flex;
  align-items: center;
  padding: 0 14px;
  color: var(--text-secondary);
  font-size: 13px;
}

.georgia-card-list {
  display: grid;
  gap: 10px;
  padding: 12px;
}

.georgia-card-list[hidden],
.georgia-table-wrap[hidden] {
  display: none;
}

.georgia-parcel-card {
  display: grid;
  grid-template-columns: 148px minmax(380px, 1fr) minmax(220px, 0.42fr);
  gap: 18px;
  align-items: stretch;
  min-height: 174px;
  padding: 14px;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background:
    linear-gradient(145deg, color-mix(in srgb, var(--surface-card) 78%, transparent), transparent),
    var(--surface-card-soft);
}

.georgia-parcel-card__visual {
  display: grid;
  align-content: start;
  gap: 9px;
}

.georgia-parcel-card__media {
  width: 132px;
  height: 126px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--accent) 24%, transparent), color-mix(in srgb, var(--accent-dark) 10%, transparent)),
    var(--surface-control);
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
}

.georgia-parcel-card__visual time {
  width: 132px;
  min-height: 30px;
  display: grid;
  place-items: center;
  padding: 0 8px;
  border: 1px solid var(--border-subtle);
  border-radius: 7px;
  background: var(--surface-control);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 900;
  text-align: center;
}

.georgia-parcel-card__photo {
  width: 100%;
  min-height: 100%;
  display: grid;
  place-items: center;
  padding: 0;
  border-radius: 8px;
  background: transparent;
}

.georgia-parcel-card__photo:hover {
  background: var(--surface-control-hover);
}

.georgia-parcel-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.georgia-parcel-card__top,
.georgia-parcel-card__meta,
.georgia-parcel-card__side,
.parcel-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.georgia-parcel-card__main {
  display: grid;
  align-content: start;
  min-width: 0;
}

.georgia-parcel-card__top {
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.georgia-parcel-card__top strong {
  display: block;
  color: var(--accent);
  font-size: 24px;
  line-height: 1;
}

.georgia-parcel-card__top span,
.georgia-parcel-card__people span,
.georgia-parcel-card__meta,
.georgia-data-table small {
  color: var(--text-secondary);
  font-size: 12px;
}

.georgia-parcel-card__people {
  min-width: 0;
}

.georgia-parcel-card__main p {
  display: -webkit-box;
  min-height: 40px;
  max-height: 60px;
  margin: 10px 0 12px;
  padding: 10px 12px;
  overflow: hidden;
  border-left: 3px solid color-mix(in srgb, var(--accent) 58%, transparent);
  border-radius: 0 8px 8px 0;
  background: color-mix(in srgb, var(--accent) 8%, var(--surface-card-soft));
  color: var(--text-primary);
  font-size: 14px;
  line-height: 1.35;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.georgia-parcel-card__meta {
  flex-wrap: wrap;
}

.georgia-parcel-card__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 9px;
}

.georgia-parcel-card__chips span,
.type-chip,
.payment-pill {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.georgia-parcel-card__chips span {
  border: 1px solid var(--border-subtle);
  background: var(--surface-control);
  color: var(--text-secondary);
}

.georgia-parcel-card__chips .type-chip {
  border-color: color-mix(in srgb, var(--accent) 42%, transparent);
  background: color-mix(in srgb, var(--accent) 13%, var(--surface-card));
  color: var(--accent);
}

.georgia-parcel-card__chips .cost-chip {
  border-color: color-mix(in srgb, var(--gold) 46%, transparent);
  background: color-mix(in srgb, var(--gold) 12%, var(--surface-card));
  color: color-mix(in srgb, var(--gold) 76%, var(--text-primary));
}

.payment-pill--paid {
  border: 1px solid var(--status-success-border);
  background: var(--status-success-bg);
  color: var(--status-success);
}

.georgia-parcel-card .payment-pill--paid,
.georgia-data-table .payment-pill--paid {
  border-color: color-mix(in srgb, var(--status-success) 48%, transparent);
  background: color-mix(in srgb, var(--status-success) 24%, var(--surface-card-raised));
  color: color-mix(in srgb, var(--status-success) 78%, var(--text-primary));
}

.payment-pill--unpaid {
  border: 1px solid var(--status-danger-border);
  background: var(--status-danger-bg);
  color: var(--status-danger);
}

.georgia-parcel-card .payment-pill--unpaid,
.georgia-data-table .payment-pill--unpaid {
  border-color: color-mix(in srgb, var(--status-danger) 50%, transparent);
  background: color-mix(in srgb, var(--status-danger) 18%, var(--surface-card-raised));
  color: color-mix(in srgb, var(--status-danger) 82%, var(--text-primary));
}

.georgia-parcel-card__side .payment-pill,
.georgia-parcel-card__side .status-pill {
  width: 100%;
  min-height: 38px;
  justify-content: center;
  border-radius: 8px;
  text-align: center;
}

.georgia-parcel-card__side .payment-pill {
  box-sizing: border-box;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding: 8px 10px;
  font-size: 13px;
  line-height: 1.25;
  overflow-wrap: anywhere;
  white-space: normal;
}

.georgia-payment-card-summary strong {
  width: 100%;
  font-size: 12px;
  line-height: 1.2;
  text-align: left;
}

.georgia-payment-card-summary small {
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  gap: 3px 6px;
  color: currentColor;
  font-size: 11px;
  font-weight: 750;
  line-height: 1.35;
  opacity: 0.9;
  text-align: left;
}

.georgia-payment-card-summary small b {
  font-weight: 900;
  opacity: 0.55;
}

.georgia-payment-card-summary small .is-due {
  color: var(--status-danger);
  font-weight: 900;
}

.georgia-parcel-card__people {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.georgia-parcel-card__people div {
  min-width: 0;
  padding: 11px 12px;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background:
    linear-gradient(145deg, color-mix(in srgb, var(--surface-card) 78%, transparent), transparent),
    var(--surface-card-soft);
}

.georgia-parcel-card__people strong {
  display: block;
  margin-top: 5px;
  overflow: hidden;
  color: var(--text-primary);
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.georgia-parcel-card__side {
  display: grid;
  align-content: start;
  justify-items: stretch;
  gap: 10px;
  min-width: 0;
}

.georgia-parcel-card__side .status-pill {
  justify-self: end;
  width: auto;
  min-height: 24px;
  padding-inline: 8px;
  border: 0;
  background: transparent;
}

.georgia-parcel-card__side .parcel-actions,
.georgia-parcel-card__side .parcel-actions button {
  width: 100%;
}

.status-pill {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--status-success-bg);
  color: var(--status-success);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.georgia-parcel-card .status-pill--created,
.georgia-data-table .status-pill--created {
  border: 1px solid color-mix(in srgb, var(--accent) 48%, transparent);
  background: color-mix(in srgb, var(--accent) 22%, var(--surface-card-raised));
  color: color-mix(in srgb, var(--accent) 82%, var(--text-primary));
}

.status-pill--issued {
  background: color-mix(in srgb, var(--accent) 14%, var(--surface-card));
  color: var(--accent);
}

.status-pill--cancelled {
  background: var(--status-danger-bg);
  color: var(--status-danger);
}

.parcel-actions {
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 7px;
}

.parcel-actions button {
  flex: 0 0 auto;
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 10px;
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  background: var(--control-secondary-bg);
  color: var(--control-secondary-text);
  font-size: 12px;
  font-weight: 800;
}

.georgia-parcel-card .parcel-actions button,
.georgia-data-table .parcel-actions button {
  border-color: var(--border-accent);
  background: color-mix(in srgb, var(--accent) 14%, var(--surface-card));
  color: var(--text-primary);
}

.parcel-actions button span {
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  border-radius: 5px;
  background: var(--surface-control-hover);
  font-size: 13px;
  line-height: 1;
}

.georgia-parcel-card .parcel-actions button span,
.georgia-data-table .parcel-actions button span {
  border: 1px solid color-mix(in srgb, var(--accent) 46%, transparent);
  background: color-mix(in srgb, var(--accent) 34%, var(--surface-card-raised));
  color: color-mix(in srgb, var(--accent) 86%, var(--text-primary));
}

.georgia-parcel-card .parcel-action-button--issue span,
.georgia-data-table .parcel-action-button--issue span {
  border-color: color-mix(in srgb, var(--status-success) 52%, transparent);
  background: color-mix(in srgb, var(--status-success) 30%, var(--surface-card-raised));
  color: color-mix(in srgb, var(--status-success) 86%, var(--text-primary));
}

.georgia-parcel-card .parcel-action-button--cancel span,
.georgia-data-table .parcel-action-button--cancel span {
  border-color: color-mix(in srgb, var(--status-danger) 52%, transparent);
  background: color-mix(in srgb, var(--status-danger) 28%, var(--surface-card-raised));
  color: color-mix(in srgb, var(--status-danger) 86%, var(--text-primary));
}

.parcel-actions button strong {
  font-size: 12px;
}

.parcel-action-button--issue {
  border-color: var(--status-success-border);
  background: var(--status-success-bg);
  color: var(--status-success);
}

.parcel-action-button--cancel {
  border-color: var(--status-danger-border);
  background: var(--status-danger-bg);
  color: var(--status-danger);
}

.parcel-actions button:hover {
  border-color: var(--border-accent);
  background: var(--surface-control-hover);
}

.parcel-actions button[data-action="cancel"]:hover {
  border-color: var(--status-danger-border);
  background: var(--status-danger-bg);
}

.parcel-actions button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

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

.georgia-data-table {
  width: 100%;
  min-width: 1180px;
  border-collapse: collapse;
}

.georgia-data-table th,
.georgia-data-table td {
  padding: 11px 10px;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-primary);
  font-size: 13px;
  text-align: left;
  vertical-align: top;
}

.georgia-data-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--surface-card-raised);
  color: var(--text-secondary);
  font-size: 12px;
  text-transform: uppercase;
}

.georgia-data-table td strong,
.georgia-data-table td small {
  display: block;
}

.parcel-list-footer {
  display: flex;
  justify-content: center;
}

.parcel-edit-dialog {
  width: min(880px, calc(100% - 28px));
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background:
    linear-gradient(160deg, color-mix(in srgb, var(--surface-card) 82%, transparent), transparent),
    var(--surface-card);
  color: var(--text-primary);
  box-shadow: var(--shadow-lg);
}

.parcel-edit-dialog::backdrop {
  background: var(--surface-overlay);
}

.parcel-photo-dialog {
  width: min(980px, calc(100% - 28px));
  max-height: calc(100vh - 36px);
  padding: 60px 14px 14px;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: var(--surface-card);
  box-shadow: var(--shadow-lg);
}

.parcel-photo-dialog::backdrop {
  background: var(--surface-overlay);
}

.parcel-photo-dialog img {
  width: 100%;
  max-height: calc(100vh - 110px);
  display: block;
  object-fit: contain;
  border-radius: 8px;
  background: var(--surface-card-soft);
}

.parcel-photo-dialog__close {
  position: absolute;
  z-index: 2;
  top: 11px;
  right: 11px;
  width: 42px;
  min-height: 42px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.26);
  border-radius: 12px;
  background: rgba(7, 12, 24, 0.78);
  color: #fff;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

.parcel-photo-dialog__close svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.25;
  stroke-linecap: round;
  transition: transform 220ms ease;
}

.parcel-photo-dialog__close:hover {
  border-color: color-mix(in srgb, var(--status-danger) 72%, #fff);
  background: color-mix(in srgb, var(--status-danger) 82%, #17101a);
  color: #fff;
  box-shadow: 0 10px 28px color-mix(in srgb, var(--status-danger) 32%, transparent);
  transform: translateY(-1px);
}

.parcel-photo-dialog__close:hover svg {
  transform: rotate(90deg);
}

.parcel-photo-dialog__close:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--accent) 48%, transparent);
  outline-offset: 3px;
}

.parcel-photo-dialog__close:active {
  transform: translateY(0) scale(0.94);
}

.russia-list-date-select {
  display: grid;
  gap: 7px;
  min-width: min(360px, 100%);
  color: var(--text-primary);
  font-size: 12px;
  font-weight: 800;
}

.russia-list-date-select select {
  min-height: 44px;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: var(--surface-control);
  color: var(--text-primary);
  padding: 0 12px;
}

.russia-list-date-select option {
  color: var(--text-primary);
  background: var(--surface-card);
}

.russia-list-filters {
  grid-template-columns: minmax(260px, 1.3fr) repeat(3, minmax(150px, 0.75fr)) auto;
}

.russia-branch-section {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background:
    linear-gradient(160deg, color-mix(in srgb, var(--surface-card) 82%, transparent), transparent),
    var(--surface-card);
  box-shadow: var(--shadow-sm);
  color: var(--text-primary);
}

.russia-branch-section__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 4px 2px 10px;
  border-bottom: 1px solid var(--border-subtle);
}

.russia-branch-section__header h2 {
  margin: 0;
  font-size: 24px;
}

.russia-branch-section__header button,
.russia-group-card__summary button {
  min-height: 36px;
  border: 1px solid color-mix(in srgb, var(--border-subtle) 78%, var(--text-primary));
  border-radius: 8px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--accent) 8%, transparent), transparent 72%),
    color-mix(in srgb, var(--surface-control) 82%, var(--surface-card));
  color: var(--text-primary);
  font-weight: 900;
  box-shadow: inset 0 1px 0 color-mix(in srgb, var(--text-primary) 7%, transparent);
  transition: border-color 0.16s ease, background 0.16s ease, color 0.16s ease, transform 0.16s ease;
}

.russia-branch-section__header button:hover,
.russia-group-card__summary button:hover {
  border-color: var(--border-accent);
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--accent) 14%, transparent), transparent 72%),
    color-mix(in srgb, var(--surface-control-hover) 88%, var(--surface-card));
  color: var(--text-primary);
  transform: translateY(-1px);
}

.russia-branch-section__header [data-toggle-branch] {
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--accent) 8%, transparent), transparent 72%),
    color-mix(in srgb, var(--surface-card-soft) 72%, var(--surface-card));
  color: var(--text-primary);
}

.russia-branch-section__header [data-toggle-branch]:hover {
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--accent) 16%, transparent), transparent 72%),
    color-mix(in srgb, var(--surface-control-hover) 74%, var(--surface-card));
  color: var(--text-primary);
}

.russia-branch-section.is-collapsed {
  border-color: color-mix(in srgb, var(--accent) 34%, var(--border-subtle));
  background:
    linear-gradient(145deg, color-mix(in srgb, var(--accent) 6%, transparent), transparent 62%),
    var(--surface-card);
}

.russia-branch-section.is-collapsed .russia-branch-section__header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  padding-bottom: 4px;
  border-bottom: 0;
}

.russia-branch-section.is-collapsed .russia-branch-section__header button {
  border-color: var(--border-accent);
  background: var(--control-primary-bg);
  color: var(--control-primary-text);
  box-shadow: 0 8px 20px color-mix(in srgb, var(--accent) 16%, transparent);
}

.russia-branch-section.is-collapsed .russia-branch-section__header::after {
  content: "Филиал скрыт: посылки не входят в выбор и манифест";
  grid-column: 1 / -1;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 800;
}

.russia-branch-section.is-collapsed .russia-list-stack {
  display: none;
}

.russia-list-stack {
  display: grid;
  gap: 10px;
}

.russia-manifest-panel {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(210px, 0.35fr) auto;
  gap: 12px;
  align-items: end;
  padding: 12px;
  border: 1px solid var(--border-accent);
  border-radius: 8px;
  background:
    linear-gradient(145deg, color-mix(in srgb, var(--accent) 10%, transparent), transparent),
    var(--surface-card-soft);
}

.russia-manifest-panel > div {
  display: grid;
  gap: 4px;
}

.russia-manifest-panel span {
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.russia-manifest-panel strong {
  color: var(--text-primary);
  font-size: 16px;
}

.russia-manifest-panel label {
  display: grid;
  gap: 6px;
}

.russia-manifest-panel select {
  min-height: 40px;
  width: 100%;
  padding: 0 38px 0 12px;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background:
    linear-gradient(45deg, transparent 50%, var(--text-secondary) 50%) calc(100% - 18px) 50% / 6px 6px no-repeat,
    linear-gradient(135deg, var(--text-secondary) 50%, transparent 50%) calc(100% - 13px) 50% / 6px 6px no-repeat,
    var(--surface-control);
  color: var(--text-primary);
  font-weight: 850;
  appearance: none;
}

.russia-manifest-panel select:focus {
  outline: 2px solid color-mix(in srgb, var(--accent) 34%, transparent);
  border-color: var(--border-accent);
}

.russia-manifest-panel option {
  background: var(--surface-card);
  color: var(--text-primary);
}

.russia-manifest-panel button {
  min-height: 40px;
  padding: 0 16px;
  border: 1px solid var(--border-accent);
  border-radius: 8px;
  background: var(--control-primary-bg);
  color: var(--control-primary-text);
  font-weight: 900;
}

.russia-manifest-panel button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.russia-origin-picker {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.russia-origin-picker select {
  min-width: 280px;
  padding: 10px 38px 10px 12px;
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  background: var(--surface-card);
  color: var(--text-primary);
  font: inherit;
}

.russia-list-date-picker {
  min-width: min(360px, 100%);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 8px;
}

.russia-list-date-picker .russia-list-date-select {
  min-width: 0;
}

.russia-list-date-more {
  min-height: 44px;
  padding-inline: 14px;
  border: 1px solid var(--border-accent);
  background: color-mix(in srgb, var(--accent) 12%, var(--surface-control));
  color: var(--accent);
}

.parcel-workspace[data-russia-page] .select2-container,
.parcel-workspace[data-russia-page] .select2-selection--single {
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
}

.parcel-workspace[data-russia-page] .select2-selection--single {
  min-height: 46px;
}

.parcel-workspace[data-russia-page] .select2-container--default .select2-selection--single .select2-selection__rendered {
  padding-left: 12px;
  padding-right: 64px;
  overflow: hidden;
  line-height: 44px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.parcel-workspace[data-russia-page] .select2-container--default .select2-selection--single .select2-selection__arrow {
  height: 44px;
}

@media (max-width: 640px) {
  .parcel-workspace .russia-origin-picker {
    width: 100%;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: stretch;
  }

  .parcel-workspace .russia-origin-picker select {
    width: 100%;
    min-width: 0;
  }
}

.russia-manifest-panel .russia-manifest-panel__actions {
  display: grid;
  grid-template-columns: repeat(2, max-content);
  gap: 8px;
}

.russia-list-card {
  display: grid;
  grid-template-columns: 118px minmax(0, 1fr);
  gap: 12px;
  min-height: 138px;
  padding: 11px;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background:
    linear-gradient(145deg, color-mix(in srgb, var(--surface-card) 78%, transparent), transparent),
    var(--surface-card-soft);
}

.russia-list-card__side {
  width: 118px;
  min-width: 0;
  display: grid;
  align-content: start;
  justify-items: stretch;
  gap: 6px;
}

.russia-list-card__select {
  display: none;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  padding: 0 8px;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: var(--surface-control);
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 900;
}

.russia-list-card__select input {
  width: 14px;
  height: 14px;
  accent-color: var(--accent);
}

.is-manifest-manual .russia-list-card__select {
  display: flex;
}

.russia-list-card__destination {
  position: relative;
  width: 118px;
  height: 104px;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--gold) 34%, transparent);
  border-radius: 8px;
  background:
    linear-gradient(145deg, color-mix(in srgb, var(--gold) 16%, transparent), color-mix(in srgb, var(--gold) 6%, transparent)),
    var(--surface-card);
  box-shadow: inset 0 1px 0 color-mix(in srgb, var(--text-inverse) 6%, transparent);
}

.russia-list-card.is-manifested .russia-list-card__destination {
  border-color: color-mix(in srgb, var(--status-success) 52%, transparent);
  background:
    linear-gradient(145deg, color-mix(in srgb, var(--status-success) 20%, transparent), color-mix(in srgb, var(--accent) 8%, transparent)),
    var(--surface-card);
}

.russia-list-card.is-manifested .russia-list-card__number {
  color: var(--status-success);
}

.russia-list-card.is-issued {
  border-color: var(--status-success-border);
}

.russia-issue-button,
.russia-issued-pill {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
}

.russia-issue-button {
  border: 1px solid var(--border-accent);
  background: var(--control-primary-bg);
  color: var(--control-primary-text);
}

.russia-issued-pill {
  border: 1px solid var(--status-success-border);
  border-radius: 8px;
  background:
    linear-gradient(145deg, color-mix(in srgb, var(--status-success) 13%, transparent), transparent 70%),
    var(--surface-card);
  color: var(--status-success);
  width: 118px;
  min-height: 46px;
  padding: 6px 8px;
  font-size: 11px;
  line-height: 1.1;
  text-align: center;
  white-space: normal;
}

.russia-issue-dialog {
  width: min(720px, calc(100% - 28px));
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: var(--surface-card);
  color: var(--text-primary);
  box-shadow: var(--shadow-lg);
}

.russia-issue-dialog::backdrop {
  background: var(--surface-overlay);
}

.russia-issue-modal {
  display: grid;
  gap: 14px;
}

.russia-issue-modal__header,
.russia-issue-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.russia-issue-modal__header h2 {
  margin: 0;
  font-size: 28px;
}

.parcel-icon-button.russia-issue-close-button {
  border: 1px solid var(--border-accent);
  background: color-mix(in srgb, var(--accent) 12%, var(--surface-card-soft));
  color: var(--accent);
  font-weight: 900;
}

.parcel-icon-button.russia-issue-close-button:hover {
  background: var(--surface-control-hover);
}

.russia-issue-cancel-button,
.russia-issue-actions [data-russia-issue-submit] {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  border-radius: 8px;
  font: inherit;
  font-weight: 900;
  cursor: pointer;
}

.russia-issue-passport[hidden],
.russia-issue-resident[hidden],
.russia-issue-actions button[hidden] {
  display: none;
}

.russia-issue-cancel-button {
  min-width: 112px;
  border: 1px solid var(--border-accent);
  background: color-mix(in srgb, var(--accent) 10%, var(--surface-card-soft));
  color: var(--accent);
}

.russia-issue-cancel-button:hover {
  background: var(--surface-control-hover);
}

.russia-issue-actions [data-russia-issue-submit] {
  min-width: 118px;
  border: 1px solid var(--border-accent);
  background: var(--control-primary-bg);
  color: var(--control-primary-text);
}

.russia-issue-actions [data-russia-issue-submit]:disabled {
  opacity: 0.56;
  cursor: not-allowed;
}

.russia-issue-warning {
  display: grid;
  gap: 9px;
  padding: 12px;
  border: 1px solid var(--status-danger-border);
  border-radius: 8px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--status-danger) 12%, transparent), transparent 74%),
    var(--surface-card-raised);
  color: var(--status-danger);
  font-weight: 900;
}

.russia-issue-grid,
.russia-issue-resident {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.russia-issue-grid section,
.russia-issue-resident label,
.russia-issue-passport,
.russia-issue-locations,
.russia-issue-parcel {
  padding: 12px;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: var(--surface-card-soft);
}

.russia-issue-grid span,
.russia-issue-passport label span {
  display: block;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.russia-issue-grid strong {
  display: block;
  margin-top: 5px;
  color: var(--text-primary);
}

.russia-issue-parcels {
  display: grid;
  gap: 8px;
}

.russia-issue-parcel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.russia-issue-parcel span {
  color: var(--accent);
  font-weight: 900;
}

.russia-issue-parcel small {
  display: block;
  margin-top: 3px;
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 900;
}

.russia-group-issue-recipient {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: var(--surface-card-soft);
}

.russia-group-issue-recipient.is-blocked {
  border-color: var(--status-warning-border);
  background: var(--status-warning-bg);
}

.russia-group-issue-recipient.is-taxable {
  border-color: var(--status-danger-border);
  background: var(--status-danger-bg);
}

.russia-group-issue-recipient.is-unknown {
  border-color: var(--status-warning-border);
  background: var(--status-warning-bg);
}

.russia-group-issue-recipient.is-blocked,
.russia-group-issue-recipient.is-blocked.is-taxable,
.russia-group-issue-recipient.is-blocked.is-unknown {
  border-color: var(--status-danger-border);
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--status-danger) 11%, transparent), transparent 72%),
    var(--surface-card-soft);
  color: var(--text-primary);
}

.russia-group-issue-recipient header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.russia-group-issue-fields {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(170px, 0.42fr) minmax(170px, 0.42fr);
  gap: 10px;
  align-items: start;
}

.russia-group-issue-recipient header strong,
.russia-group-issue-recipient header small {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
}

.russia-group-issue-recipient header span {
  padding: 5px 9px;
  border: 1px solid var(--border-accent);
  border-radius: 999px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.russia-group-issue-fields label,
.russia-group-issue-radios {
  display: grid;
  gap: 6px;
}

.russia-group-issue-fields label span,
.russia-group-issue-radios > span {
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.russia-group-issue-fields input[type="text"] {
  min-height: 40px;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: var(--surface-control);
  color: var(--text-primary);
  padding: 0 10px;
  font: inherit;
  font-weight: 850;
}

.russia-group-issue-fields small {
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 900;
}

.russia-group-issue-fields small[data-tone="error"] {
  color: var(--status-danger);
}

.russia-group-issue-fields small[data-tone="ok"] {
  color: var(--status-success);
}

.russia-group-issue-radios label {
  min-height: 34px;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 0 9px;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: var(--surface-control);
  color: var(--text-primary);
  font-size: 12px;
  font-weight: 850;
}

.russia-group-issue-radios label:has(input:disabled) {
  opacity: 0.55;
}

.russia-group-issue-note {
  margin: 0;
  color: var(--status-danger);
  font-size: 12px;
  font-weight: 900;
}

.russia-group-issue-warning-inline {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 0;
  padding: 9px 11px;
  border: 1px solid var(--status-danger-border);
  border-radius: 8px;
  background: color-mix(in srgb, var(--status-danger) 9%, var(--surface-control));
  color: var(--status-danger);
  font-size: 12px;
  font-weight: 900;
  line-height: 1.4;
}

.russia-group-issue-warning-inline::before {
  content: "!";
  display: grid;
  place-items: center;
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--status-danger);
  color: var(--text-inverse);
  font-size: 11px;
}

.russia-group-issue-trackings {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.russia-group-issue-trackings span {
  padding: 5px 8px;
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  background: var(--surface-control);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 850;
}

.russia-group-issue-trackings span.is-taxable {
  border-color: var(--status-danger-border);
  background: var(--status-danger-bg);
  color: var(--status-danger);
}

.russia-group-issue-trackings span.is-unknown {
  border-color: var(--status-warning-border);
  background: var(--status-warning-bg);
  color: var(--status-warning);
}

.russia-issue-passport {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: end;
}

.russia-issue-passport label {
  display: grid;
  gap: 7px;
}

.russia-issue-passport input {
  width: 100%;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: var(--surface-control);
  color: var(--text-primary);
  font-weight: 900;
}

.russia-issue-passport > strong {
  min-width: 112px;
  color: var(--text-secondary);
  font-size: 13px;
  text-align: right;
}

.russia-issue-passport > strong[data-tone="error"] {
  color: var(--status-danger);
}

.russia-issue-passport > strong[data-tone="ok"] {
  color: var(--status-success);
}

.russia-issue-resident label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 900;
}

.russia-issue-locations {
  display: grid;
  gap: 8px;
}

.russia-issue-locations > strong {
  color: var(--text-primary);
}

.russia-issue-board-link {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  justify-content: center;
  padding: 9px 12px;
  border-radius: 8px;
  color: var(--control-primary-text);
  background: var(--control-primary-bg);
  font-weight: 800;
  text-decoration: none;
}

.russia-issue-location {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 10px;
  padding: 10px;
  border: 1px solid var(--status-success-border);
  border-radius: 8px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--status-success) 12%, transparent), transparent 72%),
    var(--surface-card-raised);
  color: var(--text-primary);
}

.russia-issue-location.is-missing {
  border-color: var(--status-warning-border);
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--status-warning) 12%, transparent), transparent 72%),
    var(--surface-card-raised);
}

.russia-issue-location span {
  color: var(--text-primary);
  font-weight: 900;
}

.russia-issue-location b {
  color: var(--accent);
}

.russia-issue-location small {
  grid-column: 1 / -1;
  color: var(--text-secondary);
  font-weight: 800;
}

.russia-list-card__destination::after {
  content: "";
  position: absolute;
  right: -28px;
  bottom: -34px;
  width: 88px;
  height: 88px;
  border: 1px solid color-mix(in srgb, var(--gold) 12%, transparent);
  border-radius: 50%;
}

.russia-list-card__number,
.russia-list-card__date {
  position: absolute;
  z-index: 1;
  left: 11px;
  max-width: calc(100% - 22px);
}

.russia-list-card__number {
  top: 10px;
  color: var(--gold);
  font-size: 22px;
  font-weight: 900;
  line-height: 1;
  white-space: nowrap;
}

.russia-list-card__date {
  bottom: 9px;
  color: var(--text-secondary);
  font-size: 10px;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
}

.russia-list-card__city {
  width: 118px;
  min-width: 0;
  overflow: hidden;
  color: var(--gold);
  font-size: 15px;
  font-weight: 900;
  line-height: 1.15;
  text-align: center;
  text-overflow: clip;
  white-space: nowrap;
}

.russia-list-card__main {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(260px, 1.25fr) minmax(260px, 1fr) minmax(138px, 0.42fr);
  grid-template-areas:
    "person person payment"
    "description logistics summary"
    "weights weights summary";
  gap: 9px 11px;
  align-items: stretch;
}

.russia-list-card__person {
  grid-area: person;
  min-width: 0;
  align-self: center;
}

.russia-list-card__person > strong {
  display: block;
  overflow: hidden;
  color: var(--text-primary);
  font-size: 18px;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.russia-list-card__person-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  margin-top: 5px;
}

.russia-list-card__person-meta span,
.russia-list-card__meta,
.russia-group-card small {
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 750;
}

.russia-list-card__badges {
  grid-area: payment;
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  min-width: 0;
}

.russia-list-card__description {
  grid-area: description;
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 5px;
  padding: 9px 11px;
  border-left: 3px solid color-mix(in srgb, var(--accent) 50%, transparent);
  border-radius: 0 8px 8px 0;
  background: var(--surface-card-soft);
}

.russia-list-card__description small,
.russia-list-card__logistics small,
.russia-list-card__summary > small {
  color: color-mix(in srgb, var(--text-secondary) 78%, transparent);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.055em;
  line-height: 1;
  text-transform: uppercase;
}

.russia-list-card__description p {
  display: -webkit-box;
  margin: 0;
  overflow: hidden;
  color: var(--text-primary);
  font-size: 13px;
  line-height: 1.35;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.russia-list-card__logistics {
  grid-area: logistics;
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px 10px;
  align-content: start;
  padding: 9px 10px;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: var(--surface-card-soft);
}

.russia-list-card__logistics-item {
  min-width: 0;
}

.russia-list-card__logistics-item--wide {
  grid-column: 1 / -1;
}

.russia-list-card__logistics span {
  display: block;
  margin-top: 4px;
  overflow: hidden;
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.russia-list-card__weights {
  grid-area: weights;
  min-width: 0;
  display: grid;
  gap: 7px;
  padding: 9px 10px;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface-card-soft) 82%, var(--surface-card));
}

.russia-list-card__weights-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

.russia-list-card__weights-head span,
.russia-list-card__weights-head small {
  color: color-mix(in srgb, var(--text-secondary) 78%, transparent);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.055em;
  line-height: 1;
  text-transform: uppercase;
}

.russia-list-card__weights-head small {
  overflow: hidden;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.russia-list-card__weights-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-height: 72px;
  overflow: auto;
  padding-right: 2px;
}

.russia-list-card__weights.has-many .russia-list-card__weights-list {
  max-height: 88px;
}

.russia-list-card__weight-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 28px;
  padding: 0 9px;
  border: 1px solid var(--border-accent);
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 10%, var(--surface-card));
  color: var(--text-primary);
  font-size: 12px;
  font-weight: 850;
  white-space: nowrap;
}

.russia-list-card__weight-chip b {
  color: var(--accent);
  font-size: 11px;
}

.russia-list-card__summary {
  grid-area: summary;
  min-width: 0;
  display: grid;
  align-content: stretch;
  gap: 7px;
}

.russia-weight-badge {
  min-height: 54px;
  display: grid;
  align-content: center;
  gap: 4px;
  padding: 8px 10px;
  border: 1px solid var(--border-accent);
  border-radius: 8px;
  background: color-mix(in srgb, var(--accent) 10%, var(--surface-card));
}

.russia-weight-badge strong,
.russia-weight-badge span {
  display: block;
}

.russia-weight-badge strong {
  color: var(--accent);
  font-size: 17px;
  line-height: 1;
  white-space: nowrap;
}

.russia-weight-badge span {
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 800;
}

.russia-list-card__group-state {
  min-height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 0 8px;
  border: 1px solid var(--border-subtle);
  border-radius: 7px;
  background: var(--surface-control);
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 800;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.russia-group-card {
  border: 1px solid color-mix(in srgb, var(--gold) 22%, transparent);
  border-radius: 8px;
  background:
    linear-gradient(145deg, color-mix(in srgb, var(--gold) 10%, transparent), transparent),
    var(--surface-card-soft);
  overflow: hidden;
}

.russia-group-card__summary {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) minmax(180px, 0.7fr) minmax(210px, 0.55fr) 120px;
  gap: 14px;
  align-items: center;
  padding: 14px;
}

.russia-group-card__summary strong,
.russia-group-card__summary small {
  display: block;
}

.russia-group-card__summary strong {
  margin-top: 4px;
  color: var(--text-primary);
  font-size: 18px;
}

.group-label {
  display: inline-flex;
  min-height: 26px;
  align-items: center;
  padding: 0 8px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--gold) 14%, var(--surface-card));
  color: var(--gold);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.russia-group-card__numbers {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.russia-group-card__numbers span {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--surface-control);
  color: var(--text-primary);
  font-size: 12px;
  font-weight: 900;
}

.russia-group-card__payment {
  display: grid;
  gap: 7px;
}

.russia-group-card__actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.russia-group-card__details {
  display: grid;
  gap: 8px;
  padding: 0 14px 14px;
  border-top: 1px solid var(--border-subtle);
}

.russia-group-card__details[hidden] {
  display: none;
}

.russia-group-card__details::before {
  content: "Состав группы";
  margin-top: 12px;
  color: var(--gold);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.settings-page {
  width: min(1280px, 100%);
  align-self: start;
  display: grid;
  gap: 16px;
  color: var(--text-primary);
}

.documents-page {
  width: min(1180px, 100%);
  align-self: start;
  display: grid;
  gap: 14px;
  color: var(--text-primary);
}

.documents-hero,
.documents-upload,
.documents-list-panel {
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background:
    linear-gradient(160deg, color-mix(in srgb, var(--surface-card) 82%, transparent), transparent),
    var(--surface-card);
  box-shadow: var(--shadow-sm);
}

.documents-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 22px;
}

.documents-hero h1,
.documents-upload h2,
.documents-list-panel h2 {
  margin: 0;
  letter-spacing: 0;
}

.documents-hero h1 {
  font-size: clamp(34px, 5vw, 54px);
  line-height: 1;
}

.documents-hero__counter {
  min-width: 130px;
  padding: 12px 14px;
  border: 1px solid var(--border-accent);
  border-radius: 8px;
  background: color-mix(in srgb, var(--accent) 10%, var(--surface-card-soft));
  text-align: right;
}

.documents-hero__counter span,
.documents-hero__counter strong {
  display: block;
}

.documents-hero__counter span {
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.documents-hero__counter strong {
  margin-top: 4px;
  color: var(--text-primary);
  font-size: 28px;
}

.documents-upload,
.documents-list-panel {
  display: grid;
  gap: 14px;
  padding: 16px;
}

.documents-upload__form {
  display: grid;
  grid-template-columns: minmax(0, 0.7fr) minmax(220px, 0.45fr) auto;
  gap: 10px;
  align-items: end;
}

.documents-upload__wide {
  grid-column: 1 / 3;
}

.documents-upload label,
.documents-search {
  display: grid;
  gap: 7px;
}

.documents-upload label > span {
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.documents-upload input:not([type="file"]),
.documents-upload textarea,
.documents-search input {
  width: 100%;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: var(--surface-control);
  color: var(--text-primary);
  font: inherit;
  font-weight: 800;
  outline: none;
}

.documents-upload input:not([type="file"]),
.documents-search input {
  min-height: 46px;
  padding: 0 12px;
}

.documents-upload textarea {
  min-height: 82px;
  padding: 10px 12px;
  resize: vertical;
}

.documents-upload input:not([type="file"]):focus,
.documents-upload textarea:focus,
.documents-search input:focus {
  border-color: var(--border-accent);
  box-shadow: 0 0 0 3px var(--accent-ring);
}

.documents-file-picker {
  min-height: 46px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 6px;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: var(--surface-control);
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 850;
  text-transform: none;
  cursor: pointer;
}

.documents-file-picker input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.documents-file-picker__button {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  border-radius: 8px;
  background: var(--control-primary-bg);
  color: var(--control-primary-text);
  font-weight: 900;
  text-transform: none;
}

.documents-file-picker__name {
  min-width: 0;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 850;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-transform: none;
}

.documents-upload button,
.documents-search button,
.document-card a {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  border-radius: 8px;
  background: var(--control-primary-bg);
  color: var(--control-primary-text);
  font-weight: 900;
  text-decoration: none;
}

.documents-upload > small {
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 800;
}

.documents-list-panel__top {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 14px;
}

.documents-search {
  grid-template-columns: minmax(260px, 1fr) auto;
}

.documents-list {
  display: grid;
  gap: 10px;
}

.document-card {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: var(--surface-card-soft);
}

.document-card__type {
  min-height: 48px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border-accent);
  border-radius: 8px;
  background: color-mix(in srgb, var(--accent) 12%, var(--surface-card));
  color: var(--accent);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.document-card__body {
  min-width: 0;
}

.document-card__body strong,
.document-card__body span,
.document-card__body small {
  display: block;
}

.document-card__body strong {
  color: var(--text-primary);
  font-size: 16px;
  overflow-wrap: anywhere;
}

.document-card__body span,
.document-card__body small,
.document-card__body p,
.documents-empty {
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 800;
}

.document-card__body p {
  margin: 6px 0;
  line-height: 1.45;
}

.documents-empty {
  padding: 18px;
  border: 1px dashed var(--border-subtle);
  border-radius: 8px;
  text-align: center;
}

.audit-page {
  width: min(1240px, 100%);
  margin: 0 auto;
  display: grid;
  gap: 14px;
}

.audit-hero,
.audit-filters,
.audit-entry,
.audit-empty {
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background:
    linear-gradient(145deg, color-mix(in srgb, var(--accent) 7%, transparent), transparent 70%),
    var(--surface-card);
  box-shadow: var(--shadow-sm);
}

.audit-hero {
  min-height: 116px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 22px;
}

.audit-hero h1 {
  margin: 0;
  color: var(--text-primary);
  font-size: clamp(38px, 5vw, 58px);
  line-height: 0.95;
  letter-spacing: 0;
}

.audit-hero__counter {
  min-width: 126px;
  min-height: 68px;
  display: grid;
  place-items: center;
  padding: 10px 14px;
  border: 1px solid var(--border-accent);
  border-radius: 8px;
  background: var(--surface-control);
}

.audit-hero__counter span,
.audit-hero__counter strong {
  display: block;
  text-align: center;
}

.audit-hero__counter span {
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.audit-hero__counter strong {
  color: var(--text-primary);
  font-size: 30px;
  line-height: 1;
}

.audit-hero__counter strong span {
  display: inline;
  color: inherit;
  font-size: inherit;
  font-weight: inherit;
  text-transform: none;
}

.audit-filters {
  padding: 14px;
}

.audit-filters form {
  display: grid;
  grid-template-columns: minmax(180px, 0.75fr) minmax(160px, 0.6fr) minmax(220px, 1fr) auto auto;
  gap: 10px;
  align-items: end;
}

.audit-filters label {
  display: grid;
  gap: 7px;
}

.audit-filters span {
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.audit-filters input,
.audit-filters select {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: var(--surface-control);
  color: var(--text-primary);
  font: inherit;
  font-weight: 800;
  padding: 0 12px;
  outline: none;
  color-scheme: inherit;
}

.audit-filters select option {
  background: var(--surface-card);
  color: var(--text-primary);
  font-weight: 800;
}

.audit-filters select option:checked {
  background: var(--accent);
  color: var(--accent-contrast);
}

.audit-filters input:hover,
.audit-filters select:hover {
  border-color: var(--border-accent);
  background: var(--surface-control-hover);
}

.audit-filters input:focus,
.audit-filters select:focus {
  border-color: var(--border-accent);
  box-shadow: 0 0 0 3px var(--accent-ring);
}

.audit-filters button,
.audit-filters a {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  border-radius: 8px;
  font-weight: 900;
  text-decoration: none;
}

.audit-filters button {
  border: 1px solid var(--border-accent);
  background: var(--control-primary-bg);
  color: var(--control-primary-text);
}

.audit-filters a {
  border: 1px solid var(--border-subtle);
  background: var(--surface-control);
  color: var(--text-secondary);
}

.audit-list {
  display: grid;
  gap: 10px;
}

.audit-entry {
  display: grid;
  grid-template-columns: 118px minmax(0, 1fr);
  overflow: hidden;
}

.audit-entry__time {
  display: grid;
  align-content: center;
  gap: 6px;
  padding: 14px;
  border-right: 1px solid var(--border-subtle);
  background: color-mix(in srgb, var(--accent) 8%, transparent);
}

.audit-entry__time strong,
.audit-entry__time span {
  display: block;
}

.audit-entry__time strong {
  color: var(--text-primary);
  font-size: 13px;
}

.audit-entry__time span {
  color: var(--accent);
  font-size: 18px;
  font-weight: 950;
}

.audit-entry__body {
  min-width: 0;
  display: grid;
  gap: 10px;
  padding: 14px;
}

.audit-entry__top {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.audit-entry__top strong {
  color: var(--text-primary);
  font-size: 16px;
}

.audit-entry__top span {
  flex: 0 0 auto;
  padding: 5px 9px;
  border: 1px solid var(--border-accent);
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 12px;
  font-weight: 900;
}

.audit-entry__meta,
.audit-entry__details {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.audit-entry__meta span,
.audit-entry__details div {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 9px;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: var(--surface-control);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 850;
}

.audit-entry__meta b,
.audit-entry__details dd {
  color: var(--text-primary);
  font-weight: 900;
}

.audit-entry__details {
  margin: 0;
}

.audit-entry__details dt,
.audit-entry__details dd {
  margin: 0;
}

.audit-entry__details dt {
  color: var(--text-secondary);
}

.audit-entry small {
  color: var(--text-secondary);
  font-size: 11px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.audit-empty {
  min-height: 120px;
  display: grid;
  place-items: center;
  color: var(--text-secondary);
  font-weight: 850;
}

.audit-load-more {
  display: flex;
  justify-content: center;
  padding: 4px 0 12px;
}

.audit-load-more[hidden] {
  display: none;
}

.audit-load-more button {
  min-width: 190px;
  min-height: 46px;
  border: 1px solid var(--border-accent);
  border-radius: 8px;
  background: var(--surface-control);
  color: var(--text-primary);
  font-weight: 900;
}

.audit-load-more button:hover {
  background: var(--surface-control-hover);
}

.audit-load-more button:disabled {
  cursor: wait;
  opacity: 0.62;
}

.settings-hero,
.settings-panel {
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background:
    linear-gradient(160deg, color-mix(in srgb, var(--surface-card) 82%, transparent), transparent),
    var(--surface-card);
  box-shadow: var(--shadow-sm);
}

.settings-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 22px;
}

.settings-hero h1,
.settings-panel__header h2 {
  margin: 0;
  letter-spacing: 0;
}

.settings-hero h1 {
  font-size: clamp(34px, 5vw, 58px);
  line-height: 1;
}

.settings-current {
  min-width: 220px;
  padding: 14px 16px;
  border: 1px solid color-mix(in srgb, var(--gold) 42%, transparent);
  border-radius: 8px;
  background: color-mix(in srgb, var(--gold) 10%, transparent);
  text-align: right;
}

.settings-current span,
.settings-current strong {
  display: block;
}

.settings-current span {
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 800;
}

.settings-current strong {
  margin-top: 6px;
  color: var(--text-primary);
  font-size: 15px;
}

.settings-form {
  display: grid;
  gap: 12px;
}

.settings-panel {
  display: grid;
  gap: 12px;
  padding: 16px;
}

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

.theme-option,
.accent-option {
  position: relative;
  display: grid;
  gap: 6px;
  min-width: 0;
  padding: 9px;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: var(--surface-card-soft);
  cursor: pointer;
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.theme-option:hover,
.accent-option:hover {
  border-color: color-mix(in srgb, var(--accent) 48%, transparent);
  transform: translateY(-1px);
}

.theme-option input,
.accent-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.theme-option:has(input:checked),
.accent-option:has(input:checked) {
  border-color: color-mix(in srgb, var(--accent) 62%, transparent);
  background: color-mix(in srgb, var(--accent) 12%, var(--surface-card-soft));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 32%, transparent), 0 0 0 4px var(--accent-ring);
}

.theme-option__preview {
  height: 66px;
  display: grid;
  grid-template-columns: 0.46fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 6px;
  padding: 7px;
  border-radius: 7px;
  overflow: hidden;
}

.theme-option__preview i,
.theme-option__preview b,
.theme-option__preview em {
  border-radius: 5px;
}

.theme-option__preview i {
  grid-row: 1 / -1;
}

.theme-option strong,
.accent-option strong {
  color: var(--text-primary);
}

.theme-option small {
  color: var(--text-secondary);
  font-size: 11px;
}

.theme-option strong {
  font-size: 13px;
}

.theme-preview--aurora .theme-option__preview {
  background: linear-gradient(135deg, #07121b, #102331);
}

.theme-preview--aurora i { background: #0f2d35; }
.theme-preview--aurora b { background: #18a891; }
.theme-preview--aurora em { background: #d7a84e; }

.theme-preview--midnight .theme-option__preview {
  background: linear-gradient(135deg, #070b16, #171d33);
}

.theme-preview--midnight i { background: #202845; }
.theme-preview--midnight b { background: #3378d4; }
.theme-preview--midnight em { background: #c9b26a; }

.theme-preview--graphite .theme-option__preview {
  background: linear-gradient(135deg, #121311, #2a2924);
}

.theme-preview--graphite i { background: #34342e; }
.theme-preview--graphite b { background: #c78b28; }
.theme-preview--graphite em { background: #e0b85f; }

.theme-preview--copper .theme-option__preview {
  background: linear-gradient(135deg, #130c12, #321a25);
}

.theme-preview--copper i { background: #38212b; }
.theme-preview--copper b { background: #df6f54; }
.theme-preview--copper em { background: #d7964a; }

.theme-preview--alpine .theme-option__preview {
  background: linear-gradient(135deg, #eef5f7, #ffffff);
}

.theme-preview--alpine i { background: #d7e8ee; }
.theme-preview--alpine b { background: #3378d4; }
.theme-preview--alpine em { background: #b88a2f; }

.theme-preview--porcelain .theme-option__preview {
  background: linear-gradient(135deg, #f7f8f3, #ffffff);
}

.theme-preview--porcelain i { background: #e0ebe3; }
.theme-preview--porcelain b { background: #2f9d68; }
.theme-preview--porcelain em { background: #bd9143; }

.theme-preview--sunrise .theme-option__preview {
  background: linear-gradient(135deg, #f8f1ea, #fffaf4);
}

.theme-preview--sunrise i { background: #ead8c7; }
.theme-preview--sunrise b { background: #c75d77; }
.theme-preview--sunrise em { background: #c68c38; }

.theme-preview--studio .theme-option__preview {
  background: linear-gradient(135deg, #eef0fb, #ffffff);
}

.theme-preview--studio i { background: #d8ddf0; }
.theme-preview--studio b { background: #625bc0; }
.theme-preview--studio em { background: #7aa62f; }

.theme-preview--nebula .theme-option__preview {
  background:
    radial-gradient(circle at 75% 20%, #a340b8 0, transparent 40%),
    linear-gradient(135deg, #080516, #24124d);
}

.settings-workspace {
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.settings-section-nav {
  position: sticky;
  top: 16px;
  display: grid;
  gap: 7px;
  padding: 10px;
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  background:
    linear-gradient(160deg, color-mix(in srgb, var(--accent) 7%, transparent), transparent 58%),
    var(--surface-card);
  box-shadow: var(--shadow-sm);
}

.settings-section-nav button {
  min-width: 0;
  min-height: 62px;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  grid-template-areas: "icon title" "icon copy";
  align-items: center;
  gap: 1px 10px;
  padding: 9px 10px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--text-secondary);
  text-align: left;
  box-shadow: none;
}

.settings-section-nav button > span {
  grid-area: icon;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: var(--surface-control);
  color: var(--text-secondary);
  font-size: 17px;
}

.settings-section-nav button strong {
  grid-area: title;
  overflow: hidden;
  color: var(--text-primary);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.settings-section-nav button small {
  grid-area: copy;
  overflow: hidden;
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.settings-section-nav button:hover,
.settings-section-nav button.is-active {
  border-color: color-mix(in srgb, var(--accent) 42%, transparent);
  background: color-mix(in srgb, var(--accent) 11%, var(--surface-card-soft));
  transform: none;
}

.settings-section-nav button.is-active > span {
  border-color: color-mix(in srgb, var(--accent) 58%, transparent);
  background: var(--control-primary-bg);
  color: var(--control-primary-text);
  box-shadow: 0 0 0 3px var(--accent-ring);
}

.settings-section-content,
.settings-section {
  min-width: 0;
}

.settings-section {
  display: grid;
  gap: 12px;
  animation: settings-section-in 180ms ease-out;
}

.settings-section[hidden] {
  display: none !important;
}

.settings-section-heading {
  padding: 3px 3px 1px;
}

.settings-section-heading h2 {
  margin: 2px 0 0;
  color: var(--text-primary);
  font-size: clamp(23px, 3vw, 32px);
}

.settings-session-exit {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  border-color: color-mix(in srgb, var(--status-danger) 30%, var(--border-subtle));
}

.settings-session-exit h2 {
  margin: 2px 0 4px;
}

.settings-session-exit small {
  color: var(--text-secondary);
}

.settings-session-exit button {
  min-height: 44px;
  border: 1px solid color-mix(in srgb, var(--status-danger) 48%, transparent);
  background: color-mix(in srgb, var(--status-danger) 14%, var(--surface-card));
  color: var(--status-danger);
}

.settings-page form[aria-busy="true"] {
  opacity: 0.68;
  pointer-events: none;
}

@keyframes settings-section-in {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 900px) {
  .settings-workspace {
    grid-template-columns: minmax(0, 1fr);
  }

  .settings-section-nav {
    position: sticky;
    top: 0;
    z-index: 12;
    grid-auto-flow: column;
    grid-auto-columns: minmax(155px, 1fr);
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    scrollbar-width: thin;
  }

  .settings-section-nav button {
    min-height: 54px;
  }
}

@media (max-width: 640px) {
  .settings-section-nav {
    margin-inline: -4px;
    grid-auto-columns: 145px;
    padding: 7px;
  }

  .settings-section-nav button {
    grid-template-columns: 30px minmax(0, 1fr);
    min-height: 48px;
    padding: 7px;
  }

  .settings-section-nav button > span {
    width: 30px;
    height: 30px;
  }

  .settings-section-nav button small {
    display: none;
  }

  .settings-session-exit {
    grid-template-columns: minmax(0, 1fr);
  }

  .settings-session-exit button {
    width: 100%;
  }
}

.theme-preview--nebula i { background: rgba(59, 35, 101, 0.92); }
.theme-preview--nebula b { background: linear-gradient(135deg, #f23ca6, #7b49ff); }
.theme-preview--nebula em { background: #30cfff; }

.theme-preview--kyoto .theme-option__preview {
  background:
    linear-gradient(90deg, rgba(89, 57, 38, 0.06) 1px, transparent 1px),
    linear-gradient(135deg, #eee5d5, #fffaf0);
  background-size: 8px 8px, auto;
}

.theme-preview--kyoto i { background: #dbc9ad; }
.theme-preview--kyoto b { background: #a32d2b; }
.theme-preview--kyoto em { background: #211b18; }

.accent-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(82px, 1fr));
  gap: 8px;
}

.accent-option {
  justify-items: center;
  text-align: center;
}

.accent-option span {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  box-shadow: inset 0 0 0 5px rgba(255, 255, 255, 0.18);
}

.accent-option strong {
  font-size: 13px;
}

.accent-preview--teal span { background: #18a891; }
.accent-preview--emerald span { background: #2f9d68; }
.accent-preview--sapphire span { background: #3378d4; }
.accent-preview--amber span { background: #c78b28; }
.accent-preview--rose span { background: #c75d77; }
.accent-preview--violet span { background: #7b68d8; }
.accent-preview--coral span { background: #df6f54; }
.accent-preview--lime span { background: #7aa62f; }
.accent-preview--volt span { background: linear-gradient(135deg, #e4ff62, #86b900); }
.accent-preview--plasma span { background: linear-gradient(135deg, #ff3da6, #8a4dff 58%, #30cfff); }

.settings-toggle {
  min-height: 82px;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: var(--surface-card-soft);
  cursor: pointer;
}

.settings-toggle input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.settings-toggle__control {
  width: 58px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  padding: 4px;
  border: 1px solid color-mix(in srgb, var(--accent) 28%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, var(--muted) 18%, var(--panel));
  transition: background 0.2s ease, border-color 0.2s ease;
}

.settings-toggle__control::before {
  content: "";
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--panel);
  box-shadow: var(--shadow-sm);
  transform: translateX(0);
  transition: transform 0.22s cubic-bezier(0.22, 1, 0.36, 1), background 0.2s ease;
}

.settings-toggle input:checked + .settings-toggle__control {
  border-color: color-mix(in srgb, var(--accent) 62%, transparent);
  background: var(--control-primary-bg);
}

.settings-toggle input:checked + .settings-toggle__control::before {
  background: var(--accent-contrast);
  transform: translateX(26px);
}

.settings-toggle strong,
.settings-toggle small {
  display: block;
}

.settings-toggle strong {
  color: var(--text-primary);
}

.settings-toggle small {
  margin-top: 4px;
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.45;
}

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

.settings-actions {
  display: flex;
  justify-content: flex-end;
}

.settings-actions button {
  min-height: 48px;
  border-radius: 8px;
  background: var(--control-primary-bg);
  color: var(--control-primary-text);
  font-weight: 900;
}

.booking-settings-form {
  display: grid;
  gap: 14px;
}

.settings-panel--rs-upload {
  gap: 14px;
}

.rs-upload-status {
  min-width: 172px;
  padding: 10px 12px;
  border: 1px solid color-mix(in srgb, var(--accent) 42%, transparent);
  border-radius: 8px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--accent) 14%, transparent), transparent 72%),
    var(--surface-card-soft);
  text-align: right;
}

.rs-upload-status span,
.rs-upload-status strong,
.rs-upload-status small {
  display: block;
}

.rs-upload-status span {
  color: var(--accent);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.rs-upload-status strong {
  margin-top: 4px;
  color: var(--text-primary);
  font-size: 17px;
}

.rs-upload-status small {
  margin-top: 3px;
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 800;
}

.rs-upload-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(150px, auto);
  gap: 10px;
  align-items: stretch;
  padding: 12px;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface-card-soft) 82%, transparent);
}

.rs-upload-field {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-width: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.rs-upload-field strong,
.rs-upload-field small {
  display: block;
}

.rs-upload-field strong {
  color: var(--text-primary);
}

.rs-upload-field small {
  margin-top: 4px;
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.4;
}

.rs-upload-picker {
  min-width: min(420px, 52%);
  min-height: 48px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 6px;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: var(--surface-control);
  color: var(--text-primary);
  cursor: pointer;
}

.rs-upload-picker input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.rs-upload-picker__button {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  border-radius: 7px;
  border: 1px solid var(--border-accent);
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--accent) 22%, transparent), transparent 78%),
    color-mix(in srgb, var(--accent) 14%, var(--surface-card));
  color: var(--accent);
  font-size: 13px;
  font-weight: 900;
}

.rs-upload-picker__name {
  min-width: 0;
  overflow: hidden;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rs-upload-form button {
  min-height: 52px;
  padding-inline: 18px;
  border-radius: 8px;
  font-weight: 900;
}

.settings-panel__header--compact h2 {
  font-size: 20px;
}

.booking-rule-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
  gap: 14px;
  margin-top: 16px;
}

.booking-rule-form,
.booking-rule-list {
  display: grid;
  align-content: start;
  gap: 14px;
  padding: 14px;
  border: 1px solid color-mix(in srgb, var(--border-subtle) 78%, var(--accent));
  border-radius: 8px;
  background:
    linear-gradient(145deg, color-mix(in srgb, var(--accent) 7%, transparent), transparent 54%),
    var(--surface-card-soft);
}

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

.booking-rule-grid label {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.booking-rule-grid span {
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 900;
}

.booking-rule-grid input,
.booking-rule-grid select {
  width: 100%;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: var(--surface-control);
  color: var(--text-primary);
  font: inherit;
  font-weight: 800;
  outline: none;
  box-shadow: inset 0 1px 0 color-mix(in srgb, var(--text-inverse) 8%, transparent);
  transition: border-color 0.16s ease, background 0.16s ease, box-shadow 0.16s ease;
}

.booking-rule-grid input::placeholder {
  color: var(--text-muted);
}

.booking-rule-grid select {
  cursor: pointer;
}

.booking-rule-grid select option {
  background: var(--surface-card);
  color: var(--text-primary);
}

.booking-rule-grid input:hover,
.booking-rule-grid select:hover {
  border-color: color-mix(in srgb, var(--accent) 38%, var(--border-subtle));
  background: var(--surface-control-hover);
}

.booking-rule-grid input:focus,
.booking-rule-grid select:focus {
  border-color: var(--border-accent);
  background: var(--surface-control-hover);
  box-shadow: 0 0 0 3px var(--accent-ring);
}

.booking-rule-grid__wide {
  grid-column: 1 / -1;
}

.booking-rule-submit {
  min-height: 46px;
  justify-self: end;
  padding: 0 18px;
  border-radius: 8px;
  background: var(--control-primary-bg);
  color: var(--control-primary-text);
  font-weight: 900;
}

.booking-rule-items {
  display: grid;
  gap: 10px;
}

.booking-rule-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 72px;
  padding: 12px;
  border: 1px solid var(--border-subtle);
  border-left: 3px solid var(--accent);
  border-radius: 8px;
  background: var(--surface-card);
}

.booking-rule-item.is-closed {
  border-left-color: #c75d77;
}

.booking-rule-item span,
.booking-rule-item small {
  display: block;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 800;
}

.booking-rule-item strong {
  display: block;
  margin-top: 3px;
  color: var(--text-primary);
  font-size: 18px;
  letter-spacing: 0;
}

.booking-rule-item small {
  margin-top: 4px;
  color: var(--text-muted);
  line-height: 1.35;
}

.booking-rule-item__side {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
}

.booking-rule-item__side b {
  min-width: 82px;
  padding: 7px 10px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--accent) 16%, transparent);
  color: var(--accent);
  font-size: 12px;
  text-align: center;
}

.booking-rule-item.is-closed .booking-rule-item__side b {
  background: color-mix(in srgb, #c75d77 18%, transparent);
  color: #f0a5b5;
}

.booking-rule-item__side button {
  width: 34px;
  min-height: 34px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--border-accent);
  border-radius: 8px;
  background: color-mix(in srgb, var(--accent) 12%, var(--surface-card-soft));
  color: var(--accent);
  font-size: 22px;
  font-weight: 900;
  line-height: 1;
}

.booking-rule-item__side button:hover {
  background: var(--surface-control-hover);
  color: var(--accent);
}

.booking-rule-empty {
  min-height: 94px;
  display: grid;
  place-items: center;
  padding: 16px;
  border: 1px dashed var(--border-subtle);
  border-radius: 8px;
  color: var(--text-secondary);
  text-align: center;
}

.parcel-edit-form {
  display: grid;
  gap: 16px;
}

.parcel-edit-form__header,
.parcel-edit-form__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.parcel-edit-form__header h2 {
  margin: 0;
  font-size: 28px;
}

.parcel-icon-button {
  width: 40px;
  min-height: 40px;
  display: grid;
  place-items: center;
  padding: 0;
  border-radius: 8px;
  background: var(--control-secondary-bg);
  color: var(--control-secondary-text);
  font-size: 24px;
}

.parcel-edit-form .parcel-icon-button {
  border: 1px solid var(--border-accent);
  background: color-mix(in srgb, var(--accent) 14%, var(--surface-card-soft));
  color: var(--accent);
  font-weight: 900;
  box-shadow: none;
}

.parcel-edit-form .parcel-icon-button:hover,
.parcel-edit-form .parcel-icon-button:focus-visible {
  background: var(--surface-control-hover);
  color: var(--accent);
  outline: none;
}

.parcel-icon-button.warehouse-issue-close {
  width: 42px;
  min-height: 42px;
  border: 1px solid var(--border-accent);
  background: color-mix(in srgb, var(--accent) 12%, var(--surface-card-soft));
  color: var(--accent);
  font-size: 20px;
  font-weight: 900;
  box-shadow: none;
}

.parcel-icon-button.warehouse-issue-close:hover,
.parcel-icon-button.warehouse-issue-close:focus-visible {
  border-color: var(--border-accent);
  background: var(--surface-control-hover);
  color: var(--accent);
  outline: none;
}

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

.parcel-edit-grid__wide {
  grid-column: 1 / -1;
}

.parcel-edit-photo {
  position: relative;
}

.parcel-edit-photo input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
}

.parcel-edit-photo__control {
  display: grid;
  gap: 4px;
  min-height: 62px;
  padding: 11px 14px;
  border: 1px dashed var(--border-accent);
  border-radius: 8px;
  background: color-mix(in srgb, var(--accent) 8%, var(--surface-control));
  color: var(--text-primary);
  cursor: pointer;
}

.parcel-edit-photo__control strong {
  color: var(--accent);
}

.parcel-edit-photo__control small {
  color: var(--text-secondary);
}

.parcel-edit-photo:focus-within .parcel-edit-photo__control,
.parcel-edit-photo:hover .parcel-edit-photo__control {
  border-style: solid;
  background: var(--surface-control-hover);
}

.parcel-edit-form__footer {
  justify-content: flex-end;
}

.trips-page,
.trip-day-page {
  width: min(1180px, 100%);
  align-self: start;
  display: grid;
  gap: 14px;
}

.trips-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 22px 24px;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--accent) 10%, transparent), transparent 42%),
    var(--surface-card);
  box-shadow: var(--shadow-sm);
}

.trips-hero h1 {
  margin: 0;
  color: var(--text-primary);
  font-size: clamp(36px, 5vw, 56px);
  letter-spacing: 0;
  line-height: 1;
}

.trips-hero__note {
  min-width: 148px;
  padding: 16px;
  border: 1px solid var(--border-accent);
  border-radius: 8px;
  background: color-mix(in srgb, var(--accent) 8%, var(--surface-card-soft));
  color: var(--text-secondary);
  text-align: right;
}

.trips-hero__note span,
.trips-hero__note strong {
  display: block;
}

.trips-hero__note strong {
  margin-top: 4px;
  color: var(--text-primary);
  font-size: 18px;
}

.trip-hero-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.trip-hero-actions form {
  margin: 0;
}

.booking-choice-modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 24px;
  background: color-mix(in srgb, var(--page-bg) 74%, rgba(0, 0, 0, 0.42));
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease;
}

.booking-choice-modal.is-open {
  opacity: 1;
  pointer-events: none;
}

.booking-choice-modal__panel {
  position: relative;
  z-index: 2;
  width: min(640px, 100%);
  display: grid;
  gap: 18px;
  padding: 22px;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: var(--surface-card);
  box-shadow: var(--shadow-lg);
  pointer-events: auto;
  transform: translateY(10px);
  transition: transform 0.2s ease;
}

.booking-choice-modal.is-open .booking-choice-modal__panel {
  transform: translateY(0);
}

.booking-choice-modal__head h2,
.trip-calendar-shell__top h2,
.trips-empty h2 {
  margin: 0;
  color: var(--text-primary);
  letter-spacing: 0;
}

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

.trips-page {
  position: relative;
  isolation: isolate;
}

.trips-page > :not(.trip-route-map) {
  z-index: 1;
}

.booking-choice-layout {
  display: grid;
  grid-template-columns: minmax(280px, 0.74fr) minmax(480px, 1.26fr);
  align-items: stretch;
  gap: 18px;
}

.trip-route-map {
  display: none;
  position: fixed;
  z-index: 0;
  top: 160px;
  right: 18px;
  bottom: 18px;
  width: clamp(330px, 31vw, 500px);
  height: auto;
  min-height: 0;
  margin: 0;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  opacity: 1;
  pointer-events: none;
  mask-image: linear-gradient(to right, transparent, black 22%, black 88%, transparent);
}

@media (min-width: 1100px) {
  .trip-route-map {
    display: block;
    pointer-events: auto;
  }

  .trips-page:has(.trip-calendar-shell:not([hidden])) .trip-route-map > .trip-route-map__canvas {
    opacity: 0.12;
  }

  .trips-page:has(.trip-calendar-shell:not([hidden])) .trip-route-map__lens {
    display: none;
  }
}

.trip-route-map::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.25;
  background-image:
    linear-gradient(color-mix(in srgb, var(--text-secondary) 11%, transparent) 1px, transparent 1px),
    linear-gradient(90deg, color-mix(in srgb, var(--text-secondary) 11%, transparent) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: linear-gradient(to bottom, transparent, black 14%, black 86%, transparent);
  pointer-events: none;
}

.trip-route-map__caption {
  display: none;
  gap: 2px;
  padding: 10px 12px;
  border: 1px solid color-mix(in srgb, var(--border-subtle) 84%, transparent);
  border-radius: 9px;
  background: color-mix(in srgb, var(--surface-card) 84%, transparent);
  backdrop-filter: blur(10px);
}

.trip-route-map__caption span {
  color: var(--accent);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.trip-route-map__caption strong {
  color: var(--text-primary);
  font-size: 17px;
}

.trip-route-map__caption small {
  color: var(--text-secondary);
  font-size: 10px;
  font-weight: 700;
}

.trip-route-map__canvas {
  position: absolute;
  inset: 20px 0;
  width: 100%;
  height: calc(100% - 40px);
  overflow: visible;
  opacity: 0.38;
  transition: opacity 0.2s ease;
}

.trip-route-map__lens {
  --lens-size: 168px;
  position: absolute;
  z-index: 4;
  width: var(--lens-size);
  height: var(--lens-size);
  overflow: hidden;
  border: 2px solid color-mix(in srgb, var(--accent) 72%, white);
  border-radius: 50%;
  background: color-mix(in srgb, var(--surface-card) 90%, transparent);
  box-shadow:
    0 14px 34px color-mix(in srgb, var(--page-bg) 68%, transparent),
    inset 0 0 0 5px color-mix(in srgb, white 10%, transparent);
  opacity: 0;
  pointer-events: none;
  transform: scale(0.82);
  transition: opacity 0.14s ease, transform 0.14s ease;
}

.trip-route-map__lens.is-visible {
  opacity: 1;
  transform: scale(1);
}

.trip-route-map__lens::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 18px 18px 30px color-mix(in srgb, white 8%, transparent);
}

.trip-route-map__lens-canvas {
  position: absolute;
  max-width: none;
  overflow: visible;
  opacity: 1;
}

.trip-route-map__tooltip {
  position: absolute;
  z-index: 2;
  width: 204px;
  display: grid;
  gap: 3px;
  padding: 11px 13px;
  border: 1px solid color-mix(in srgb, var(--accent) 52%, var(--border-subtle));
  border-radius: 10px;
  background: color-mix(in srgb, var(--surface-card) 94%, transparent);
  box-shadow: 0 14px 34px color-mix(in srgb, var(--page-bg) 70%, transparent);
  opacity: 0;
  pointer-events: none;
  transform: translateY(7px) scale(0.96);
  transition: opacity 0.14s ease, transform 0.14s ease;
}

.trip-route-map__tooltip.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.trip-route-map__tooltip span {
  color: var(--accent);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.trip-route-map__tooltip strong {
  color: var(--text-primary);
  font-size: 14px;
}

.trip-route-map__tooltip small {
  color: var(--text-secondary);
  font-size: 10px;
  font-weight: 700;
}

.trip-route-map__terrain {
  fill: color-mix(in srgb, #456f70 25%, transparent);
  stroke: color-mix(in srgb, #77a9a3 24%, transparent);
  stroke-width: 1;
}

.trip-route-map__terrain--far {
  fill: color-mix(in srgb, #536278 18%, transparent);
}

.trip-route-map__road-shadow,
.trip-route-map__road {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.trip-route-map__road-shadow {
  stroke: color-mix(in srgb, var(--page-bg) 82%, transparent);
  stroke-width: 11;
}

.trip-route-map__road {
  stroke: url(#routeGlow);
  stroke-width: 4;
  filter: url(#routeSoftGlow);
}

.trip-route-map__details {
  color: var(--text-secondary);
  opacity: 0.62;
}

.trip-route-map__details text {
  fill: currentColor;
  font-family: "Manrope", sans-serif;
  font-size: 9px;
  font-weight: 800;
  paint-order: stroke;
  stroke: color-mix(in srgb, var(--surface-card) 92%, transparent);
  stroke-width: 3px;
  stroke-linejoin: round;
}

.trip-route-map__compass circle {
  fill: color-mix(in srgb, var(--surface-card) 74%, transparent);
  stroke: color-mix(in srgb, var(--text-secondary) 34%, transparent);
}

.trip-route-map__compass path {
  fill: color-mix(in srgb, var(--accent) 78%, white);
  stroke: var(--surface-card);
  stroke-width: 1;
}

.trip-route-map__compass text {
  fill: var(--accent);
  font-size: 10px;
  font-weight: 950;
}

.trip-route-map__road-badge rect {
  fill: color-mix(in srgb, #397557 78%, var(--surface-card));
  stroke: color-mix(in srgb, white 38%, transparent);
}

.trip-route-map__road-badge text {
  fill: #f5fff8;
  font-size: 9px;
  stroke: none;
}

.trip-route-map__river path {
  fill: none;
  stroke: color-mix(in srgb, #58a6ff 52%, transparent);
  stroke-width: 1.4;
  stroke-dasharray: 3 3;
}

.trip-route-map__river text {
  fill: color-mix(in srgb, #86c5ff 78%, var(--text-secondary));
  font-size: 8px;
  font-style: italic;
}

.trip-route-map__landmark path {
  fill: color-mix(in srgb, var(--gold) 48%, var(--surface-card));
  stroke: color-mix(in srgb, var(--gold) 72%, var(--text-secondary));
  stroke-width: 1.2;
}

.trip-route-map__distance line {
  stroke: color-mix(in srgb, var(--text-secondary) 30%, transparent);
  stroke-dasharray: 3 4;
}

.trip-route-map__distance circle {
  fill: var(--gold);
}

.trip-route-map__distance text {
  font-size: 8px;
}

.trip-route-map__vehicle circle {
  fill: color-mix(in srgb, var(--accent) 82%, white);
  stroke: var(--surface-card);
  stroke-width: 3;
  filter: url(#routeSoftGlow);
}

.trip-route-map__vehicle path {
  fill: var(--surface-card);
  stroke: none;
}

.trip-route-map__lens-canvas .trip-route-map__details {
  opacity: 1;
}

.trip-route-map__border line {
  stroke: color-mix(in srgb, #ffb454 65%, transparent);
  stroke-width: 1.5;
  stroke-dasharray: 5 7;
}

.trip-route-map__border rect {
  fill: color-mix(in srgb, var(--surface-card) 92%, #ffb454);
  stroke: color-mix(in srgb, #ffb454 66%, var(--border-subtle));
}

.trip-route-map__border text {
  fill: color-mix(in srgb, #ffca79 82%, var(--text-primary));
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.06em;
}

.trip-route-map__stop circle {
  fill: var(--surface-card);
  stroke: color-mix(in srgb, #58a6ff 78%, var(--accent));
  stroke-width: 2.5;
}

.trip-route-map__stop .trip-route-map__stop-hit {
  fill: transparent;
  stroke: none;
  pointer-events: all;
}

.trip-route-map__stop {
  cursor: zoom-in;
}

.trip-route-map__stop.is-selected > circle:not(.trip-route-map__stop-hit) {
  fill: #ffd36a;
  stroke: white;
  filter: url(#routeSoftGlow);
  transform: scale(1.7);
  transform-box: fill-box;
  transform-origin: center;
  animation: routeStopPulse 1.25s ease-in-out infinite;
}

@keyframes routeStopPulse {
  0%, 100% {
    opacity: 0.82;
    transform: scale(1.45);
  }
  50% {
    opacity: 1;
    transform: scale(2.05);
  }
}

.trip-route-map__stop text {
  fill: var(--text-secondary);
  font-family: "Manrope", sans-serif;
  font-size: 10px;
  font-weight: 750;
  paint-order: stroke;
  stroke: color-mix(in srgb, var(--surface-card) 88%, transparent);
  stroke-width: 3px;
  stroke-linejoin: round;
}

.trip-route-map__stop.is-major circle {
  fill: color-mix(in srgb, var(--accent) 70%, white);
  stroke: var(--surface-card);
  stroke-width: 3;
}

.trip-route-map__stop.is-major text {
  fill: var(--text-primary);
  font-size: 12px;
  font-weight: 900;
}

.trip-route-map__stop.is-pass circle {
  fill: #ffb454;
  stroke: var(--surface-card);
}

.trip-route-map__stop.is-pass text,
.trip-route-map__stop.is-border-stop text {
  fill: color-mix(in srgb, #ffca79 76%, var(--text-primary));
  font-weight: 850;
}

.trip-route-map__legend {
  display: none;
  gap: 14px;
  color: var(--text-secondary);
  font-size: 9px;
  font-weight: 750;
}

.trip-route-map__legend span {
  display: flex;
  align-items: center;
  gap: 5px;
}

.trip-route-map__legend i {
  width: 14px;
  height: 3px;
  border-radius: 999px;
  background: #58a6ff;
}

.trip-route-map__legend span:last-child i {
  width: 7px;
  height: 7px;
  border: 2px solid var(--surface-card);
  border-radius: 50%;
  background: var(--accent);
}

.booking-choice-card {
  min-height: 154px;
  display: grid;
  align-content: space-between;
  justify-items: start;
  gap: 10px;
  padding: 18px;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--accent) 18%, transparent), transparent 70%),
    var(--surface-card-soft);
  color: var(--text-primary);
  text-align: left;
  box-shadow: var(--shadow-sm);
}

.booking-choice-card:hover {
  border-color: var(--border-accent);
  background: var(--surface-control-hover);
  transform: translateY(-1px);
}

.booking-choice-card span {
  display: inline-grid;
  place-items: center;
  min-width: 42px;
  min-height: 42px;
  padding: 0 12px;
  border-radius: 8px;
  background: var(--control-primary-bg);
  color: var(--control-primary-text);
  font-weight: 900;
}

.booking-choice-card strong {
  font-size: 18px;
}

.booking-choice-card small {
  color: var(--text-secondary);
  font-weight: 800;
}

.trip-calendar-shell {
  display: grid;
  gap: 14px;
}

.booking-choice-modal[hidden],
.trip-calendar-shell[hidden],
.trip-calendar-panel[hidden] {
  display: none !important;
}

.trip-calendar-shell__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: var(--surface-card);
}

.trip-calendar-shell__change {
  appearance: none;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  border: 1px solid color-mix(in srgb, var(--accent) 56%, transparent);
  border-radius: 8px;
  background: var(--control-primary-bg);
  color: var(--control-primary-text);
  font-weight: 900;
  text-decoration: none;
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

.trip-calendar-shell__change:hover {
  border-color: color-mix(in srgb, var(--accent) 78%, transparent);
  background: var(--control-primary-bg-hover);
  color: var(--control-primary-text);
  transform: translateY(-1px);
}

.trip-calendar-shell__change--secondary {
  background: var(--surface-control);
  color: var(--text-primary);
}

.trip-calendar-shell__change--secondary:hover {
  background: var(--surface-control-hover);
  color: var(--text-primary);
}

.trip-calendar-shell__change:focus-visible {
  outline: none;
  border-color: var(--border-accent);
  box-shadow: 0 0 0 3px var(--accent-ring);
}

.trip-calendar-panel {
  display: grid;
  gap: 14px;
}

.trip-calendar-panel__status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: var(--surface-card-soft);
}

.trip-calendar-panel__status span {
  color: var(--text-primary);
  font-size: 20px;
  font-weight: 900;
}

.trip-calendar-panel__status strong {
  color: var(--text-secondary);
}

.trip-months {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.trip-month {
  position: relative;
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: var(--surface-card);
  box-shadow: var(--shadow-sm);
}

.trip-month.is-current {
  border-color: color-mix(in srgb, var(--accent) 84%, var(--border-subtle));
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--accent) 24%, transparent), transparent 34%),
    linear-gradient(135deg, color-mix(in srgb, var(--accent) 16%, transparent), transparent 58%),
    var(--surface-card);
  box-shadow: 0 0 0 4px var(--accent-ring), 0 18px 42px color-mix(in srgb, var(--accent) 16%, transparent), var(--shadow-sm);
}

.trip-month.is-current::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 5px;
  border-radius: 8px 8px 0 0;
  background: var(--control-primary-bg);
}

.trip-month.is-current::after {
  content: attr(data-current-label);
  position: absolute;
  right: 12px;
  top: 12px;
  padding: 6px 10px;
  border: 1px solid color-mix(in srgb, var(--accent) 70%, transparent);
  border-radius: 8px;
  background: var(--control-primary-bg);
  color: var(--control-primary-text);
  font-size: 11px;
  font-weight: 900;
  box-shadow: 0 8px 22px color-mix(in srgb, var(--accent) 22%, transparent);
}

.trip-month h3 {
  margin: 0;
  color: var(--text-primary);
  letter-spacing: 0;
}

.trip-month.is-current h3 {
  padding-right: 86px;
  color: var(--accent);
}

.trip-weekdays,
.trip-days {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
}

.trip-weekdays span {
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 900;
  text-align: center;
}

.trip-day {
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 8px;
  font-weight: 900;
  text-decoration: none;
}

.trip-day.is-allowed {
  border: 1px solid var(--border-accent);
  background: var(--control-primary-bg);
  color: var(--control-primary-text);
  box-shadow: 0 0 0 3px var(--accent-ring);
}

.trip-day.is-allowed:hover {
  background: var(--control-primary-bg-hover);
  transform: translateY(-1px);
}

.trip-day.is-allowed.is-manual {
  position: relative;
  outline: 2px solid color-mix(in srgb, #d7a84f 72%, transparent);
  outline-offset: 2px;
}

.trip-day.is-allowed.is-manual::after,
.trip-day.is-disabled.is-manual-closed::after {
  content: "";
  position: absolute;
  right: 5px;
  top: 5px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #d7a84f;
}

.trip-day.is-disabled {
  position: relative;
  border: 1px solid var(--border-subtle);
  background: color-mix(in srgb, var(--muted) 10%, var(--surface-card-soft));
  color: var(--text-muted);
  opacity: 0.68;
}

.trip-day.is-disabled.is-manual-closed {
  border-color: color-mix(in srgb, #c75d77 45%, transparent);
  color: #f0a5b5;
  opacity: 0.9;
}

.trip-day.is-disabled.is-manual-closed::after {
  background: #c75d77;
}

.trip-day.is-empty {
  background: transparent;
}

.trips-empty {
  display: grid;
  gap: 10px;
  padding: 22px;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: var(--surface-card);
  color: var(--text-secondary);
}

.trips-empty p {
  margin: 0;
}

.bus-booking-shell {
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: var(--surface-card);
  box-shadow: var(--shadow-sm);
}

.bus-booking-summary,
.bus-workspace {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.bus-booking-summary h2,
.booking-side-panel h2 {
  margin: 0;
  color: var(--text-primary);
  letter-spacing: 0;
}

.bus-legend {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 10px;
}

.bus-legend span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 900;
}

.bus-legend i {
  width: 12px;
  height: 12px;
  border-radius: 4px;
}

.bus-legend .is-free { background: var(--surface-control); border: 1px solid var(--border-subtle); }
.bus-legend .is-booked { background: var(--control-primary-bg); }
.bus-legend .is-female { background: #e874a8; }
.bus-legend .is-male { background: #5d9cec; }
.bus-legend .has-comment { background: var(--gold); }
.bus-legend .is-paid { background: #32d583; }
.bus-legend .is-door { background: color-mix(in srgb, var(--gold) 38%, var(--surface-card)); border: 1px solid color-mix(in srgb, var(--gold) 54%, transparent); }

.bus-workspace {
  align-items: start;
}

.bus-frame {
  width: min(760px, 100%);
  display: grid;
  gap: 8px;
  padding: 24px 20px;
  border: 2px solid color-mix(in srgb, var(--accent) 34%, var(--border-subtle));
  border-radius: 34px 34px 14px 14px;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--accent) 9%, transparent), transparent 28%),
    color-mix(in srgb, var(--surface-card-soft) 68%, var(--surface-card));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--text-primary) 8%, transparent);
}

.bus-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 64px minmax(0, 1fr);
  gap: 10px;
  align-items: stretch;
}

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

.bus-row--door-stack {
  grid-template-columns: minmax(0, 1fr) 64px minmax(0, 1fr);
}

.bus-door-stack__left,
.bus-door-stack__aisle {
  display: grid;
  gap: 8px;
}

.bus-door-stack__aisle span {
  display: grid;
  place-items: center;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 900;
}

.bus-aisle {
  display: grid;
  place-items: center;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.bus-seat,
.bus-service {
  min-height: 56px;
  display: grid;
  place-items: center;
  gap: 2px;
  padding: 8px;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: var(--surface-control);
  color: var(--text-primary);
  text-align: center;
}

.bus-seat {
  position: relative;
  transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease, box-shadow 0.16s ease;
}

.bus-seat:hover {
  border-color: var(--border-accent);
  background: var(--surface-control-hover);
  transform: translateY(-1px);
  box-shadow: 0 10px 24px color-mix(in srgb, var(--accent) 12%, transparent);
}

.bus-seat span {
  font-size: 18px;
  font-weight: 900;
}

.bus-seat small {
  max-width: 100%;
  overflow: hidden;
  color: var(--text-secondary);
  font-size: 10px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bus-seat.is-booked {
  border-color: color-mix(in srgb, var(--accent) 62%, var(--border-subtle));
  background:
    linear-gradient(145deg, color-mix(in srgb, var(--accent) 24%, var(--surface-card)), transparent 74%),
    color-mix(in srgb, var(--accent) 18%, var(--surface-control));
  color: var(--text-primary);
  box-shadow: 0 10px 24px color-mix(in srgb, var(--accent) 14%, transparent);
}

.bus-seat.is-booked.gender-female {
  border-color: color-mix(in srgb, var(--seat-female) 72%, var(--border-subtle));
  background:
    linear-gradient(90deg, var(--seat-female) 0 8px, transparent 8px),
    linear-gradient(145deg, color-mix(in srgb, var(--seat-female) 32%, var(--surface-card)), transparent 74%),
    color-mix(in srgb, var(--seat-female) 18%, var(--surface-control));
  box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--seat-female) 42%, transparent), 0 10px 24px color-mix(in srgb, var(--seat-female) 14%, transparent);
}

.bus-seat.is-booked.gender-male {
  border-color: color-mix(in srgb, var(--seat-male) 72%, var(--border-subtle));
  background:
    linear-gradient(90deg, var(--seat-male) 0 8px, transparent 8px),
    linear-gradient(145deg, color-mix(in srgb, var(--seat-male) 32%, var(--surface-card)), transparent 74%),
    color-mix(in srgb, var(--seat-male) 18%, var(--surface-control));
  box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--seat-male) 42%, transparent), 0 10px 24px color-mix(in srgb, var(--seat-male) 14%, transparent);
}

.bus-seat.has-comment::before,
.bus-seat.is-paid::after {
  content: "";
  position: absolute;
  width: 9px;
  height: 9px;
  border: 2px solid var(--surface-card);
  border-radius: 50%;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.16);
}

.bus-seat.has-comment::before {
  left: 6px;
  top: 6px;
  background: var(--gold);
}

.bus-seat.is-paid::after {
  right: 6px;
  top: 6px;
  background: #32d583;
}

.bus-seat.ticket-issued {
  border-color: color-mix(in srgb, var(--accent) 34%, var(--border-subtle));
  background:
    linear-gradient(135deg, var(--gold) 0 15px, transparent 15px),
    linear-gradient(145deg, color-mix(in srgb, var(--accent) 18%, var(--surface-card)), transparent 74%),
    color-mix(in srgb, var(--accent) 12%, var(--surface-control));
  color: var(--text-primary);
  box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--accent) 24%, transparent);
}

.bus-seat.ticket-issued.gender-female {
  border-color: color-mix(in srgb, var(--seat-female) 58%, var(--border-subtle));
  background:
    linear-gradient(135deg, var(--gold) 0 15px, transparent 15px),
    linear-gradient(90deg, var(--seat-female) 0 8px, transparent 8px),
    linear-gradient(145deg, color-mix(in srgb, var(--seat-female) 24%, var(--surface-card)), transparent 74%),
    color-mix(in srgb, var(--seat-female) 14%, var(--surface-control));
  box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--seat-female) 26%, transparent), 0 10px 24px color-mix(in srgb, var(--seat-female) 8%, transparent);
}

.bus-seat.ticket-issued.gender-male {
  border-color: color-mix(in srgb, var(--seat-male) 58%, var(--border-subtle));
  background:
    linear-gradient(135deg, var(--gold) 0 15px, transparent 15px),
    linear-gradient(90deg, var(--seat-male) 0 8px, transparent 8px),
    linear-gradient(145deg, color-mix(in srgb, var(--seat-male) 24%, var(--surface-card)), transparent 74%),
    color-mix(in srgb, var(--seat-male) 14%, var(--surface-control));
  box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--seat-male) 26%, transparent), 0 10px 24px color-mix(in srgb, var(--seat-male) 8%, transparent);
}

.bus-seat.ticket-issued::after {
  content: "✓";
  position: absolute;
  right: 5px;
  bottom: 5px;
  top: auto;
  width: 17px;
  height: 17px;
  display: grid;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--gold) 72%, var(--surface-card));
  border-radius: 999px;
  background: var(--gold);
  color: var(--ink);
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
}

.bus-seat.ticket-issued.is-paid::after {
  border-color: color-mix(in srgb, var(--status-success) 72%, var(--surface-card));
  background: var(--status-success);
  color: #ffffff;
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--status-success) 18%, transparent);
}

.bus-seat.ticket-issued span,
.bus-seat.ticket-issued small {
  color: var(--text-primary);
}

.push-settings {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    "copy actions"
    "status status";
  gap: 12px 18px;
  align-items: start;
  padding: 16px;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--accent) 8%, transparent), transparent 68%),
    var(--surface-card-soft);
}

.push-settings > div:first-child {
  grid-area: copy;
  min-width: 0;
}

.push-settings strong,
.push-settings small,
.push-settings span {
  display: block;
}

.push-settings small,
.push-settings span {
  color: var(--text-secondary);
}

.push-settings__actions {
  grid-area: actions;
  display: grid;
  grid-template-columns: repeat(3, auto);
  gap: 8px;
  align-items: center;
  justify-content: end;
}

.dashboard-route-stop__metrics {
  display: grid;
  gap: 1px;
  white-space: nowrap;
}

.push-settings--chat .push-settings__actions {
  display: flex;
  flex-wrap: wrap;
  max-width: 680px;
}

.push-settings--chat select {
  min-height: 42px;
  padding: 0 34px 0 12px;
  border: 1px solid var(--border-accent);
  border-radius: 8px;
  background: var(--input-bg);
  color: var(--text-primary);
  font: inherit;
  font-weight: 750;
}

.push-settings button {
  min-height: 42px;
  min-width: 108px;
  border: 1px solid var(--border-accent);
  border-radius: 8px;
  padding: 0 14px;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.push-settings [data-enable-push],
.push-settings [data-test-push],
.push-settings [data-enable-chat-push],
.push-settings [data-test-chat-push] {
  color: var(--control-primary-text);
  background: var(--control-primary-bg);
}

.push-settings [data-disable-push],
.push-settings [data-disable-chat-push],
.push-settings [data-snooze-chat-push] {
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 10%, var(--surface-card));
}

.push-settings button:disabled {
  opacity: 0.58;
  cursor: not-allowed;
}

.push-settings [data-push-status],
.push-settings [data-chat-push-status] {
  grid-area: status;
  min-height: 22px;
  font-size: 0.9rem;
  font-weight: 800;
}

.push-settings [data-push-status][data-tone="ok"],
.push-settings [data-chat-push-status][data-tone="ok"] {
  color: var(--status-success);
}

.push-settings [data-push-status][data-tone="error"],
.push-settings [data-chat-push-status][data-tone="error"] {
  color: var(--status-danger);
}

.warehouse-issue-board {
  min-height: 100vh;
  padding: clamp(16px, 3vw, 36px);
  color: var(--text-primary);
  background:
    radial-gradient(circle at top left, color-mix(in srgb, var(--accent) 18%, transparent), transparent 34%),
    var(--surface-page);
}

.warehouse-issue-board__hero {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-end;
  max-width: 980px;
  margin: 0 auto 18px;
  padding: 18px;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: var(--surface-card);
  box-shadow: var(--shadow-sm);
}

.warehouse-issue-board__hero h1 {
  margin: 4px 0;
  font-size: clamp(2rem, 7vw, 4rem);
  line-height: 0.95;
}

.warehouse-issue-board__hero span,
.warehouse-issue-board__hero strong {
  color: var(--text-secondary);
}

.warehouse-issue-board__list {
  display: grid;
  gap: 12px;
  max-width: 980px;
  margin: 0 auto;
}

.warehouse-issue-card {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr) 190px;
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--border-subtle);
  border-left: 5px solid var(--accent);
  border-radius: 8px;
  background: var(--surface-card);
  transition: opacity 0.16s ease, filter 0.16s ease, background 0.16s ease;
}

.warehouse-issue-card.is-missing {
  border-left-color: var(--status-danger);
}

.warehouse-issue-card.is-already-issued {
  border-left-color: var(--status-warning);
}

.warehouse-issue-card.is-handed {
  opacity: 0.54;
  filter: saturate(0.72);
  background: color-mix(in srgb, var(--surface-card) 64%, var(--surface-page));
}

.warehouse-issue-card__shelf,
.warehouse-issue-card__body,
.warehouse-issue-card__side {
  min-width: 0;
}

.warehouse-issue-card__shelf {
  display: grid;
  place-content: center;
  gap: 4px;
  min-height: 110px;
  border: 1px solid var(--border-accent);
  border-radius: 8px;
  background: color-mix(in srgb, var(--accent) 14%, var(--surface-card));
  text-align: center;
}

.warehouse-issue-card.is-missing .warehouse-issue-card__shelf {
  border-color: var(--status-danger-border);
  background: var(--status-danger-bg);
}

.warehouse-issue-card.is-already-issued .warehouse-issue-card__shelf {
  border-color: var(--status-warning-border);
  background: var(--status-warning-bg);
}

.warehouse-issue-card__shelf span,
.warehouse-issue-card__body span,
.warehouse-issue-card__side span,
.warehouse-issue-card__body small,
.warehouse-issue-card__side small {
  color: var(--text-secondary);
}

.warehouse-issue-card__shelf strong {
  font-size: clamp(2rem, 8vw, 3.2rem);
  line-height: 1;
}

.warehouse-issue-card__body {
  display: grid;
  gap: 12px;
}

.warehouse-issue-card__body strong,
.warehouse-issue-card__side strong {
  display: block;
  overflow-wrap: anywhere;
}

.warehouse-issue-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.warehouse-issue-card__meta span {
  padding: 6px 9px;
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  background: var(--surface-card-soft);
  font-weight: 800;
}

.warehouse-issue-card__side {
  display: grid;
  align-content: center;
  gap: 4px;
}

.warehouse-issue-card__status {
  width: fit-content;
  padding: 5px 8px;
  border-radius: 999px;
  background: var(--status-success-bg);
  color: var(--status-success);
  font-size: 12px;
}

.warehouse-issue-card.is-missing .warehouse-issue-card__status {
  background: var(--status-danger-bg);
  color: var(--status-danger);
}

.warehouse-issue-card.is-already-issued .warehouse-issue-card__status {
  background: var(--status-warning-bg);
  color: var(--status-warning);
}

.warehouse-issue-card__handed {
  min-height: 40px;
  margin-top: 8px;
  border: 1px solid var(--border-accent);
  border-radius: 8px;
  background: var(--control-primary-bg);
  color: var(--control-primary-text);
  font: inherit;
  font-weight: 900;
  cursor: pointer;
}

.warehouse-issue-card__handed:disabled {
  cursor: not-allowed;
  opacity: 0.74;
}

.bus-seat.is-booked {
  cursor: grab;
}

.bus-seat.is-dragging {
  cursor: grabbing;
  opacity: 0.58;
  transform: scale(0.96);
}

.bus-seat.is-drop-target {
  border-color: var(--gold);
  background: color-mix(in srgb, var(--gold) 18%, var(--surface-control));
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--gold) 26%, transparent), 0 14px 30px color-mix(in srgb, var(--gold) 18%, transparent);
}

.bus-seat.is-booked small {
  color: var(--text-secondary);
}

.bus-service {
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 900;
}

.bus-service--driver {
  background: color-mix(in srgb, var(--text-primary) 9%, var(--surface-control));
}

.bus-service--door {
  grid-column: 1 / -1;
  border-color: color-mix(in srgb, var(--gold) 54%, transparent);
  background: color-mix(in srgb, var(--gold) 26%, var(--surface-card));
  color: var(--text-primary);
}

.bus-service--door-tall {
  min-height: 120px;
  height: 100%;
}

.bus-service--gap {
  border-style: dashed;
  background: transparent;
}

.bus-row--front,
.bus-row--door {
  margin-bottom: 4px;
}

.bus-row--rear {
  grid-template-columns: 1fr;
  margin-top: 6px;
}

.bus-rear-seats {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.bus-seat--rear {
  min-height: 58px;
}

.booking-side-panel {
  width: min(320px, 100%);
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: var(--surface-card-soft);
}

.booking-side-panel dl {
  display: grid;
  gap: 10px;
  margin: 0;
}

.booking-side-panel dl div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-subtle);
}

.booking-side-panel dt {
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 900;
}

.booking-side-panel dd {
  margin: 0;
  color: var(--text-primary);
  font-weight: 900;
  text-align: right;
}

.booking-side-panel__hint {
  padding: 12px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.45;
}

.seat-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 24px;
}

.seat-modal[hidden] {
  display: none !important;
}

.seat-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 8, 12, 0.72);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.seat-modal__panel {
  position: relative;
  width: min(860px, 100%);
  max-height: min(860px, calc(100vh - 40px));
  overflow: auto;
  display: grid;
  gap: 16px;
  padding: 20px;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: var(--surface-card);
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transform: translateY(18px) scale(0.98);
  transition: opacity 0.22s ease, transform 0.22s cubic-bezier(0.22, 1, 0.36, 1);
}

.seat-modal.is-open .seat-modal__backdrop {
  opacity: 1;
}

.seat-modal.is-open .seat-modal__panel {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.seat-modal__close {
  position: absolute;
  right: 14px;
  top: 14px;
  width: 38px;
  min-height: 38px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--border-subtle);
  background: var(--surface-control);
  color: var(--text-primary);
  font-size: 24px;
}

.seat-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding-right: 48px;
}

.seat-modal__header h2 {
  margin: 0;
  color: var(--text-primary);
}

.seat-modal__badge {
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--control-primary-bg);
  color: var(--control-primary-text);
  font-size: 12px;
  font-weight: 900;
}

.seat-booking-form {
  display: grid;
  gap: 14px;
}

.seat-form-section {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: var(--surface-card-soft);
}

.seat-form-section--route {
  padding-bottom: 12px;
}

.seat-form-section__num {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: color-mix(in srgb, var(--gold) 24%, var(--surface-control));
  color: var(--gold);
  font-size: 12px;
  font-weight: 900;
}

.seat-form-section h3 {
  margin: 0 0 12px;
  color: var(--text-primary);
}

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

.seat-form-grid--route {
  grid-template-columns: minmax(180px, 1.25fr) minmax(130px, 0.8fr) minmax(130px, 0.82fr) minmax(150px, 0.92fr);
  align-items: start;
}

.seat-form-grid label {
  display: grid;
  gap: 7px;
}

.seat-form-grid span {
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 900;
}

.seat-input-uppercase {
  text-transform: uppercase;
}

.seat-birth-date {
  display: grid;
  width: 100%;
  min-width: 0;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.seat-birth-date select {
  min-width: 0;
  padding-inline: 7px 22px;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.seat-booking-form input,
.seat-booking-form select,
.seat-booking-form textarea {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: var(--surface-control);
  color: var(--text-primary);
  padding: 0 12px;
  font-weight: 800;
  outline: none;
  transition: border-color 0.16s ease, background 0.16s ease, box-shadow 0.16s ease;
}

.seat-booking-form textarea {
  min-height: 86px;
  padding-block: 10px;
  resize: vertical;
}

.seat-booking-form input::placeholder,
.seat-booking-form textarea::placeholder {
  color: var(--text-muted);
}

.seat-booking-form select option {
  background: var(--surface-card);
  color: var(--text-primary);
}

.seat-booking-form input:focus,
.seat-booking-form select:focus,
.seat-booking-form textarea:focus {
  border-color: var(--border-accent);
  background: var(--surface-control-hover);
  box-shadow: 0 0 0 3px var(--accent-ring);
}

.seat-form-grid__wide {
  grid-column: 1 / -1;
}

.seat-form-grid__comment {
  grid-column: 1 / -1;
}

.seat-form-grid--route .seat-form-grid__comment textarea {
  min-height: 58px;
}

.seat-booking-form input:disabled,
.seat-booking-form select:disabled,
.seat-booking-form textarea:disabled {
  opacity: 1;
  cursor: default;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--accent) 7%, transparent), transparent 54%),
    var(--surface-control);
  color: var(--text-primary);
  -webkit-text-fill-color: var(--text-primary);
}

.seat-booking-form__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.seat-booking-form__footer p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 800;
}

.seat-booking-form__footer button {
  min-height: 46px;
  border-radius: 8px;
  font-weight: 900;
}

.seat-booking-actions {
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.seat-booking-actions button {
  min-width: 128px;
}

.seat-booking-actions button:disabled {
  cursor: wait;
  opacity: 0.58;
}

.seat-booking-actions__edit {
  border: 1px solid var(--border-accent);
  background: var(--surface-control-hover);
  color: var(--text-primary);
}

.seat-booking-actions__print {
  border: 1px solid var(--border-accent);
  background: var(--control-primary-bg);
  color: var(--control-primary-text);
}

.seat-booking-actions__transfer {
  border: 1px solid color-mix(in srgb, var(--gold) 55%, var(--border-subtle));
  background: color-mix(in srgb, var(--gold) 12%, var(--surface-card));
  color: var(--text-primary);
}

.seat-transfer-modal {
  z-index: 90;
}

.seat-transfer-modal__panel {
  width: min(620px, 100%);
}

.seat-transfer-passenger,
.seat-transfer-field {
  display: grid;
  gap: 6px;
  padding: 14px;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: var(--surface-card-soft);
}

.seat-transfer-passenger span,
.seat-transfer-field span {
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 900;
}

.seat-transfer-passenger strong {
  color: var(--text-primary);
  font-size: 18px;
}

.seat-transfer-passenger small,
.seat-transfer-availability,
.seat-transfer-note {
  color: var(--text-secondary);
  font-size: 13px;
}

.seat-transfer-field select {
  min-height: 46px;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: var(--surface-control);
  color: var(--text-primary);
  padding: 0 12px;
  font-weight: 900;
  color-scheme: inherit;
  outline: none;
}

.seat-transfer-field select:hover {
  border-color: var(--border-accent);
  background: var(--surface-control-hover);
}

.seat-transfer-field select:focus {
  border-color: var(--accent);
  background: var(--surface-control-hover);
  box-shadow: 0 0 0 3px var(--accent-ring);
}

.seat-transfer-field select option {
  background: var(--surface-card);
  color: var(--text-primary);
  font-weight: 800;
}

.seat-transfer-field select option:checked {
  background: var(--accent);
  color: var(--accent-contrast);
}

.seat-transfer-field select:disabled {
  cursor: not-allowed;
  opacity: 0.65;
}

.seat-transfer-seats {
  display: grid;
  place-items: center;
  gap: 10px;
}

.transfer-bus {
  width: min(390px, 100%);
  display: grid;
  gap: 5px;
  padding: 14px 12px 18px;
  border: 2px solid var(--border-subtle);
  border-radius: 28px 28px 12px 12px;
  background: color-mix(in srgb, var(--surface-card-soft) 92%, transparent);
  box-shadow: inset 0 0 0 4px color-mix(in srgb, var(--surface-control) 75%, transparent);
}

.transfer-bus-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 30px minmax(0, 1fr);
  gap: 6px;
  align-items: stretch;
}

.transfer-bus-side,
.transfer-bus-rear {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px;
}

.transfer-bus-rear {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin-top: 3px;
}

.transfer-bus-aisle,
.transfer-bus-door-aisle {
  display: grid;
  place-items: center;
  color: var(--text-muted);
  font-size: 9px;
  font-weight: 900;
}

.transfer-bus-seat {
  position: relative;
  min-width: 0;
  min-height: 32px;
  padding: 0;
  border: 1px solid var(--border-subtle);
  border-radius: 7px 7px 4px 4px;
  background: var(--surface-control);
  color: var(--text-primary);
  font-weight: 900;
}

.transfer-bus-seat::after {
  content: "";
  position: absolute;
  inset: auto 5px 3px;
  height: 3px;
  border-radius: 3px;
  background: color-mix(in srgb, currentColor 30%, transparent);
}

.transfer-bus-seat.is-booked {
  cursor: not-allowed;
  opacity: 0.9;
}

.transfer-bus-seat.is-booked.gender-female {
  border-color: color-mix(in srgb, #f15b9a 75%, var(--border-subtle));
  background: color-mix(in srgb, #f15b9a 44%, var(--surface-card));
  color: #ffeaf3;
}

.transfer-bus-seat.is-booked.gender-male {
  border-color: color-mix(in srgb, #3d8dff 75%, var(--border-subtle));
  background: color-mix(in srgb, #3d8dff 44%, var(--surface-card));
  color: #eaf3ff;
}

.transfer-bus-seat.is-booked.gender-none {
  background: color-mix(in srgb, var(--text-muted) 28%, var(--surface-card));
}

.transfer-bus-seat.is-selected {
  border-color: var(--accent);
  background: var(--control-primary-bg);
  color: var(--control-primary-text);
  box-shadow: 0 0 0 3px var(--accent-ring);
}

.transfer-bus-service {
  min-height: 32px;
  display: grid;
  place-items: center;
  padding: 4px;
  border: 1px dashed var(--border-subtle);
  border-radius: 7px;
  background: color-mix(in srgb, var(--surface-control) 78%, transparent);
  color: var(--text-secondary);
  font-size: 8px;
  font-weight: 900;
  text-align: center;
}

.transfer-bus-service.is-door {
  border-color: color-mix(in srgb, var(--gold) 55%, var(--border-subtle));
  background: color-mix(in srgb, var(--gold) 11%, var(--surface-card));
}

.transfer-bus-service.is-tall {
  min-height: 69px;
}

.transfer-bus-door-left,
.transfer-bus-door-aisle {
  display: grid;
  gap: 5px;
}

.transfer-bus-door-aisle {
  grid-template-rows: repeat(2, 1fr);
}

.seat-transfer-note {
  margin: 0;
  padding: 10px 12px;
  border-left: 3px solid var(--gold);
  background: color-mix(in srgb, var(--gold) 8%, transparent);
}

.seat-transfer-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.seat-transfer-actions button {
  min-height: 44px;
  min-width: 130px;
}

.seat-transfer-confirm {
  background: var(--control-primary-bg);
  color: var(--control-primary-text);
}

.seat-booking-actions__delete {
  border: 1px solid color-mix(in srgb, var(--danger) 44%, transparent);
  background: color-mix(in srgb, var(--danger) 12%, var(--surface-card));
  color: color-mix(in srgb, var(--danger) 88%, var(--text-primary));
}

.seat-booking-actions__delete:hover {
  background: color-mix(in srgb, var(--danger) 20%, var(--surface-card));
}

.parcel-edit-form__footer button[type="button"] {
  border: 1px solid var(--border-accent);
  background: color-mix(in srgb, var(--accent) 12%, var(--surface-card-soft));
  color: var(--accent);
}

@media (max-width: 640px) {
  .toast-stack {
    bottom: 82px;
    left: 50%;
    width: calc(100vw - 24px);
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
    padding: 16px;
  }

  .topbar__user {
    width: 100%;
    justify-content: space-between;
  }

  .page {
    margin-top: 20px;
  }
}

@media (max-width: 980px) {
  .app-layout {
    grid-template-columns: 84px minmax(0, 1fr);
  }

  .app-sidebar {
    padding-inline: 12px;
  }

  .sidebar-brand div,
  .sidebar-link span,
  .sidebar-user__meta,
  .sidebar-logout span {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }

  .sidebar-link,
  .sidebar-logout button {
    justify-content: center;
    padding: 0;
  }

  .sidebar-user {
    justify-content: center;
    padding: 10px;
  }

  .auth-shell {
    grid-template-columns: 1fr;
    gap: 20px;
    padding: 20px 0;
  }

  .auth-hero {
    min-height: 520px;
  }

  .login-card {
    order: -1;
  }

  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .parcel-form__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .parcel-form-sections {
    grid-template-columns: 1fr;
  }

  .parcel-form-section,
  .parcel-form-section:nth-child(n + 3) {
    grid-column: auto;
  }

  .parcel-form__grid--two,
  .parcel-form__grid--parcel,
  .parcel-form__grid--four {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .parcel-form-section:nth-child(3) .parcel-form__grid--parcel {
    grid-template-areas:
      "category weight"
      "count photo"
      "description photo";
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .parcel-form-section:nth-child(3) .parcel-form__grid--parcel.is-document {
    grid-template-areas:
      "category photo"
      "description photo";
  }

  .parcel-form-section:nth-child(3) .parcel-photo-input strong {
    min-height: 44px;
  }

  .parcel-row {
    grid-template-columns: 76px minmax(0, 1fr);
  }

  .parcel-row__people,
  .parcel-row__route,
  .parcel-row__status {
    grid-column: 2;
  }

  .parcel-row__status {
    justify-self: stretch;
    text-align: left;
  }

  .russia-date-layout,
  .russia-date-confirm,
  .russia-finance-layout,
  .russia-form-sections,
  .russia-form-grid--money,
  .russia-form-grid--payment,
  .russia-form-grid--notes,
  .russia-form-grid--three,
  .russia-form-grid--four {
    grid-template-columns: 1fr;
  }

  .russia-finance-card--notes {
    grid-column: auto;
  }

  .russia-form-section--wide,
  .russia-form-span-2 {
    grid-column: auto;
  }

  .russia-form-grid--parcel {
    grid-template-columns: 1fr;
  }

  .parcel-list-filters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .russia-list-filters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .parcel-list-filters button {
    grid-column: 1 / -1;
  }

  .georgia-parcel-card {
    grid-template-columns: 148px minmax(0, 1fr);
  }

  .georgia-parcel-card__side {
    grid-column: 2;
  }

  .georgia-parcel-card__side {
    justify-content: flex-start;
  }

  .parcel-edit-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .russia-group-card__summary {
    grid-template-columns: 1fr;
  }

  .theme-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .accent-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .app-layout {
    display: block;
  }

  .app-sidebar {
    position: fixed;
    top: auto;
    right: max(12px, env(safe-area-inset-right));
    bottom: max(12px, env(safe-area-inset-bottom));
    left: max(12px, env(safe-area-inset-left));
    z-index: 95;
    box-sizing: border-box;
    width: auto;
    max-width: calc(100vw - 24px);
    height: auto;
    display: grid;
    gap: 0;
    padding: 8px;
    border: 1px solid var(--sidebar-line);
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
  }

  .sidebar-brand,
  .sidebar-user,
  .app-sidebar > .sidebar-logout {
    display: none;
  }

  .sidebar-nav {
    position: relative;
    min-height: auto;
    flex: none;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 5px;
    overflow: visible;
    direction: ltr;
    padding-left: 0;
    padding-right: 0;
  }

  .sidebar-more-toggle {
    display: flex;
  }

  .sidebar-more-panel {
    position: absolute;
    left: 0;
    right: 0;
    bottom: calc(100% + 10px);
    box-sizing: border-box;
    display: none;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
    padding: 10px;
    border: 1px solid var(--sidebar-line);
    border-radius: 8px;
    background:
      linear-gradient(180deg, var(--sidebar-veil), transparent),
      var(--sidebar-bg);
    box-shadow: var(--shadow-lg);
  }

  .sidebar-more-panel[hidden] {
    display: none;
  }

  .app-sidebar.is-more-open .sidebar-more-panel {
    display: grid;
  }

  .sidebar-logout--mobile {
    display: block;
  }

  .sidebar-link,
  .sidebar-logout--mobile button {
    min-height: 52px;
    display: grid;
    justify-items: center;
    align-content: center;
    gap: 3px;
    padding: 4px 2px;
    text-align: center;
  }

  .sidebar-nav > .sidebar-link > span {
    display: none;
  }

  .sidebar-nav > .sidebar-link::after {
    content: attr(data-mobile-label);
    max-width: 100%;
    overflow: hidden;
    color: inherit;
    font-size: 10px;
    line-height: 1.1;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .sidebar-more-panel .sidebar-link span,
  .sidebar-logout--mobile span {
    position: static;
    width: auto;
    height: auto;
    clip: auto;
    overflow: hidden;
    color: inherit;
    font-size: 10px;
    line-height: 1.1;
    max-width: 100%;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .sidebar-link svg,
  .sidebar-logout--mobile svg {
    width: 20px;
    height: 20px;
  }

  .sidebar-link.is-active::before {
    width: 24px;
    height: 3px;
    position: absolute;
    bottom: 5px;
    left: 50%;
    transform: translateX(-50%);
  }

  .app-main {
    min-height: 100vh;
    padding: 20px 12px 104px;
    align-items: start;
  }

  .auth-shell {
    width: min(100% - 24px, 520px);
  }

  .auth-hero,
  .login-card {
    padding: 22px;
  }

  .auth-hero {
    min-height: 560px;
  }

  .auth-brand img {
    width: 58px;
    height: 58px;
  }

  .auth-brand span {
    font-size: 22px;
  }

  .auth-copy h1 {
    font-size: 42px;
  }

  .auth-copy p:not(.eyebrow) {
    font-size: 16px;
  }

  .auth-safe-info {
    grid-template-columns: 1fr;
  }

  .route-map {
    display: none;
  }

  .dashboard-shell {
    width: min(100% - 24px, 520px);
  }

  .dashboard-board {
    padding: 22px;
  }

  .dashboard-board__header {
    flex-direction: column;
  }

  .dashboard-board__branch {
    width: 100%;
  }

  .dashboard-network {
    min-height: 500px;
    margin-bottom: 16px;
    background-size: 28px 28px, 28px 28px, auto;
  }

  .dashboard-network__title {
    top: 14px;
  }

  .dashboard-network__title h2 {
    font-size: 18px;
  }

  .dashboard-network__status {
    top: 20px;
    max-width: 112px;
    justify-content: flex-end;
    line-height: 1.2;
    text-align: right;
  }

  .dashboard-route-map--desktop {
    display: none;
  }

  .dashboard-route-map--mobile {
    display: block;
  }

  .dashboard-route-checkpoint {
    top: 52%;
    left: 50%;
    display: flex;
    align-items: center;
    gap: 7px;
    transform: translate(-50%, -50%);
  }

  .dashboard-route-checkpoint__copy {
    min-width: 126px;
    padding: 6px 8px;
  }

  .dashboard-route-checkpoint__pin {
    flex: 0 0 auto;
    width: 18px;
    height: 18px;
  }

  .dashboard-route-road--base {
    stroke-width: 15;
  }

  .dashboard-route-road--flow {
    stroke-width: 5;
  }

  .dashboard-route-stop {
    gap: 7px;
  }

  .dashboard-route-stop--spb {
    left: 23%;
    top: 16.4%;
  }

  .dashboard-route-stop--moscow {
    left: 70.5%;
    top: 37.3%;
  }

  .dashboard-route-stop--tbilisi {
    left: 25.8%;
    top: 66.2%;
  }

  .dashboard-route-stop--batumi {
    left: 70.5%;
    top: 87%;
    flex-direction: row-reverse;
    transform: translate(-100%, -50%);
  }

  .dashboard-route-stop__pin {
    width: 16px;
    height: 16px;
  }

  .dashboard-route-stop__copy {
    min-width: 116px;
    padding: 7px 8px;
  }

  .dashboard-route-stop__copy strong {
    font-size: 11px;
  }

  .stats-grid,
  .stat-card--wide,
  .branch-list,
  .mini-list {
    grid-template-columns: 1fr;
  }

  .stat-card--wide {
    grid-column: auto;
  }

  .stat-card__top strong {
    font-size: 34px;
  }

  .parcel-workspace__header,
  .parcel-form__header,
  .latest-parcels__header,
  .russia-date-panel__header,
  .parcel-form__footer {
    align-items: stretch;
    flex-direction: column;
  }

  .parcel-form__grid,
  .parcel-form__span-2,
  .parcel-form__grid--two,
  .parcel-form__grid--parcel,
  .parcel-form__grid--four,
  .direction-options,
  .parcel-row {
    grid-template-columns: 1fr;
  }

  .parcel-form-section:nth-child(3) .parcel-form__grid--parcel {
    grid-template-areas:
      "category"
      "description"
      "weight"
      "count"
      "photo";
    grid-template-columns: 1fr;
  }

  .parcel-form-section:nth-child(3) .parcel-form__grid--parcel.is-document {
    grid-template-areas:
      "category"
      "description"
      "photo";
  }

  .parcel-row__number {
    justify-content: start;
    padding-inline: 12px;
  }

  .parcel-row__people,
  .parcel-row__route,
  .parcel-row__status {
    grid-column: auto;
  }

  .parcel-row__media {
    width: 100%;
    height: 120px;
  }

  .russia-date-card {
    grid-template-columns: 1fr;
  }

  .russia-date-card small {
    grid-column: auto;
  }

  .russia-weight-entry {
    grid-template-columns: 1fr;
  }

  .parcel-list-hero,
  .documents-hero,
  .documents-list-panel__top,
  .parcel-list-toolbar__row,
  .parcel-edit-form__header,
  .parcel-edit-form__footer {
    align-items: stretch;
    flex-direction: column;
  }

  .parcel-list-summary {
    width: 100%;
    text-align: left;
  }

  .segmented-control,
  .segmented-control button {
    width: 100%;
  }

  .segmented-control button {
    padding-inline: 8px;
  }

  .parcel-list-filters,
  .documents-upload__form,
  .documents-search,
  .document-card,
  .russia-list-filters,
  .parcel-edit-grid,
  .georgia-parcel-card,
  .russia-list-card,
  .russia-group-issue-recipient header,
  .russia-group-issue-fields,
  .parcel-direction-grid {
    grid-template-columns: 1fr;
  }

  .documents-upload__wide {
    grid-column: auto;
  }

  .documents-hero__counter,
  .documents-search button,
  .documents-upload button,
  .document-card a {
    width: 100%;
  }

  .parcel-direction-page {
    align-self: start;
    gap: 12px;
  }

  .parcel-direction-hero {
    padding: 20px;
  }

  .parcel-direction-hero h1 {
    font-size: clamp(30px, 10vw, 42px);
  }

  .parcel-direction-card {
    min-height: 150px;
    align-content: start;
    padding: 18px;
  }

  .parcel-direction-card strong {
    font-size: 20px;
  }

  .georgia-parcel-card__side {
    grid-column: auto;
  }

  .georgia-parcel-card__media,
  .georgia-parcel-card__visual time {
    width: 100%;
  }

  .georgia-parcel-card__media {
    height: 180px;
  }

  .georgia-parcel-card__people {
    grid-template-columns: 1fr;
  }

  .parcel-actions {
    width: 100%;
  }

  .parcel-actions button {
    flex: 1 1 130px;
  }

  .parcel-edit-form__footer button {
    width: 100%;
  }

  .russia-branch-section__header,
  .russia-list-card__top {
    align-items: stretch;
    flex-direction: column;
  }

  .russia-list-card__bottom {
    grid-template-columns: 1fr;
  }

  .russia-issue-grid,
  .russia-issue-resident,
  .russia-issue-passport {
    grid-template-columns: 1fr;
  }

  .russia-issue-passport > strong {
    text-align: left;
  }

  .russia-list-card__side {
    width: 132px;
    justify-self: center;
  }

  .russia-list-card__destination,
  .russia-list-card__city {
    width: 132px;
  }

  .russia-list-card__badges {
    justify-items: stretch;
  }

  .settings-hero {
    align-items: stretch;
    flex-direction: column;
  }

  .warehouse-hero,
  .warehouse-issue-search,
  .warehouse-tax-export,
  .warehouse-form__footer {
    align-items: stretch;
    flex-direction: column;
  }

  .warehouse-hero__hint {
    width: 100%;
    text-align: left;
  }

  .warehouse-entry {
    grid-template-columns: 1fr;
  }

  .warehouse-issue-search,
  .warehouse-tax-export,
  .warehouse-issue-summary,
  .warehouse-issue-tax,
  .warehouse-issue-item {
    grid-template-columns: 1fr;
  }

  .warehouse-issue-search form,
  .warehouse-tax-export__stats,
  .warehouse-tax-export__actions {
    grid-template-columns: 1fr;
    width: 100%;
  }

  .warehouse-tax-export__stats,
  .warehouse-tax-export__actions {
    display: grid;
  }

  .warehouse-tax-export__stats section {
    text-align: left;
  }

  .warehouse-issue-item div:last-child {
    text-align: left;
  }

  .warehouse-issue-actions {
    flex-direction: column;
  }

  .warehouse-form__footer button,
  .warehouse-issue-actions button,
  .warehouse-issue-search button,
  .warehouse-tax-export__actions a {
    width: 100%;
  }

  .trips-hero,
  .trip-calendar-shell__top,
  .trip-calendar-panel__status {
    align-items: stretch;
    flex-direction: column;
  }

  .booking-choice-modal {
    position: static;
    inset: auto;
    z-index: auto;
    display: block;
    padding: 0;
    background: transparent;
    opacity: 1;
    pointer-events: auto;
    transition: none;
  }

  .booking-choice-modal__panel {
    width: 100%;
    max-height: none;
    gap: 16px;
    padding: 20px;
    box-shadow: var(--shadow-sm);
    transform: none;
    transition: none;
  }

  .booking-choice-card {
    min-height: 130px;
    align-content: start;
    padding: 16px;
  }

  .booking-choice-layout {
    grid-template-columns: 1fr;
  }

  .trip-route-map {
    display: none;
  }

  .trip-route-map__caption {
    right: 14px;
    left: 14px;
  }

  .trip-route-map__canvas {
    top: 84px;
    height: calc(100% - 122px);
  }

  .settings-current {
    width: 100%;
    text-align: left;
  }

  .rs-upload-status {
    width: 100%;
    text-align: left;
  }

  .rs-upload-field {
    align-items: stretch;
    flex-direction: column;
  }

  .rs-upload-picker {
    min-width: 0;
    width: 100%;
  }

  .theme-grid,
  .accent-grid,
  .rs-upload-form,
  .settings-toggle-grid,
  .booking-rule-layout,
  .booking-rule-grid,
  .booking-choice-grid,
  .trip-months {
    grid-template-columns: 1fr;
  }

  .booking-rule-submit {
    width: 100%;
    justify-self: stretch;
  }

  .booking-rule-item {
    align-items: stretch;
    flex-direction: column;
  }

  .booking-rule-item__side {
    justify-content: space-between;
  }

  .trips-hero__note {
    width: 100%;
    text-align: left;
  }

  .bus-booking-summary,
  .bus-workspace,
  .seat-modal__header,
  .seat-booking-form__footer {
    align-items: stretch;
    flex-direction: column;
  }

  .bus-row {
    grid-template-columns: minmax(0, 1fr) 34px minmax(0, 1fr);
    gap: 6px;
  }

  .bus-frame {
    padding: 18px 12px;
  }

  .bus-seat,
  .bus-service {
    min-height: 48px;
    padding: 6px 4px;
  }

  .bus-seat span {
    font-size: 15px;
  }

  .booking-side-panel,
  .seat-booking-form__footer button {
    width: 100%;
  }

  .seat-form-section {
    grid-template-columns: 1fr;
  }

  .seat-form-grid {
    grid-template-columns: 1fr;
  }

  .seat-modal {
    padding: 12px;
  }

  .seat-transfer-actions {
    flex-direction: column-reverse;
  }

  .seat-transfer-actions button {
    width: 100%;
  }
}

/* Compact production layout for Russia parcel cards */
@media (max-width: 1180px) {
  .russia-list-card__main {
    grid-template-columns: minmax(0, 1fr) minmax(138px, 0.36fr);
    grid-template-areas:
      "person payment"
      "description summary"
      "logistics logistics"
      "weights weights";
  }

  .russia-list-card__logistics {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .russia-list-card__logistics-item--wide {
    grid-column: auto;
  }
}

@media (max-width: 760px) {
  .russia-list-card {
    grid-template-columns: 100px minmax(0, 1fr);
  }

  .russia-list-card__side,
  .russia-list-card__destination,
  .russia-list-card__city,
  .russia-issued-pill {
    width: 100px;
  }

  .russia-list-card__destination {
    height: 94px;
  }

  .russia-list-card__main {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      "person"
      "payment"
      "description"
      "logistics"
      "weights"
      "summary";
  }

  .russia-list-card__badges {
    justify-content: flex-start;
  }

  .russia-list-card__summary {
    grid-template-columns: minmax(120px, 0.45fr) minmax(0, 1fr);
    align-items: stretch;
  }

  .push-settings,
  .warehouse-issue-card,
  .warehouse-issue-board__hero {
    grid-template-columns: 1fr;
  }

  .push-settings {
    grid-template-areas:
      "copy"
      "actions"
      "status";
  }

  .push-settings__actions {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    justify-content: stretch;
  }

  .push-settings button {
    min-width: 0;
  }

  .warehouse-issue-board__hero {
    display: grid;
    align-items: start;
  }

  .warehouse-issue-card__side {
    align-content: start;
  }
}

.dashboard-home-page [data-dashboard-count],
.dashboard-home-page [data-dashboard-total] {
  display: inline-block;
  transition: color 180ms ease, transform 180ms ease, text-shadow 180ms ease;
}

.dashboard-home-page [data-dashboard-count].is-live-updated,
.dashboard-home-page [data-dashboard-total].is-live-updated {
  color: var(--accent);
  transform: scale(1.08);
  text-shadow: 0 0 16px color-mix(in srgb, var(--accent) 48%, transparent);
}

@media (max-width: 520px) {
  .russia-list-card {
    grid-template-columns: 1fr;
  }

  .russia-list-card__side {
    width: 100%;
    grid-template-columns: 94px minmax(0, 1fr);
    align-items: center;
  }

  .russia-list-card__destination {
    width: 94px;
    height: 82px;
  }

  .russia-list-card__city {
    width: 100%;
    padding-inline: 8px;
    text-align: left;
  }

  .russia-issued-pill {
    width: 100%;
  }

  .russia-list-card__logistics {
    grid-template-columns: 1fr;
  }

  .russia-list-card__summary {
    grid-template-columns: 1fr;
  }

  .warehouse-issue-board {
    padding: 12px;
  }

  .warehouse-issue-card {
    padding: 12px;
  }

  .warehouse-issue-card__shelf {
    min-height: 92px;
  }
}

.chat-page {
  width: min(1380px, 100%);
  height: calc(100dvh - 48px);
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 10px;
}

/* Analytics portal */
.analytics-page .app-main {
  background:
    radial-gradient(circle at 88% 3%, color-mix(in srgb, var(--accent) 13%, transparent), transparent 27rem),
    var(--surface-page);
}

.analytics-shell {
  width: min(1540px, 100%);
  margin: 0 auto;
  padding: clamp(18px, 2.5vw, 38px);
  display: grid;
  gap: 20px;
}

.analytics-hero {
  position: relative;
  overflow: hidden;
  min-height: 178px;
  padding: clamp(24px, 3vw, 42px);
  border: 1px solid var(--border-subtle);
  border-radius: 26px;
  background:
    linear-gradient(118deg, color-mix(in srgb, var(--surface-card) 96%, transparent), color-mix(in srgb, var(--accent) 8%, var(--surface-card)));
  box-shadow: var(--shadow-card);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.analytics-hero::after {
  content: "";
  position: absolute;
  width: 340px;
  height: 340px;
  right: -100px;
  top: -180px;
  border: 55px solid color-mix(in srgb, var(--accent) 10%, transparent);
  border-radius: 50%;
}

.analytics-eyebrow,
.analytics-panel__head > div > span,
.analytics-section-head > div > span {
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .12em;
}

.analytics-hero h1 {
  margin: 8px 0 7px;
  color: var(--text-primary);
  font-size: clamp(30px, 4vw, 55px);
  line-height: 1;
}

.analytics-hero p {
  max-width: 720px;
  margin: 0;
  color: var(--text-secondary);
}

.analytics-hero__scope {
  position: relative;
  z-index: 1;
  min-width: 220px;
  padding: 18px 22px;
  border: 1px solid color-mix(in srgb, var(--accent) 32%, var(--border-subtle));
  border-radius: 18px;
  background: color-mix(in srgb, var(--surface-card-soft) 88%, transparent);
  display: grid;
  gap: 3px;
  text-align: right;
}

.analytics-hero__scope span,
.analytics-hero__scope small {
  color: var(--text-secondary);
}

.analytics-hero__scope strong {
  color: var(--text-primary);
  font-size: 19px;
}

.analytics-filters {
  padding: 14px;
  border: 1px solid var(--border-subtle);
  border-radius: 18px;
  background: var(--surface-card);
  box-shadow: var(--shadow-card);
  display: flex;
  align-items: end;
  gap: 12px;
  flex-wrap: wrap;
}

.analytics-filters label {
  display: grid;
  gap: 6px;
}

.analytics-filters label > span {
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 700;
}

.analytics-filters select,
.analytics-filters input {
  min-height: 42px;
  border: 1px solid var(--border-subtle);
  border-radius: 11px;
  background: var(--surface-control);
  color: var(--text-primary);
}

.analytics-periods {
  display: flex;
  gap: 4px;
  padding: 4px;
  border-radius: 12px;
  background: var(--surface-control);
}

.analytics-periods button,
.analytics-apply {
  min-height: 40px;
  border: 0;
  border-radius: 9px;
  padding: 0 16px;
  color: var(--text-secondary);
  background: transparent;
  font-weight: 700;
  cursor: pointer;
}

.analytics-periods button.is-active,
.analytics-apply {
  color: var(--button-primary-text, #fff);
  background: var(--accent);
  box-shadow: 0 8px 22px color-mix(in srgb, var(--accent) 25%, transparent);
}

.analytics-custom-dates {
  display: none;
  gap: 8px;
}

.analytics-custom-dates.is-visible {
  display: flex;
}

.analytics-apply {
  margin-left: auto;
}

.analytics-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.analytics-kpi,
.analytics-panel {
  border: 1px solid var(--border-subtle);
  background: var(--surface-card);
  box-shadow: var(--shadow-card);
}

.analytics-kpi {
  position: relative;
  overflow: hidden;
  min-height: 155px;
  padding: 22px;
  border-radius: 19px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
}

.analytics-kpi--accent,
.analytics-kpi--booking {
  background:
    linear-gradient(140deg, color-mix(in srgb, var(--accent) 14%, var(--surface-card)), var(--surface-card));
}

.analytics-kpi--accent::after,
.analytics-kpi--booking::after {
  content: "";
  position: absolute;
  right: -25px;
  top: -30px;
  width: 105px;
  height: 105px;
  border: 18px solid color-mix(in srgb, var(--accent) 10%, transparent);
  border-radius: 50%;
}

.analytics-kpi > span {
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 700;
}

.analytics-kpi > strong,
.analytics-money strong {
  color: var(--text-primary);
  font-size: clamp(25px, 2.4vw, 38px);
  line-height: 1.1;
}

.analytics-kpi em,
.analytics-money em {
  color: var(--text-secondary);
  font-size: .45em;
  font-style: normal;
}

.analytics-kpi > small {
  color: var(--text-secondary);
  font-size: 11px;
}

.analytics-money {
  display: grid;
  gap: 3px;
}

.analytics-money strong {
  font-size: clamp(19px, 2vw, 29px);
}

.analytics-change.is-up,
.is-up {
  color: var(--success, #35bd7b) !important;
}

.analytics-change.is-down,
.is-down {
  color: var(--danger, #ef6372) !important;
}

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

.analytics-grid--wide {
  grid-template-columns: minmax(0, 1.65fr) minmax(280px, .65fr);
}

.analytics-grid--three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.analytics-panel {
  min-width: 0;
  padding: 22px;
  border-radius: 20px;
}

.analytics-panel__head,
.analytics-section-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 18px;
}

.analytics-panel__head h2,
.analytics-section-head h2 {
  margin: 5px 0 0;
  color: var(--text-primary);
  font-size: clamp(18px, 2vw, 25px);
}

.analytics-panel__legend {
  color: var(--text-secondary);
  font-size: 11px;
}

.analytics-panel__legend i {
  display: inline-block;
  width: 18px;
  height: 3px;
  margin-right: 7px;
  border-radius: 9px;
  background: var(--accent);
  vertical-align: middle;
}

.analytics-chart {
  min-height: 220px;
  margin-top: 24px;
}

.analytics-chart--bars {
  height: 230px;
  display: flex;
  align-items: stretch;
  gap: 4px;
}

.analytics-bar-item {
  min-width: 0;
  flex: 1;
  display: grid;
  grid-template-rows: 18px 1fr 18px;
  gap: 5px;
  text-align: center;
}

.analytics-bar-value,
.analytics-bar-item small {
  overflow: hidden;
  color: var(--text-secondary);
  font-size: 9px;
  white-space: nowrap;
}

.analytics-bar-track {
  min-height: 0;
  border-radius: 6px;
  background: color-mix(in srgb, var(--surface-control) 76%, transparent);
  display: flex;
  align-items: end;
  overflow: hidden;
}

.analytics-bar-track i {
  width: 100%;
  border-radius: 6px 6px 2px 2px;
  background: color-mix(in srgb, var(--accent) 55%, var(--surface-control));
  transition: height .45s ease;
}

.analytics-bar-item.is-peak .analytics-bar-track i {
  background: var(--accent);
  box-shadow: 0 0 18px color-mix(in srgb, var(--accent) 45%, transparent);
}

[data-chart-tone="booking"] .analytics-bar-track i {
  background: color-mix(in srgb, var(--gold) 65%, var(--surface-control));
}

.analytics-chart--line svg {
  width: 100%;
  height: 220px;
  overflow: visible;
}

.analytics-line-path {
  fill: none;
  stroke: var(--accent);
  stroke-width: 4;
  vector-effect: non-scaling-stroke;
}

.analytics-line-area {
  fill: color-mix(in srgb, var(--accent) 13%, transparent);
}

.analytics-chart--line circle {
  fill: var(--surface-card);
  stroke: var(--accent);
  stroke-width: 3;
  vector-effect: non-scaling-stroke;
}

[data-chart-tone="booking"] .analytics-line-path,
[data-chart-tone="booking"] circle {
  stroke: var(--gold);
}

[data-chart-tone="booking"] .analytics-line-area {
  fill: color-mix(in srgb, var(--gold) 13%, transparent);
}

.analytics-line-labels {
  display: flex;
  justify-content: space-between;
  gap: 2px;
}

.analytics-line-labels small {
  min-width: 0;
  color: var(--text-secondary);
  font-size: 9px;
}

.analytics-donut-wrap {
  min-height: 250px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 28px;
}

.analytics-donut {
  --card-end: 0%;
  --cash-end: 0%;
  --mixed-end: 0%;
  --partial-end: 0%;
  width: 145px;
  height: 145px;
  flex: 0 0 auto;
  padding: 18px;
  border-radius: 50%;
  background: conic-gradient(
    var(--accent) 0 var(--card-end),
    var(--gold) var(--card-end) var(--cash-end),
    #5f8ff7 var(--cash-end) var(--mixed-end),
    #e58a45 var(--mixed-end) var(--partial-end),
    color-mix(in srgb, var(--danger, #ef6372) 70%, var(--surface-control)) var(--partial-end) 100%
  );
}

.analytics-donut > div {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: var(--surface-card);
  display: grid;
  place-content: center;
  text-align: center;
}

.analytics-donut strong {
  color: var(--text-primary);
  font-size: 28px;
}

.analytics-donut span {
  color: var(--text-secondary);
  font-size: 10px;
}

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

.analytics-legend-list span {
  color: var(--text-secondary);
  font-size: 12px;
}

.analytics-legend-list i {
  display: inline-block;
  width: 9px;
  height: 9px;
  margin-right: 7px;
  border-radius: 50%;
  background: var(--accent);
}

.analytics-legend-list i.is-cash {
  background: var(--gold);
}

.analytics-legend-list i.is-mixed {
  background: #5f8ff7;
}

.analytics-legend-list i.is-partial {
  background: #e58a45;
}

.analytics-legend-list i.is-unpaid {
  background: var(--danger, #ef6372);
}

.analytics-legend-list b {
  margin-left: 6px;
  color: var(--text-primary);
}

.analytics-section-head {
  margin-top: 12px;
}

.analytics-insights {
  display: grid;
  gap: 14px;
}

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

.analytics-insight {
  padding: 17px;
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  background: var(--surface-card);
  display: flex;
  gap: 12px;
}

.analytics-insight > i {
  width: 9px;
  height: 9px;
  margin-top: 5px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 5px color-mix(in srgb, var(--accent) 12%, transparent);
}

.analytics-insight.is-positive > i {
  background: var(--success, #35bd7b);
}

.analytics-insight.is-negative > i {
  background: var(--danger, #ef6372);
}

.analytics-insight strong {
  color: var(--text-primary);
  font-size: 13px;
}

.analytics-insight p {
  margin: 6px 0 0;
  color: var(--text-secondary);
  font-size: 11px;
  line-height: 1.55;
}

.analytics-branch-table {
  margin-top: 18px;
  display: grid;
}

.analytics-branch-row {
  padding: 13px 10px;
  border-top: 1px solid var(--border-subtle);
  display: grid;
  grid-template-columns: 1.4fr repeat(4, 1fr);
  gap: 12px;
  align-items: center;
}

.analytics-branch-row strong,
.analytics-branch-row span {
  color: var(--text-primary);
  font-size: 12px;
}

.analytics-branch-row--head {
  border-top: 0;
}

.analytics-branch-row--head span {
  color: var(--text-secondary);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}

.russia-latin-hint {
  display: block;
  min-height: 14px;
  margin-top: 5px;
  color: var(--text-secondary);
  font-size: 10px;
  font-weight: 600;
  line-height: 1.3;
  transition: color .18s ease, transform .18s ease;
}

.russia-latin-hint.is-warning {
  color: var(--danger, #ef6372);
  transform: translateX(3px);
}

.russia-form-grid input.is-latin-rejected {
  border-color: var(--danger, #ef6372) !important;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--danger, #ef6372) 18%, transparent) !important;
  animation: russia-latin-rejected .28s ease;
}

@keyframes russia-latin-rejected {
  0%, 100% { transform: translateX(0); }
  35% { transform: translateX(-3px); }
  70% { transform: translateX(3px); }
}

@media (max-width: 1180px) {
  .analytics-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .analytics-grid--three {
    grid-template-columns: 1fr 1fr;
  }

  .analytics-grid--three > :first-child {
    grid-column: 1 / -1;
  }

  .analytics-insights__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .analytics-shell {
    padding: 14px 12px 90px;
    gap: 13px;
  }

  .analytics-hero {
    min-height: auto;
    padding: 22px;
    border-radius: 19px;
    align-items: stretch;
    flex-direction: column;
  }

  .analytics-hero__scope {
    min-width: 0;
    text-align: left;
  }

  .analytics-filters,
  .analytics-custom-dates {
    align-items: stretch;
    flex-direction: column;
  }

  .analytics-filters > label,
  .analytics-filters select,
  .analytics-filters input,
  .analytics-apply {
    width: 100%;
  }

  .analytics-periods {
    width: 100%;
    overflow-x: auto;
  }

  .analytics-periods button {
    flex: 1 0 auto;
  }

  .analytics-kpis,
  .analytics-grid,
  .analytics-grid--wide,
  .analytics-grid--three,
  .analytics-insights__grid {
    grid-template-columns: 1fr;
  }

  .analytics-grid--three > :first-child {
    grid-column: auto;
  }

  .analytics-kpi {
    min-height: 130px;
  }

  .analytics-donut-wrap {
    min-height: 210px;
    gap: 16px;
  }

  .analytics-donut {
    width: 125px;
    height: 125px;
  }

  .analytics-branch-table {
    overflow-x: auto;
  }

  .analytics-branch-row {
    min-width: 650px;
  }
}

.chat-hero {
  min-height: 78px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 11px 16px;
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  background:
    radial-gradient(circle at 84% 20%, color-mix(in srgb, var(--accent) 20%, transparent), transparent 30%),
    linear-gradient(135deg, color-mix(in srgb, var(--surface-card) 92%, transparent), var(--surface-card-soft));
  box-shadow: var(--shadow-sm);
}

.chat-hero h1 {
  margin: 0 0 2px;
  color: var(--text-primary);
  font-size: clamp(27px, 3vw, 40px);
  line-height: 1.04;
}

.chat-hero .eyebrow {
  margin-bottom: 2px;
  font-size: 10px;
}

.chat-hero > div > span {
  color: var(--text-secondary);
  font-size: 11px;
}

.chat-hero .parcel-list-summary {
  min-width: 96px;
  padding: 8px 11px;
  border-radius: 9px;
}

.chat-hero .parcel-list-summary span {
  font-size: 10px;
}

.chat-hero .parcel-list-summary strong {
  margin-top: 2px;
  font-size: 23px;
}

@media (min-width: 641px) and (max-height: 800px) {
  .chat-hero {
    min-height: 62px;
    padding: 8px 14px;
  }

  .chat-hero .eyebrow,
  .chat-hero > div > span {
    display: none;
  }

  .chat-hero h1 {
    margin: 0;
    font-size: clamp(25px, 2.5vw, 34px);
  }

  .chat-hero .parcel-list-summary {
    min-width: 82px;
    padding: 6px 9px;
  }
}

.chat-shell {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(300px, 0.28fr) minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid var(--border-subtle);
  border-radius: 20px;
  background:
    linear-gradient(145deg, color-mix(in srgb, var(--accent) 7%, transparent), transparent),
    var(--surface-card);
  box-shadow: var(--shadow-lg);
}

.chat-channel-list {
  min-height: 0;
  display: grid;
  align-content: start;
  gap: 8px;
  padding: 16px 12px;
  overflow-y: auto;
  border-right: 1px solid var(--border-subtle);
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--accent) 7%, transparent), transparent 44%),
    var(--surface-card-soft);
}

.chat-channel-list__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 6px 10px;
  color: var(--text-primary);
}

.chat-channel-list__head span {
  min-width: 25px;
  height: 25px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--surface-control);
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 900;
}

.chat-channel-list button {
  min-height: 66px;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 9px 11px;
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  background:
    linear-gradient(145deg, color-mix(in srgb, var(--surface-card) 70%, transparent), transparent),
    var(--surface-control);
  color: var(--text-primary);
  font-weight: 900;
  text-align: left;
  transition: border-color 0.16s ease, background 0.16s ease, transform 0.16s ease;
}

.chat-channel-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border-accent);
  overflow: hidden;
  border-radius: 13px;
  background:
    linear-gradient(145deg, color-mix(in srgb, var(--accent) 36%, transparent), color-mix(in srgb, var(--accent-dark) 12%, transparent)),
    var(--surface-card);
  color: var(--accent);
}

.chat-channel-icon img,
.chat-room__avatar img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.chat-channel-icon svg {
  width: 21px;
  height: 21px;
  fill: currentColor;
}

.chat-channel-list button:hover {
  border-color: var(--border-accent);
  transform: translateY(-1px);
}

.chat-channel-label {
  min-width: 0;
  display: -webkit-box;
  overflow: hidden;
  line-height: 1.2;
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  white-space: normal;
}

.chat-channel-copy {
  min-width: 0;
  display: grid;
  gap: 5px;
}

.chat-channel-copy small {
  overflow: hidden;
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-channel-list button.is-active {
  border-color: var(--border-accent);
  background:
    linear-gradient(145deg, color-mix(in srgb, var(--accent) 20%, transparent), transparent),
    var(--surface-card);
  box-shadow: inset 3px 0 0 var(--accent);
}

.chat-channel-list button.is-active .chat-channel-icon {
  background: var(--control-primary-bg);
  color: var(--control-primary-text);
}

.chat-channel-list strong,
.chat-widget__fab span {
  width: max-content;
  min-width: 24px;
  height: 24px;
  display: inline-grid;
  place-items: center;
  justify-self: end;
  padding: 0 7px;
  border-radius: 999px;
  background: var(--control-primary-bg);
  color: var(--control-primary-text);
  font-size: 12px;
}

.chat-channel-list strong[hidden],
.chat-widget__fab span[hidden] {
  display: none;
}

.chat-room {
  position: relative;
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: auto 1fr auto;
}

.chat-room__header {
  min-height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 18px;
  border-bottom: 1px solid var(--border-subtle);
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--surface-card) 80%, transparent), transparent),
    var(--surface-card-soft);
}

.chat-room__avatar {
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--border-accent);
  border-radius: 14px;
  background: var(--surface-control);
  color: var(--accent);
}

.chat-room__avatar svg {
  width: 22px;
  fill: currentColor;
}

.chat-room__identity {
  min-width: 0;
  flex: 1;
}

.chat-mobile-back {
  display: none;
  width: 38px;
  min-height: 38px;
  padding: 0;
  border-radius: 12px;
  background: var(--surface-control);
  color: var(--text-primary);
  font-size: 20px;
}

.chat-room__header span {
  display: block;
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.chat-room__header strong {
  color: var(--text-primary);
  font-size: 20px;
}

.chat-messages {
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 13px;
  padding: 12px;
  overflow-y: auto;
  overscroll-behavior: contain;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--accent) 6%, transparent), transparent 45%),
    radial-gradient(circle at 14px 14px, color-mix(in srgb, var(--text-secondary) 10%, transparent) 1px, transparent 1px) 0 0 / 22px 22px,
    var(--surface-bg);
}

.chat-load-more {
  align-self: center;
  min-height: 34px;
  padding: 0 14px;
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface-card) 82%, transparent);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 900;
}

.chat-load-more:hover {
  border-color: var(--border-accent);
  background: color-mix(in srgb, var(--accent) 12%, var(--surface-card));
  color: var(--text-primary);
}

.chat-load-more[hidden] {
  display: none;
}

.chat-message {
  display: flex;
  justify-content: flex-start;
}

.chat-message.is-mine {
  justify-content: flex-end;
}

.chat-message.is-received-entering { animation: chat-message-received 620ms cubic-bezier(.16, 1, .3, 1) both; transform-origin: left bottom; }
.chat-message.is-sent-entering { animation: chat-message-sent 650ms cubic-bezier(.16, 1, .3, 1) both; transform-origin: right bottom; }
.chat-message.is-being-deleted { pointer-events: none; animation: chat-message-delete 360ms cubic-bezier(.55, 0, .7, .2) both; }
.chat-message.is-deleted-entering { animation: chat-message-tombstone 720ms cubic-bezier(.16, 1, .3, 1) both; }
.chat-message.is-edited-entering .chat-message__bubble { animation: chat-message-edited 1050ms cubic-bezier(.16, 1, .3, 1) both; }

@keyframes chat-message-received {
  0% { opacity: 0; transform: translate3d(-26px, 14px, 0) scale(.88); filter: blur(5px); }
  58% { opacity: 1; transform: translate3d(3px, -2px, 0) scale(1.018); filter: blur(0); }
  100% { opacity: 1; transform: none; filter: blur(0); }
}

@keyframes chat-message-sent {
  0% { opacity: 0; transform: translate3d(34px, 20px, 0) scale(.78) rotate(2deg); filter: blur(4px); }
  55% { opacity: 1; transform: translate3d(-4px, -3px, 0) scale(1.025) rotate(-.4deg); filter: blur(0); }
  100% { opacity: 1; transform: none; filter: blur(0); }
}

@keyframes chat-message-delete {
  0% { opacity: 1; transform: scale(1); filter: blur(0); }
  45% { opacity: .72; transform: scale(.96) rotate(-.4deg); }
  100% { opacity: 0; transform: translate3d(18px, -5px, 0) scale(.82); filter: blur(7px); }
}

@keyframes chat-message-tombstone {
  0% { opacity: 0; transform: scale(.84); filter: blur(5px); }
  55% { opacity: 1; transform: scale(1.02); filter: blur(0); }
  100% { opacity: 1; transform: none; filter: blur(0); }
}

@keyframes chat-message-edited {
  0% { transform: scale(.97); box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 0%, transparent), var(--shadow-sm); }
  35% { transform: scale(1.012); border-color: var(--accent); box-shadow: 0 0 0 5px color-mix(in srgb, var(--accent) 20%, transparent), 0 14px 38px color-mix(in srgb, var(--accent) 18%, transparent); }
  100% { transform: none; box-shadow: var(--shadow-sm); }
}

.chat-message__bubble {
  position: relative;
  width: fit-content;
  max-width: min(680px, 78%);
  display: grid;
  gap: 4px;
  padding: 8px 10px;
  border: 1px solid var(--border-subtle);
  border-radius: 14px 14px 14px 5px;
  background: var(--surface-card);
  color: var(--text-primary);
  box-shadow: var(--shadow-sm);
}

.chat-message.is-mine .chat-message__bubble {
  border-color: var(--border-accent);
  border-radius: 14px 14px 5px 14px;
  background: color-mix(in srgb, var(--accent) 14%, var(--surface-card));
}

.chat-message__bubble header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--text-secondary);
  font-size: 10px;
  font-weight: 850;
  line-height: 1;
}

.chat-message__reply-action { width: 25px; min-height: 25px; padding: 0; border: 0; border-radius: 8px; background: transparent; color: var(--text-secondary); font-size: 16px; opacity: 0; transition: opacity 150ms ease, background 150ms ease, color 150ms ease; }
.chat-message:hover .chat-message__reply-action, .chat-message__reply-action:focus-visible { opacity: 1; }
.chat-message__reply-action:hover { background: color-mix(in srgb, var(--accent) 15%, transparent); color: var(--accent); }
.chat-message__manage-action { width: 25px; min-height: 25px; padding: 0; border: 0; border-radius: 8px; background: transparent; color: var(--text-secondary); font-size: 16px; opacity: 0; transition: opacity 150ms ease, background 150ms ease, color 150ms ease; }
.chat-message:hover .chat-message__manage-action, .chat-message__manage-action:focus-visible { opacity: 1; }
.chat-message__manage-action:hover { background: color-mix(in srgb, var(--accent) 15%, transparent); color: var(--accent); }
.chat-message__manage-action.is-delete:hover { background: color-mix(in srgb, #d64545 14%, transparent); color: #d64545; }
.chat-message__deleted { color: var(--text-secondary); font-style: italic; }
.chat-message__receipt { justify-self: end; min-height: 14px; display: inline-flex; align-items: center; gap: 3px; margin: -2px 0 -3px; padding: 0 1px; border: 0; background: transparent; color: var(--text-secondary); font-size: 9px; cursor: help; }
.chat-message__receipt.is-delivered { color: color-mix(in srgb, var(--accent) 72%, var(--text-secondary)); }
.chat-message__receipt.is-read { color: var(--accent); }
.chat-message__receipt strong { font-size: 8px; }
.chat-message.is-deleted-entering .chat-message__bubble { border-style: dashed; background: color-mix(in srgb, var(--surface-card) 78%, transparent); }
.chat-message__reply { min-width: 0; display: grid; gap: 1px; padding: 5px 7px; border: 0; border-left: 3px solid var(--accent); border-radius: 7px; background: color-mix(in srgb, var(--accent) 9%, var(--surface-bg)); color: var(--text-primary); text-align: left; }
.chat-message__reply strong { color: var(--accent); font-size: 11px; }
.chat-message__reply span { overflow: hidden; color: var(--text-secondary); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.chat-message__reactions { position: absolute; z-index: 3; left: 10px; bottom: -13px; display: flex; align-items: center; gap: 3px; height: 25px; }
.chat-message.is-mine .chat-message__reactions { right: 10px; left: auto; }
.chat-message__reactions button { display: inline-flex; align-items: center; justify-content: center; border-radius: 999px; }
.chat-reaction-pill { min-width: 29px; min-height: 24px; gap: 3px; padding: 2px 7px; border: 1px solid var(--border-subtle); background: var(--surface-card); color: var(--text-primary); box-shadow: var(--shadow-sm); }
.chat-reaction-pill.is-mine { border-color: var(--border-accent); background: color-mix(in srgb, var(--accent) 16%, var(--surface-card)); }
.chat-reaction-pill strong { font-size: 10px; }
.chat-reaction-open { width: 25px; min-height: 25px; padding: 0; border: 1px solid var(--border-subtle); background: var(--surface-card); color: var(--text-secondary); font-size: 14px; opacity: 0; box-shadow: var(--shadow-sm); transition: opacity 140ms ease, transform 140ms ease; }
.chat-message:hover .chat-reaction-open, .chat-reaction-open:focus-visible { opacity: 1; }
.chat-reaction-picker { position: absolute; z-index: 9; bottom: 32px; left: 0; display: flex; gap: 3px; padding: 5px; border: 1px solid var(--border-subtle); border-radius: 999px; background: color-mix(in srgb, var(--surface-card) 96%, transparent); box-shadow: var(--shadow-lg); backdrop-filter: blur(14px); }
.chat-message.is-mine .chat-reaction-picker { right: 0; left: auto; }
.chat-reaction-picker[hidden] { display: none; }
.chat-reaction-picker button { width: 38px; min-height: 38px; padding: 0; border: 0; background: transparent; font-size: 21px; transition: transform 120ms ease, background 120ms ease; }
.chat-reaction-picker button:hover { background: color-mix(in srgb, var(--accent) 12%, transparent); transform: scale(1.16); }
.chat-message.is-highlighted .chat-message__bubble { animation: chat-message-highlight 1.4s ease; }
@keyframes chat-message-highlight { 35% { box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 42%, transparent), var(--shadow-sm); } }
.chat-unread-divider { display: flex; align-items: center; gap: 10px; color: var(--accent); font-size: 11px; font-weight: 900; text-transform: uppercase; letter-spacing: .08em; }
.chat-unread-divider::before, .chat-unread-divider::after { content: ""; height: 1px; flex: 1; background: color-mix(in srgb, var(--accent) 46%, transparent); }
.chat-date-divider { position: relative; z-index: 2; display: flex; justify-content: center; margin: 3px 0; pointer-events: none; }
.chat-date-divider span { padding: 4px 10px; border: 1px solid var(--border-subtle); border-radius: 999px; background: color-mix(in srgb, var(--surface-card) 88%, transparent); color: var(--text-secondary); box-shadow: var(--shadow-sm); font-size: 9px; font-weight: 850; backdrop-filter: blur(8px); }

.chat-room__identity button { min-height: 18px; display: block; padding: 0; border: 0; background: transparent; color: var(--text-secondary); text-align: left; }
.chat-room__identity button:hover { color: var(--accent); }
.chat-room__identity [data-chat-presence-label].is-typing { color: var(--accent); animation: chat-typing-pulse 1.1s ease-in-out infinite alternate; }
@keyframes chat-typing-pulse { to { opacity: .58; } }
.chat-presence-panel { position: absolute; z-index: 11; top: 62px; right: 58px; width: min(340px, calc(100% - 24px)); max-height: min(430px, calc(100% - 78px)); overflow: hidden auto; padding: 8px; border: 1px solid var(--border-subtle); border-radius: 13px; background: color-mix(in srgb, var(--surface-card) 96%, transparent); box-shadow: var(--shadow-lg); backdrop-filter: blur(18px); }
.chat-presence-panel[hidden] { display: none; }
.chat-presence-panel > header { display: flex; align-items: center; justify-content: space-between; padding: 3px 4px 8px; }
.chat-presence-panel > header button { width: 28px; min-height: 28px; padding: 0; border-radius: 7px; }
.chat-presence-panel > div { display: grid; gap: 4px; }
.chat-presence-user { display: grid; grid-template-columns: 9px minmax(0, 1fr) auto; align-items: center; gap: 8px; padding: 7px 8px; border-radius: 9px; background: var(--surface-card-soft); }
.chat-presence-user > i { width: 8px; height: 8px; border-radius: 50%; background: var(--text-muted); box-shadow: 0 0 0 3px color-mix(in srgb, var(--text-muted) 12%, transparent); }
.chat-presence-user.is-online > i { background: #31c86b; box-shadow: 0 0 0 3px color-mix(in srgb, #31c86b 17%, transparent); }
.chat-presence-user > span { min-width: 0; display: grid; }
.chat-presence-user strong { overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.chat-presence-user small, .chat-presence-user em { color: var(--text-secondary); font-size: 9px; font-style: normal; }

.chat-search-open { margin-left: auto; width: 40px; min-height: 40px; padding: 0; border-radius: 12px; font-size: 22px; }
.chat-search-panel { position: absolute; z-index: 8; inset: 70px 12px auto; max-height: calc(100% - 82px); display: grid; gap: 10px; padding: 14px; overflow-y: auto; border: 1px solid var(--border-accent); border-radius: 14px; background: color-mix(in srgb, var(--surface-card) 96%, transparent); box-shadow: var(--shadow-lg); backdrop-filter: blur(18px); }
.chat-search-panel[hidden] { display: none; }
.chat-search-panel > header { display: flex; align-items: center; justify-content: space-between; }
.chat-search-panel > header button { width: 34px; min-height: 34px; padding: 0; border-radius: 9px; }
.chat-search-panel form { display: grid; grid-template-columns: minmax(180px, 1.6fr) minmax(140px, 1fr) minmax(140px, 1fr) repeat(2, minmax(125px, .8fr)) auto; gap: 8px; align-items: end; }
.chat-search-panel input, .chat-search-panel select { width: 100%; min-height: 42px; border: 1px solid var(--border-subtle); border-radius: 10px; background: var(--input-bg); color: var(--text-primary); }
.chat-search-panel label { display: grid; gap: 4px; color: var(--text-secondary); font-size: 10px; font-weight: 800; }
.chat-search-results { display: grid; gap: 7px; }
.chat-search-result { display: grid; gap: 5px; width: 100%; padding: 10px 12px; border: 1px solid var(--border-subtle); border-radius: 10px; background: var(--surface-card-soft); color: var(--text-primary); text-align: left; }
.chat-search-result:hover { border-color: var(--border-accent); background: color-mix(in srgb, var(--accent) 9%, var(--surface-card)); }
.chat-search-result > span { display: flex; justify-content: space-between; gap: 10px; color: var(--text-secondary); font-size: 10px; }
.chat-search-result b { color: var(--accent); font-size: 11px; }
.chat-search-result p { margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-search-summary, .chat-search-empty { color: var(--text-secondary); font-size: 12px; }
.chat-search-more { justify-self: center; min-height: 36px; }

.chat-message__bubble p {
  margin: 0;
  color: var(--text-primary);
  line-height: 1.32;
  white-space: pre-wrap;
}

@media (min-width: 641px) {
  .chat-message__reply-action,
  .chat-message__manage-action {
    width: 20px;
    min-height: 20px;
    border-radius: 6px;
    font-size: 13px;
  }
}

.chat-message__attachments {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 6px;
}

.chat-message__image img {
  width: 100%;
  height: 128px;
  display: block;
  object-fit: cover;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
}

.chat-message__image { overflow: hidden; border-radius: 8px; }
.chat-message__image img { transition: transform 260ms cubic-bezier(.16, 1, .3, 1), filter 260ms ease; }
.chat-message__image:hover img { transform: scale(1.035); filter: saturate(1.08); }
.chat-message__document { min-width: min(280px, 100%); display: grid; grid-template-columns: 48px minmax(0, 1fr); grid-template-rows: auto auto; align-items: center; gap: 2px 10px; padding: 9px; border: 1px solid var(--border-subtle); border-radius: 11px; background: color-mix(in srgb, var(--surface-bg) 72%, transparent); color: var(--text-primary); text-decoration: none; transition: transform 180ms ease, border-color 180ms ease, background 180ms ease; }
.chat-message__document:hover { transform: translateY(-2px); border-color: var(--border-accent); background: color-mix(in srgb, var(--accent) 10%, var(--surface-bg)); }
.chat-message__document > span { grid-row: 1 / 3; display: grid; place-items: center; width: 48px; height: 48px; border-radius: 10px; background: color-mix(in srgb, var(--accent) 17%, var(--surface-card)); color: var(--accent); font-size: 10px; font-weight: 950; }
.chat-message__document strong { overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.chat-message__document small { color: var(--text-secondary); font-size: 10px; font-weight: 800; }

.chat-empty-state {
  width: min(420px, 100%);
  justify-self: center;
  align-self: center;
  display: grid;
  gap: 6px;
  margin: auto;
  padding: 18px;
  border: 1px dashed var(--border-subtle);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface-card) 72%, transparent);
  color: var(--text-secondary);
  text-align: center;
}

.chat-empty-state strong {
  color: var(--text-primary);
}

.chat-composer {
  display: grid;
  gap: 8px;
  padding: 12px 14px 14px;
  border-top: 1px solid var(--border-subtle);
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--surface-card) 78%, transparent), transparent),
    var(--surface-card);
}

.chat-composer__row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 8px;
  align-items: end;
}

.chat-composer button[type="submit"] {
  position: relative;
  width: 48px;
  padding: 0;
  overflow: visible;
  border-radius: 14px;
  font-size: 21px;
  transition: transform 180ms ease, filter 180ms ease, box-shadow 180ms ease;
}

.chat-composer button[type="submit"]:hover:not(:disabled) { transform: translateY(-2px) scale(1.04); box-shadow: 0 10px 24px color-mix(in srgb, var(--accent) 28%, transparent); }
.chat-composer.is-sending button[type="submit"] { color: transparent; transform: scale(.92); filter: saturate(.7); }
.chat-composer.is-sending button[type="submit"]::after { content: ""; position: absolute; inset: 50% auto auto 50%; width: 17px; height: 17px; margin: -10px 0 0 -10px; border: 2px solid color-mix(in srgb, currentColor 28%, transparent); border-top-color: var(--control-primary-text); border-right-color: var(--control-primary-text); border-radius: 50%; animation: chat-send-spin 650ms linear infinite; }
.chat-send-burst { position: absolute; z-index: 5; inset: 50% auto auto 50%; width: 1px; height: 1px; pointer-events: none; }
.chat-send-burst i { --burst-x: 28px; --burst-y: -20px; position: absolute; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 12px color-mix(in srgb, var(--accent) 70%, transparent); animation: chat-send-particle 780ms cubic-bezier(.16, 1, .3, 1) both; }
.chat-send-burst i:nth-child(2) { --burst-x: -25px; --burst-y: -25px; width: 4px; height: 4px; animation-delay: 35ms; }
.chat-send-burst i:nth-child(3) { --burst-x: 34px; --burst-y: 8px; width: 4px; height: 4px; animation-delay: 70ms; }
.chat-send-burst i:nth-child(4) { --burst-x: -30px; --burst-y: 12px; width: 5px; height: 5px; animation-delay: 20ms; }
.chat-send-burst i:nth-child(5) { --burst-x: 5px; --burst-y: -34px; width: 3px; height: 3px; animation-delay: 85ms; }
@keyframes chat-send-spin { to { transform: rotate(360deg); } }
@keyframes chat-send-particle { 0% { opacity: 0; transform: translate(0, 0) scale(.2); } 18% { opacity: 1; } 100% { opacity: 0; transform: translate(var(--burst-x), var(--burst-y)) scale(1.15); } }

@media (prefers-reduced-motion: reduce) {
  .chat-message.is-received-entering,
  .chat-message.is-sent-entering,
  .chat-message.is-being-deleted,
  .chat-message.is-deleted-entering,
  .chat-message.is-edited-entering .chat-message__bubble,
  .chat-composer.is-sending button[type="submit"]::after,
  .chat-send-burst i {
    animation: none !important;
  }

  .chat-message,
  .chat-message__bubble,
  .chat-composer button[type="submit"] {
    transition: none !important;
  }
}

.chat-management {
  display: grid;
  grid-template-columns: minmax(280px, 0.72fr) minmax(0, 1.28fr);
  gap: 16px;
}

.chat-management__create {
  align-content: start;
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  background: var(--surface-card-soft);
}

.chat-management__create label {
  display: grid;
  gap: 7px;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 900;
}

.chat-management__create input {
  min-height: 44px;
  border: 1px solid var(--border-subtle);
  border-radius: 9px;
  background: var(--surface-control);
  color: var(--text-primary);
  padding: 9px 11px;
}

.chat-management__create button {
  min-height: 44px;
  border-radius: 9px;
  background: var(--control-primary-bg);
  color: var(--control-primary-text);
  font-weight: 900;
}

.chat-management__list {
  display: grid;
  align-content: start;
  gap: 8px;
}

.chat-management__list article {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  padding: 10px;
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  background: var(--surface-control);
}

.chat-management__avatar {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 13px;
  background: var(--control-primary-bg);
  color: var(--control-primary-text);
  font-weight: 950;
}

.chat-management__avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.chat-management__list article > div {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.chat-management__list small {
  color: var(--text-secondary);
}

.chat-management__list button {
  min-height: 38px;
  border: 1px solid color-mix(in srgb, var(--danger) 45%, transparent);
  border-radius: 8px;
  background: color-mix(in srgb, var(--danger) 10%, var(--surface-card));
  color: var(--danger);
  font-weight: 900;
}

.chat-management__actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.chat-management__actions label {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: var(--surface-card);
  color: var(--text-primary);
  cursor: pointer;
  font-size: 12px;
  font-weight: 900;
}

.chat-management__actions input[type="file"] {
  display: none;
}

.chat-composer textarea,
.chat-widget__form textarea {
  min-height: 46px;
  max-height: 120px;
  padding: 11px 13px;
  resize: vertical;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: var(--surface-control);
  color: var(--text-primary);
  line-height: 1.35;
}

.chat-composer textarea:focus {
  outline: 2px solid color-mix(in srgb, var(--accent) 30%, transparent);
  border-color: var(--border-accent);
}

.chat-photo-button,
.chat-composer button,
.chat-widget__form button {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 14px;
  border: 1px solid var(--border-accent);
  border-radius: 8px;
  background: var(--control-primary-bg);
  color: var(--control-primary-text);
  font-weight: 900;
}

.chat-photo-button input {
  display: none;
}

.chat-composer__preview {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chat-composer__preview span {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  padding: 0 8px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 12%, var(--surface-card));
  color: var(--text-primary);
  font-size: 12px;
  font-weight: 800;
}

.chat-widget {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 90;
  display: grid;
  justify-items: end;
  gap: 10px;
}

.chat-widget[hidden],
.chat-widget__panel[hidden] {
  display: none;
}

.chat-widget__fab {
  position: relative;
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  gap: 0;
  padding: 0 18px;
  border: 1px solid var(--border-accent);
  border-radius: 999px;
  background: var(--control-primary-bg);
  color: var(--control-primary-text);
  box-shadow: var(--shadow-lg);
  font-weight: 900;
}

.chat-widget__fab span {
  position: absolute;
  top: -9px;
  right: -7px;
  min-width: 24px;
  height: 24px;
  border: 2px solid var(--surface-card);
  box-shadow: var(--shadow-sm);
}

.chat-widget__panel {
  position: relative;
  width: min(420px, calc(100vw - 28px));
  overflow: hidden;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: var(--surface-card);
  box-shadow: var(--shadow-lg);
  transform-origin: calc(100% - 24px) 100%;
  will-change: opacity, transform;
}

.chat-widget__panel.is-opening {
  animation: chat-widget-panel-open 380ms cubic-bezier(.16, 1, .3, 1) both;
}

.chat-widget__panel.is-opening > header,
.chat-widget__panel.is-opening > .chat-widget__messages,
.chat-widget__panel.is-opening > .chat-widget__form,
.chat-widget__panel.is-opening > a {
  animation: chat-widget-panel-content-in 300ms cubic-bezier(.16, 1, .3, 1) both;
}

.chat-widget__panel.is-opening > header { animation-delay: 25ms; }
.chat-widget__panel.is-opening > .chat-widget__messages { animation-delay: 45ms; }
.chat-widget__panel.is-opening > .chat-widget__form { animation-delay: 65ms; }
.chat-widget__panel.is-opening > a { animation-delay: 85ms; }

.chat-widget__panel.is-closing {
  pointer-events: none;
  animation: chat-widget-panel-close 220ms cubic-bezier(.4, 0, 1, 1) both;
}

@keyframes chat-widget-panel-open {
  from {
    opacity: 0;
    filter: blur(4px);
    transform: translateY(18px) scale(.94);
  }
  to {
    opacity: 1;
    filter: blur(0);
    transform: translateY(0) scale(1);
  }
}

@keyframes chat-widget-panel-close {
  from {
    opacity: 1;
    filter: blur(0);
    transform: translateY(0) scale(1);
  }
  to {
    opacity: 0;
    filter: blur(3px);
    transform: translateY(12px) scale(.965);
  }
}

@keyframes chat-widget-panel-content-in {
  from {
    opacity: 0;
    transform: translateY(7px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes chat-widget-fab-return {
  0% {
    opacity: 0;
    transform: translateY(8px) scale(.86);
  }
  72% {
    opacity: 1;
    transform: translateY(-1px) scale(1.03);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .chat-widget__panel.is-opening,
  .chat-widget__panel.is-opening > header,
  .chat-widget__panel.is-opening > .chat-widget__messages,
  .chat-widget__panel.is-opening > .chat-widget__form,
  .chat-widget__panel.is-opening > a,
  .chat-widget__panel.is-closing,
  .chat-widget__fab.is-entering {
    animation: none;
  }
}

.chat-widget__panel > header {
  position: relative;
  z-index: 8;
  min-height: 54px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--surface-card-soft);
}

.chat-widget__panel > header span,
.chat-widget__panel > a {
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.chat-widget__panel > header strong {
  display: block;
  color: var(--text-primary);
}

.chat-widget__panel > header button {
  width: 30px;
  min-height: 30px;
  padding: 0;
  border-radius: 8px;
  background: var(--surface-control);
  color: var(--text-primary);
}

.chat-widget__messages {
  height: min(390px, calc(100vh - 270px));
  min-height: 220px;
  display: flex;
  flex-direction: column;
  gap: 11px;
  padding: 12px 12px 58px;
  overflow: auto;
  scrollbar-color: transparent transparent;
  scrollbar-width: thin;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--accent) 5%, transparent), transparent 48%),
    var(--surface-bg);
}

.chat-widget__channel-switcher {
  min-width: 0;
  flex: 1 1 auto;
}

.chat-widget__panel > header .chat-widget__channel-trigger {
  width: 100%;
  min-height: 42px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 4px 7px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  text-align: left;
}

.chat-widget__channel-action {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--accent);
  text-transform: none;
  white-space: nowrap;
}

.chat-widget__channel-action b {
  font-size: 9px;
  font-weight: 900;
}

.chat-widget__fab[hidden] {
  display: none;
}

.chat-widget__fab.is-entering {
  animation: chat-widget-fab-return 260ms cubic-bezier(.16, 1, .3, 1) both;
}

.chat-widget__channel-trigger:hover,
.chat-widget__channel-trigger.is-open {
  border-color: var(--border-subtle);
  background: color-mix(in srgb, var(--accent) 8%, var(--surface-control));
}

.chat-widget__channel-trigger > span {
  min-width: 0;
}

.chat-widget__channel-trigger small,
.chat-widget__channel-trigger strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-widget__channel-trigger small {
  color: var(--text-secondary);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: .05em;
  text-transform: uppercase;
}

.chat-widget__channel-trigger strong {
  margin-top: 2px;
  color: var(--text-primary);
  font-size: 15px;
  text-transform: none;
}

.chat-widget__channel-trigger i {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--surface-control);
  color: var(--accent);
  font-size: 18px;
  font-style: normal;
  transition: transform 180ms ease, background 180ms ease;
}

.chat-widget__channel-trigger.is-open i {
  transform: rotate(180deg);
}

.chat-widget__header-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 5px;
}

.chat-widget__messages:hover,
.chat-widget__messages.is-scrolling {
  scrollbar-color: color-mix(in srgb, var(--accent) 42%, transparent) transparent;
}

.chat-widget__messages::-webkit-scrollbar {
  width: 5px;
}

.chat-widget__messages::-webkit-scrollbar-track {
  background: transparent;
}

.chat-widget__messages::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: transparent;
}

.chat-widget__messages:hover::-webkit-scrollbar-thumb,
.chat-widget__messages.is-scrolling::-webkit-scrollbar-thumb {
  background: color-mix(in srgb, var(--accent) 42%, transparent);
}

.chat-widget__channels {
  position: absolute;
  top: 65px;
  right: 10px;
  left: 10px;
  z-index: 20;
  max-height: min(320px, calc(100vh - 190px));
  display: grid;
  gap: 5px;
  padding: 7px;
  overflow-y: auto;
  overscroll-behavior: contain;
  border: 1px solid color-mix(in srgb, var(--accent) 28%, var(--border-subtle));
  border-radius: 12px;
  background: color-mix(in srgb, var(--surface-card) 97%, transparent);
  box-shadow: var(--shadow-lg);
  scrollbar-color: color-mix(in srgb, var(--accent) 34%, transparent) transparent;
  scrollbar-width: thin;
  backdrop-filter: blur(18px);
  animation: chat-widget-channel-menu-open 170ms cubic-bezier(.16, 1, .3, 1) both;
}

.chat-widget__channels[hidden] {
  display: none;
}

.chat-widget__channels button {
  width: 100%;
  min-height: 76px;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  padding: 7px 8px;
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  background: color-mix(in srgb, var(--surface-control) 82%, transparent);
  color: var(--text-primary);
  text-align: left;
  transition: border-color 150ms ease, background 150ms ease, transform 150ms ease;
}

.chat-widget__channels button:hover {
  border-color: color-mix(in srgb, var(--accent) 38%, var(--border-subtle));
  background: color-mix(in srgb, var(--accent) 10%, var(--surface-control));
  transform: translateX(2px);
}

.chat-widget__channels button.is-active {
  border-color: var(--border-accent);
  background: color-mix(in srgb, var(--accent) 16%, var(--surface-card));
}

.chat-widget__channel-icon {
  width: 34px;
  height: 34px;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  background: color-mix(in srgb, var(--accent) 10%, var(--surface-card));
  color: var(--accent);
  font-size: 13px;
  font-weight: 950;
}

.chat-widget__channels button.is-active .chat-widget__channel-icon {
  border-color: var(--border-accent);
  background: var(--control-primary-bg);
  color: var(--control-primary-text);
}

.chat-widget__channel-copy {
  min-width: 0;
}

.chat-widget__channel-copy strong,
.chat-widget__channel-copy small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-widget__channel-copy strong {
  color: var(--text-primary);
  font-size: 12px;
  font-weight: 900;
}

.chat-widget__channel-date {
  display: block;
  margin-top: 3px;
  color: var(--accent);
  font-size: 9px;
  font-weight: 850;
  letter-spacing: .01em;
}

.chat-widget__channel-copy small {
  margin-top: 3px;
  display: -webkit-box;
  color: var(--text-secondary);
  font-size: 9px;
  line-height: 1.25;
  white-space: normal;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.chat-widget__channel-copy small b {
  margin-right: 3px;
  color: var(--accent);
  font-weight: 900;
}

.chat-widget__channel-meta {
  display: grid;
  justify-items: end;
  gap: 5px;
}

.chat-widget__channel-meta time {
  color: var(--text-secondary);
  font-size: 8px;
  font-weight: 800;
}

.chat-widget__channel-meta b {
  min-width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--control-primary-bg);
  color: var(--control-primary-text);
  font-size: 10px;
}

@keyframes chat-widget-channel-menu-open {
  from { opacity: 0; transform: translateY(-7px) scale(.98); }
  to { opacity: 1; transform: none; }
}

.chat-widget-message {
  position: relative;
  width: fit-content;
  max-width: 82%;
  display: grid;
  align-self: flex-start;
  gap: 4px;
  padding: 7px 9px;
  border: 1px solid var(--border-subtle);
  border-radius: 14px 14px 14px 5px;
  background: var(--surface-card);
  color: var(--text-primary);
  box-shadow: var(--shadow-sm);
  animation: chat-widget-message-enter 320ms cubic-bezier(.16, 1, .3, 1) both;
}

@keyframes chat-widget-message-enter { from { opacity: 0; transform: translateY(9px) scale(.96); } to { opacity: 1; transform: none; } }

.chat-widget-message.is-mine {
  align-self: flex-end;
  border-color: var(--border-accent);
  border-radius: 14px 14px 5px 14px;
  background: color-mix(in srgb, var(--accent) 14%, var(--surface-card));
}

.chat-widget-message strong,
.chat-widget-message span {
  color: var(--text-secondary);
  font-size: 11px;
  line-height: 1.2;
}

.chat-widget-message p {
  margin: 0;
  color: var(--text-primary);
  font-size: 13px;
  line-height: 1.38;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.chat-widget-message > header { min-height: 10px; display: flex; align-items: baseline; justify-content: flex-end; gap: 7px; padding: 0 17px 0 0; border: 0; background: transparent; }
.chat-widget-message > header strong { min-width: 0; margin-right: auto; overflow: hidden; color: var(--accent); font-size: 9px; font-weight: 850; line-height: 1.1; text-overflow: ellipsis; white-space: nowrap; }
.chat-widget-message > header small { flex: 0 0 auto; color: var(--text-secondary); font-size: 8px; font-weight: 650; line-height: 1; opacity: .78; }
.chat-widget-message > header > button { position: absolute; z-index: 2; top: 3px; right: 4px; width: 20px; min-height: 18px; padding: 0; border: 0; border-radius: 6px; background: transparent; color: var(--text-secondary); font-size: 15px; line-height: 1; opacity: 0; transition: opacity 120ms ease, background 120ms ease, color 120ms ease; }
.chat-widget-message:hover > header > button, .chat-widget-message:focus-within > header > button { opacity: 1; }
.chat-widget-message > header > button:hover { background: color-mix(in srgb, var(--accent) 13%, transparent); color: var(--accent); }
.chat-widget-message__actions { position: absolute; z-index: 12; top: calc(100% + 5px); left: 7px; display: flex; gap: 3px; padding: 4px; border: 1px solid var(--border-subtle); border-radius: 10px; background: color-mix(in srgb, var(--surface-card) 96%, transparent); box-shadow: var(--shadow-lg); backdrop-filter: blur(14px); animation: chat-widget-actions-open 160ms cubic-bezier(.16, 1, .3, 1) both; }
.chat-widget-message.is-mine .chat-widget-message__actions { right: 7px; left: auto; }
.chat-widget-message__actions[hidden] { display: none; }
.chat-widget-message__actions button { min-height: 30px; display: inline-flex; align-items: center; gap: 4px; padding: 4px 7px; border: 0; border-radius: 7px; background: transparent; color: var(--text-secondary); font-size: 12px; font-weight: 850; white-space: nowrap; }
.chat-widget-message__actions button span { color: inherit; font-size: 9px; }
.chat-widget-message__actions button:hover { background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--accent); }
.chat-widget-message__actions button.is-danger:hover { background: color-mix(in srgb, #d64545 13%, transparent); color: #d64545; }
@keyframes chat-widget-actions-open { from { opacity: 0; transform: translateY(-5px) scale(.94); } to { opacity: 1; transform: none; } }
.chat-widget-message__reply { min-width: 0; display: grid; gap: 2px; padding: 5px 7px; border: 0; border-left: 2px solid var(--accent); border-radius: 6px; background: color-mix(in srgb, var(--accent) 8%, var(--surface-bg)); text-align: left; }
.chat-widget-message__reply strong { color: var(--accent); font-size: 9px; }
.chat-widget-message__reply span { overflow: hidden; color: var(--text-secondary); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.chat-widget-message__attachments { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px; }
.chat-widget-message__attachments > a:only-child { grid-column: 1 / -1; }
.chat-widget-message__attachments img { width: 100%; height: 104px; display: block; object-fit: cover; border-radius: 8px; transition: transform 180ms ease; }
.chat-widget-message__attachments a { overflow: hidden; border-radius: 8px; }
.chat-widget-message__attachments a:hover img { transform: scale(1.035); }
.chat-widget-message__file { grid-column: 1 / -1; min-width: 0; display: grid; grid-template-columns: 40px minmax(0, 1fr); align-items: center; gap: 8px; padding: 6px; border: 1px solid var(--border-subtle); background: var(--surface-bg); color: var(--text-primary); text-decoration: none; }
.chat-widget-message__file span { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 7px; background: color-mix(in srgb, var(--accent) 15%, var(--surface-card)); color: var(--accent); font-size: 8px; font-weight: 950; }
.chat-widget-message__file strong { overflow: hidden; color: var(--text-primary); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.chat-widget-message__reactions { display: flex; flex-wrap: wrap; gap: 3px; }
.chat-widget-message__reactions span { padding: 2px 6px; border: 1px solid var(--border-subtle); border-radius: 999px; background: var(--surface-card); color: var(--text-primary); font-size: 10px; }

.chat-widget__form {
  display: grid;
  gap: 8px;
  padding: 10px;
  border-top: 1px solid var(--border-subtle);
}
.chat-widget__form-row { display: grid; grid-template-columns: 38px minmax(0, 1fr) 42px; align-items: end; gap: 7px; }
.chat-widget__attach { width: 38px; height: 42px; display: grid; place-items: center; border: 1px solid var(--border-subtle); border-radius: 10px; background: var(--surface-control); color: var(--accent); cursor: pointer; font-size: 22px; font-weight: 700; }
.chat-widget__attach:hover { border-color: var(--border-accent); background: color-mix(in srgb, var(--accent) 10%, var(--surface-control)); }
.chat-widget__attach input { display: none; }
.chat-widget__reply-preview { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 8px; border-left: 3px solid var(--accent); border-radius: 7px; background: color-mix(in srgb, var(--accent) 8%, var(--surface-bg)); }
.chat-widget__reply-preview[hidden], .chat-widget__file-preview[hidden] { display: none; }
.chat-widget__reply-preview > div { min-width: 0; display: grid; grid-template-columns: auto 1fr; gap: 1px 5px; }
.chat-widget__reply-preview span { color: var(--text-secondary); font-size: 9px; }
.chat-widget__reply-preview strong { overflow: hidden; color: var(--accent); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.chat-widget__reply-preview small { grid-column: 1 / -1; overflow: hidden; color: var(--text-primary); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.chat-widget__reply-preview button { width: 27px; min-height: 27px; padding: 0; border-radius: 7px; }
.chat-widget__file-preview { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.chat-widget__file-preview::-webkit-scrollbar { display: none; }
.chat-widget__file-preview span { max-width: 150px; flex: 0 0 auto; overflow: hidden; padding: 4px 7px; border-radius: 999px; background: color-mix(in srgb, var(--accent) 10%, var(--surface-bg)); color: var(--text-primary); font-size: 9px; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.chat-widget__form.is-sending .chat-widget__form-row > button { opacity: .65; transform: scale(.92); }
.chat-widget__panel > header button.is-muted { color: #d64545; text-decoration: line-through; }

.field-counter {
  display: block;
  margin-top: 6px;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 800;
  text-align: right;
}

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

.chat-reply-preview { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 10px; border-left: 3px solid var(--accent); border-radius: 8px; background: color-mix(in srgb, var(--accent) 9%, var(--surface-bg)); }
.chat-reply-preview[hidden] { display: none; }
.chat-reply-preview > div { min-width: 0; display: grid; grid-template-columns: auto 1fr; gap: 2px 6px; }
.chat-reply-preview span { color: var(--text-secondary); font-size: 11px; }
.chat-reply-preview strong { overflow: hidden; color: var(--accent); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.chat-reply-preview small { grid-column: 1 / -1; overflow: hidden; color: var(--text-primary); text-overflow: ellipsis; white-space: nowrap; }
.chat-reply-preview button { width: 32px; min-height: 32px; padding: 0; border-radius: 9px; }

.parcel-field-label-row {
  width: 100%;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.parcel-field-label-row .field-counter--inline {
  flex: 0 0 auto;
  margin: 0;
  color: var(--text-muted);
  line-height: inherit;
}

.chat-widget__panel > a {
  display: block;
  padding: 0 12px 12px;
  text-decoration: none;
}

@media (max-width: 820px) {
  .chat-widget-message > header > button { opacity: 1; }
  .chat-page {
    height: calc(100vh - 32px);
  }

  .chat-shell { position: relative; display: block; }

  .chat-channel-list {
    height: 100%;
    border-right: 0;
  }

  .chat-room {
    position: absolute;
    inset: 0;
    background: var(--surface-card);
    transform: translateX(102%);
    transition: transform 0.22s ease;
  }

  .chat-shell.is-room-open .chat-room { transform: translateX(0); }
  .chat-mobile-back { display: grid; place-items: center; }
  .chat-management { grid-template-columns: 1fr; }

  .chat-message__bubble {
    max-width: min(100%, 520px);
  }

  .chat-message__reply-action, .chat-message__manage-action { opacity: 1; }
  .chat-reaction-open { opacity: 0; }
  .chat-search-panel { inset: 64px 8px 8px; }
  .chat-search-panel form { grid-template-columns: 1fr 1fr; }
  .chat-search-panel form > input:first-child { grid-column: 1 / -1; }
}

@media (max-width: 640px) {
  .chat-screen-page {
    height: var(--chat-viewport-height, 100dvh);
    min-height: 0;
    overflow: hidden;
  }

  .chat-screen-page .app-layout,
  .chat-screen-page .app-main {
    height: var(--chat-viewport-height, 100dvh);
    min-height: 0;
    overflow: hidden;
  }

  .chat-screen-page .app-main {
    display: block;
    padding: 8px 8px calc(96px + env(safe-area-inset-bottom));
  }

  .chat-page {
    width: 100%;
    height: 100%;
    gap: 8px;
  }

  .chat-hero {
    min-height: 56px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
    padding: 7px 9px 7px 11px;
    border-radius: 12px;
  }

  .chat-hero > div:first-child { min-width: 0; }
  .chat-hero .eyebrow,
  .chat-hero > div > span { display: none; }
  .chat-hero h1 {
    margin: 0;
    overflow: hidden;
    font-size: clamp(17px, 5.4vw, 22px);
    line-height: 1.08;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .chat-hero .parcel-list-summary {
    width: auto;
    min-width: 54px;
    min-height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 5px 8px;
    border-radius: 9px;
    text-align: center;
  }
  .chat-hero .parcel-list-summary span {
    display: block;
    font-size: 9px;
    line-height: 1;
  }
  .chat-hero .parcel-list-summary strong {
    margin: 0;
    font-size: 20px;
  }
  .chat-shell { min-height: 0; border-radius: 14px; }
  .chat-channel-list { padding: 10px; }
  .chat-channel-list button { min-height: 70px; }
  .chat-room { min-height: 0; grid-template-rows: auto minmax(0, 1fr) auto; overflow: hidden; }
  .chat-room__header { min-height: 58px; padding: 0 8px; }
  .chat-room__identity { min-width: 0; }
  .chat-room__identity strong, .chat-room__identity span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .chat-search-panel form { grid-template-columns: 1fr; }
  .chat-search-panel form > input:first-child { grid-column: auto; }
  .chat-messages { min-height: 0; padding: 10px 7px; scroll-padding-bottom: 12px; }
  .chat-message__bubble { max-width: 88%; }
  .chat-composer { position: relative; z-index: 4; gap: 6px; padding: 7px max(7px, env(safe-area-inset-right)) max(7px, env(safe-area-inset-bottom)) max(7px, env(safe-area-inset-left)); box-shadow: 0 -8px 24px color-mix(in srgb, var(--bg) 22%, transparent); }
  .chat-composer__row { grid-template-columns: 42px minmax(0, 1fr) 44px; gap: 6px; align-items: end; }
  .chat-composer textarea { min-height: 44px; max-height: 112px; padding: 10px 11px; resize: none; }
  .chat-composer button[type="submit"] { width: 44px; min-height: 44px; border-radius: 12px; }
  .chat-photo-button { width: 42px; min-height: 44px; padding: 0; font-size: 0; }
  .chat-photo-button::after { content: "＋"; font-size: 22px; }
  .chat-widget {
    right: max(14px, env(safe-area-inset-right));
    bottom: calc(max(12px, env(safe-area-inset-bottom)) + 86px);
    max-width: calc(100vw - 28px);
  }

  .chat-widget__panel {
    width: min(360px, calc(100vw - 28px));
    max-height: calc(100vh - 128px);
  }

  .chat-widget__messages {
    max-height: min(310px, calc(100vh - 330px));
  }
}

/* Russia parcels: stable grouped layout and themed payment state */
.russia-group-card__summary {
  grid-template-columns:
    minmax(210px, 1.35fr)
    minmax(150px, .8fr)
    minmax(230px, .95fr)
    minmax(250px, auto);
  gap: clamp(12px, 1.4vw, 22px);
}

.russia-group-card__summary > * {
  min-width: 0;
}

.russia-group-card__summary > div:first-child strong,
.russia-group-card__summary > div:first-child small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.russia-group-card__payment {
  align-content: center;
  justify-items: stretch;
}

.russia-group-card__payment .payment-pill {
  width: 100%;
  min-height: 36px;
  justify-content: center;
  padding: 7px 12px;
  border-radius: 10px;
  font-size: 12px;
  line-height: 1.25;
  text-align: center;
  white-space: normal;
}

.russia-group-card__payment .payment-pill--paid {
  border-color: color-mix(in srgb, var(--status-success) 48%, var(--border-subtle));
  background: color-mix(in srgb, var(--status-success) 18%, var(--surface-card));
  color: color-mix(in srgb, var(--status-success) 82%, var(--text-primary));
}

.russia-group-card__payment .payment-pill--partial {
  border: 1px solid color-mix(in srgb, var(--gold) 48%, var(--border-subtle));
  background: color-mix(in srgb, var(--gold) 17%, var(--surface-card));
  color: color-mix(in srgb, var(--gold) 82%, var(--text-primary));
}

.russia-group-card__payment .payment-pill--unpaid {
  border-color: color-mix(in srgb, var(--status-danger) 50%, var(--border-subtle));
  background: color-mix(in srgb, var(--status-danger) 17%, var(--surface-card));
  color: color-mix(in srgb, var(--status-danger) 84%, var(--text-primary));
}

.russia-group-card__payment small {
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 800;
  text-align: center;
}

.russia-group-payment-totals {
  display: grid;
  gap: 6px;
}

.russia-group-payment-bucket {
  display: grid;
  gap: 5px;
  padding: 8px 10px;
  border: 1px solid var(--border-subtle);
  border-radius: 9px;
  background: color-mix(in srgb, var(--surface-control) 78%, transparent);
}

.russia-group-payment-bucket > small,
.russia-group-payment-grand-total > small {
  font-size: 9px;
  font-weight: 900;
  letter-spacing: .06em;
  line-height: 1;
  text-align: left;
  text-transform: uppercase;
}

.russia-group-payment-bucket > div,
.russia-group-payment-grand-total > div {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.russia-group-payment-bucket b,
.russia-group-payment-grand-total b {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.russia-group-payment-bucket em,
.russia-group-payment-grand-total em {
  font-size: 9px;
  font-style: normal;
  font-weight: 900;
  opacity: .78;
}

.russia-group-payment-bucket.is-due {
  border-color: color-mix(in srgb, var(--status-danger) 42%, var(--border-subtle));
  background: color-mix(in srgb, var(--status-danger) 11%, var(--surface-control));
}

.russia-group-payment-bucket.is-due > small,
.russia-group-payment-bucket.is-due b {
  color: color-mix(in srgb, var(--status-danger) 92%, var(--text-primary));
}

.russia-group-payment-bucket.is-paid {
  border-color: color-mix(in srgb, var(--status-success) 38%, var(--border-subtle));
  background: color-mix(in srgb, var(--status-success) 9%, var(--surface-control));
}

.russia-group-payment-bucket.is-paid > small,
.russia-group-payment-bucket.is-paid b {
  color: color-mix(in srgb, var(--status-success) 88%, var(--text-primary));
}

.russia-group-payment-grand-total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 3px 2px 0;
}

.russia-group-payment-grand-total > small {
  color: var(--text-secondary);
}

.russia-group-payment-grand-total > div {
  justify-content: flex-end;
}

.russia-group-payment-grand-total b {
  color: var(--text-secondary);
  font-size: 10px;
}

.russia-group-card__payment .russia-group-card__meta {
  text-align: center;
}

.russia-group-card__actions {
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.russia-group-card__actions button {
  width: 100%;
  min-width: 0;
  padding-inline: 12px;
  white-space: normal;
  line-height: 1.15;
}

.russia-group-card__actions [data-issue-group] {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--border-subtle));
  background: color-mix(in srgb, var(--accent) 18%, var(--surface-control));
  color: color-mix(in srgb, var(--accent) 82%, var(--text-primary));
}

.russia-group-issued {
  min-height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 7px 10px;
  border: 1px solid color-mix(in srgb, var(--status-success) 42%, var(--border-subtle));
  border-radius: 8px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--status-success) 13%, transparent), transparent 76%),
    var(--surface-control);
  color: var(--status-success);
  text-align: left;
}

.russia-group-issued > b {
  display: grid;
  place-items: center;
  flex: 0 0 25px;
  width: 25px;
  height: 25px;
  border-radius: 50%;
  background: var(--status-success);
  color: var(--text-inverse);
  font-size: 14px;
}

.russia-group-issued strong,
.russia-group-issued small {
  display: block;
  line-height: 1.15;
}

.russia-group-issued strong {
  color: color-mix(in srgb, var(--status-success) 82%, var(--text-primary));
  font-size: 11px;
  font-weight: 900;
}

.russia-group-issued small {
  margin-top: 3px;
  color: color-mix(in srgb, var(--text-secondary) 88%, var(--status-success));
  font-size: 9px;
  font-weight: 800;
}

@media (max-width: 1280px) {
  .russia-group-card__summary {
    grid-template-columns: minmax(220px, 1.25fr) minmax(150px, .75fr) minmax(250px, 1fr);
  }

  .russia-group-card__actions {
    grid-column: 1 / -1;
    width: min(100%, 420px);
    justify-self: end;
  }
}

@media (max-width: 820px) {
  .russia-group-card__summary {
    grid-template-columns: 1fr 1fr;
    align-items: start;
  }

  .russia-group-card__payment {
    align-self: stretch;
  }
}

@media (max-width: 560px) {
  .russia-group-card__summary {
    grid-template-columns: 1fr;
  }

  .russia-group-card__actions {
    grid-column: auto;
    width: 100%;
    grid-template-columns: 1fr;
  }
}

/* Russia parcels: readable grouped card hierarchy */
.russia-group-card {
  border-color: color-mix(in srgb, var(--accent) 24%, var(--border-subtle));
  border-radius: 14px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--accent) 7%, transparent), transparent 46%),
    var(--surface-card-soft);
}

.russia-group-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 15px 18px;
  border-bottom: 1px solid var(--border-subtle);
  background: color-mix(in srgb, var(--surface-card) 72%, transparent);
}

.russia-group-card__identity {
  min-width: 0;
}

.russia-group-card__identity strong,
.russia-group-card__identity small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.russia-group-card__identity strong {
  margin-top: 7px;
  color: var(--text-primary);
  font-size: 20px;
  line-height: 1.1;
}

.russia-group-card__identity small {
  margin-top: 5px;
}

.russia-group-card__status.payment-pill {
  min-width: 190px;
  min-height: 36px;
  justify-content: center;
  padding: 7px 14px;
  border-radius: 10px;
  text-align: center;
}

.russia-group-card__overview {
  display: grid;
  grid-template-columns: minmax(280px, .9fr) minmax(360px, 1.15fr) minmax(230px, .65fr);
  gap: 12px;
  align-items: stretch;
  padding: 14px;
}

.russia-group-card__composition,
.russia-group-card__finance {
  min-width: 0;
  padding: 13px;
  border: 1px solid var(--border-subtle);
  border-radius: 11px;
  background: color-mix(in srgb, var(--surface-control) 64%, transparent);
}

.russia-group-card__composition {
  display: grid;
  align-content: start;
  gap: 13px;
}

.russia-group-card__composition > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.russia-group-card__composition > header strong,
.russia-group-card__section-title {
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 900;
}

.russia-issue-warning[hidden] {
  display: none;
}

.russia-group-warning-row {
  display: grid;
  gap: 5px;
}

.russia-group-warning-row + .russia-group-warning-row {
  padding-top: 9px;
  border-top: 1px solid color-mix(in srgb, var(--status-danger) 24%, transparent);
}

.russia-group-warning-row strong {
  line-height: 1.35;
}

.russia-group-warning-row span {
  color: color-mix(in srgb, var(--status-danger) 72%, var(--text-secondary));
  font-size: 12px;
  line-height: 1.35;
}

.russia-group-card__composition > header small {
  text-align: right;
  white-space: nowrap;
}

.russia-group-card__numbers {
  align-content: start;
  gap: 8px;
}

.russia-group-card__numbers span {
  min-width: 38px;
  min-height: 34px;
  justify-content: center;
  border: 1px solid color-mix(in srgb, var(--accent) 18%, var(--border-subtle));
  background: color-mix(in srgb, var(--accent) 9%, var(--surface-control));
  font-size: 13px;
}

.russia-group-card__finance {
  display: grid;
  align-content: start;
  gap: 10px;
}

.russia-group-payment-bucket {
  grid-template-columns: minmax(76px, auto) minmax(0, 1fr);
  align-items: center;
  min-height: 46px;
  padding: 8px 10px;
}

.russia-group-payment-bucket > div {
  justify-content: flex-end;
}

.russia-group-payment-bucket b {
  padding: 4px 7px;
  border-radius: 7px;
  background: color-mix(in srgb, var(--surface-card) 72%, transparent);
}

.russia-group-payment-grand-total {
  min-height: 27px;
  padding: 4px 7px 0;
  border-top: 1px solid var(--border-subtle);
}

.russia-group-card__overview .russia-group-card__actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-content: center;
  gap: 8px;
  min-width: 0;
}

.russia-group-card__overview .russia-group-card__actions button {
  min-height: 42px;
  border-radius: 10px;
}

.russia-group-card__overview .russia-group-issued {
  width: 100%;
}

@media (max-width: 1180px) {
  .russia-group-card__overview {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .russia-group-card__overview .russia-group-card__actions {
    grid-column: 1 / -1;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: min(100%, 440px);
    justify-self: end;
  }
}

@media (max-width: 760px) {
  .russia-group-card__header {
    align-items: stretch;
    flex-direction: column;
  }

  .russia-group-card__status.payment-pill {
    width: 100%;
  }

  .russia-group-card__overview {
    grid-template-columns: minmax(0, 1fr);
    padding: 10px;
  }

  .russia-group-card__overview .russia-group-card__actions {
    grid-column: auto;
    width: 100%;
  }
}

@media (max-width: 520px) {
  .russia-group-card__header {
    padding: 13px;
  }

  .russia-group-card__composition > header,
  .russia-group-payment-bucket,
  .russia-group-payment-grand-total {
    align-items: flex-start;
    grid-template-columns: minmax(0, 1fr);
    flex-direction: column;
  }

  .russia-group-payment-bucket > div,
  .russia-group-payment-grand-total > div {
    justify-content: flex-start;
  }

  .russia-group-card__overview .russia-group-card__actions {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Russia parcels: payment block in the regular card view */
.russia-list-card__main {
  grid-template-columns: minmax(230px, 1.2fr) minmax(220px, .95fr) minmax(300px, .78fr);
}

.russia-list-card__badges {
  align-content: start;
  align-items: stretch;
  justify-content: flex-start;
  gap: 7px;
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(105px, .75fr);
}

.russia-list-card__badges .payment-pill {
  width: 100%;
  min-height: 38px;
  justify-content: center;
  padding: 7px 11px;
  border-radius: 10px;
  font-size: 12px;
  line-height: 1.25;
  text-align: center;
  white-space: normal;
}

.russia-list-card__badges .payment-pill--paid {
  border-color: color-mix(in srgb, var(--status-success) 48%, var(--border-subtle));
  background: color-mix(in srgb, var(--status-success) 18%, var(--surface-card));
  color: color-mix(in srgb, var(--status-success) 82%, var(--text-primary));
}

.russia-list-card__badges .payment-pill--unpaid {
  border-color: color-mix(in srgb, var(--status-danger) 50%, var(--border-subtle));
  background: color-mix(in srgb, var(--status-danger) 17%, var(--surface-card));
  color: color-mix(in srgb, var(--status-danger) 84%, var(--text-primary));
}

.russia-list-card__badges .russia-issue-button {
  width: 100%;
  min-height: 38px;
  margin: 0;
}

@media (max-width: 1180px) and (min-width: 981px) {
  .russia-list-card__main {
    grid-template-columns: minmax(220px, 1fr) minmax(185px, .8fr);
    grid-template-areas:
      "person payment"
      "description logistics"
      "weights summary";
  }
}

@media (max-width: 560px) {
  .russia-list-card__badges {
    grid-template-columns: 1fr;
  }
}

/* Russia parcels: compact right rail — weight above, payment below */
.russia-list-card__main {
  grid-template-columns: minmax(230px, 1.25fr) minmax(220px, 1fr) minmax(240px, 260px);
  grid-template-areas:
    "person person person"
    "description logistics summary"
    "weights weights payment";
}

.russia-list-card__summary {
  align-content: start;
  align-self: stretch;
  grid-template-rows: minmax(54px, 1fr) auto;
}

.russia-list-card__summary .russia-weight-badge {
  min-height: 0;
}

.russia-list-card__summary .russia-list-card__group-state {
  min-height: 34px;
  padding-block: 6px;
  border-radius: 9px;
  background: color-mix(in srgb, var(--surface-control) 78%, transparent);
  font-size: 11px;
  line-height: 1.2;
  white-space: normal;
}

.russia-list-card__badges {
  align-self: center;
  align-content: center;
  align-items: center;
}

.russia-list-card__badges .payment-pill,
.russia-list-card__badges .russia-issue-button {
  height: auto;
  min-height: 46px;
  max-height: none;
}

.russia-list-card__badges .payment-pill {
  padding-block: 6px;
}

.russia-list-card__badges .russia-issue-button {
  padding-block: 8px;
}

@media (max-width: 1180px) and (min-width: 981px) {
  .russia-list-card__main {
    grid-template-columns: minmax(220px, 1fr) minmax(230px, 260px);
    grid-template-areas:
      "person person"
      "description summary"
      "logistics summary"
      "weights payment";
  }
}

@media (max-width: 980px) {
  .russia-list-card__main {
    grid-template-columns: 1fr;
    grid-template-areas:
      "person"
      "description"
      "logistics"
      "weights"
      "summary"
      "payment";
  }

  .russia-list-card__summary {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-rows: auto;
    align-items: stretch;
  }
}

@media (max-width: 560px) {
  .russia-list-card__summary {
    grid-template-columns: 1fr;
  }
}
/* Georgia parcel form: mobile field containment and consistent controls */
@media (max-width: 640px) {
  .parcel-workspace[data-page="georgia-parcels"],
  .parcel-workspace[data-page="georgia-parcels"] .parcel-form,
  .parcel-workspace[data-page="georgia-parcels"] .parcel-form-sections,
  .parcel-workspace[data-page="georgia-parcels"] .parcel-form-section,
  .parcel-workspace[data-page="georgia-parcels"] .parcel-form__grid,
  .parcel-workspace[data-page="georgia-parcels"] .parcel-form__grid > label {
    min-width: 0;
    max-width: 100%;
  }

  .parcel-workspace[data-page="georgia-parcels"] .parcel-form-section {
    width: 100%;
    overflow: hidden;
  }

  .parcel-workspace[data-page="georgia-parcels"] .parcel-form__grid--two {
    width: 100%;
    grid-template-columns: minmax(0, 1fr);
  }

  .parcel-workspace[data-page="georgia-parcels"] .parcel-form input,
  .parcel-workspace[data-page="georgia-parcels"] .parcel-form select,
  .parcel-workspace[data-page="georgia-parcels"] .parcel-fallback-person,
  .parcel-workspace[data-page="georgia-parcels"] .select2-container,
  .parcel-workspace[data-page="georgia-parcels"] .select2-selection--single {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
  }

  .parcel-workspace[data-page="georgia-parcels"] .parcel-form input,
  .parcel-workspace[data-page="georgia-parcels"] .parcel-form select,
  .parcel-workspace[data-page="georgia-parcels"] .parcel-fallback-person,
  .parcel-workspace[data-page="georgia-parcels"] .select2-selection--single {
    height: 46px;
    min-height: 46px;
  }

  .parcel-workspace[data-page="georgia-parcels"] .select2-container--default .select2-selection--single .select2-selection__rendered {
    max-width: 100%;
    padding-left: 12px;
    padding-right: 32px;
    overflow: hidden;
    line-height: 44px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .parcel-workspace[data-page="georgia-parcels"] .select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 44px;
  }

  .chat-screen-page.is-chat-keyboard-open .app-main { padding-bottom: 6px; }
  .chat-screen-page.is-chat-keyboard-open .app-sidebar { display: none; }
  .chat-screen-page.is-chat-keyboard-open .chat-page { grid-template-rows: minmax(0, 1fr); }
  .chat-screen-page.is-chat-keyboard-open .chat-hero { display: none; }
  .chat-screen-page.is-chat-keyboard-open .chat-shell { height: 100%; }
}

@media (max-width: 380px) {
  .chat-hero { min-height: 52px; padding: 6px 8px 6px 10px; }
  .chat-hero h1 { font-size: 17px; }
  .chat-hero .parcel-list-summary { min-height: 36px; padding: 4px 7px; }
  .chat-hero .parcel-list-summary span { display: none; }
  .chat-hero .parcel-list-summary strong { font-size: 19px; }
  .chat-room__avatar { width: 34px; height: 34px; }
  .chat-message__bubble { max-width: 94%; padding: 7px 9px; }
  .chat-reaction-pill { min-width: 28px; padding-inline: 5px; }
}

@media (max-width: 820px) and (max-height: 560px) {
  .chat-screen-page .app-main { padding-top: 5px; }
  .chat-page { grid-template-rows: minmax(0, 1fr); }
  .chat-hero { display: none; }
}

.booking-date-transfer {
  display: grid;
  gap: 14px;
  margin-top: 14px;
  padding: 16px;
  border: 1px solid color-mix(in srgb, var(--gold) 42%, var(--border-subtle));
  border-radius: 8px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--gold) 9%, transparent), transparent 58%),
    var(--surface-card-soft);
}

.booking-date-transfer__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.booking-date-transfer__header h2 { margin: 0; color: var(--text-primary); font-size: 22px; }
.booking-date-transfer__header small { display: block; max-width: 760px; margin-top: 5px; color: var(--text-secondary); line-height: 1.45; }
.booking-date-transfer__count {
  flex: 0 0 auto;
  padding: 9px 12px;
  border: 1px solid var(--border-accent);
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 10%, var(--surface-card));
  color: var(--accent);
  font-size: 13px;
  font-weight: 900;
}

.booking-date-transfer__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 34px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
}

.booking-date-transfer__grid label { display: grid; gap: 7px; min-width: 0; }
.booking-date-transfer__grid label > span { color: var(--text-secondary); font-size: 12px; font-weight: 900; }
.booking-date-transfer__grid select {
  width: 100%;
  min-width: 0;
  min-height: 48px;
  padding: 0 12px;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: var(--surface-control);
  color: var(--text-primary);
  font: inherit;
  font-weight: 800;
  color-scheme: inherit;
  outline: none;
}
.booking-date-transfer__grid select option { background: var(--surface-card); color: var(--text-primary); }
.booking-date-transfer__grid select:focus { border-color: var(--border-accent); box-shadow: 0 0 0 3px var(--accent-ring); }
.booking-date-transfer__arrow { min-height: 48px; display: grid; place-items: center; color: var(--gold); font-size: 24px; font-weight: 900; }
.booking-date-transfer__grid button {
  min-height: 48px;
  padding: 0 18px;
  border-radius: 8px;
  background: var(--control-primary-bg);
  color: var(--control-primary-text);
  font-weight: 900;
  white-space: nowrap;
}
.booking-date-transfer__grid button:disabled { cursor: not-allowed; opacity: .5; }
.booking-date-transfer__confirm { display: flex; align-items: flex-start; gap: 9px; color: var(--text-secondary); font-size: 13px; font-weight: 800; }
.booking-date-transfer__confirm input { width: 18px; height: 18px; flex: 0 0 auto; accent-color: var(--accent); }

@media (max-width: 760px) {
  .booking-date-transfer { padding: 13px; }
  .booking-date-transfer__header { align-items: flex-start; flex-direction: column; }
  .booking-date-transfer__count { width: 100%; border-radius: 8px; text-align: center; }
  .booking-date-transfer__grid { grid-template-columns: minmax(0, 1fr); }
  .booking-date-transfer__arrow { min-height: 24px; transform: rotate(90deg); }
  .booking-date-transfer__grid button { width: 100%; }
}

/* Mobile booking day: shared by Tbilisi and Moscow routes. */
@media (max-width: 640px) {
  .trip-day-page {
    width: 100%;
    min-width: 0;
    gap: 10px;
    padding-bottom: 76px;
  }

  .trip-day-page .trips-hero {
    align-items: stretch;
    flex-direction: column;
    gap: 14px;
    padding: 16px;
  }

  .trip-day-page .trips-hero h1 {
    font-size: clamp(25px, 8vw, 34px);
    line-height: 1.08;
    overflow-wrap: anywhere;
  }

  .trip-day-page .trip-hero-actions,
  .trip-day-page .trip-hero-actions form {
    width: 100%;
  }

  .trip-day-page .trip-hero-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .trip-day-page .trip-calendar-shell__change {
    width: 100%;
    min-height: 46px;
    display: grid;
    place-items: center;
    padding: 9px 10px;
    text-align: center;
    white-space: normal;
  }

  .trip-day-page .bus-booking-shell {
    min-width: 0;
    gap: 12px;
    padding: 12px;
    overflow: hidden;
  }

  .trip-day-page .bus-booking-summary {
    gap: 12px;
  }

  .trip-day-page .bus-booking-summary h2 {
    font-size: 20px;
  }

  .trip-day-page .bus-legend {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px 10px;
  }

  .trip-day-page .bus-legend span {
    min-width: 0;
    font-size: 11px;
  }

  .trip-day-page .bus-workspace {
    width: 100%;
    min-width: 0;
    gap: 12px;
  }

  .trip-day-page .bus-frame {
    width: 100%;
    min-width: 0;
    gap: 6px;
    padding: 14px 7px 16px;
    border-radius: 24px 24px 12px 12px;
  }

  .trip-day-page .bus-row,
  .trip-day-page .bus-row--door-stack {
    grid-template-columns: minmax(0, 1fr) 24px minmax(0, 1fr);
    gap: 4px;
  }

  .trip-day-page .bus-side,
  .trip-day-page .bus-rear-seats,
  .trip-day-page .bus-door-stack__left,
  .trip-day-page .bus-door-stack__aisle {
    gap: 4px;
  }

  .trip-day-page .bus-seat,
  .trip-day-page .bus-service {
    min-width: 0;
    min-height: 52px;
    padding: 5px 2px;
    border-radius: 7px;
  }

  .trip-day-page .bus-seat span {
    font-size: 15px;
  }

  .trip-day-page .bus-seat small {
    width: 100%;
    font-size: 8px;
  }

  .trip-day-page .bus-service,
  .trip-day-page .bus-aisle,
  .trip-day-page .bus-door-stack__aisle span {
    font-size: 8px;
  }

  .trip-day-page .bus-service--door-tall {
    min-height: 108px;
  }

  .trip-day-page .bus-row--front .bus-aisle {
    font-size: 0;
  }

  .trip-day-page .bus-row--rear {
    width: 100%;
    min-width: 0;
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
  }

  .trip-day-page .bus-rear-seats {
    width: 100%;
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .trip-day-page .bus-seat--rear {
    width: 100%;
    min-width: 0;
    min-height: 56px;
  }

  .trip-day-page .bus-seat--rear small {
    display: none;
  }

  .trip-day-page .booking-side-panel {
    width: 100%;
    gap: 10px;
    padding: 13px;
  }

  .trip-day-page .booking-side-panel dl {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .trip-day-page .booking-side-panel dl div {
    min-width: 0;
    display: grid;
    gap: 3px;
    padding: 9px;
    border: 1px solid var(--border-subtle);
    border-radius: 7px;
    background: var(--surface-control);
  }

  .trip-day-page .booking-side-panel dd {
    text-align: left;
    overflow-wrap: anywhere;
  }

  .trip-day-page .seat-modal {
    align-items: end;
    z-index: 120;
    padding: 0;
  }

  .trip-day-page .seat-modal__panel,
  .trip-day-page .seat-transfer-modal__panel {
    width: 100%;
    max-width: none;
    max-height: calc(100dvh - 8px);
    gap: 12px;
    padding: 16px 12px calc(24px + env(safe-area-inset-bottom));
    border-radius: 16px 16px 0 0;
    overscroll-behavior: contain;
  }

  .trip-day-page .seat-modal__header {
    gap: 8px;
    padding-right: 42px;
  }

  .trip-day-page .seat-modal__header h2 {
    font-size: 23px;
    overflow-wrap: anywhere;
  }

  .trip-day-page .seat-modal__badge {
    align-self: start;
  }

  .trip-day-page .seat-modal__close {
    right: 10px;
    top: 10px;
    width: 42px;
    min-height: 42px;
  }

  .trip-day-page .seat-form-section {
    gap: 9px;
    padding: 12px;
  }

  .trip-day-page .seat-form-section__num {
    width: 30px;
    height: 30px;
  }

  .trip-day-page .seat-form-grid,
  .trip-day-page .seat-form-grid--route {
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
  }

  .trip-day-page .seat-booking-form input,
  .trip-day-page .seat-booking-form select {
    min-height: 48px;
    font-size: 16px;
  }

  .trip-day-page .seat-booking-form textarea {
    min-height: 94px;
    font-size: 16px;
  }

  .trip-day-page .seat-birth-date {
    grid-template-columns: minmax(0, .8fr) minmax(0, 1fr) minmax(0, 1fr);
    gap: 5px;
  }

  .trip-day-page .seat-birth-date select {
    padding-inline: 8px 20px;
    font-size: 15px;
  }

  .trip-day-page .seat-booking-actions {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .trip-day-page .seat-booking-actions button {
    width: 100%;
    min-width: 0;
    min-height: 46px;
    padding-inline: 8px;
    white-space: normal;
  }

  .trip-day-page .seat-booking-actions button[data-seat-submit]:not([hidden]) {
    grid-column: 1 / -1;
  }

  .trip-day-page .seat-transfer-passenger,
  .trip-day-page .seat-transfer-field {
    padding: 12px;
  }

  .trip-day-page .seat-transfer-field select {
    width: 100%;
    min-width: 0;
    min-height: 48px;
    font-size: 16px;
  }

  .trip-day-page .seat-transfer-seats {
    width: 100%;
    min-width: 0;
  }

  .trip-day-page .transfer-bus {
    width: 100%;
    min-width: 0;
    padding: 12px 8px 15px;
  }

  .trip-day-page .transfer-bus-row {
    grid-template-columns: minmax(0, 1fr) 24px minmax(0, 1fr);
    gap: 4px;
  }

  .trip-day-page .transfer-bus-side,
  .trip-day-page .transfer-bus-rear,
  .trip-day-page .transfer-bus-door-left,
  .trip-day-page .transfer-bus-door-aisle {
    gap: 4px;
  }

  .trip-day-page .transfer-bus-seat,
  .trip-day-page .transfer-bus-service {
    min-height: 38px;
  }

  .trip-day-page .transfer-bus-rear {
    width: 100%;
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}
/* Russia parcel form: prevent mobile overflow from breaking the bottom menu */
@media (max-width: 640px) {
  .parcel-workspace[data-russia-page],
  .parcel-workspace[data-russia-page] .russia-parcel-form,
  .parcel-workspace[data-russia-page] .russia-form-sections,
  .parcel-workspace[data-russia-page] .russia-form-section,
  .parcel-workspace[data-russia-page] .russia-form-grid,
  .parcel-workspace[data-russia-page] .russia-finance-layout,
  .parcel-workspace[data-russia-page] .russia-finance-card,
  .parcel-workspace[data-russia-page] label {
    min-width: 0;
    max-width: 100%;
  }

  .parcel-workspace[data-russia-page] {
    width: 100%;
    overflow-x: clip;
  }

  .parcel-workspace[data-russia-page] .russia-parcel-form {
    width: 100%;
    padding: 14px;
    overflow: hidden;
  }

  .parcel-workspace[data-russia-page] .russia-form-section {
    width: 100%;
    padding: 12px;
    overflow: hidden;
  }

  .parcel-workspace[data-russia-page] .russia-form-grid,
  .parcel-workspace[data-russia-page] .russia-form-grid--three,
  .parcel-workspace[data-russia-page] .russia-form-grid--four,
  .parcel-workspace[data-russia-page] .russia-form-grid--parcel,
  .parcel-workspace[data-russia-page] .russia-form-grid--money,
  .parcel-workspace[data-russia-page] .russia-form-grid--payment,
  .parcel-workspace[data-russia-page] .russia-form-grid--notes {
    width: 100%;
    grid-template-columns: minmax(0, 1fr);
  }

  .parcel-workspace[data-russia-page] input,
  .parcel-workspace[data-russia-page] select,
  .parcel-workspace[data-russia-page] textarea,
  .parcel-workspace[data-russia-page] button {
    max-width: 100%;
  }

  .parcel-workspace[data-russia-page] .russia-origin-picker {
    width: 100%;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: stretch;
  }

  .parcel-workspace[data-russia-page] .russia-origin-picker select {
    width: 100%;
    min-width: 0;
  }

  .parcel-workspace[data-russia-page] .russia-description-builder,
  .parcel-workspace[data-russia-page] .russia-description-input,
  .parcel-workspace[data-russia-page] .russia-description-items,
  .parcel-workspace[data-russia-page] .russia-weight-box,
  .parcel-workspace[data-russia-page] .russia-weight-entry,
  .parcel-workspace[data-russia-page] .russia-weight-chips {
    min-width: 0;
    max-width: 100%;
  }

  .parcel-workspace[data-russia-page] .russia-description-builder__top {
    align-items: flex-start;
    flex-direction: column;
  }

  .parcel-workspace[data-russia-page] .russia-description-builder__top small {
    max-width: 100%;
    text-align: left;
  }

  .parcel-workspace[data-russia-page] .russia-description-chip,
  .parcel-workspace[data-russia-page] .russia-weight-chip {
    max-width: 100%;
    overflow-wrap: anywhere;
  }

  .parcel-workspace[data-russia-page] .parcel-form__actions,
  .parcel-workspace[data-russia-page] .parcel-form__actions button,
  .parcel-workspace[data-russia-page] .parcel-primary-action--link {
    width: 100%;
  }
}
/* Explicit description action also works with mobile keyboards that use Next. */
.russia-description-input {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.russia-description-action {
  min-width: 112px;
  min-height: 46px;
  padding: 8px 14px;
  border: 1px solid color-mix(in srgb, var(--accent) 48%, var(--border-subtle));
  border-radius: 8px;
  background: color-mix(in srgb, var(--accent) 18%, var(--surface-control));
  color: color-mix(in srgb, var(--accent) 82%, var(--text-primary));
  font-weight: 900;
}

@media (max-width: 480px) {
  .parcel-workspace[data-russia-page] .russia-description-input {
    grid-template-columns: minmax(0, 1fr);
  }

  .parcel-workspace[data-russia-page] .russia-description-action {
    width: 100%;
  }
}
/* Russia parcels list: complete phone layout */
@media (max-width: 640px) {
  .parcel-list-page[data-russia-list-page],
  .parcel-list-page[data-russia-list-page] .parcel-list-toolbar,
  .parcel-list-page[data-russia-list-page] .russia-list-filters,
  .parcel-list-page[data-russia-list-page] .russia-manifest-panel,
  .parcel-list-page[data-russia-list-page] .russia-branch-section,
  .parcel-list-page[data-russia-list-page] .russia-list-stack,
  .parcel-list-page[data-russia-list-page] .russia-list-card,
  .parcel-list-page[data-russia-list-page] .russia-list-card__main,
  .parcel-list-page[data-russia-list-page] .russia-group-card,
  .parcel-list-page[data-russia-list-page] .russia-group-card__summary {
    min-width: 0;
    max-width: 100%;
  }

  .parcel-list-page[data-russia-list-page] {
    width: 100%;
    overflow-x: clip;
    padding-bottom: 92px;
  }

  .parcel-list-page[data-russia-list-page] .parcel-list-hero,
  .parcel-list-page[data-russia-list-page] .parcel-list-toolbar__row,
  .parcel-list-page[data-russia-list-page] .russia-branch-section__header {
    align-items: stretch;
    flex-direction: column;
  }

  .parcel-list-page[data-russia-list-page] .parcel-list-summary {
    width: 100%;
  }

  .parcel-list-page[data-russia-list-page] .russia-list-date-select,
  .parcel-list-page[data-russia-list-page] .russia-list-date-select select,
  .parcel-list-page[data-russia-list-page] .segmented-control {
    width: 100%;
    min-width: 0;
  }

  .parcel-list-page[data-russia-list-page] .segmented-control {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .parcel-list-page[data-russia-list-page] .segmented-control button {
    min-width: 0;
    padding-inline: 7px;
    white-space: normal;
  }

  .parcel-list-page[data-russia-list-page] .russia-list-filters {
    width: 100%;
    grid-template-columns: minmax(0, 1fr);
  }

  .parcel-list-page[data-russia-list-page] .russia-list-filters label,
  .parcel-list-page[data-russia-list-page] .russia-list-filters input,
  .parcel-list-page[data-russia-list-page] .russia-list-filters select,
  .parcel-list-page[data-russia-list-page] .russia-list-filters button {
    width: 100%;
    min-width: 0;
    max-width: 100%;
  }

  .parcel-list-page[data-russia-list-page] .russia-list-filters button {
    grid-column: auto;
  }

  .parcel-list-page[data-russia-list-page] .russia-manifest-panel {
    width: 100%;
    grid-template-columns: minmax(0, 1fr);
    align-items: stretch;
  }

  .parcel-list-page[data-russia-list-page] .russia-manifest-panel__actions,
  .parcel-list-page[data-russia-list-page] .russia-manifest-panel .russia-manifest-panel__actions {
    width: 100%;
    grid-template-columns: minmax(0, 1fr);
  }

  .parcel-list-page[data-russia-list-page] .russia-manifest-panel button,
  .parcel-list-page[data-russia-list-page] .russia-manifest-panel select {
    width: 100%;
    min-width: 0;
  }

  .parcel-list-page[data-russia-list-page] .russia-branch-section {
    width: 100%;
    padding: 10px;
  }

  .parcel-list-page[data-russia-list-page] .russia-branch-section__header h2 {
    overflow-wrap: anywhere;
    font-size: 20px;
  }

  .parcel-list-page[data-russia-list-page] .russia-branch-section__header button {
    width: 100%;
  }

  .parcel-list-page[data-russia-list-page] .russia-branch-section.is-collapsed .russia-branch-section__header {
    grid-template-columns: minmax(0, 1fr);
  }

  .parcel-list-page[data-russia-list-page] .russia-list-card {
    width: 100%;
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
    padding: 10px;
  }

  .parcel-list-page[data-russia-list-page] .russia-list-card__side {
    width: 100%;
    grid-template-columns: 92px minmax(0, 1fr);
    grid-template-rows: repeat(3, auto);
    align-items: center;
    gap: 5px 10px;
  }

  .parcel-list-page[data-russia-list-page] .russia-list-card__destination {
    width: 92px;
    height: 84px;
    grid-column: 1;
    grid-row: 1 / span 3;
  }

  .parcel-list-page[data-russia-list-page] .russia-list-card__select {
    width: 100%;
    grid-column: 2;
    grid-row: 1;
  }

  .parcel-list-page[data-russia-list-page] .russia-list-card__city {
    width: 100%;
    grid-column: 2;
    grid-row: 2;
    text-align: left;
  }

  .parcel-list-page[data-russia-list-page] .russia-issued-pill {
    width: 100%;
    min-height: 32px;
    grid-column: 2;
    grid-row: 3;
  }

  .parcel-list-page[data-russia-list-page] .russia-list-card__main {
    width: 100%;
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      "person"
      "description"
      "logistics"
      "weights"
      "summary"
      "payment";
  }

  .parcel-list-page[data-russia-list-page] .russia-list-card__person > strong,
  .parcel-list-page[data-russia-list-page] .russia-list-card__logistics span,
  .parcel-list-page[data-russia-list-page] .russia-list-card__weights-head small {
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .parcel-list-page[data-russia-list-page] .russia-list-card__logistics,
  .parcel-list-page[data-russia-list-page] .russia-list-card__summary,
  .parcel-list-page[data-russia-list-page] .russia-list-card__badges {
    grid-template-columns: minmax(0, 1fr);
  }

  .parcel-list-page[data-russia-list-page] .russia-list-card__badges .payment-pill,
  .parcel-list-page[data-russia-list-page] .russia-list-card__badges .russia-issue-button {
    width: 100%;
    min-height: 44px;
  }

  .parcel-list-page[data-russia-list-page] .russia-group-card__summary {
    width: 100%;
    grid-template-columns: minmax(0, 1fr);
  }

  .parcel-list-page[data-russia-list-page] .russia-group-card__actions {
    width: 100%;
    grid-template-columns: minmax(0, 1fr);
  }

  .parcel-list-page[data-russia-list-page] .russia-group-card__payment .payment-pill {
    width: 100%;
  }

  .russia-issue-dialog {
    width: calc(100% - 16px);
    max-width: calc(100% - 16px);
    max-height: calc(100dvh - 20px);
    margin: auto;
    padding: 12px;
    overflow: auto;
  }

  .russia-issue-modal,
  .russia-issue-parcels,
  .russia-group-issue-recipient,
  .russia-group-issue-fields {
    min-width: 0;
    max-width: 100%;
  }

  .russia-issue-modal__header h2 {
    font-size: 22px;
    overflow-wrap: anywhere;
  }

  .russia-issue-grid,
  .russia-issue-resident,
  .russia-issue-passport,
  .russia-group-issue-fields,
  .russia-group-issue-radios {
    grid-template-columns: minmax(0, 1fr);
  }

  .russia-issue-actions {
    align-items: stretch;
    flex-direction: column-reverse;
  }

  .russia-issue-actions button,
  .russia-issue-board-link {
    width: 100%;
  }
}

/* Blacklist registry in settings */
.blacklist-settings { display: grid; gap: 16px; }
.blacklist-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.blacklist-form label { min-width: 0; display: grid; gap: 6px; color: var(--text-secondary); font-size: 11px; font-weight: 850; }
.blacklist-form input,
.blacklist-form textarea { width: 100%; min-width: 0; border: 1px solid var(--border-subtle); border-radius: 10px; background: var(--input-bg); color: var(--text-primary); }
.blacklist-form input { min-height: 44px; }
.blacklist-form textarea { min-height: 92px; resize: vertical; }
.blacklist-form__reason { grid-column: 1 / -1; }
.blacklist-form > button { grid-column: 1 / -1; justify-self: end; min-height: 42px; }
.blacklist-settings__count { min-width: 38px; min-height: 38px; display: grid; place-items: center; border: 1px solid var(--border-accent); border-radius: 999px; color: var(--accent); }
.blacklist-list { display: grid; gap: 10px; }
.blacklist-card { display: grid; grid-template-columns: minmax(170px, .9fr) minmax(220px, 1.1fr) minmax(240px, 1.5fr) auto; align-items: center; gap: 12px; padding: 13px; border: 1px solid var(--border-subtle); border-left: 3px solid var(--status-danger); border-radius: 12px; background: color-mix(in srgb, var(--status-danger) 5%, var(--surface-card-soft)); }
.blacklist-card--readonly { grid-template-columns: minmax(170px, .9fr) minmax(220px, 1.1fr) minmax(240px, 1.5fr); }
.blacklist-card__person { min-width: 0; display: grid; gap: 3px; }
.blacklist-card__person > strong { overflow-wrap: anywhere; color: var(--text-primary); }
.blacklist-card__person small { color: var(--status-danger); font-weight: 850; }
.blacklist-card__identifiers { min-width: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
.blacklist-card__identifiers span { min-width: 0; display: grid; gap: 2px; padding: 7px 9px; border-radius: 8px; background: var(--surface-control); }
.blacklist-card__identifiers small,
.blacklist-card__meta { color: var(--text-secondary); font-size: 9px; }
.blacklist-card__identifiers strong { overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.blacklist-card > p { margin: 0; overflow-wrap: anywhere; color: var(--text-secondary); font-size: 12px; line-height: 1.35; }
.blacklist-card__meta { grid-column: 1 / -1; display: flex; justify-content: space-between; gap: 10px; padding-top: 8px; border-top: 1px solid var(--border-subtle); }
.blacklist-card > form { grid-column: 4; grid-row: 1; }
.blacklist-card > form button { min-height: 38px; border-color: color-mix(in srgb, var(--status-danger) 55%, var(--border-subtle)); color: var(--status-danger); background: color-mix(in srgb, var(--status-danger) 8%, var(--surface-card)); }

@media (max-width: 980px) {
  .blacklist-card { grid-template-columns: minmax(0, 1fr) auto; }
  .blacklist-card--readonly { grid-template-columns: minmax(0, 1fr); }
  .blacklist-card__identifiers,
  .blacklist-card > p { grid-column: 1 / -1; }
  .blacklist-card > form { grid-column: 2; grid-row: 1; }
}

@media (max-width: 640px) {
  .blacklist-form { grid-template-columns: minmax(0, 1fr); }
  .blacklist-form__reason,
  .blacklist-form > button { grid-column: auto; }
  .blacklist-form > button { width: 100%; }
  .blacklist-card { grid-template-columns: minmax(0, 1fr); padding: 11px; }
  .blacklist-card__identifiers,
  .blacklist-card > p,
  .blacklist-card > form,
  .blacklist-card__meta { grid-column: 1; grid-row: auto; }
  .blacklist-card > form button { width: 100%; }
  .blacklist-card__meta { flex-direction: column; gap: 3px; }
}
.blacklist-warning {
  width: min(520px, calc(100vw - 32px));
  margin: auto;
  padding: 28px;
  border: 1px solid color-mix(in srgb, var(--danger, #e76067) 58%, var(--border-color, #41506b));
  border-radius: 22px;
  color: var(--text-primary, #f7f4f2);
  background: linear-gradient(145deg, color-mix(in srgb, var(--surface, #172137) 92%, #4f1720), var(--surface, #172137));
  box-shadow: 0 28px 90px rgb(0 0 0 / 45%);
}

.blacklist-warning::backdrop {
  background: rgb(3 7 16 / 76%);
  backdrop-filter: blur(7px);
}

.blacklist-warning__icon {
  display: grid;
  width: 48px;
  height: 48px;
  margin-bottom: 18px;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--danger, #e76067) 70%, transparent);
  border-radius: 15px;
  color: #fff;
  background: color-mix(in srgb, var(--danger, #e76067) 78%, transparent);
  font-size: 1.55rem;
  font-weight: 900;
}

.blacklist-warning h2 {
  margin: 5px 0 9px;
  color: var(--text-primary, #f7f4f2);
  font-size: clamp(1.35rem, 3vw, 1.8rem);
}

.blacklist-warning__hint {
  margin: 0;
  color: var(--text-muted, #aeb8ca);
  line-height: 1.55;
}

.blacklist-warning__details {
  display: grid;
  gap: 10px;
  margin: 22px 0;
}

.blacklist-warning__details > div {
  padding: 13px 15px;
  border: 1px solid var(--border-color, #41506b);
  border-radius: 14px;
  background: color-mix(in srgb, var(--surface-strong, #202c45) 86%, transparent);
}

.blacklist-warning__details dt {
  margin-bottom: 5px;
  color: var(--text-muted, #aeb8ca);
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.blacklist-warning__details dd {
  margin: 0;
  color: var(--text-primary, #f7f4f2);
  font-weight: 750;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.blacklist-warning__confirm {
  width: 100%;
  min-height: 46px;
  border: 0;
  border-radius: 13px;
  color: #fff;
  background: var(--accent, #d45d46);
  font: inherit;
  font-weight: 850;
  cursor: pointer;
}

@media (max-width: 520px) {
  .blacklist-warning {
    width: calc(100vw - 20px);
    padding: 21px;
    border-radius: 18px;
  }
}

/* VipTour access-key login sequence */
.auth-page::before,
.auth-page::after {
  content: "";
  position: fixed;
  z-index: 0;
  width: 52vw;
  aspect-ratio: 1;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.13;
  pointer-events: none;
  animation: authAmbientDrift 16s ease-in-out infinite alternate;
}

.auth-page::before {
  left: -24vw;
  top: -28vw;
  background: #28d8bb;
}

.auth-page::after {
  right: -28vw;
  bottom: -30vw;
  background: #d7a84e;
  animation-delay: -8s;
}

.auth-shell {
  position: relative;
  z-index: 1;
  perspective: 1400px;
}

.auth-hero {
  animation: authHeroReveal 1s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.auth-brand,
.auth-copy,
.auth-safe-info {
  animation: authContentReveal 0.8s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.auth-brand { animation-delay: 0.18s; }
.auth-copy { animation-delay: 0.34s; }
.auth-safe-info { animation-delay: 0.5s; }

.route-map__point {
  animation: authMapPointReveal 0.7s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.route-map__point--spb { animation-delay: 0.42s; }
.route-map__point--msk { animation-delay: 0.5s; }
.route-map__point--tbs { animation-delay: 0.58s; }
.route-map__point--batumi { animation-delay: 0.66s; }

.route-map__line {
  background-size: 200% 100%;
  animation: authRouteFlow 3.4s linear infinite, authRouteReveal 0.9s 0.54s ease-out both;
}

.login-card {
  position: relative;
  min-height: 438px;
  isolation: isolate;
  overflow: hidden;
  animation: authCardReveal 0.9s 0.16s cubic-bezier(0.16, 1, 0.3, 1) both;
  transition: border-color 0.35s ease, box-shadow 0.35s ease;
}

.login-card::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
  background: linear-gradient(115deg, transparent 20%, rgba(255,255,255,0.08) 42%, transparent 62%);
  transform: translateX(-120%);
  animation: authGlassSweep 1.2s 0.62s ease-out both;
  pointer-events: none;
}

.login-card__aura {
  position: absolute;
  z-index: -1;
  top: -150px;
  right: -150px;
  width: 290px;
  height: 290px;
  border-radius: 50%;
  background: rgba(24, 168, 145, 0.18);
  filter: blur(55px);
  transition: background 0.45s ease, transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

.login-card__header,
.login-form,
.login-note,
.flash-list {
  position: relative;
  z-index: 2;
  transition: opacity 0.35s ease, transform 0.45s cubic-bezier(0.16, 1, 0.3, 1), filter 0.35s ease;
}

.login-card__mark {
  position: relative;
  overflow: hidden;
  animation: authMarkBreathe 4.6s ease-in-out infinite;
}

.login-card__mark::after {
  content: "";
  position: absolute;
  inset: -50%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.68), transparent);
  transform: rotate(35deg) translateX(-80%);
  animation: authMarkSweep 4.6s 1.2s ease-in-out infinite;
}

.login-field__control {
  position: relative;
  display: block;
}

.login-form .login-field__control > svg {
  position: absolute;
  z-index: 1;
  left: 15px;
  top: 50%;
  width: 20px;
  height: 20px;
  transform: translateY(-50%);
  fill: none;
  stroke: rgba(244, 251, 255, 0.62);
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: stroke 0.2s ease, transform 0.25s ease, filter 0.25s ease;
  pointer-events: none;
}

.login-form .login-field__control:focus-within > svg {
  stroke: #58e3ca;
  transform: translateY(-50%) scale(1.08);
  filter: drop-shadow(0 0 7px rgba(88, 227, 202, 0.5));
}

.login-form .login-field__control input {
  padding-left: 47px;
}

.login-button {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  overflow: hidden;
  box-shadow: 0 14px 28px rgba(12, 132, 113, 0.2);
  transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.login-button::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 20%, rgba(255,255,255,0.27) 46%, transparent 72%);
  transform: translateX(-130%);
  transition: transform 0.55s ease;
}

.login-button:hover::before { transform: translateX(130%); }
.login-button:hover { transform: translateY(-2px); box-shadow: 0 18px 34px rgba(12, 132, 113, 0.3); }
.login-button:active { transform: translateY(0) scale(0.99); }

.login-button > span,
.login-button > svg {
  position: relative;
  z-index: 1;
}

.login-button > svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 0.2s ease;
}

.login-button:hover > svg { transform: translateX(3px); }

.auth-key-stage {
  position: absolute;
  z-index: 5;
  inset: 100px 22px 54px;
  display: grid;
  place-items: center;
  opacity: 0;
  visibility: hidden;
  transform: scale(0.96);
  transition: opacity 0.32s ease, transform 0.45s cubic-bezier(0.16, 1, 0.3, 1), visibility 0s 0.45s;
  pointer-events: none;
}

.auth-key-stage__grid {
  position: absolute;
  inset: 0;
  border-radius: 8px;
  background-image:
    linear-gradient(rgba(83, 225, 198, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(83, 225, 198, 0.045) 1px, transparent 1px);
  background-size: 22px 22px;
  mask-image: radial-gradient(circle at center, #000 12%, transparent 72%);
}

.auth-key-core {
  position: absolute;
  left: 50%;
  top: 43%;
  width: 170px;
  height: 170px;
  transform: translate(-50%, -50%);
  display: grid;
  place-items: center;
}

.auth-key-core__orbit {
  position: absolute;
  inset: 5px;
  border: 1px solid rgba(91, 232, 205, 0.25);
  border-radius: 50%;
}

.auth-key-core__orbit--outer {
  border-top-color: #51ddc3;
  border-right-color: rgba(215, 168, 78, 0.65);
  animation: authOrbit 3.2s linear infinite;
}

.auth-key-core__orbit--inner {
  inset: 20px;
  border-style: dashed;
  opacity: 0.62;
  animation: authOrbit 5s linear infinite reverse;
}

.auth-key-core__scanner {
  position: absolute;
  z-index: 2;
  left: 24px;
  right: 24px;
  top: 50%;
  height: 2px;
  border-radius: 50%;
  background: #68f2d8;
  box-shadow: 0 0 8px #68f2d8, 0 0 22px rgba(104, 242, 216, 0.7);
  opacity: 0;
}

.auth-key-icon {
  width: 128px;
  height: 128px;
  overflow: visible;
  color: #63e9d0;
  filter: drop-shadow(0 0 14px rgba(62, 213, 185, 0.3));
  transition: color 0.35s ease, filter 0.35s ease, transform 0.35s ease;
}

.auth-key-icon__halo {
  fill: rgba(54, 210, 181, 0.05);
  stroke: currentColor;
  stroke-width: 1;
  stroke-dasharray: 4 8;
  transform-origin: 80px 80px;
  animation: authOrbit 8s linear infinite;
}

.auth-key-icon__shackle,
.auth-key-icon__body,
.auth-key-icon__stem {
  fill: none;
  stroke: currentColor;
  stroke-width: 6;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

.auth-key-icon__body {
  fill: rgba(7, 28, 31, 0.92);
  stroke-width: 5;
}

.auth-key-icon__hole { fill: currentColor; }
.auth-key-icon__stem { stroke-width: 4; }

.auth-key-icon__shackle {
  transform-origin: 57px 71px;
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.credential-particle {
  position: absolute;
  top: 39%;
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 88px;
  padding: 7px 10px;
  border: 1px solid rgba(98, 233, 208, 0.42);
  border-radius: 999px;
  background: rgba(6, 25, 31, 0.88);
  color: rgba(225, 255, 249, 0.86);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.1em;
  opacity: 0;
  box-shadow: 0 0 20px rgba(53, 214, 184, 0.12);
}

.credential-particle svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: #62e9d0;
  stroke-width: 1.7;
}

.credential-particle--login { left: 4%; }
.credential-particle--password { right: 4%; }

.auth-key-stage__status {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 2px;
  display: grid;
  justify-items: center;
  gap: 5px;
  text-align: center;
}

.auth-key-stage__eyebrow {
  color: #62e9d0;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.2em;
  transition: color 0.3s ease;
}

.auth-key-stage__status strong {
  color: #f5fffd;
  font-size: 14px;
  font-weight: 700;
}

.auth-key-stage__progress {
  width: 150px;
  height: 2px;
  margin-top: 5px;
  overflow: hidden;
  border-radius: 99px;
  background: rgba(255,255,255,0.12);
}

.auth-key-stage__progress i {
  display: block;
  width: 42%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, transparent, #62e9d0, transparent);
  transform: translateX(-110%);
}

.login-card:is(.is-forging, .is-scanning, .is-success, .is-error) .auth-key-stage {
  opacity: 1;
  visibility: visible;
  transform: scale(1);
  transition-delay: 0s;
}

.login-card:is(.is-forging, .is-scanning, .is-success, .is-error) .login-form,
.login-card:is(.is-forging, .is-scanning, .is-success, .is-error) .flash-list {
  opacity: 0;
  transform: translateY(8px) scale(0.97);
  filter: blur(5px);
  pointer-events: none;
}

.login-card:is(.is-forging, .is-scanning, .is-success, .is-error) .login-note {
  opacity: 0.18;
}

.login-card:is(.is-forging, .is-scanning, .is-success, .is-error) .login-card__header {
  opacity: 0.52;
  transform: translateY(-3px);
}

.login-card.is-forging .credential-particle--login {
  animation: authCredentialLogin 0.66s 0.08s cubic-bezier(0.55, 0, 0.25, 1) both;
}

.login-card.is-forging .credential-particle--password {
  animation: authCredentialPassword 0.66s 0.16s cubic-bezier(0.55, 0, 0.25, 1) both;
}

.login-card.is-forging .auth-key-icon {
  animation: authKeyForge 0.78s 0.2s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.login-card.is-forging .auth-key-stage__progress i,
.login-card.is-scanning .auth-key-stage__progress i {
  animation: authProgress 1.05s ease-in-out infinite;
}

.login-card.is-scanning .auth-key-core__scanner {
  opacity: 1;
  animation: authScan 1.05s ease-in-out infinite;
}

.login-card.is-scanning .auth-key-icon {
  animation: authKeyPulse 1.3s ease-in-out infinite;
}

.login-card.is-success {
  border-color: rgba(77, 240, 165, 0.55);
  box-shadow: 0 24px 72px rgba(0,0,0,0.4), 0 0 42px rgba(61, 227, 150, 0.14), inset 0 1px 0 rgba(255,255,255,0.12);
}

.login-card.is-success .login-card__aura { background: rgba(62, 235, 157, 0.32); transform: scale(1.35); }
.login-card.is-success .auth-key-icon { color: #4df0a5; filter: drop-shadow(0 0 20px rgba(77, 240, 165, 0.65)); animation: authAccessGranted 0.65s cubic-bezier(0.16, 1, 0.3, 1) both; }
.login-card.is-success .auth-key-icon__shackle { transform: translate(-5px, -3px) rotate(-28deg); }
.login-card.is-success .auth-key-stage__eyebrow { color: #4df0a5; }
.login-card.is-success .auth-key-stage__progress i { width: 100%; transform: none; background: #4df0a5; transition: width 0.3s ease; }

.login-card.is-error {
  border-color: rgba(255, 94, 105, 0.52);
  box-shadow: 0 24px 72px rgba(0,0,0,0.4), 0 0 38px rgba(255, 72, 89, 0.12), inset 0 1px 0 rgba(255,255,255,0.12);
  animation: authCardReject 0.42s ease both;
}

.login-card.is-error .login-card__aura { background: rgba(255, 70, 88, 0.27); transform: scale(1.2); }
.login-card.is-error .auth-key-icon { color: #ff6673; filter: drop-shadow(0 0 17px rgba(255, 82, 98, 0.55)); animation: authKeyReject 0.42s ease both; }
.login-card.is-error .auth-key-stage__eyebrow { color: #ff7b86; }
.login-card.is-error .auth-key-stage__progress i { width: 100%; transform: none; background: #ff6673; }

@keyframes authHeroReveal {
  from { opacity: 0; transform: translateX(-32px) rotateY(3deg); filter: blur(7px); }
  to { opacity: 1; transform: none; filter: none; }
}

@keyframes authCardReveal {
  from { opacity: 0; transform: translateX(38px) rotateY(-5deg) scale(0.97); filter: blur(8px); }
  to { opacity: 1; transform: none; filter: none; }
}

@keyframes authContentReveal {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: none; }
}

@keyframes authMapPointReveal {
  from { opacity: 0; transform: scale(0.35); }
  to { opacity: 0.78; transform: scale(1); }
}

@keyframes authRouteReveal { from { opacity: 0; } to { opacity: 0.28; } }
@keyframes authRouteFlow { to { background-position: -200% 0; } }
@keyframes authGlassSweep { to { transform: translateX(120%); } }
@keyframes authOrbit { to { transform: rotate(360deg); } }
@keyframes authMarkBreathe { 50% { box-shadow: 0 14px 38px rgba(24, 168, 145, 0.4); transform: translateY(-1px); } }
@keyframes authMarkSweep { 0%, 58% { transform: rotate(35deg) translateX(-90%); } 76%, 100% { transform: rotate(35deg) translateX(90%); } }
@keyframes authAmbientDrift { to { transform: translate(8vw, 5vw) scale(1.12); } }
@keyframes authCredentialLogin { 0% { opacity: 0; transform: translateX(-28px) scale(0.8); } 35% { opacity: 1; } 82% { opacity: 1; transform: translateX(94px) scale(0.92); } 100% { opacity: 0; transform: translateX(112px) scale(0.3); } }
@keyframes authCredentialPassword { 0% { opacity: 0; transform: translateX(28px) scale(0.8); } 35% { opacity: 1; } 82% { opacity: 1; transform: translateX(-94px) scale(0.92); } 100% { opacity: 0; transform: translateX(-112px) scale(0.3); } }
@keyframes authKeyForge { 0% { opacity: 0; transform: scale(0.45) rotate(-12deg); } 65% { opacity: 1; transform: scale(1.08) rotate(2deg); } 100% { opacity: 1; transform: scale(1); } }
@keyframes authProgress { from { transform: translateX(-110%); } to { transform: translateX(260%); } }
@keyframes authScan { 0%, 100% { transform: translateY(-45px); opacity: 0.3; } 50% { transform: translateY(45px); opacity: 1; } }
@keyframes authKeyPulse { 50% { transform: scale(1.035); filter: drop-shadow(0 0 20px rgba(62, 213, 185, 0.55)); } }
@keyframes authAccessGranted { 0% { transform: scale(0.9); } 55% { transform: scale(1.13); } 100% { transform: scale(1); } }
@keyframes authKeyReject { 20%, 60% { transform: translateX(-5px); } 40%, 80% { transform: translateX(5px); } }
@keyframes authCardReject { 25%, 75% { transform: translateX(-3px); } 50% { transform: translateX(3px); } }

@media (max-width: 640px) {
  .login-card { min-height: 430px; }
  .auth-key-stage { inset: 98px 12px 50px; }
  .auth-key-core { width: 156px; height: 156px; }
  .credential-particle { min-width: 74px; padding: 6px 8px; }
  .credential-particle--login { left: 0; }
  .credential-particle--password { right: 0; }
  @keyframes authCredentialLogin { 0% { opacity: 0; transform: translateX(-18px) scale(0.8); } 35%, 82% { opacity: 1; } 82% { transform: translateX(66px) scale(0.9); } 100% { opacity: 0; transform: translateX(82px) scale(0.3); } }
  @keyframes authCredentialPassword { 0% { opacity: 0; transform: translateX(18px) scale(0.8); } 35%, 82% { opacity: 1; } 82% { transform: translateX(-66px) scale(0.9); } 100% { opacity: 0; transform: translateX(-82px) scale(0.3); } }
}

@media (prefers-reduced-motion: reduce) {
  .auth-page::before,
  .auth-page::after,
  .auth-hero,
  .auth-brand,
  .auth-copy,
  .auth-safe-info,
  .route-map__point,
  .route-map__line,
  .login-card,
  .login-card::before,
  .login-card__mark,
  .login-card__mark::after,
  .auth-key-core__orbit,
  .auth-key-icon,
  .auth-key-icon__halo,
  .credential-particle,
  .auth-key-core__scanner,
  .auth-key-stage__progress i {
    animation: none !important;
  }

  .auth-hero,
  .auth-brand,
  .auth-copy,
  .auth-safe-info,
  .route-map__point,
  .login-card {
    opacity: 1;
    transform: none;
    filter: none;
  }

  .login-card:is(.is-forging, .is-scanning, .is-success, .is-error) .auth-key-icon { opacity: 1; }
}

/* Tablet navigation: reuse the compact phone dock without shrinking page layouts. */
@media (min-width: 641px) and (max-width: 1024px) {
  .app-layout,
  .sidebar-collapsed .app-layout {
    display: block;
  }

  .app-sidebar,
  .sidebar-collapsed .app-sidebar,
  .sidebar-collapsed .app-sidebar:hover,
  .sidebar-collapsed .app-sidebar:focus-within {
    position: fixed;
    top: auto;
    right: auto;
    bottom: max(14px, env(safe-area-inset-bottom));
    left: 50%;
    z-index: 95;
    box-sizing: border-box;
    width: min(720px, calc(100vw - 32px));
    max-width: none;
    height: auto;
    display: grid;
    gap: 0;
    overflow: visible;
    padding: 8px;
    border: 1px solid var(--sidebar-line);
    border-radius: 8px;
    background:
      linear-gradient(180deg, var(--sidebar-veil), transparent),
      var(--sidebar-bg);
    box-shadow: var(--shadow-lg);
    transform: translateX(-50%);
  }

  .sidebar-brand,
  .sidebar-user,
  .app-sidebar > .sidebar-logout {
    display: none;
  }

  .sidebar-nav,
  .sidebar-collapsed .app-sidebar:not(:hover):not(:focus-within) .sidebar-nav {
    position: relative;
    min-height: auto;
    display: grid;
    flex: none;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 6px;
    overflow: visible;
    padding: 0;
    direction: ltr;
  }

  .sidebar-more-toggle {
    display: flex;
  }

  .sidebar-more-panel {
    position: absolute;
    left: 0;
    right: 0;
    bottom: calc(100% + 10px);
    box-sizing: border-box;
    display: none;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 7px;
    max-height: min(360px, calc(100vh - 116px));
    overflow-y: auto;
    padding: 10px;
    border: 1px solid var(--sidebar-line);
    border-radius: 8px;
    background:
      linear-gradient(180deg, var(--sidebar-veil), transparent),
      var(--sidebar-bg);
    box-shadow: var(--shadow-lg);
  }

  .sidebar-more-panel[hidden] {
    display: none;
  }

  .app-sidebar.is-more-open .sidebar-more-panel {
    display: grid;
  }

  .sidebar-logout--mobile {
    display: block;
  }

  .sidebar-link,
  .sidebar-logout--mobile button,
  .sidebar-collapsed .app-sidebar:not(:hover):not(:focus-within) .sidebar-link,
  .sidebar-collapsed .app-sidebar:not(:hover):not(:focus-within) .sidebar-logout button {
    min-height: 54px;
    display: grid;
    justify-items: center;
    align-content: center;
    gap: 4px;
    padding: 5px 4px;
    text-align: center;
  }

  .sidebar-nav > .sidebar-link > span {
    display: none;
  }

  .sidebar-nav > .sidebar-link::after {
    content: attr(data-mobile-label);
    max-width: 100%;
    overflow: hidden;
    color: inherit;
    font-size: 11px;
    line-height: 1.1;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .sidebar-more-panel .sidebar-link span,
  .sidebar-logout--mobile span,
  .sidebar-collapsed .sidebar-more-panel .sidebar-link span,
  .sidebar-collapsed .sidebar-logout--mobile span {
    position: static;
    width: auto;
    height: auto;
    max-width: 100%;
    overflow: hidden;
    clip: auto;
    opacity: 1;
    visibility: visible;
    transform: none;
    color: inherit;
    font-size: 11px;
    line-height: 1.15;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .sidebar-link svg,
  .sidebar-logout--mobile svg,
  .sidebar-collapsed .app-sidebar:not(:hover):not(:focus-within) .sidebar-link svg,
  .sidebar-collapsed .app-sidebar:not(:hover):not(:focus-within) .sidebar-logout svg {
    width: 21px;
    height: 21px;
  }

  .sidebar-link.is-active::before,
  .sidebar-collapsed .app-sidebar:not(:hover):not(:focus-within) .sidebar-link.is-active::before {
    position: absolute;
    bottom: 5px;
    left: 50%;
    width: 28px;
    height: 3px;
    transform: translateX(-50%);
  }

  .app-main {
    min-height: 100vh;
    padding-bottom: 112px;
  }

  .chat-widget {
    right: max(18px, env(safe-area-inset-right));
    bottom: calc(max(14px, env(safe-area-inset-bottom)) + 88px);
  }

  .chat-widget__panel {
    max-height: calc(100vh - 126px);
  }
}

/* Georgia parcels: split cash/card/on-receipt payment editor. */
.parcel-form__grid--finance {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  align-items: end;
}

.georgia-payment-mode {
  position: relative;
  grid-column: 1 / -1;
  display: grid !important;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 12px !important;
  min-height: 62px;
  padding: 11px 14px;
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--accent) 6%, transparent), transparent 64%),
    var(--surface-card-soft);
  cursor: pointer;
  transition: border-color 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

.georgia-payment-mode:hover,
.georgia-payment-mode:focus-within {
  border-color: color-mix(in srgb, var(--accent) 46%, var(--border-subtle));
  background: color-mix(in srgb, var(--accent) 7%, var(--surface-card-soft));
}

.georgia-payment-mode:focus-within {
  box-shadow: 0 0 0 3px var(--accent-ring);
}

.georgia-payment-mode > input {
  position: absolute;
  width: 1px;
  height: 1px;
  min-height: 0;
  opacity: 0;
  pointer-events: none;
}

.georgia-payment-mode__switch {
  position: relative;
  width: 46px;
  height: 26px;
  display: block;
  flex: 0 0 auto;
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  background: var(--surface-control);
  box-shadow: inset 0 1px 4px color-mix(in srgb, #000 18%, transparent);
  transition: border-color 180ms ease, background 180ms ease;
}

.georgia-payment-mode__switch i {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--text-secondary);
  box-shadow: 0 2px 6px color-mix(in srgb, #000 28%, transparent);
  transition: transform 220ms cubic-bezier(.2, .8, .2, 1), background 180ms ease;
}

.georgia-payment-mode > input:checked + .georgia-payment-mode__switch {
  border-color: color-mix(in srgb, var(--accent) 68%, transparent);
  background: color-mix(in srgb, var(--accent) 28%, var(--surface-control));
}

.georgia-payment-mode > input:checked + .georgia-payment-mode__switch i {
  background: var(--accent);
  transform: translateX(20px);
}

.georgia-payment-mode__copy {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.georgia-payment-mode__copy strong {
  color: var(--text-primary);
  font-size: 13px;
}

.georgia-payment-mode__copy small {
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 500;
  line-height: 1.35;
}

.parcel-form.has-detailed-payment [data-payment-status] {
  opacity: 0.58;
  cursor: not-allowed;
}

.georgia-payment {
  grid-column: 1 / -1;
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid color-mix(in srgb, var(--accent) 28%, var(--border-subtle));
  border-radius: 8px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--accent) 7%, transparent), transparent 54%),
    var(--surface-card-soft);
  animation: georgiaPaymentReveal 240ms cubic-bezier(.2, .8, .2, 1) both;
}

.georgia-payment[hidden] {
  display: none;
}

.georgia-payment__header,
.georgia-payment__summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.georgia-payment__header > div {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.georgia-payment__header strong {
  color: var(--text-primary);
  font-size: 15px;
}

.georgia-payment__header small,
.georgia-payment__summary small {
  color: var(--text-secondary);
  font-size: 11px;
  line-height: 1.35;
}

.georgia-payment__state {
  flex: 0 0 auto;
  padding: 7px 10px;
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  background: var(--surface-control);
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 850;
}

.georgia-payment[data-payment-state="cash"] .georgia-payment__state,
.georgia-payment[data-payment-state="card"] .georgia-payment__state,
.georgia-payment[data-payment-state="mixed"] .georgia-payment__state {
  border-color: color-mix(in srgb, var(--status-success) 48%, var(--border-subtle));
  background: color-mix(in srgb, var(--status-success) 12%, var(--surface-control));
  color: var(--status-success);
}

.georgia-payment[data-payment-state="partial"] .georgia-payment__state {
  border-color: color-mix(in srgb, var(--gold) 52%, var(--border-subtle));
  background: color-mix(in srgb, var(--gold) 12%, var(--surface-control));
  color: var(--gold);
}

.georgia-payment__methods {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.georgia-payment__methods > label {
  min-width: 0;
  display: grid;
  gap: 7px;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 750;
}

.georgia-payment__input {
  position: relative;
  display: block;
}

.georgia-payment__input input {
  width: 100%;
  padding-right: 58px;
}

.georgia-payment__input b {
  position: absolute;
  top: 50%;
  right: 11px;
  color: var(--accent);
  font-size: 10px;
  letter-spacing: 0.06em;
  transform: translateY(-50%);
  pointer-events: none;
}

.georgia-payment__input--due b {
  color: var(--gold);
}

.georgia-payment__summary {
  justify-content: flex-start;
  flex-wrap: wrap;
  padding-top: 11px;
  border-top: 1px solid var(--border-subtle);
}

.georgia-payment__summary > span {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  color: var(--text-secondary);
  font-size: 11px;
}

.georgia-payment__summary > span strong {
  color: var(--text-primary);
  font-size: 12px;
}

.georgia-payment__summary small {
  flex: 1 1 260px;
  margin-left: auto;
  text-align: right;
}

.georgia-payment__summary small.is-error {
  color: var(--status-danger);
  font-weight: 750;
}

.payment-pill--partial {
  border-color: color-mix(in srgb, var(--gold) 52%, var(--border-subtle));
  background: color-mix(in srgb, var(--gold) 14%, var(--surface-card));
  color: var(--gold);
}

@media (max-width: 760px) {
  .georgia-payment__header,
  .georgia-payment__summary {
    align-items: flex-start;
  }

  .georgia-payment__methods {
    grid-template-columns: 1fr;
  }

  .georgia-payment__summary small {
    flex-basis: 100%;
    margin-left: 0;
    text-align: left;
  }
}

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

/* Georgia new: richer latest-parcel cards with a clearer information hierarchy. */
.parcel-workspace[data-page="georgia-parcels"] .parcel-row--georgia {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  grid-template-columns: 82px minmax(165px, .86fr) minmax(245px, 1.2fr) minmax(185px, .84fr) minmax(250px, 1fr);
  grid-template-areas: "media main people route status";
  gap: 16px;
  min-height: 120px;
  padding: 14px;
  border-color: color-mix(in srgb, var(--border-subtle) 78%, var(--accent));
  border-radius: 14px;
  background:
    radial-gradient(circle at 8% 0%, color-mix(in srgb, var(--accent) 10%, transparent), transparent 34%),
    linear-gradient(145deg, color-mix(in srgb, var(--surface-card-raised) 76%, transparent), var(--surface-card-soft));
  box-shadow: 0 10px 26px color-mix(in srgb, #000 15%, transparent), inset 0 1px 0 color-mix(in srgb, #fff 5%, transparent);
  transition: border-color 200ms ease, box-shadow 200ms ease, transform 200ms ease;
}

.parcel-workspace[data-page="georgia-parcels"] .parcel-row--georgia::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 12px auto 12px 0;
  width: 3px;
  border-radius: 0 999px 999px 0;
  background: linear-gradient(180deg, var(--accent), var(--gold));
  opacity: 0.72;
}

.parcel-workspace[data-page="georgia-parcels"] .parcel-row--georgia:hover {
  border-color: color-mix(in srgb, var(--accent) 46%, var(--border-subtle));
  box-shadow: 0 16px 34px color-mix(in srgb, #000 21%, transparent), inset 0 1px 0 color-mix(in srgb, #fff 7%, transparent);
  transform: translateY(-2px);
}

.parcel-row--georgia .parcel-row__media { grid-area: media; }
.parcel-row--georgia .parcel-row__main { grid-area: main; }
.parcel-row--georgia .parcel-row__people { grid-area: people; }
.parcel-row--georgia .parcel-row__route { grid-area: route; }
.parcel-row--georgia .parcel-row__status { grid-area: status; }

.parcel-workspace[data-page="georgia-parcels"] .parcel-row--georgia .parcel-row__media {
  width: 76px;
  height: 76px;
  border-color: color-mix(in srgb, var(--accent) 34%, var(--border-subtle));
  border-radius: 12px;
  box-shadow: 0 8px 18px color-mix(in srgb, #000 22%, transparent);
}

.parcel-workspace[data-page="georgia-parcels"] .parcel-row--georgia .parcel-row__media img {
  transition: transform 420ms cubic-bezier(.2, .8, .2, 1);
}

.parcel-workspace[data-page="georgia-parcels"] .parcel-row--georgia:hover .parcel-row__media img {
  transform: scale(1.07);
}

.parcel-row--georgia .parcel-row__title {
  align-items: baseline;
  flex-wrap: wrap;
  margin-bottom: 9px;
}

.parcel-row--georgia .parcel-row__title strong {
  font-size: 19px;
  letter-spacing: .02em;
}

.parcel-row--georgia .parcel-row__title > span {
  margin: 0;
  padding: 3px 7px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface-control) 84%, transparent);
  font-size: 10px;
}

.parcel-row--georgia .parcel-row__main p {
  color: color-mix(in srgb, var(--text-primary) 88%, var(--text-secondary));
  font-size: 13px;
  line-height: 1.45;
}

.parcel-row--georgia .parcel-row__people {
  position: relative;
  display: grid;
  gap: 10px;
  padding-left: 18px;
}

.parcel-row--georgia .parcel-row__people::before {
  content: "";
  position: absolute;
  top: 17px;
  bottom: 17px;
  left: 5px;
  width: 1px;
  background: linear-gradient(var(--accent), color-mix(in srgb, var(--gold) 75%, var(--accent)));
  opacity: .62;
}

.parcel-row--georgia .parcel-row__person {
  position: relative;
  display: grid;
  gap: 2px;
  margin: 0;
  overflow: visible;
  white-space: normal;
}

.parcel-row--georgia .parcel-row__person > i {
  position: absolute;
  top: 8px;
  left: -17px;
  width: 9px;
  height: 9px;
  border: 2px solid var(--surface-card-raised);
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 16%, transparent);
}

.parcel-row--georgia .parcel-row__person:last-child > i {
  background: var(--gold);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--gold) 15%, transparent);
}

.parcel-row--georgia .parcel-row__person > span {
  margin: 0;
  color: var(--text-secondary);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.parcel-row--georgia .parcel-row__person > strong {
  font-size: 12px;
  line-height: 1.25;
}

.parcel-row--georgia .parcel-row__route-line {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 5px;
  white-space: normal;
}

.parcel-row--georgia .parcel-row__route-line > span {
  margin: 0;
  overflow: visible;
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 850;
  text-transform: none;
  white-space: normal;
}

.parcel-row--georgia .parcel-row__route-line > i {
  flex: 0 0 auto;
  color: var(--accent);
  font-style: normal;
  filter: drop-shadow(0 0 5px color-mix(in srgb, var(--accent) 42%, transparent));
}

.parcel-row--georgia .parcel-row__route small {
  margin-top: 9px;
  padding: 5px 7px;
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  background: color-mix(in srgb, var(--surface-control) 72%, transparent);
  font-size: 10px;
}

.parcel-workspace[data-page="georgia-parcels"] .parcel-row--georgia .parcel-row__status {
  max-width: none;
  padding: 10px;
  border-color: color-mix(in srgb, var(--accent) 28%, var(--border-subtle));
  border-radius: 11px;
  background:
    linear-gradient(140deg, color-mix(in srgb, var(--accent) 8%, transparent), transparent 58%),
    color-mix(in srgb, var(--surface-card-raised) 88%, var(--surface-control));
  box-shadow: inset 0 1px 0 color-mix(in srgb, #fff 5%, transparent);
}

.parcel-row--georgia .parcel-row__edit {
  border-radius: 8px;
}

@media (max-width: 1200px) and (min-width: 981px) {
  .parcel-workspace[data-page="georgia-parcels"] .parcel-row--georgia {
    grid-template-columns: 76px minmax(160px, .8fr) minmax(230px, 1.15fr) minmax(245px, 1fr);
    grid-template-areas:
      "media main people status"
      "media route route status";
    align-items: start;
  }
}

@media (max-width: 980px) {
  .parcel-form__grid--finance {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .parcel-workspace[data-page="georgia-parcels"] .parcel-row--georgia {
    grid-template-columns: 76px minmax(0, 1fr);
    grid-template-areas:
      "media main"
      "media people"
      "media route"
      "status status";
    align-items: start;
  }
}

@media (max-width: 640px) {
  .parcel-form__grid--finance {
    grid-template-columns: 1fr;
  }

  .parcel-workspace[data-page="georgia-parcels"] .parcel-row--georgia {
    grid-template-columns: 1fr;
    grid-template-areas: "media" "main" "people" "route" "status";
  }

  .parcel-workspace[data-page="georgia-parcels"] .parcel-row--georgia .parcel-row__media {
    width: 100%;
    height: 132px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .georgia-payment,
  .parcel-workspace[data-page="georgia-parcels"] .parcel-row--georgia,
  .parcel-workspace[data-page="georgia-parcels"] .parcel-row--georgia .parcel-row__media img {
    animation: none;
    transition: none;
  }
}

/* Read-only legacy database */
.legacy-page {
  display: grid;
  gap: 18px;
}

.legacy-hero,
.legacy-records-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 24px;
  overflow: hidden;
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  background:
    radial-gradient(circle at 92% 10%, color-mix(in srgb, var(--gold) 17%, transparent), transparent 34%),
    linear-gradient(135deg, color-mix(in srgb, var(--accent) 9%, var(--surface-card)), var(--surface-card));
  box-shadow: var(--shadow-sm);
}

.legacy-hero h1,
.legacy-records-header h1 {
  margin: 5px 0 6px;
  color: var(--text-primary);
  font-size: clamp(30px, 4vw, 48px);
  line-height: 1.04;
}

.legacy-hero p,
.legacy-records-header p,
.legacy-connection-card p {
  margin: 0;
  color: var(--text-secondary);
}

.legacy-readonly-badge {
  min-width: max-content;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 13px;
  border: 1px solid color-mix(in srgb, var(--gold) 48%, var(--border-subtle));
  border-radius: 999px;
  background: color-mix(in srgb, var(--gold) 12%, var(--surface-card));
  color: color-mix(in srgb, var(--gold) 82%, var(--text-primary));
  font-size: 12px;
  font-weight: 900;
}

.legacy-readonly-badge svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.legacy-connection-card {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: center;
  gap: 13px;
  padding: 15px 17px;
  border: 1px solid var(--border-subtle);
  border-radius: 13px;
  background: var(--surface-card-soft);
}

.legacy-connection-card.is-ready { border-color: var(--status-success-border); }
.legacy-connection-card.is-error { border-color: var(--status-danger-border); }

.legacy-connection-card__icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: color-mix(in srgb, var(--status-success) 14%, var(--surface-control));
  color: var(--status-success);
  font-size: 20px;
  font-weight: 950;
}

.legacy-connection-card.is-error .legacy-connection-card__icon {
  background: color-mix(in srgb, var(--status-danger) 14%, var(--surface-control));
  color: var(--status-danger);
}

.legacy-connection-card strong,
.legacy-connection-card p,
.legacy-connection-card span { display: block; }
.legacy-connection-card p { margin-top: 2px; }
.legacy-connection-card span { margin-top: 5px; color: var(--text-muted); font-size: 12px; }
.legacy-connection-card code { overflow-wrap: anywhere; color: var(--accent); }

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

.legacy-section-card {
  min-height: 220px;
  display: flex;
  flex-direction: column;
  padding: 17px;
  border: 1px solid var(--border-subtle);
  border-radius: 15px;
  background: linear-gradient(150deg, color-mix(in srgb, var(--accent) 5%, var(--surface-card)), var(--surface-card));
  color: var(--text-primary);
  box-shadow: var(--shadow-sm);
  text-decoration: none;
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.legacy-section-card:hover {
  border-color: var(--border-accent);
  box-shadow: var(--shadow-md);
  transform: translateY(-3px);
}

.legacy-section-card.is-missing { opacity: .72; }
.legacy-section-card__top,
.legacy-section-card footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.legacy-section-card__index { color: var(--gold); font-size: 13px; font-weight: 950; letter-spacing: .08em; }
.legacy-section-card__state { padding: 5px 8px; border-radius: 999px; background: color-mix(in srgb, var(--status-success) 10%, var(--surface-control)); color: var(--status-success); font-size: 9px; font-weight: 900; text-transform: uppercase; }
.legacy-section-card.is-missing .legacy-section-card__state { background: var(--surface-control); color: var(--text-muted); }
.legacy-section-card h2 { margin: 24px 0 7px; font-size: 20px; }
.legacy-section-card p { margin: 0; color: var(--text-secondary); font-size: 13px; line-height: 1.55; }
.legacy-section-card footer { margin-top: auto; padding-top: 18px; color: var(--text-secondary); font-size: 12px; }
.legacy-section-card footer b { color: var(--text-primary); font-size: 18px; }
.legacy-section-card footer i { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; background: var(--surface-control); color: var(--accent); font-size: 20px; font-style: normal; }

.legacy-breadcrumb { display: flex; align-items: center; gap: 8px; color: var(--text-muted); font-size: 12px; }
.legacy-breadcrumb a { color: var(--accent); font-weight: 850; text-decoration: none; }
.legacy-breadcrumb strong { overflow: hidden; color: var(--text-secondary); text-overflow: ellipsis; white-space: nowrap; }

.legacy-records-total { min-width: 130px; padding: 14px 16px; border: 1px solid var(--border-subtle); border-radius: 13px; background: color-mix(in srgb, var(--surface-control) 80%, transparent); text-align: right; }
.legacy-records-total span { display: block; color: var(--text-muted); font-size: 10px; font-weight: 850; text-transform: uppercase; }
.legacy-records-total strong { display: block; margin-top: 4px; color: var(--gold); font-size: 28px; }

.legacy-search { display: grid; gap: 7px; padding: 14px; border: 1px solid var(--border-subtle); border-radius: 13px; background: var(--surface-card); }
.legacy-search label { color: var(--text-secondary); font-size: 11px; font-weight: 850; }
.legacy-search > div { display: grid; grid-template-columns: minmax(180px, 1fr) auto auto; gap: 8px; }
.legacy-search input { min-width: 0; }
.legacy-search a { min-height: 42px; display: inline-flex; align-items: center; padding: 0 14px; border: 1px solid var(--border-subtle); border-radius: 10px; color: var(--text-secondary); font-size: 12px; font-weight: 850; text-decoration: none; }

.legacy-table-card { overflow: hidden; border: 1px solid var(--border-subtle); border-radius: 14px; background: var(--surface-card); box-shadow: var(--shadow-sm); }
.legacy-table-meta { display: flex; justify-content: space-between; gap: 12px; padding: 11px 14px; border-bottom: 1px solid var(--border-subtle); color: var(--text-muted); font-size: 11px; }
.legacy-table-meta b { color: var(--accent); }
.legacy-table-wrap { overflow: auto; }
.legacy-table { width: max-content; min-width: 100%; border-collapse: collapse; }
.legacy-table th { position: sticky; top: 0; z-index: 2; padding: 11px 12px; border-bottom: 1px solid var(--border-subtle); background: var(--surface-card-soft); color: var(--text-secondary); font-size: 10px; font-weight: 900; text-align: left; white-space: nowrap; }
.legacy-table td { max-width: 290px; padding: 10px 12px; border-bottom: 1px solid color-mix(in srgb, var(--border-subtle) 70%, transparent); color: var(--text-primary); font-size: 12px; line-height: 1.4; overflow-wrap: anywhere; }
.legacy-table tbody tr:hover { background: color-mix(in srgb, var(--accent) 5%, transparent); }
.legacy-table tbody tr:last-child td { border-bottom: 0; }

.legacy-empty { padding: 34px 20px; border: 1px dashed var(--border-subtle); border-radius: 14px; background: var(--surface-card-soft); text-align: center; }
.legacy-empty.is-error { border-color: var(--status-danger-border); }
.legacy-empty strong { color: var(--text-primary); }
.legacy-empty p { margin: 5px 0 0; color: var(--text-secondary); }

.legacy-pagination { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; }
.legacy-pagination a { width: max-content; padding: 9px 12px; border: 1px solid var(--border-subtle); border-radius: 9px; background: var(--surface-card); color: var(--text-primary); font-size: 12px; font-weight: 850; text-decoration: none; }
.legacy-pagination a:last-child { justify-self: end; }
.legacy-pagination strong { color: var(--text-secondary); font-size: 12px; }

@media (max-width: 1050px) {
  .legacy-section-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 680px) {
  .legacy-hero,
  .legacy-records-header { align-items: flex-start; flex-direction: column; padding: 18px; }
  .legacy-readonly-badge { min-width: 0; }
  .legacy-section-grid { grid-template-columns: 1fr; }
  .legacy-section-card { min-height: 190px; }
  .legacy-records-total { width: 100%; text-align: left; }
  .legacy-search > div { grid-template-columns: 1fr auto; }
  .legacy-search input { grid-column: 1 / -1; }
  .legacy-table-meta { align-items: flex-start; flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  .legacy-section-card { transition: none; }
}
