* { box-sizing: border-box; }
body {
  margin: 0;
  background: #f5f7fb;
  color: #182033;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  line-height: 1.6;
}
.container {
  max-width: 760px;
  margin: 0 auto;
  padding: 22px 16px 40px;
}
.card {
  background: white;
  border-radius: 18px;
  padding: 24px;
  box-shadow: 0 8px 28px rgba(22, 34, 66, 0.08);
}
h1 { font-size: 26px; margin: 0 0 18px; }
h2 { font-size: 18px; margin: 26px 0 12px; }
p { white-space: pre-wrap; }
.label { display: block; font-weight: 650; margin: 16px 0 8px; }
.small { color: #697386; font-size: 13px; font-weight: 400; }
.field { margin-bottom: 12px; }
input, select, textarea, button {
  font: inherit;
}
input, select, textarea {
  width: 100%;
  min-height: 46px;
  border: 1px solid #d6dce8;
  border-radius: 12px;
  padding: 10px 12px;
  background: #fff;
  outline: none;
}
input:focus, select:focus, textarea:focus { border-color: #5c7cfa; box-shadow: 0 0 0 3px rgba(92,124,250,.12); }
.input-row { display: flex; align-items: center; gap: 10px; }
.input-row input { flex: 1; }
.suffix, .unit-label { color: #556070; white-space: nowrap; }
.two-col { display: grid; grid-template-columns: 1fr auto 1fr auto; gap: 8px; align-items: center; }
.address-grid { display: grid; gap: 10px; }
.radio-group { display: grid; gap: 12px; }
.radio-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 12px;
  border: 1px solid #e0e5ef;
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
  min-height: 48px;
}
.radio-item:has(input:checked) { background: #eef3ff; border-color: #8aa2ff; }
.radio-item input[type="radio"] {
  width: 20px;
  height: 20px;
  min-height: 20px;
  flex: 0 0 auto;
  accent-color: #4f6ef7;
}
.question-radio .radio-item { font-size: 17px; padding: 14px 13px; }
.question-text {
  font-size: 22px;
  font-weight: 650;
  margin: 26px 0 22px;
}
.hint { color: #697386; font-size: 14px; margin-top: 8px; }
.actions {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 28px;
}
button {
  border: 0;
  border-radius: 12px;
  padding: 11px 18px;
  background: #355cff;
  color: #fff;
  cursor: pointer;
  min-height: 44px;
  font-weight: 650;
}
button.secondary { background: #e9edf6; color: #1f2a44; }
button.danger { background: #e5484d; }
button:disabled { background: #c8ceda; color: #fff; cursor: not-allowed; }
.phase-home {
  background: #07110d;
  color: #fff;
}
.phase-home .container {
  max-width: none;
  margin: 0;
  padding: 0;
}
.phase-home .card {
  background: transparent;
  border-radius: 0;
  padding: 0;
  box-shadow: none;
}
.home-hero {
  min-height: 88dvh;
  padding: 28px clamp(18px, 5vw, 72px) 58px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(4, 10, 8, .88) 0%, rgba(4, 10, 8, .68) 36%, rgba(4, 10, 8, .16) 76%),
    linear-gradient(180deg, rgba(4, 10, 8, .12) 0%, rgba(4, 10, 8, .4) 100%),
    url("/assets/football-hero.jpg") center / cover no-repeat;
}
.home-nav {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  position: relative;
  z-index: 1;
}
.home-brand {
  font-size: 15px;
  font-weight: 750;
  letter-spacing: 0;
  color: rgba(255,255,255,.92);
}
.home-admin-link {
  color: rgba(255,255,255,.82);
  text-decoration: none;
  font-size: 14px;
}
.home-admin-link:hover {
  color: #fff;
}
.home-hero-content {
  width: min(640px, 100%);
  position: relative;
  z-index: 1;
}
.home-kicker {
  margin: 0 0 12px;
  color: #a9f0c5;
  font-size: 16px;
  font-weight: 700;
}
.home-hero h1 {
  margin: 0;
  max-width: 11em;
  color: #fff;
  font-size: clamp(42px, 8vw, 82px);
  line-height: 1.03;
  font-weight: 850;
}
.home-subtitle {
  max-width: 560px;
  margin: 22px 0 0;
  color: rgba(255,255,255,.84);
  font-size: 19px;
  line-height: 1.7;
}
.home-actions {
  margin-top: 34px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.home-actions button {
  min-width: 160px;
  min-height: 50px;
  border-radius: 999px;
  background: #f5c542;
  color: #10160f;
  box-shadow: 0 18px 42px rgba(0,0,0,.22);
}
.home-overview {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: rgba(255,255,255,.12);
  border-top: 1px solid rgba(255,255,255,.16);
}
.home-overview div {
  min-height: 116px;
  padding: 24px clamp(18px, 4vw, 44px);
  background: #0b1711;
}
.home-overview strong,
.home-overview span {
  display: block;
}
.home-overview strong {
  font-size: 18px;
  color: #fff;
  margin-bottom: 8px;
}
.home-overview span {
  color: rgba(255,255,255,.68);
  font-size: 14px;
  line-height: 1.6;
}
.error {
  margin-top: 16px;
  color: #b42318;
  background: #fff2f1;
  border: 1px solid #ffd0cc;
  padding: 10px 12px;
  border-radius: 12px;
}
.success { color: #087f5b; }
.progress-wrap { margin-bottom: 22px; }
.progress-text { font-size: 14px; color: #697386; margin-bottom: 8px; }
.progress-bar { height: 10px; background: #e8edf7; border-radius: 999px; overflow: hidden; }
.progress { height: 100%; background: #4f6ef7; border-radius: 999px; transition: width .2s ease; }
.time-input-row { display: flex; align-items: center; gap: 10px; justify-content: center; }
.time-part { width: 92px; text-align: center; font-size: 22px; }
.time-colon { font-size: 26px; font-weight: 700; }
.voice-question {
  background: #f2f5ff;
  border: 1px solid #dbe4ff;
  border-radius: 14px;
  padding: 16px;
  font-size: 20px;
  font-weight: 650;
  margin: 18px 0;
}
.timer {
  display: inline-block;
  background: #f6f8fc;
  border: 1px solid #e0e5ef;
  border-radius: 999px;
  padding: 8px 14px;
  margin: 6px 0 16px;
  font-weight: 650;
}
.audio-actions { display: flex; gap: 10px; flex-wrap: wrap; margin: 10px 0; }
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; background: #fff; }
th, td { border-bottom: 1px solid #e7ebf3; text-align: left; padding: 9px; vertical-align: top; }
th { background: #f7f9fd; white-space: nowrap; }
.detail-table th { width: 230px; color: #44516c; }
pre { background: #111827; color: #f9fafb; padding: 14px; border-radius: 12px; overflow-x: auto; }
a { color: #355cff; }
@media (max-width: 600px) {
  .container { padding: 12px; }
  .card { padding: 18px 14px; border-radius: 16px; }
  h1 { font-size: 23px; }
  h2 { font-size: 17px; }
  .question-text { font-size: 21px; }
  .radio-item { min-height: 52px; }
  .actions { position: sticky; bottom: 0; background: rgba(255,255,255,.96); padding: 12px 0 0; }
  .actions button { flex: 1; }
  .phase-home .container,
  .phase-home .card {
    padding: 0;
  }
  .home-hero {
    min-height: 86dvh;
    padding: 22px 18px 40px;
    background:
      linear-gradient(180deg, rgba(4, 10, 8, .5) 0%, rgba(4, 10, 8, .88) 78%),
      url("/assets/football-hero.jpg") center / cover no-repeat;
  }
  .home-nav {
    align-items: flex-start;
  }
  .home-admin-link {
    font-size: 13px;
  }
  .home-kicker {
    font-size: 14px;
  }
  .home-hero h1 {
    font-size: 43px;
    max-width: 7em;
  }
  .home-subtitle {
    font-size: 16px;
    line-height: 1.65;
  }
  .home-actions {
    margin-top: 24px;
  }
  .home-actions button {
    width: 100%;
  }
  .home-overview {
    grid-template-columns: 1fr;
  }
  .home-overview div {
    min-height: auto;
    padding: 20px 18px;
  }
}

/* v5 mobile/form refinements */
.field-error input,
.field-error select,
.field-error textarea,
.field-error .radio-item {
  border-color: #e5484d;
  background: #fffafa;
}
.field-msg {
  color: #b42318;
  font-size: 13px;
  margin-top: 6px;
}
.compact-address {
  grid-template-columns: 1fr 1fr 1fr;
}
.audio-preview {
  width: 100%;
  margin-top: 12px;
}
.next-wrap {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  min-width: 120px;
}
.countdown {
  min-height: 16px;
  color: #697386;
  font-size: 12px;
  line-height: 1.2;
}
.survey-screen {
  min-height: calc(100dvh - 120px);
  display: flex;
  flex-direction: column;
}
.question-area {
  flex: 1;
  display: flex;
  flex-direction: column;
}
.phase-survey .card {
  padding-bottom: 16px;
}
.phase-survey .progress-wrap { margin-bottom: 12px; }
.phase-survey .question-text { margin: 12px 0 14px; }
.phase-survey .radio-group { gap: 8px; }
.phase-survey .radio-item { min-height: 43px; padding: 8px 10px; }
.phase-survey .actions { margin-top: auto; }

@media (max-width: 600px) {
  body.phase-survey { background: #fff; }
  .phase-survey .container { padding: 8px; }
  .phase-survey .card { min-height: calc(100dvh - 16px); padding: 12px 12px 10px; border-radius: 14px; box-shadow: none; }
  .survey-screen { min-height: calc(100dvh - 38px); }
  .phase-survey .progress-wrap { margin-bottom: 8px; }
  .phase-survey .progress-text { font-size: 12px; margin-bottom: 4px; }
  .phase-survey .progress-bar { height: 7px; }
  .phase-survey .question-text { font-size: 18px; line-height: 1.35; margin: 8px 0 10px; }
  .question-radio .radio-item { font-size: 15px; min-height: 40px; padding: 7px 9px; border-radius: 10px; }
  .radio-item input[type="radio"] { width: 19px; height: 19px; min-height: 19px; }
  .phase-survey .radio-group { gap: 6px; }
  .phase-survey .hint { font-size: 12px; margin-top: 4px; }
  .phase-survey .error { margin-top: 8px; padding: 8px 10px; font-size: 13px; }
  .phase-survey .actions { position: static; background: transparent; padding: 6px 0 0; margin-top: auto; }
  .phase-survey .actions button { min-height: 38px; padding: 8px 12px; }
  .next-wrap { flex: 1; }
  .next-wrap button { width: 100%; }
  .countdown { align-self: center; font-size: 11px; }
  .compact-address { grid-template-columns: 1fr; }
}

@media (max-height: 720px) and (max-width: 600px) {
  .phase-survey .question-text { font-size: 17px; margin: 6px 0 8px; }
  .question-radio .radio-item { font-size: 14px; min-height: 36px; padding: 6px 8px; }
  .phase-survey .radio-group { gap: 5px; }
  .phase-survey .actions button { min-height: 36px; }
}

/* v6 address picker and audio fixes */
.address-picker-button {
  width: 100%;
  text-align: left;
  background: #fff;
  color: #182033;
  border: 1px solid #d6dce8;
  border-radius: 12px;
  font-weight: 500;
  min-height: 46px;
  padding: 10px 12px;
  position: relative;
}
.address-picker-button::after {
  content: "▾";
  position: absolute;
  right: 14px;
  color: #556070;
}
.address-panel {
  margin-top: 8px;
  padding: 10px;
  border: 1px solid #e0e5ef;
  border-radius: 12px;
  background: #f8faff;
  gap: 8px;
}
.address-detail { margin-top: 8px; }
.audio-actions button { min-width: 104px; }

@media (max-width: 600px) {
  .address-panel { grid-template-columns: 1fr; }
  .address-picker-button { min-height: 48px; }
}

/* v7 region picker and audio compatibility refinements */
.field-error .address-picker-button {
  border-color: #e5484d;
  background: #fffafa;
}
.upload-fallback {
  margin-top: 14px;
  padding: 12px;
  border: 1px dashed #d6dce8;
  border-radius: 12px;
  background: #fbfcff;
}
.upload-fallback input[type="file"] {
  padding: 8px;
  min-height: 42px;
}
.address-panel select {
  margin-bottom: 8px;
}
@media (max-width: 600px) {
  .audio-actions button { flex: 1 1 calc(50% - 8px); }
  .voice-question { font-size: 18px; }
}
.sound-status{margin:10px 0 14px;padding:10px 12px;border-radius:14px;background:#f7f8fc;border:1px solid #e3e7f0;color:#4b5563;font-size:0.95rem;font-weight:600;}
.sound-status span{color:#111827;}
