/* Shared customer screens, including the copy served by the box. */
:root {
  color-scheme: light;
  --ink: #163b37;
  --secondary: #526a65;
  --teal: #126e60;
  --teal-light: #e6f4ee;
  --line: #d6e3dc;
  --canvas: #f3f6f2;
  --paper: #fff;
  --warn-ink: #a12836;
  --warn-bg: #fff0f2;
  --warn-line: #e6acb4;
  --danger: #9a322b;
  --gutter: clamp(14px, 4vw, 30px);
  font: 100%/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background: var(--canvas);
  -webkit-text-size-adjust: 100%;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-padding-block: 1rem calc(6rem + env(safe-area-inset-bottom, 0px)); }
body { margin: 0; background: var(--canvas); color: var(--ink); }
.app-shell {
  max-width: 58rem;
  margin-inline: auto;
  padding: max(1rem, env(safe-area-inset-top, 0px)) var(--gutter)
    calc(6.5rem + env(safe-area-inset-bottom, 0px));
  padding-left: max(var(--gutter), env(safe-area-inset-left, 0px));
  padding-right: max(var(--gutter), env(safe-area-inset-right, 0px));
  overflow-wrap: anywhere;
}
.page-head { padding: 1.05rem .25rem 1.25rem; }
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  color: var(--teal);
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .1em;
}
.eyebrow::before {
  content: "";
  flex: none;
  width: 1.55rem;
  height: 1.55rem;
  border-radius: .5rem;
  background:
    linear-gradient(#fff, #fff) 30% center / 2px 26% no-repeat,
    linear-gradient(#fff, #fff) 47% center / 2px 58% no-repeat,
    linear-gradient(#fff, #fff) 64% center / 2px 41% no-repeat,
    linear-gradient(#fff, #fff) 81% center / 2px 19% no-repeat,
    var(--teal);
}
h1, h2, h3, p, figure, fieldset { margin: 0; }
h1, h2, h3 { line-height: 1.3; color: var(--ink); }
h1 { margin-block: .5rem .35rem; font-size: clamp(1.9rem, 6.5vw, 2.65rem); letter-spacing: -.035em; }
h2 { font-size: 1.15rem; letter-spacing: -.015em; }
h3 { font-size: 1rem; }
.page-head p, .muted, small { color: var(--secondary); }
.page-head p { max-width: 46rem; }
small, .muted { font-size: .9rem; }
a { color: var(--teal); text-underline-offset: .2em; }
.tab-page, .card-list, .voice-list, .settings-group { display: grid; gap: .8rem; min-width: 0; }
.tab-page { align-content: start; }
.panel, .voice-card, details {
  min-width: 0;
  margin: 0;
  padding: clamp(14px, 4vw, 24px);
  border: 1px solid var(--line);
  border-radius: 1.1rem;
  background: var(--paper);
}
.panel > * + *, .voice-card > * + * { margin-block-start: .7rem; }
.panel > :first-child, .voice-card > :first-child { margin-block-start: 0; }
.voice-card { padding: 1rem; }
.voice-card.current {
  border-color: #85b6a7;
  background: linear-gradient(110deg, #e4f3eb, #f7fbf8);
  box-shadow: inset 4px 0 0 var(--teal);
  padding-inline-start: 1.25rem;
}
.pill {
  display: inline-flex;
  align-items: center;
  align-self: start;
  width: fit-content;
  max-width: 100%;
  padding: .18rem .6rem;
  border-radius: 100px;
  background: var(--teal-light);
  color: #195f52;
  font-size: .79rem;
  line-height: 1.5;
  font-weight: 650;
}
.current .pill { background: var(--teal); color: white; }
.missing, .notice.missing, .pill.missing {
  color: var(--warn-ink);
  background: var(--warn-bg);
  border-color: var(--warn-line);
}
.summary, .notice {
  padding: .75rem .9rem;
  border: 1px solid #c5dfd2;
  border-radius: .75rem;
  background: #eef7f1;
  color: #245d4d;
  white-space: pre-line;
  font-size: .92rem;
}
.notice { margin-block: .15rem .85rem; }
.notice.bad, .notice.danger { background: #fff0ec; border-color: #e7b4a8; color: var(--danger); }
.notice:empty, .summary:empty { display: none; }
#soundActivation { width: min(26rem, calc(100% - 2rem)); max-height: 88vh; overflow: auto; padding: 1.25rem; border: 1px solid var(--line); border-radius: 1rem; color: var(--ink); }
#soundActivation::backdrop { background: rgb(15 41 39 / 45%); }
#activationForm { display: grid; gap: .8rem; }
#activationMessage { color: var(--warn-ink); }
#activationMessage:empty { display: none; }
.row, .actions { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .75rem; }
.row { justify-content: space-between; }
.row > * { min-width: 0; max-width: 100%; }
.settings-group { gap: 0; }
.settings-group > * { margin: 0; padding-block: .75rem; }
.settings-group > * + * { border-top: 1px solid var(--line); }
.settings-group > :first-child { padding-top: .25rem; }
.settings-group > :last-child { padding-bottom: .25rem; }
fieldset { min-width: 0; padding: 0; border: 0; }
label { display: block; font-size: .95rem; }
label:has(input:is([type="checkbox"], [type="radio"])) {
  display: flex;
  align-items: center;
  gap: .55rem;
  min-height: 44px;
}
button, select, textarea, input {
  min-width: 0;
  max-width: 100%;
  font: inherit;
  letter-spacing: inherit;
  color: inherit;
  accent-color: var(--teal);
}
input:not([type="checkbox"]):not([type="radio"]), select, textarea {
  display: block;
  width: 100%;
  min-height: 44px;
  padding: .55rem .72rem;
  border: 1px solid #a7bcb0;
  border-radius: .65rem;
  background-color: var(--paper);
  font-size: 1rem;
}
label > :is(input:not([type="checkbox"], [type="radio"]), select, textarea) { margin-top: .3rem; }
input:is([type="checkbox"], [type="radio"]) { flex: none; width: 1.15rem; height: 1.15rem; margin: 0; }
input[type="file"]::file-selector-button {
  margin-right: .5rem;
  padding: .3rem .55rem;
  border: 0;
  border-radius: .4rem;
  background: var(--teal-light);
  color: var(--teal);
  font: inherit;
}
textarea { min-height: 5.5rem; resize: vertical; }
audio, progress { display: block; width: 100%; max-width: 100%; accent-color: var(--teal); }
button {
  min-height: 44px;
  padding: .55rem .9rem;
  border: 1px solid #c8dbcf;
  border-radius: .7rem;
  background: #f3f8f4;
  color: var(--teal);
  font-weight: 600;
  line-height: 1.35;
  cursor: pointer;
  touch-action: manipulation;
}
button.primary { background: var(--teal); color: white; border-color: var(--teal); }
button.danger { background: #fff3ef; color: var(--danger); border-color: #ecc6bc; }
button:disabled, fieldset:disabled button { opacity: .55; cursor: default; }
:focus-visible { outline: 3px solid #13768c; outline-offset: 3px; }
.segmented { display: flex; flex-wrap: wrap; gap: .2rem; padding: .2rem; border-radius: .8rem; background: #e9eee8; }
.segmented button { flex: 1 1 auto; min-height: 44px; border: 0; border-radius: .6rem; background: transparent; color: var(--secondary); }
.segmented :is([aria-pressed="true"], [aria-selected="true"], .active) {
  background: var(--paper);
  color: var(--teal);
  box-shadow: 0 1px 4px #163b371e;
}
details { padding-block: .3rem; }
details > summary { display: list-item; min-height: 44px; padding-block: .7rem; color: var(--ink); font-weight: 650; cursor: pointer; }
summary::marker { color: var(--teal); }
details[open] { padding-bottom: 1rem; }
details[open] > * + * { margin-top: .65rem; }
.tabbar {
  position: fixed;
  z-index: 8;
  right: 0;
  bottom: 0;
  left: 0;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  align-items: stretch;
  gap: 2px;
  padding: .35rem max(.35rem, env(safe-area-inset-right, 0px))
    calc(.35rem + env(safe-area-inset-bottom, 0px)) max(.35rem, env(safe-area-inset-left, 0px));
  border-top: 1px solid var(--line);
  background: #fff;
  box-shadow: 0 -3px 16px #133d320a;
}
.tabbar button[data-tab] {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .18rem;
  min-height: 3.35rem;
  padding: .25rem .1rem;
  border: 0;
  border-radius: .68rem;
  background: transparent;
  color: var(--secondary);
  font-size: .76rem;
  font-weight: 550;
}
.tabbar button[data-tab] svg { display: block; flex: none; width: 1.35rem; height: 1.35rem; }
.tabbar button[data-tab][aria-selected="true"] { background: var(--teal-light); color: var(--teal); font-weight: 750; }
.preview-player {
  position: fixed; z-index: 9; left: var(--gutter); right: var(--gutter);
  bottom: calc(5rem + env(safe-area-inset-bottom, 0px)); margin-inline: auto; max-width: 36rem;
  max-height: 60vh; overflow: auto; padding: .8rem 1rem; border: 1px solid var(--line);
  border-radius: 1rem; background: var(--paper); box-shadow: 0 .3rem 1.5rem #12372f2a;
}
.preview-head { display: flex; gap: .5rem; align-items: center; justify-content: space-between; }
.preview-head button { flex: none; }
.preview-player p { margin: .3rem 0; }
.preview-player audio { display: block; width: 100%; }

@media (hover: hover) {
  button:enabled:hover { filter: brightness(.96); }
  a:hover, summary:hover { color: #074e44; }
}
@media (min-width: 44rem) {
  .app-shell { padding-top: 1.7rem; }
  .page-head { padding-bottom: 1.65rem; }
  .voice-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .voice-list > .current { grid-column: 1 / -1; }
  .tabbar {
    max-width: 40rem;
    margin-inline: auto;
    bottom: max(.75rem, env(safe-area-inset-bottom, 0px));
    padding: .35rem;
    border: 1px solid var(--line);
    border-radius: 1rem;
    box-shadow: 0 4px 22px #12372f12;
  }
}
