:root {
  color-scheme: light;
  --brand-50: #f5f3ff;
  --brand-100: #ede9fe;
  --brand-200: #ddd6fe;
  --brand-500: #a76cff;
  --brand-600: #964cfe;
  --brand-700: #7e38df;
  --brand-800: #6424ba;
  --ink: #191627;
  --muted: #6b6478;
  --surface: #ffffff;
  --canvas: #f7f6fa;
  --border: #e5e1ea;
  --danger: #c62828;
  --success: #08775a;
  --warning: #a15c00;
  --shadow-sm: 0 1px 2px rgba(26, 18, 43, 0.06);
  --shadow-md: 0 12px 34px rgba(48, 33, 76, 0.14);
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--canvas); color: var(--ink); }
body { min-width: 320px; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: 0.55; }
a { color: inherit; }
:focus-visible { outline: 3px solid rgba(124, 58, 237, 0.38); outline-offset: 2px; }
.hidden { display: none !important; }
.skip-link { position: fixed; left: 12px; top: -60px; z-index: 10000; padding: 10px 14px; border-radius: 8px; background: var(--ink); color: white; }
.skip-link:focus { top: 12px; }
.icon-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; flex: 0 0 auto; }

.auth-page { min-height: 100vh; display: grid; grid-template-columns: minmax(360px, 520px) 1fr; background: var(--surface); }
.auth-panel { display: flex; flex-direction: column; justify-content: center; padding: clamp(32px, 7vw, 88px); position: relative; z-index: 2; }
.brand { display: inline-flex; align-items: center; gap: 11px; font-size: 22px; font-weight: 750; letter-spacing: -0.03em; }
.brand-mark { width: 38px; height: 38px; display: grid; place-items: center; color: white; background: var(--brand-600); border-radius: 12px 12px 12px 4px; box-shadow: 0 8px 20px rgba(150,76,254,.24); }
.brand-mark .icon { width: 22px; height: 22px; }
.auth-copy { margin: 64px 0 28px; }
.eyebrow { color: var(--brand-700); font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
h1, h2, h3, p { margin-top: 0; }
.auth-copy h1 { margin: 10px 0 12px; max-width: 420px; font-size: clamp(31px, 4vw, 46px); line-height: 1.08; letter-spacing: -.045em; }
.auth-copy p { color: var(--muted); line-height: 1.65; }
.auth-art { min-height: 100vh; position: relative; overflow: hidden; background: linear-gradient(145deg, #55209d 0%, #7e38df 45%, #a76cff 100%); }
.auth-art::before, .auth-art::after { content: ""; position: absolute; border-radius: 999px; border: 1px solid rgba(255,255,255,.2); }
.auth-art::before { width: 620px; height: 620px; right: -180px; top: -160px; }
.auth-art::after { width: 430px; height: 430px; left: -100px; bottom: -160px; }
.art-card { position: absolute; inset: 16% 11%; padding: 28px; border: 1px solid rgba(255,255,255,.24); border-radius: 28px; background: rgba(255,255,255,.12); backdrop-filter: blur(18px); box-shadow: 0 28px 80px rgba(30,15,61,.28); color: white; }
.art-map { position: relative; height: 100%; min-height: 360px; border-radius: 20px; background: linear-gradient(rgba(255,255,255,.08),rgba(255,255,255,.08)), repeating-linear-gradient(28deg, transparent 0 48px, rgba(255,255,255,.11) 49px 51px), repeating-linear-gradient(118deg, transparent 0 80px, rgba(255,255,255,.08) 81px 84px); }
.art-route { position: absolute; width: 60%; height: 35%; top: 36%; left: 20%; border: 3px dashed rgba(255,255,255,.58); border-radius: 60% 30% 65% 35%; transform: rotate(-10deg); }
.art-pin { position: absolute; display: grid; place-items: center; min-width: 70px; padding: 10px 12px; background: white; color: var(--brand-800); font-weight: 800; border-radius: 12px 12px 12px 3px; box-shadow: var(--shadow-md); }
.art-pin.one { left: 18%; top: 22%; }.art-pin.two { right: 15%; top: 48%; }.art-pin.three { left: 40%; bottom: 12%; }

.form-stack { display: grid; gap: 17px; }
.field { display: grid; gap: 7px; color: #312b3a; font-size: 14px; font-weight: 650; }
.field small { color: var(--muted); font-weight: 400; }
.input, .select, .textarea { width: 100%; min-height: 48px; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 11px 13px; background: white; color: var(--ink); transition: border-color .18s, box-shadow .18s; }
.textarea { min-height: 96px; resize: vertical; }
.input:hover, .select:hover, .textarea:hover { border-color: #c5bed0; }
.input:focus, .select:focus, .textarea:focus { outline: 0; border-color: var(--brand-600); box-shadow: 0 0 0 4px rgba(150,76,254,.14); }
.button { min-height: 46px; display: inline-flex; align-items: center; justify-content: center; gap: 9px; border: 1px solid transparent; border-radius: 11px; padding: 10px 16px; font-weight: 700; transition: transform .15s, background .18s, border-color .18s, box-shadow .18s; }
.button:active { transform: translateY(1px); }
.button.primary { color: white; background: var(--brand-600); box-shadow: 0 7px 18px rgba(150,76,254,.22); }
.button.primary:hover { background: var(--brand-700); }
.button.secondary { color: var(--brand-700); background: var(--brand-50); border-color: var(--brand-200); }
.button.ghost { color: var(--ink); background: transparent; border-color: var(--border); }
.button.danger { color: white; background: var(--danger); }
.button.small { min-height: 38px; padding: 7px 11px; font-size: 13px; }
.form-error { padding: 11px 13px; border-radius: 10px; color: #8d1b1b; background: #fff0f0; border: 1px solid #ffd0d0; font-size: 14px; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 248px minmax(0,1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 24px 16px; background: #1f182b; color: #e9e3f3; }
.sidebar .brand { color: white; padding: 0 8px 26px; }
.nav-label { padding: 20px 12px 8px; color: #a79ab8; font-size: 11px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; }
.side-nav { display: grid; gap: 5px; }
.nav-button { width: 100%; min-height: 46px; display: flex; align-items: center; gap: 12px; border: 0; border-radius: 11px; padding: 10px 12px; color: #d7cfdf; background: transparent; text-align: left; font-weight: 600; }
.nav-button:hover { background: rgba(255,255,255,.07); color: white; }
.nav-button.active { background: var(--brand-600); color: white; }
.sidebar-footer { margin-top: auto; padding-top: 18px; border-top: 1px solid rgba(255,255,255,.1); }
.user-chip { display: grid; grid-template-columns: 38px minmax(0,1fr) 36px; align-items: center; gap: 10px; }
.avatar { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 50%; background: rgba(255,255,255,.13); font-weight: 750; }
.user-chip strong, .user-chip small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-chip small { margin-top: 3px; color: #aa9fb8; font-size: 11px; text-transform: capitalize; }
.icon-button { width: 42px; height: 42px; display: inline-grid; place-items: center; border: 0; border-radius: 10px; background: transparent; color: inherit; }
.icon-button:hover { background: rgba(255,255,255,.08); }
.mobile-header, .mobile-nav { display: none; }

.workspace { min-width: 0; min-height: 100vh; }
.page { padding: 30px clamp(22px, 3.2vw, 52px) 52px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; margin-bottom: 24px; }
.page-head h1 { margin: 0 0 8px; font-size: clamp(26px,3vw,36px); letter-spacing: -.035em; }
.page-head p { margin: 0; color: var(--muted); line-height: 1.55; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); box-shadow: var(--shadow-sm); }
.card-pad { padding: 22px; }
.section-title { margin: 0 0 16px; font-size: 18px; }

.map-page { height: 100vh; min-height: 620px; display: grid; grid-template-columns: minmax(0,1fr) 380px; padding: 0; overflow: hidden; }
.map-stage { position: relative; min-width: 0; background: #e6e2eb; }
#map { width: 100%; height: 100%; }
.map-toolbar { position: absolute; top: 20px; left: 20px; right: 20px; z-index: 4; display: flex; gap: 10px; pointer-events: none; }
.search-control { max-width: 520px; flex: 1; display: flex; align-items: center; gap: 10px; min-height: 50px; padding: 0 14px; border: 1px solid rgba(51,35,75,.1); border-radius: 14px; background: white; box-shadow: var(--shadow-md); pointer-events: auto; }
.search-control .input { min-height: 46px; padding: 0; border: 0; box-shadow: none; }
.map-toolbar .button { pointer-events: auto; box-shadow: var(--shadow-md); }
.map-empty { position: absolute; inset: 0; display: grid; place-items: center; padding: 30px; text-align: center; background: #eeeaf3; }
.map-empty .card { max-width: 380px; }
.map-side { z-index: 3; display: flex; flex-direction: column; min-width: 0; background: white; border-left: 1px solid var(--border); }
.map-side-head { padding: 24px; border-bottom: 1px solid var(--border); }
.map-side-head h1 { margin: 0 0 6px; font-size: 22px; }.map-side-head p { margin: 0; color: var(--muted); font-size: 14px; }
.nearby-list { overflow: auto; padding: 12px; }
.code-list-item { width: 100%; display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 12px; padding: 14px; border: 1px solid transparent; border-radius: 12px; background: transparent; text-align: left; }
.code-list-item:hover { background: var(--canvas); }.code-list-item.active { background: var(--brand-50); border-color: var(--brand-200); }
.code-list-item strong, .code-list-item small { display: block; }.code-list-item small { margin-top: 5px; color: var(--muted); }
.code-pill { align-self: center; padding: 7px 9px; border-radius: 8px; color: var(--brand-800); background: var(--brand-100); font-weight: 800; }
.detail-panel { margin-top: auto; padding: 22px; border-top: 1px solid var(--border); background: #fcfbfd; }
.detail-panel h2 { margin: 0 0 5px; font-size: 20px; }.detail-panel p { color: var(--muted); }
.detail-code { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 18px 0; padding: 15px; border-radius: 12px; background: var(--brand-50); color: var(--brand-800); font-size: 24px; font-weight: 800; }
.detail-actions { display: flex; gap: 9px; flex-wrap: wrap; }
.map-pin { position: relative; min-width: 58px; padding: 8px 10px; border-radius: 10px 10px 10px 2px; background: var(--brand-600); color: white; font: 800 13px/1 Inter,sans-serif; box-shadow: 0 7px 18px rgba(70,31,126,.28); transform: translate(-8px,-30px); white-space: nowrap; }
.map-pin::after { content: ""; position: absolute; left: 0; bottom: -10px; border-top: 12px solid var(--brand-600); border-right: 12px solid transparent; }
.map-pin.selected { background: #55209d; transform: translate(-8px,-34px) scale(1.08); }.map-pin.selected::after { border-top-color: #55209d; }

.stats-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 16px; margin-bottom: 22px; }
.stat-card { padding: 20px; }.stat-card span { display: block; color: var(--muted); font-size: 13px; }.stat-card strong { display: block; margin-top: 10px; font-size: 30px; letter-spacing: -.04em; }
.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.data-table th, .data-table td { padding: 13px 14px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: middle; }
.data-table th { color: var(--muted); font-size: 12px; letter-spacing: .03em; text-transform: uppercase; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.filters { display: grid; grid-template-columns: minmax(200px,1fr) repeat(2,minmax(140px,.45fr)) auto; gap: 10px; margin-bottom: 16px; }
.empty-state { padding: 48px 22px; text-align: center; color: var(--muted); }.empty-state .icon { width: 38px; height: 38px; margin-bottom: 12px; color: var(--brand-600); }

.plans { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 18px; max-width: 820px; }
.plan-card { position: relative; padding: 26px; }.plan-card.featured { border: 2px solid var(--brand-600); box-shadow: var(--shadow-md); }
.plan-badge { position: absolute; right: 18px; top: 18px; padding: 5px 9px; border-radius: 99px; color: var(--brand-800); background: var(--brand-100); font-size: 12px; font-weight: 750; }
.price { display: flex; align-items: baseline; gap: 4px; margin: 20px 0; }.price strong { font-size: 40px; letter-spacing: -.05em; }.price span { color: var(--muted); }
.feature-list { display: grid; gap: 11px; margin: 22px 0; padding: 0; list-style: none; }.feature-list li { display: flex; gap: 9px; line-height: 1.45; }.feature-list .icon { color: var(--success); }
.settings-grid { display: grid; grid-template-columns: minmax(0,1fr) minmax(280px,.7fr); gap: 20px; }
.language-options { display: grid; gap: 9px; }.language-option { min-height: 52px; display: flex; align-items: center; justify-content: space-between; border: 1px solid var(--border); border-radius: 11px; padding: 10px 13px; background: white; }.language-option.active { border-color: var(--brand-600); background: var(--brand-50); color: var(--brand-800); }
.faq-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px; }.faq-card { padding: 0; overflow: hidden; }.faq-card summary { padding: 18px 20px; font-weight: 700; cursor: pointer; }.faq-card p { padding: 0 20px 20px; color: var(--muted); line-height: 1.6; }
.status-badge { display: inline-flex; align-items: center; border-radius: 99px; padding: 5px 9px; color: var(--success); background: #e7f7f1; font-size: 12px; font-weight: 700; }

.dialog-backdrop { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 20px; background: rgba(21,14,31,.52); backdrop-filter: blur(3px); }
.dialog { width: min(540px,100%); max-height: min(760px,calc(100vh - 40px)); overflow: auto; border-radius: 20px; background: white; box-shadow: 0 30px 90px rgba(20,10,40,.3); }
.dialog-head { display: flex; justify-content: space-between; align-items: flex-start; padding: 22px 22px 12px; }.dialog-head h2 { margin: 0 0 5px; font-size: 22px; }.dialog-head p { margin: 0; color: var(--muted); line-height: 1.45; }.dialog-body { padding: 10px 22px 22px; }.dialog-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 20px; }
.toast-region { position: fixed; z-index: 1000; right: 22px; bottom: 22px; display: grid; gap: 10px; }.toast { max-width: 360px; padding: 13px 16px; border-radius: 12px; color: white; background: #241b30; box-shadow: var(--shadow-md); animation: toast-in .2s ease-out; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

@media (max-width: 1050px) {
  .app-shell { grid-template-columns: 80px minmax(0,1fr); }.sidebar { padding-inline: 10px; }.sidebar .brand span:last-child, .nav-button span, .nav-label, .user-chip > div, .sidebar-footer .icon-button { display: none; }.sidebar .brand { justify-content: center; padding-inline: 0; }.nav-button { justify-content: center; }.user-chip { display: flex; justify-content: center; }.map-page { grid-template-columns: minmax(0,1fr) 330px; }.stats-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
}

@media (max-width: 760px) {
  .auth-page { grid-template-columns: 1fr; }.auth-art { display: none; }.auth-panel { min-height: 100vh; padding: 28px 22px; }.auth-copy { margin: 52px 0 24px; }
  .app-shell { display: block; padding: 62px 0 72px; }.sidebar { display: none; }.mobile-header { position: fixed; inset: 0 0 auto; z-index: 50; height: 62px; display: flex; align-items: center; justify-content: space-between; padding: 10px 16px; border-bottom: 1px solid var(--border); background: rgba(255,255,255,.94); backdrop-filter: blur(12px); }.mobile-header .brand-mark { width: 34px; height: 34px; }
  .mobile-nav { position: fixed; inset: auto 0 0; z-index: 50; min-height: 68px; display: grid; grid-template-columns: repeat(4,1fr); padding: 7px max(8px,env(safe-area-inset-right)) max(7px,env(safe-area-inset-bottom)) max(8px,env(safe-area-inset-left)); border-top: 1px solid var(--border); background: rgba(255,255,255,.96); backdrop-filter: blur(12px); }.mobile-nav .nav-button { min-height: 52px; display: grid; justify-items: center; align-content: center; gap: 3px; padding: 3px; color: var(--muted); font-size: 10px; }.mobile-nav .nav-button.active { background: transparent; color: var(--brand-700); }.mobile-nav .icon { width: 22px; height: 22px; }
  .page { padding: 20px 16px 34px; }.page-head { align-items: stretch; flex-direction: column; }.page-head .button { width: 100%; }
  .map-page { height: calc(100vh - 130px); min-height: 560px; display: block; position: relative; }.map-stage { height: 100%; }.map-side { position: absolute; left: 12px; right: 12px; bottom: 12px; max-height: 48%; border: 0; border-radius: 20px; box-shadow: var(--shadow-md); overflow: hidden; }.map-side-head { display: none; }.nearby-list { display: none; }.detail-panel { border: 0; }.map-toolbar { top: 12px; left: 12px; right: 12px; }.map-toolbar .button span { display: none; }.map-toolbar .button { width: 50px; padding: 0; }
  .stats-grid, .plans, .settings-grid, .faq-grid { grid-template-columns: 1fr; }.filters { grid-template-columns: 1fr 1fr; }.filters > :first-child { grid-column: 1 / -1; }.filters .button { grid-column: 1 / -1; }
  .toast-region { left: 12px; right: 12px; bottom: 82px; }.toast { max-width: none; }
  .dialog-backdrop { place-items: end center; padding: 0; }.dialog { width: 100%; max-height: 88vh; border-radius: 22px 22px 0 0; padding-bottom: env(safe-area-inset-bottom); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
