@font-face { font-family: Barlow; src: url(fonts/BarlowSemiCondensed-Regular.ttf); font-weight: 400; font-display: swap; }
@font-face { font-family: Barlow; src: url(fonts/BarlowSemiCondensed-Medium.ttf); font-weight: 500; font-display: swap; }
@font-face { font-family: Barlow; src: url(fonts/BarlowSemiCondensed-SemiBold.ttf); font-weight: 600; font-display: swap; }

/* My Porsche palette: near-black stage, borderless tiles, red only for warnings. Dark by design. */
:root {
  --stage: #0E0E12; --tile: #1C1C20; --raised: #2A2A2E; --red: #D5001C;
  --ok: #4DBF73; --due: #F2AD33; --watch: #B8B8B8; --info: rgba(255,255,255,.4);
  --text: #fff; --secondary: rgba(255,255,255,.58);
  color-scheme: dark;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--stage); color: var(--text); font-family: Barlow, -apple-system, system-ui, sans-serif; font-size: 16px; }
body { padding: env(safe-area-inset-top) 0 0; min-height: 100vh; overflow-x: hidden; }
main { padding: 8px 16px 120px; max-width: 560px; margin: 0 auto; }
h1 { font-size: 30px; font-weight: 500; margin: 10px 0 2px; }
h2 { font-size: 20px; font-weight: 500; margin: 26px 0 10px; display: flex; gap: 8px; align-items: baseline; }
h2 small, .sub { font-size: 13px; color: var(--secondary); font-weight: 400; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
.tile { background: var(--tile); border-radius: 10px; padding: 16px; width: 100%; text-align: left; display: block; margin-bottom: 12px; transition: transform .2s; }
.tile:active, .press:active { transform: scale(.97); }
.row { display: flex; align-items: center; gap: 14px; }
.grow { flex: 1; min-width: 0; }
.title { font-size: 17px; font-weight: 500; }
.line { font-size: 14px; color: var(--secondary); margin-top: 2px; }
.line.overdue { color: var(--red); }
.dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.ok { background: var(--ok); } .due { background: var(--due); } .overdue { background: var(--red); } .watch { background: var(--watch); } .info { background: var(--info); }
.line.overdue { background: none; }
.icon { width: 30px; text-align: center; font-size: 22px; opacity: .6; flex: none; }
.chev { color: var(--secondary); }
.primary { background: #fff; color: #000; border-radius: 5px; height: 55px; width: 100%; font-size: 17px; margin-top: 10px; }
.secondary { background: var(--raised); border-radius: 5px; height: 55px; width: 100%; font-size: 17px; margin-top: 10px; }
.danger { color: var(--red); width: 100%; height: 48px; margin-top: 10px; }
.pill { display: inline-flex; gap: 6px; align-items: center; background: var(--raised); border-radius: 99px; padding: 5px 10px; font-size: 13px; font-weight: 500; }
.pill .dot { width: 7px; height: 7px; }

/* Carousel: swipe between vehicles like the My Porsche vehicle switcher. */
.carousel { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; margin: 0 -16px; scrollbar-width: none; }
.carousel::-webkit-scrollbar { display: none; }
.hero { flex: 0 0 100%; scroll-snap-align: center; height: 300px; display: flex; flex-direction: column; align-items: center; padding: 10px 16px; background: radial-gradient(circle at center, rgba(255,255,255,.07), transparent 60%); }
.hero .make { font-size: 12px; font-weight: 600; letter-spacing: 3px; color: var(--secondary); text-transform: uppercase; }
.hero .model { font-size: 26px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.hero .art { flex: 1; width: 100%; display: flex; align-items: center; justify-content: center; min-height: 0; }
.hero .art img { max-width: 100%; max-height: 170px; object-fit: contain;
  -webkit-mask-image: radial-gradient(ellipse 62% 58% at center, #000 45%, transparent 100%); mask-image: radial-gradient(ellipse 62% 58% at center, #000 45%, transparent 100%); }
.hero .art svg { width: 190px; height: 120px; stroke: rgba(255,255,255,.9); stroke-width: .7; fill: none; }
.hero.add .art { font-size: 64px; font-weight: 200; color: var(--secondary); }
.dots { display: flex; gap: 8px; justify-content: center; margin: 6px 0 4px; }
.dots i { width: 7px; height: 7px; border-radius: 99px; background: rgba(255,255,255,.25); transition: all .3s; }
.dots i.on { width: 22px; background: #fff; }

.odo { font-size: 44px; font-variant-numeric: tabular-nums; }
.odo small { font-size: 20px; }
.kv { display: flex; justify-content: space-between; padding: 6px 0; font-size: 15px; }
.kv span:first-child { color: var(--secondary); }

/* Upcoming */
.date { width: 44px; text-align: center; flex: none; }
.date b { display: block; font-size: 12px; font-weight: 600; color: var(--secondary); }
.date span { font-size: 24px; }
.tag { font-size: 11px; font-weight: 600; letter-spacing: 1.5px; color: var(--secondary); text-transform: uppercase; }

/* Tab bar */
#tabs { position: fixed; bottom: calc(14px + env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); display: flex; gap: 4px; padding: 5px; background: rgba(40,40,44,.85); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); border-radius: 99px; z-index: 5; }
#tabs button { width: 100px; height: 50px; border-radius: 99px; display: grid; place-items: center; }
#tabs button.on { background: rgba(255,255,255,.14); }
#tabs svg { width: 28px; height: 28px; stroke: #fff; stroke-width: 1.4; fill: none; stroke-linecap: round; stroke-linejoin: round; }

/* Sheets */
#sheet { position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 10; display: flex; align-items: flex-end; }
#sheet[hidden] { display: none; }
.sheet-body { background: var(--stage); width: 100%; max-width: 560px; margin: 0 auto; max-height: 92vh; overflow-y: auto; border-radius: 14px 14px 0 0; padding: 20px 16px calc(24px + env(safe-area-inset-bottom)); animation: up .3s ease-out; }
@keyframes up { from { transform: translateY(40px); opacity: 0; } }
.sheet-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.sheet-head button { color: var(--secondary); font-size: 17px; }
label { display: block; font-size: 13px; color: var(--secondary); margin: 14px 0 6px; }
input, select, textarea { width: 100%; background: var(--tile); color: #fff; border: 0; border-radius: 8px; padding: 14px; font: inherit; font-size: 17px; }
textarea { min-height: 70px; }
.seg { display: flex; background: var(--tile); border-radius: 8px; padding: 3px; gap: 3px; }
.seg button { flex: 1; padding: 10px; border-radius: 6px; font-size: 15px; }
.seg button.on { background: var(--raised); }
.check { display: flex; gap: 10px; align-items: center; padding: 6px 0; font-size: 16px; }
.check input { width: 20px; height: 20px; accent-color: #888; }

#splash { position: fixed; inset: 0; background: var(--stage); display: grid; place-items: center; font-size: 44px; font-weight: 500; letter-spacing: 10px; z-index: 20; transition: opacity .45s; }
#toast { position: fixed; top: calc(12px + env(safe-area-inset-top)); left: 50%; transform: translateX(-50%); background: var(--raised); padding: 10px 16px; border-radius: 99px; font-size: 14px; z-index: 30; }
.empty { text-align: center; color: var(--secondary); padding: 30px 0; }
.hint { font-size: 14px; color: var(--secondary); line-height: 1.4; }
