:root {
  color-scheme: light;
  --navy: #102a43;
  --navy-soft: #243f58;
  --teal: #087e82;
  --teal-dark: #06696c;
  --mint: #e5f5f2;
  --ink: #183247;
  --muted: #718397;
  --line: #e2e9ee;
  --paper: #ffffff;
  --background: #f5f8fa;
  --shadow: 0 12px 35px rgb(16 42 67 / 7%);
  font-family: "DM Sans", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; background: var(--background); color: var(--ink); }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
.topbar { height: 76px; padding: 0 max(24px, calc((100% - 1160px) / 2)); display: flex; align-items: center; justify-content: space-between; background: var(--navy); color: white; }
.brand { display: flex; align-items: center; gap: 11px; color: white; text-decoration: none; font: 800 18px Manrope, sans-serif; letter-spacing: -.4px; }
.brand-mark { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; color: var(--navy); background: #8de0d1; font-size: 20px; }
.brand-subtitle { display: block; margin-top: 2px; color: #b6c8d4; font: 600 8px "DM Sans", sans-serif; letter-spacing: 1.6px; }
.shell { width: min(1160px, calc(100% - 48px)); margin: 0 auto; }
.welcome { display: flex; align-items: end; justify-content: space-between; gap: 30px; padding: 50px 0 34px; }
.eyebrow { margin: 0 0 9px; color: var(--teal); font-size: 10px; font-weight: 700; letter-spacing: 1.55px; }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { font-family: Manrope, "Segoe UI", sans-serif; color: var(--navy); }
h1 { max-width: 610px; margin-bottom: 9px; font-size: clamp(30px, 4vw, 43px); line-height: 1.15; letter-spacing: -1.8px; }
.welcome-copy { margin: 0; color: var(--muted); font-size: 14px; }
.active-net-card { min-width: 250px; padding: 13px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); }
.active-net-card label { display: block; margin-bottom: 6px; color: var(--muted); font-size: 9px; font-weight: 700; letter-spacing: 1.2px; }
.active-net-card select { width: 100%; border: 0; outline: 0; background: transparent; color: var(--navy); font-weight: 700; }
.active-net-card .muted { display: block; margin-top: 4px; font-size: 11px; }
.tabs { display: flex; gap: 24px; overflow-x: auto; border-bottom: 1px solid var(--line); }
.tab { flex: 0 0 auto; position: relative; padding: 14px 2px; border: 0; background: transparent; color: var(--muted); font-size: 13px; font-weight: 600; }
.tab.is-active { color: var(--teal); }
.tab.is-active::after { position: absolute; right: 0; bottom: -1px; left: 0; height: 2px; background: var(--teal); content: ""; }
.view { display: none; padding: 32px 0 56px; }
.view.is-visible { display: block; }
.section-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.section-heading .eyebrow { margin-bottom: 5px; }
h2 { margin-bottom: 0; font-size: 25px; letter-spacing: -.8px; }
h3 { margin-bottom: 7px; font-size: 17px; letter-spacing: -.35px; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 40px; padding: 0 16px; border: 1px solid transparent; border-radius: 8px; font-size: 12px; font-weight: 700; transition: background .15s, transform .15s; }
.button:hover { transform: translateY(-1px); }
.button-light { color: var(--navy); background: white; }
.button-primary { color: white; background: var(--teal); }
.button-primary:hover { background: var(--teal-dark); }
.button-outline { color: var(--navy-soft); border-color: var(--line); background: white; }
.button-wide { width: 100%; }
.panel { padding: 23px; border: 1px solid var(--line); border-radius: 13px; background: var(--paper); box-shadow: var(--shadow); }
.muted { color: var(--muted); }
.roster-layout { display: grid; grid-template-columns: minmax(280px, .88fr) minmax(360px, 1.12fr); gap: 18px; align-items: start; }
.add-panel > p { margin-bottom: 19px; font-size: 12px; line-height: 1.6; }
textarea, input[type="text"] { width: 100%; padding: 12px 13px; border: 1px solid #d9e3e9; border-radius: 8px; outline: none; background: #fbfcfd; color: var(--ink); font-size: 13px; }
textarea { min-height: 136px; resize: vertical; line-height: 1.6; }
textarea:focus, input[type="text"]:focus, select:focus { border-color: #61b8b2; box-shadow: 0 0 0 3px rgb(8 126 130 / 10%); }
.form-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 12px; }
.form-footer .muted { font-size: 10px; }
.roster-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.roster-heading > div { display: flex; align-items: center; gap: 10px; }
.roster-heading h3 { margin: 0; }
.roster-actions { display: flex; align-items: center; gap: 12px; }
.button:disabled { cursor: not-allowed; opacity: .55; transform: none; }
.count-pill { padding: 4px 8px; border-radius: 20px; background: var(--mint); color: var(--teal-dark); font-size: 10px; font-weight: 700; }
.text-button { padding: 6px 0; border: 0; background: none; color: var(--muted); font-size: 11px; }
.text-button:hover { color: #b04444; }
.participant-list { max-height: 450px; overflow-y: auto; }
.participant { display: flex; align-items: center; gap: 12px; padding: 13px 2px; border-bottom: 1px solid #edf1f4; }
.participant-number { display: grid; flex: 0 0 30px; height: 30px; place-items: center; border-radius: 9px; background: #f0f5f7; color: var(--navy-soft); font-size: 11px; font-weight: 700; }
.participant-info { min-width: 0; flex: 1; }
.participant-info strong { display: block; color: var(--navy); font-size: 12px; }
.participant-info span { display: block; overflow: hidden; margin-top: 2px; color: var(--muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.remove-participant { width: 28px; height: 28px; border: 0; border-radius: 7px; background: transparent; color: #a1afbb; font-size: 18px; }
.remove-participant:hover { background: #fff1f0; color: #b04444; }
.empty-state { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; min-height: 170px; color: var(--muted); text-align: center; font-size: 12px; }
.empty-state strong { color: var(--navy-soft); font-size: 13px; }
.empty-icon { color: #99c9c3; font-size: 28px; }
.tool-layout { display: grid; grid-template-columns: minmax(280px, .8fr) minmax(300px, 1.2fr); gap: 18px; }
.question-panel > p { font-size: 12px; line-height: 1.6; }
.question-panel label, dialog label { display: block; margin: 20px 0 7px; color: var(--navy-soft); font-size: 11px; font-weight: 700; }
.question-panel input { margin-bottom: 15px; }
.question-panel label .muted { font-weight: 400; }
.tool-icon { display: grid; width: 38px; height: 38px; margin-bottom: 17px; place-items: center; border-radius: 12px; background: var(--mint); color: var(--teal); font: 700 22px Manrope, sans-serif; }
.result-panel { display: flex; min-height: 280px; flex-direction: column; align-items: center; justify-content: center; background: linear-gradient(145deg, white, #f1f8f7); text-align: center; }
.result-placeholder { color: var(--muted); font-size: 13px; }
.picked-number { display: grid; width: 48px; height: 48px; margin-bottom: 13px; place-items: center; border-radius: 15px; background: var(--mint); color: var(--teal); font-weight: 700; }
.picked-call { margin-bottom: 4px; color: var(--navy); font: 800 24px Manrope, sans-serif; }
.picked-details { margin-bottom: 14px; color: var(--muted); font-size: 13px; }
.picked-prompt { max-width: 400px; color: var(--teal-dark); font-size: 13px; font-weight: 600; }
.wheel-layout { display: grid; grid-template-columns: minmax(300px, 1.1fr) minmax(270px, .9fr); gap: 36px; align-items: center; max-width: 850px; margin: 0 auto; }
.wheel-wrap { position: relative; display: grid; width: min(100%, 420px); margin: auto; place-items: center; }
#wheel-canvas { display: block; width: 100%; height: auto; border-radius: 50%; filter: drop-shadow(0 10px 20px rgb(16 42 67 / 17%)); }
.wheel-pointer { position: absolute; z-index: 2; top: -6px; left: 50%; width: 0; height: 0; transform: translateX(-50%); border-right: 15px solid transparent; border-bottom: 0; border-left: 15px solid transparent; border-top: 28px solid #ef8b52; filter: drop-shadow(0 2px 2px rgb(16 42 67 / 18%)); }
.wheel-center { position: absolute; display: grid; width: 68px; height: 68px; place-content: center; border: 5px solid white; border-radius: 50%; background: var(--navy); color: white; font: 700 9px/1.2 Manrope, sans-serif; text-align: center; }
.wheel-panel { padding: 27px; }
.wheel-panel > .eyebrow { margin-bottom: 6px; }
.wheel-panel > p.muted { margin-bottom: 20px; font-size: 12px; line-height: 1.6; }
.wheel-count { padding: 12px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.wheel-count strong { color: var(--navy); font-size: 15px; }
.winner-box { margin-top: 15px; padding: 14px; border-radius: 9px; background: #f3f7f9; color: var(--muted); font-size: 12px; text-align: center; }
.winner-box.is-winner { background: #e5f5f2; color: var(--teal-dark); font-size: 14px; font-weight: 700; }
.history-list { display: grid; gap: 12px; }
.history-card { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 18px 20px; border: 1px solid var(--line); border-radius: 11px; background: white; }
.history-card h3 { margin-bottom: 4px; font-size: 15px; }
.history-meta { color: var(--muted); font-size: 11px; }
.history-actions { display: flex; align-items: center; gap: 10px; }
.status-pill { padding: 5px 9px; border-radius: 20px; background: #f0f3f5; color: var(--muted); font-size: 10px; font-weight: 700; }
.status-pill.is-active { background: var(--mint); color: var(--teal-dark); }
.data-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.data-grid .panel > p { font-size: 12px; line-height: 1.6; }
.file-picker { display: inline-flex; min-height: 40px; align-items: center; padding: 0 15px; border: 1px solid var(--line); border-radius: 8px; background: white; color: var(--navy); cursor: pointer; font-size: 12px; font-weight: 700; }
#import-file { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); }
.small { margin-top: 14px; font-size: 10px !important; }
.notice { margin-top: 16px; padding: 11px 13px; border: 1px solid #f2d28e; border-radius: 8px; background: #fff8e7; color: #765a20; font-size: 12px; }
.notice.is-error { border-color: #efc1bc; background: #fff1ef; color: #8d3730; }
dialog { width: min(440px, calc(100% - 32px)); padding: 23px; border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 24px 80px rgb(16 42 67 / 25%); }
dialog::backdrop { background: rgb(16 42 67 / 45%); }
.dialog-heading { display: flex; align-items: start; justify-content: space-between; }
.dialog-heading h2 { font-size: 22px; }
.icon-button { width: 30px; height: 30px; border: 0; border-radius: 8px; background: #f1f5f7; color: var(--muted); font-size: 20px; }
.dialog-actions { display: flex; justify-content: end; gap: 8px; margin-top: 20px; }
footer { padding: 22px; color: #8b9aa7; font-size: 10px; text-align: center; }
footer span { padding: 0 4px; color: #b7c3cc; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }
[hidden] { display: none !important; }

@media (max-width: 760px) {
  .welcome { align-items: stretch; flex-direction: column; padding-top: 36px; }
  .active-net-card { width: 100%; }
  .roster-layout, .tool-layout, .data-grid { grid-template-columns: 1fr; }
  .wheel-layout { grid-template-columns: 1fr; gap: 22px; }
  .wheel-wrap { width: min(100%, 350px); }
}
@media (max-width: 480px) {
  .topbar { height: 66px; padding: 0 16px; }
  .shell { width: calc(100% - 32px); }
  .brand { font-size: 16px; }
  .welcome { padding-top: 29px; }
  .tabs { gap: 19px; }
  .tab { font-size: 12px; }
  .section-heading { align-items: end; }
  .panel { padding: 18px; }
  .form-footer { align-items: flex-start; flex-direction: column; }
  .roster-heading { align-items: flex-start; flex-direction: column; }
  .roster-actions { flex-wrap: wrap; }
  .history-card { align-items: flex-start; flex-direction: column; }
  .history-actions { justify-content: space-between; width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; }
}
