:root{
  --bg:#060e1b;
  --surface:#0b182b;
  --surface2:#102036;
  --surface3:#152a46;
  --border:#27405f;
  --text:#f4f8ff;
  --text2:#cbd5e1;
  --muted:#8ea0b8;
  --blue:#3b82f6;
  --blue2:#2563eb;
  --green:#22c55e;
  --red:#ef4444;
  --amber:#f59e0b;
  --purple:#a855f7;
  color-scheme:dark;
  font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
}
*{box-sizing:border-box}
body{
  margin:0;
  min-height:100vh;
  background:
    radial-gradient(circle at 10% 0%,rgba(59,130,246,.16),transparent 35%),
    radial-gradient(circle at 90% 8%,rgba(168,85,247,.10),transparent 32%),
    var(--bg);
  color:var(--text);
}
button,input,textarea{font:inherit}
button{cursor:pointer}
.app-shell{
  width:min(1180px,100%);
  margin:0 auto;
  min-height:100vh;
  padding:24px 18px calc(96px + env(safe-area-inset-bottom));
}
.topbar{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:16px;
  margin-bottom:22px;
}
.eyebrow{
  margin:0 0 4px;
  color:var(--muted);
  font-weight:700;
  letter-spacing:.02em;
}
h1,h2,h3,p{margin-top:0}
h1{
  margin-bottom:0;
  font-size:clamp(42px,8vw,72px);
  line-height:.95;
  letter-spacing:-.055em;
}
h2{
  font-size:clamp(26px,4vw,44px);
  letter-spacing:-.04em;
  margin-bottom:0;
}
h3{
  font-size:24px;
  letter-spacing:-.035em;
  margin-bottom:12px;
}
.icon-button{
  min-width:52px;
  min-height:52px;
  border:1px solid rgba(148,163,184,.25);
  background:rgba(15,35,64,.75);
  color:var(--text);
  border-radius:999px;
  font-size:22px;
}
.screen{
  display:grid;
  gap:18px;
}
.card{
  border:1px solid rgba(96,125,167,.32);
  background:linear-gradient(145deg,rgba(15,35,64,.90),rgba(8,22,38,.94));
  border-radius:30px;
  padding:22px;
  box-shadow:0 22px 70px rgba(0,0,0,.26);
}
.hero{
  display:grid;
  grid-template-columns:1fr;
  gap:18px;
}
.hero-card{
  min-height:280px;
  display:grid;
  gap:22px;
  align-content:space-between;
  position:relative;
  overflow:hidden;
}
.hero-card:after{
  content:"";
  position:absolute;
  right:-90px;
  bottom:-90px;
  width:260px;
  height:260px;
  background:radial-gradient(circle,rgba(59,130,246,.15),transparent 66%);
  pointer-events:none;
}
.hero-top,.row,.dialog-head,.week-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
}
.chip{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:8px 13px;
  border-radius:999px;
  font-weight:800;
  color:var(--amber);
  background:rgba(245,158,11,.12);
  border:1px solid rgba(245,158,11,.28);
}
.chip.green{color:var(--green);background:rgba(34,197,94,.12);border-color:rgba(34,197,94,.28)}
.chip.blue{color:#93c5fd;background:rgba(59,130,246,.14);border-color:rgba(59,130,246,.3)}
.chip.red{color:#fca5a5;background:rgba(239,68,68,.13);border-color:rgba(239,68,68,.3)}
.chip.purple{color:#d8b4fe;background:rgba(168,85,247,.13);border-color:rgba(168,85,247,.3)}
.action-row{
  display:grid;
  grid-template-columns:132px 1fr;
  gap:22px;
  align-items:center;
}
.play-stop{
  display:grid;
  place-items:center;
  width:132px;
  height:110px;
  border:0;
  border-radius:30px;
  background:var(--green);
  color:white;
  font-size:44px;
  font-weight:900;
  box-shadow:0 20px 42px rgba(34,197,94,.18);
}
.play-stop.stop{
  background:var(--red);
  box-shadow:0 20px 42px rgba(239,68,68,.18);
}
.hero-title{
  font-size:clamp(34px,5vw,56px);
  line-height:1.05;
  letter-spacing:-.05em;
  font-weight:900;
  margin-bottom:6px;
}
.sub{
  color:var(--muted);
  font-size:clamp(18px,3vw,28px);
}
.segmented{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:10px;
}
.segmented.five{
  grid-template-columns:repeat(5,1fr);
}
.segmented button,.pill{
  border:1px solid rgba(148,163,184,.18);
  border-radius:19px;
  background:rgba(5,16,31,.62);
  color:var(--muted);
  padding:14px 12px;
  font-weight:800;
}
.segmented button.active,.pill.active{
  color:white;
  background:linear-gradient(135deg,var(--blue2),var(--blue));
  border-color:rgba(147,197,253,.65);
}
.primary,.ghost,.danger,.secondary{
  border:0;
  border-radius:20px;
  padding:15px 16px;
  color:white;
  font-weight:850;
}
.primary{background:linear-gradient(135deg,var(--blue2),var(--blue))}
.secondary{background:rgba(59,130,246,.15);color:#93c5fd;border:1px solid rgba(59,130,246,.45)}
.ghost{background:rgba(5,16,31,.65);color:#93c5fd;border:1px solid rgba(59,130,246,.42)}
.danger{background:rgba(239,68,68,.13);color:#fca5a5;border:1px solid rgba(239,68,68,.36)}
.small{padding:10px 12px;font-size:14px}
.metrics{
  display:grid;
  grid-template-columns:repeat(3,1fr);
  gap:12px;
}
.metric{
  border-radius:22px;
  background:rgba(16,32,54,.92);
  padding:16px 12px;
  text-align:center;
}
.metric small{
  display:block;
  color:var(--muted);
  font-weight:800;
  margin-bottom:5px;
}
.metric strong{
  font-size:clamp(24px,4vw,42px);
  letter-spacing:-.04em;
}
.progress{
  height:10px;
  border-radius:999px;
  background:#334155;
  overflow:hidden;
}
.progress span{
  display:block;
  height:100%;
  width:0;
  border-radius:999px;
  background:linear-gradient(90deg,var(--blue),var(--purple));
}
.week-section{
  display:grid;
  gap:12px;
}
.week-strip{
  display:flex;
  gap:12px;
  overflow-x:auto;
  padding-bottom:4px;
  scrollbar-width:none;
}
.week-strip::-webkit-scrollbar{display:none}
.day-card{
  min-width:136px;
  border-radius:26px;
  background:rgba(9,24,43,.88);
  padding:18px;
  border:1px solid rgba(148,163,184,.15);
}
.day-card.active{
  background:#0e244b;
  border-color:rgba(96,165,250,.55);
}
.day-label{
  color:var(--muted);
  font-size:20px;
  font-weight:800;
  margin-bottom:18px;
}
.day-card.active .day-label{color:#60a5fa}
.day-value{
  font-size:30px;
  font-weight:900;
  letter-spacing:-.045em;
}
.day-sub{
  color:var(--muted);
  font-weight:800;
}
.calendar-card{
  padding:24px 16px;
}
.calendar-grid{
  display:grid;
  grid-template-columns:repeat(5,1fr);
  gap:10px 8px;
}
.weekday{
  color:var(--muted);
  text-align:center;
  font-size:22px;
  padding-bottom:8px;
}
.cal-cell{
  min-height:72px;
  border-radius:18px;
  display:grid;
  place-items:center;
  align-content:center;
  gap:3px;
  color:var(--text);
}
.cal-cell:not(.blank):hover,.day-card:hover{
  outline:1px solid rgba(96,165,250,.35);
}
.cal-cell.active{
  background:#0e244b;
}
.cal-day{
  font-size:26px;
  line-height:1;
  font-weight:900;
}
.cal-val{
  color:var(--muted);
  font-size:17px;
  font-weight:800;
}
.history-list,.admin-list{
  display:grid;
  gap:12px;
}
.empty{
  color:var(--muted);
  padding:18px 0;
}
.form-grid{
  display:grid;
  grid-template-columns:repeat(3,1fr);
  gap:12px;
}
label{
  display:grid;
  gap:6px;
  color:var(--muted);
  font-weight:800;
}
input,textarea{
  width:100%;
  border:1px solid rgba(148,163,184,.2);
  background:rgba(9,24,43,.95);
  color:var(--text);
  border-radius:16px;
  padding:13px 12px;
}
.wide-label{margin-top:14px}
.day-dialog{
  width:min(760px,calc(100vw - 24px));
  border:0;
  background:transparent;
  color:var(--text);
}
.day-dialog::backdrop{background:rgba(0,0,0,.72);backdrop-filter:blur(8px)}
.dialog-card{
  display:grid;
  gap:16px;
  padding:22px;
  border-radius:30px;
  background:linear-gradient(145deg,#0f2340,#081626);
  border:1px solid rgba(96,125,167,.42);
}
.dialog-actions{
  display:flex;
  justify-content:flex-end;
  gap:12px;
}
.bottom-nav{
  position:fixed;
  left:50%;
  bottom:calc(18px + env(safe-area-inset-bottom));
  transform:translateX(-50%);
  width:min(860px,calc(100% - 36px));
  display:grid;
  grid-template-columns:repeat(5,1fr);
  gap:4px;
  padding:8px;
  border-radius:32px;
  background:rgba(12,25,43,.96);
  border:1px solid rgba(96,125,167,.28);
  backdrop-filter:blur(16px);
}
.bottom-nav button{
  border:0;
  background:transparent;
  color:var(--muted);
  border-radius:999px;
  padding:14px 8px;
  font-weight:750;
}
.bottom-nav button.active{
  color:#93c5fd;
  background:#0e244b;
}
.admin-grid{
  display:grid;
  grid-template-columns:repeat(3,1fr);
  gap:12px;
}
@media (min-width:820px){
  .hero{
    grid-template-columns:1.25fr .9fr;
  }
  .hero-card{min-height:340px}
  .week-strip{display:grid;grid-template-columns:repeat(5,1fr);overflow:visible}
  .day-card{min-width:0}
}
@media (max-width:560px){
  .app-shell{padding-left:16px;padding-right:16px}
  .card{padding:18px;border-radius:28px}
  .action-row{grid-template-columns:112px 1fr;gap:16px}
  .play-stop{width:112px;height:96px;border-radius:26px}
  .metrics{gap:9px}
  .metric{padding:12px 8px;border-radius:20px}
  .metric strong{font-size:24px}
  .segmented.five{grid-template-columns:repeat(2,1fr)}
  .form-grid{grid-template-columns:1fr}
  .admin-grid{grid-template-columns:1fr}
  .bottom-nav{grid-template-columns:repeat(5,1fr)}
  .bottom-nav button{font-size:13px;padding:12px 4px}
}
