:root {
  font-family: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: dark;
  --moto-bg: #0B1016;
  --moto-surface: #19232D;
  --moto-surface-hover: #22303C;
  --moto-sidebar: #121B24;
  --moto-gold: #D6A64B;
  --moto-gold-hover: #C9973D;
  --moto-gold-light: #F0C77E;
  --moto-gold-soft: rgba(214, 166, 75, .12);
  --moto-red: #C53C36;
  --moto-red-soft: rgba(197, 60, 54, .12);
  --moto-text: #F5F7FA;
  --moto-text-secondary: #AEB8C3;
  --moto-text-muted: #7F8B98;
  --moto-border: rgba(214, 166, 75, .16);
  --moto-border-active: var(--moto-gold);
  --moto-transition-fast: 180ms;
  --moto-transition-normal: 260ms;
  --moto-radius-sm: 6px;
  --moto-radius-md: 10px;
  --moto-radius-lg: 14px;
  --panel: var(--moto-surface);
  --line: var(--moto-border);
  --gold: var(--moto-gold);
  --muted: var(--moto-text-secondary);
  color: var(--moto-text);
  background: var(--moto-bg);
}
*{box-sizing:border-box}body{margin:0}button,input,select,textarea{font:inherit}button{cursor:pointer}a{color:inherit;text-decoration:none}.shell{max-width:1280px;margin:auto;display:grid;grid-template-columns:245px minmax(0,1fr);min-height:100vh}.sidebar{padding:28px 18px;border-right:1px solid var(--line);background:var(--moto-sidebar);position:sticky;top:0;height:100vh}.brand{font-size:25px;font-weight:900;letter-spacing:.5px;padding:4px 12px 34px}.brand span{color:var(--gold)}.official-logo{display:block;width:100%;max-width:185px;height:auto;object-fit:contain;margin:0 auto 8px}.brand{display:flex;flex-direction:column;align-items:center;text-align:center}.brand small{display:block;font-size:10px;color:var(--muted);font-weight:500;letter-spacing:1.5px;margin-top:5px}.nav{display:grid;gap:7px}.sidebar-foot{margin-top:30px;font-size:12px;line-height:1.6;color:var(--muted);padding:12px}.main{padding:30px 34px 70px;min-width:0}.top{display:flex;justify-content:space-between;gap:15px;align-items:center;margin-bottom:30px}.eyebrow{color:var(--gold);font-size:11px;letter-spacing:2px;font-weight:800;text-transform:uppercase}.top h1{margin:7px 0 0;font-size:30px}.pill{border:1px solid #605039;color:#e7c58e;padding:9px 12px;border-radius:30px;font-size:12px}.hero{background:linear-gradient(110deg,var(--moto-surface),var(--moto-sidebar));border:1px solid #3b4044;border-radius:22px;padding:34px;display:flex;justify-content:space-between;gap:20px;align-items:center;overflow:hidden}.hero h2{font-size:31px;line-height:1.15;max-width:550px;margin:10px 0}.hero p{color:var(--muted);max-width:550px;line-height:1.6}.hero-art{flex:0 0 175px;opacity:.95}.hero-logo{display:block;width:175px;height:auto;object-fit:contain}.btn{background:var(--gold);color:var(--moto-bg);border:0;border-radius:10px;padding:12px 17px;font-weight:800}.btn.secondary{background:var(--panel);color:var(--moto-text);border:1px solid #46515a}.btn.danger{background:#743a3a;color:white}.btn:focus-visible,.nav button:focus-visible{outline:2px solid white;outline-offset:2px}.stats{display:grid;grid-template-columns:repeat(3,1fr);gap:15px;margin:22px 0}.stat,.panel{background:var(--panel);border:1px solid var(--line);border-radius:16px;padding:22px}.stat small{color:var(--muted)}.stat strong{display:block;font-size:29px;margin-top:8px}.section-head{display:flex;justify-content:space-between;align-items:center;gap:12px;margin:28px 0 14px}.section-head h2{font-size:21px;margin:0}.cards{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(255px,100%),1fr));gap:14px}.bike-card{border:1px solid #37424b;background:var(--panel);border-radius:16px;padding:22px}.bike-card .bike-icon{font-size:40px;color:var(--gold)}.bike-card h3{margin:12px 0 5px}.muted{color:var(--muted)}.small{font-size:13px}.row{display:flex;justify-content:space-between;align-items:center;gap:12px;flex-wrap:wrap}.stack{display:grid;gap:12px}.record{padding:15px;border:1px solid var(--line);border-radius:11px;background:var(--panel)}.record strong{display:block;margin-bottom:5px}.empty{border:1px dashed #56616a;border-radius:14px;padding:25px;color:var(--muted);line-height:1.6}.form-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:15px}.field{display:grid;gap:7px}.field.full{grid-column:1/-1}.field label{font-size:13px;color:var(--muted)}.field input,.field select,.field textarea{width:100%;padding:12px 13px;border-radius:9px;background:var(--moto-bg);border:1px solid #44505b;color:white;outline:none}.field input:focus,.field select:focus,.field textarea:focus{border-color:var(--gold)}.field textarea{min-height:95px;resize:vertical}.form-actions{display:flex;gap:10px;justify-content:flex-end;margin-top:20px;flex-wrap:wrap}.notice{background:#2a261c;border:1px solid #665337;color:#e8d4ad;padding:14px;border-radius:12px;font-size:13px;line-height:1.5}.tag{display:inline-block;border:1px solid #6b5739;color:#e4bd7b;padding:5px 9px;border-radius:20px;font-size:11px}.tag.overdue{border-color:#ad5959;color:#f5a0a0}.tag.ok{border-color:#548a71;color:#91d7b3}.tabs{display:flex;gap:10px;flex-wrap:wrap;margin:20px 0}.tabs button{border:1px solid var(--line);background:var(--panel);color:white;border-radius:10px;padding:9px 13px}.tabs button.active{border-color:var(--gold);color:var(--gold)}.footer{margin-top:45px;color:var(--moto-text-muted);font-size:12px;border-top:1px solid var(--line);padding-top:18px}dialog{border:1px solid #4c5862;background:var(--panel);color:white;border-radius:17px;width:min(560px,calc(100% - 24px));padding:24px;max-height:90vh;overflow:auto}dialog::backdrop{background:#000a}dialog h2{margin-top:0}#toast{position:fixed;bottom:20px;right:20px;background:var(--gold);color:#111;padding:13px 18px;border-radius:12px;display:none;z-index:3;max-width:350px}.feature-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(190px,1fr));gap:13px}.feature{background:var(--panel);border:1px solid var(--line);border-radius:14px;padding:19px}.feature .glyph{font-size:27px;color:var(--gold)}.feature h3{font-size:16px}.feature p{font-size:13px;line-height:1.5;color:var(--muted)}@media(max-width:800px){.shell{display:block}.sidebar{height:auto;position:static;border-right:0;border-bottom:1px solid var(--line);padding:15px}.brand{padding:2px 4px 14px;font-size:22px}.nav{display:flex;flex-wrap:wrap;gap:5px}.sidebar-foot{display:none}.main{padding:22px 16px 75px}.top h1{font-size:24px}.hero{padding:23px}.hero h2{font-size:25px}.hero-art{display:none}.official-logo{max-width:115px}.brand{align-items:flex-start;text-align:left}.stats{grid-template-columns:1fr 1fr}.stats .stat:last-child{grid-column:1/-1}.form-grid{grid-template-columns:1fr}.field.full{grid-column:auto}}

.auth-panel{max-width:520px;margin:35px auto;background:var(--panel);border:1px solid var(--line);border-radius:18px;padding:26px}.auth-panel h2{margin-top:0}.auth-panel .field{margin:14px 0}.auth-links{display:flex;gap:10px;flex-wrap:wrap;margin-top:14px}.auth-links button{border:0;background:transparent;color:var(--gold);padding:5px}.auth-message{margin:12px 0;color:#e9c996;line-height:1.5}.brand-logo{max-height:78px;max-width:110px;object-fit:contain;display:block;margin:0 auto 8px}.auth-user{font-size:12px;color:var(--gold);overflow-wrap:anywhere}.auth-btn{margin-top:12px;width:100%}

.portal-hero {
  position: relative;
  isolation: isolate;
  display: flex;
  align-items: center;
  min-height: clamp(255px, 35vw, 400px);
  padding: clamp(24px, 5vw, 58px) 6%;
  overflow: hidden;
  border: 1px solid #574832;
  border-radius: 20px;
  background: var(--moto-bg);
}
.portal-hero-media { position: absolute; inset: 0; z-index: -2; }
.portal-hero-media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 64% 58%;
}
.portal-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(11,16,22,.88), rgba(11,16,22,.65) 34%, rgba(11,16,22,.14) 72%, transparent),
    linear-gradient(0deg, rgba(11,16,22,.32), transparent 55%);
}
.portal-hero-copy { position: relative; max-width: 55%; }
.portal-hero-copy::before {
  content: "";
  display: block;
  width: 40px;
  height: 2px;
  margin-bottom: 14px;
  background: var(--moto-gold);
}
.portal-hero-copy h1 {
  margin: 0;
  color: var(--moto-text);
  font-size: clamp(38px, 4vw, 48px);
  font-weight: 800;
  letter-spacing: 1.5px;
  line-height: 1.05;
  text-shadow: 0 2px 10px rgba(0,0,0,.6);
}
.portal-hero-copy p {
  margin: 10px 0 0;
  color: var(--moto-gold);
  font-size: clamp(.75rem, 1.5vw, 1rem);
  font-weight: 600;
  letter-spacing: 2px;
  line-height: 1.45;
}
@media (max-width: 1000px) {
  .portal-hero-copy h1 { font-size: clamp(30px, 4vw, 36px); }
}
@media (max-width: 640px) {
  .portal-hero { min-height: 310px; align-items: flex-end; }
  .portal-hero-media img { object-position: 70% 48%; }
  .portal-hero::before {
    background: linear-gradient(0deg, rgba(11,16,22,.94), rgba(11,16,22,.74) 25%, transparent 74%);
  }
  .portal-hero-copy { max-width: 100%; }
  .portal-hero-copy h1 { font-size: clamp(24px, 6vw, 30px); }
}
@media (hover: hover) and (pointer: fine) {
  .portal-hero:hover { border-color: rgba(214,166,75,.35); }
}
@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  .portal-hero { transition: border-color 700ms ease-out; }
  .portal-hero-media img { transition: transform 700ms ease-out; }
  .portal-hero:hover .portal-hero-media img { transform: scale(1.025); }
}
@media (prefers-reduced-motion: no-preference) {
  .portal-hero-copy h1 { animation: portal-hero-reveal 500ms ease-out both; }
  .portal-hero-copy p { animation: portal-hero-reveal 600ms ease-out 70ms both; }
}
@keyframes portal-hero-reveal { from { opacity: .75; } to { opacity: 1; } }
.portal-nav{display:flex;flex-wrap:wrap;gap:8px;margin:22px 0 14px}
.portal-nav a{display:inline-flex;padding:10px 15px;border:1px solid var(--line);border-radius:9px;color:var(--gold);font-weight:650}
.portal-nav a:hover,.portal-nav a:focus-visible{background:var(--panel);border-color:var(--gold)}
.portal-sections{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px}
.portal-section{background:var(--panel);border:1px solid var(--line);border-top:2px solid var(--gold);border-radius:12px;padding:20px;scroll-margin-top:16px}
.portal-section p{color:var(--muted);line-height:1.55;margin:0}
.portal-section h2,.portal-section h3{margin:0 0 10px;font-size:21px}
.portal-section .empty{margin-top:18px;padding:12px}
@media(max-width:1050px){.portal-sections{grid-template-columns:1fr}}

 .garage-nav{display:flex;flex-wrap:wrap;gap:8px;margin:0 0 20px;padding-bottom:14px;border-bottom:1px solid var(--line)}
.garage-nav [aria-current="page"]{border-color:var(--gold);color:var(--gold);background:#2b251e}

.portal-link{display:inline-block;margin-top:16px;color:var(--gold);text-decoration:underline}
.content-detail{max-width:760px;line-height:1.7}
.content-detail img{display:block;max-width:100%;height:auto;border-radius:12px;margin:18px 0}
.content-detail a{text-decoration:underline;color:var(--gold)}
.portal-nav [aria-current="page"]{border-color:var(--gold)}

.portal-hero + .home-section{margin-top:22px}
.home-section{margin:0 0 28px}
.home-section>h2{margin:0 0 12px;font-size:22px}

.sidebar .nav a {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 10px 14px;
  border-radius: 8px;
  color: var(--moto-text-secondary);
  transition: background-color var(--moto-transition-normal) ease,
    color var(--moto-transition-fast) ease,
    box-shadow 220ms ease;
}
.sidebar .nav a > span { transition: transform 220ms ease; }
.sidebar .nav a::before {
  content: "";
  position: absolute;
  inset: 15% auto 15% 0;
  width: 3px;
  border-radius: 3px;
  background: var(--moto-red);
  transform: scaleY(0);
  transition: transform 220ms ease;
}
.sidebar .nav a[aria-current="page"] {
  background: var(--moto-surface);
  color: var(--moto-gold);
  font-weight: 600;
}
.sidebar .nav a[aria-current="page"]::before {
  background: var(--moto-border-active);
  transform: scaleY(1);
}
.sidebar .nav a:active { background: var(--moto-surface-hover); }
.sidebar .nav a:focus-visible,
.btn:focus-visible,
.portal-link:focus-visible,
.portal-section a:focus-visible {
  outline: 2px solid var(--moto-gold);
  outline-offset: 2px;
}
.top h1::after, .home-section > h2::after, .section-head h2::after {
  content: "";
  display: block;
  width: 30px;
  height: 2px;
  margin-top: 8px;
  background: var(--moto-gold);
}
.portal-section {
  color: var(--moto-text);
  border-radius: var(--moto-radius-lg);
  transition: background-color var(--moto-transition-normal) ease,
    border-color var(--moto-transition-fast) ease, box-shadow var(--moto-transition-normal) ease;
}
.portal-section:focus-within { border-color: var(--moto-gold); }
.portal-link, .content-detail a {
  text-decoration-color: var(--moto-gold);
  text-underline-offset: .2em;
  transition: color var(--moto-transition-fast), text-underline-offset var(--moto-transition-fast);
}
.btn {
  display: inline-block;
  border-radius: var(--moto-radius-md);
  transition: background-color var(--moto-transition-fast) ease;
}
.btn.secondary { border-color: var(--moto-border); }
@media (hover: hover) and (pointer: fine) {
  .sidebar .nav a:hover { background: var(--moto-surface-hover); }
  .sidebar .nav a:not([aria-current="page"]):hover {
    color: var(--moto-text);
    box-shadow: inset 8px 0 14px -8px var(--moto-red-soft);
  }
  .sidebar .nav a:not([aria-current="page"]):hover > span { transform: translateX(3px); }
  .sidebar .nav a:hover::before { transform: scaleY(1); }
  article.portal-section:hover {
    background: var(--moto-surface-hover);
    border-color: var(--moto-gold);
    box-shadow: 0 8px 18px rgba(0, 0, 0, .18);
  }
  .portal-link:hover, .content-detail a:hover {
    color: var(--moto-gold-light);
    text-underline-offset: .32em;
  }
  .btn:not(.secondary):not(.danger):enabled:hover, a.btn:not(.secondary):not(.danger):hover {
    background: var(--moto-gold-hover);
  }
  .btn.secondary:hover { background: var(--moto-surface-hover); }
}
@media (prefers-reduced-motion: reduce) {
  .sidebar .nav a, .sidebar .nav a::before, .sidebar .nav a > span, .portal-section,
  .portal-link, .content-detail a, .btn { transition: none; }
  .sidebar .nav a:not([aria-current="page"]):hover > span { transform: none; }
}

.account-menu { position: relative; }
.account-menu[hidden], .sidebar .cabinet-nav-logout[hidden] { display: none; }
.account-menu summary {
  cursor: pointer;
  max-width: min(42vw, 240px);
  overflow-wrap: anywhere;
}
.account-menu-options {
  position: absolute;
  z-index: 5;
  inset: calc(100% + 8px) 0 auto auto;
  min-width: 145px;
  padding: 5px;
  background: var(--moto-surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 8px 20px #0006;
}
.account-menu-options a, .account-menu-options button, .sidebar .cabinet-nav-logout {
  display: block;
  width: 100%;
  text-align: left;
  padding: 10px 14px;
  color: var(--moto-text-secondary);
  font: inherit;
  background: transparent;
  border: 0;
  border-radius: 8px;
}
.sidebar .cabinet-nav-logout { min-height: 44px; }
.account-menu-options :is(a, button):hover, .sidebar .cabinet-nav-logout:hover {
  background: var(--moto-surface-hover);
  color: var(--moto-gold);
}

.dialog-card > a {
  display: block;
  height: 100%;
}
.dialog-card > a img {
  display: block;
  width: 100%;
  height: auto;
  margin-bottom: 14px;
  border-radius: 8px;
}
.content-dialog {
  width: min(100% - 32px, 500px);
  max-height: calc(100dvh - 32px);
}
.content-dialog::backdrop { background: rgb(0 0 0 / 72%); }
.content-dialog form { display: flex; justify-content: flex-end; }
.store-contacts {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 10px 16px;
  margin-bottom: 0;
}
.store-contacts dt { font-weight: 600; }
.store-contacts dd { margin: 0; overflow-wrap: anywhere; }
.store-contacts a { color: var(--moto-gold); text-decoration: underline; }
@media (max-width: 420px) {
  .store-contacts { grid-template-columns: 1fr; gap: 4px; }
  .store-contacts dd { margin-bottom: 10px; }
}

.news-dialog { width: min(100% - 32px, 720px); }
.news-dialog .content-detail p { margin: 0 0 14px; }

.legal-footer { display:flex; flex-wrap:wrap; gap:8px 16px; margin-top:12px; }
.legal-footer a, .legal-document a, #auth-form a { color:var(--moto-gold); text-decoration:underline; }
.legal-document section { margin-top:22px; }

@media (max-width: 800px) {
  .sidebar {
    padding: 12px clamp(12px, 4vw, 24px);
  }
  .brand {
    align-items: center;
    padding: 0 0 10px;
    text-align: center;
  }
  .official-logo {
    max-width: 88px;
    margin-bottom: 0;
  }
  .sidebar .nav {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px 8px;
  }
  .sidebar .nav a,
  .sidebar .cabinet-nav-logout {
    min-width: 0;
    padding: 8px 10px;
    font-size: 14px;
    line-height: 1.35;
    overflow-wrap: anywhere;
  }
  .main {
    padding: 18px clamp(12px, 4vw, 24px) 40px;
    overflow-wrap: anywhere;
  }
  .top {
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 10px 14px;
    margin-bottom: 20px;
  }
  .top > * { min-width: 0; }
  .top h1 {
    font-size: clamp(22px, 5.5vw, 28px);
    line-height: 1.2;
  }
  .top > .row { width: 100%; justify-content: flex-start; gap: 8px; }
  .account-menu summary {
    min-height: 44px;
    padding-block: 10px;
  }
  .account-menu-options {
    inset-inline: 0 auto;
    max-width: min(240px, calc(100vw - 32px));
  }
  .portal-hero {
    border-radius: 14px;
    min-height: clamp(235px, 70vw, 340px);
  }
  .portal-hero + .home-section { margin-top: 24px; }
  .home-section { margin-bottom: 24px; }
  .home-section > h2,
  .section-head h2,
  .portal-section h2,
  .portal-section h3 { font-size: clamp(17px, 4.5vw, 21px); }
  .portal-section,
  .panel,
  .stat,
  .bike-card,
  .feature,
  .auth-panel,
  .empty { padding: clamp(12px, 4vw, 18px); }
  .portal-sections,
  .stats,
  .form-grid { gap: 12px; }
  .portal-link { margin-top: 10px; }
  .portal-section p,
  .empty,
  .content-detail { line-height: 1.55; }
  .section-head {
    align-items: flex-start;
    flex-wrap: wrap;
    margin-top: 22px;
  }
  .stat,
  .panel,
  .record,
  .field,
  .feature,
  .row > * { min-width: 0; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat strong { font-size: 24px; }
  .feature-grid { grid-template-columns: repeat(auto-fit, minmax(min(175px, 100%), 1fr)); }
  .btn,
  .auth-links button { min-height: 44px; }
  .field :is(input, select, textarea),
  #account-delete input[type="password"] {
    min-width: 0;
    max-width: 100%;
    font-size: 16px;
  }
  .auth-panel { margin: 0 auto 18px; }
  .auth-links { gap: 4px 10px; }
  .garage-nav { margin-bottom: 16px; }
  dialog {
    max-width: calc(100% - 24px);
    max-height: calc(100dvh - 24px);
    padding: clamp(12px, 4vw, 18px);
    overscroll-behavior: contain;
    overflow-wrap: anywhere;
  }
  .content-dialog form { margin-bottom: 12px; }
  .content-dialog h2 { font-size: clamp(19px, 5vw, 23px); }
  .content-dialog,
  .content-dialog .content-detail { line-height: 1.55; }
  .legal-document h2 { font-size: 19px; }
  .legal-footer { gap: 6px 16px; }
  .legal-footer a { padding-block: 5px; }
  .footer { margin-top: 26px; }
  #toast {
    inset-inline: 12px;
    bottom: max(12px, env(safe-area-inset-bottom));
    width: auto;
    max-width: 350px;
    margin-inline: auto;
  }
}

@media (max-width: 360px) {
  .garage-nav .btn,
  .record .btn { padding-inline: 11px; }
  .stat small { font-size: 12px; }
}
