/*
 * Edelweiss settings, in the colours of her portrait: ivory panels on its slate blue, darker slate
 * around them, and gold for what's chosen. A dark mode swaps the slate for night.
 */

:root {
  color-scheme: light dark;
  --field: #61748b;
  --chrome: #4f6076;
  --on-field: #ffffff;
  --paper: #fbf6f5;
  --paper-2: #f3ebe9;
  --input: #fffdfc;
  --ink: #232b37;
  --muted: #5a6372;
  --line: #e4dbd8;
  --line-strong: #868c98;
  --accent: #44566d;
  --accent-strong: #34445a;
  --accent-soft: #e3e8ee;
  --on-accent: #ffffff;
  --gold: #d2af75;
  --gold-strong: #a7843d;
  --gold-ink: #80611f;
  --gold-soft: #f7ecd6;
  --blush: #f5e3e0;
  --blush-strong: #efcfca;
  --danger: #a3302a;
  --danger-soft: #f9e4e1;
  --focus: var(--accent);
  --pill: var(--paper);
  --field-control-border: transparent;
  --shadow: 0 24px 64px rgb(20 28 40 / 34%);
  --clear: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235a6372' stroke-width='2.2' stroke-linecap='round'%3E%3Cpath d='M7 7l10 10M17 7L7 17'/%3E%3C/svg%3E");
  --chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235a6372' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  --serif: "Palatino Linotype", Palatino, "Book Antiqua", "URW Palladio L", P052, Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", sans-serif;
  --mono: ui-monospace, "Cascadia Mono", "SF Mono", Menlo, Consolas, monospace;
  --top-h: 56px;
  --nav-h: 64px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --field: #1e2633;
    --chrome: #171d27;
    --on-field: #f4efee;
    --paper: #273141;
    --paper-2: #2f3a4c;
    --input: #1f2835;
    --ink: #ece6e4;
    --muted: #a9b2c0;
    --line: #38455a;
    --line-strong: #6f7c90;
    --accent: #b9c8db;
    --accent-strong: #d3deeb;
    --accent-soft: #34425a;
    --on-accent: #171d27;
    --gold: #d9b980;
    --gold-strong: #c9a565;
    --gold-ink: #e2c48d;
    --gold-soft: #3a3324;
    --blush: #362f44;
    --blush-strong: #4d4262;
    --danger: #f0aaa3;
    --danger-soft: #3d2323;
    --pill: #3a4860;
    --field-control-border: var(--line-strong);
    --shadow: 0 24px 64px rgb(0 0 0 / 50%);
    --clear: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23a9b2c0' stroke-width='2.2' stroke-linecap='round'%3E%3Cpath d='M7 7l10 10M17 7L7 17'/%3E%3C/svg%3E");
    --chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23a9b2c0' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  }
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  /* What Tab focuses stays clear of the top bar and the sections bar. */
  scroll-padding: calc(var(--top-h) + 16px) 0 calc(var(--nav-h) + 16px);
}

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--field);
  color: var(--on-field);
  font: 1rem/1.5 var(--sans);
}

h1, h2, h3 { margin: 0; line-height: 1.2; }
p { margin: 0; }
a { color: var(--accent); }
code, kbd { font-family: var(--mono); font-size: .9em; }
img, svg { display: block; }

:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
[tabindex="-1"]:focus { outline: none; }

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

.icon {
  flex: none;
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.muted { color: var(--muted); }
.small { font-size: .875rem; }

/* Loading, signing in, no servers */

.screen {
  --focus: #ffffff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  min-height: 100dvh;
  padding: 40px 24px calc(40px + env(safe-area-inset-bottom));
  text-align: center;
  color: var(--on-field);
}

.screen p { max-width: 32rem; }

.screen-mark {
  width: 88px;
  height: 88px;
  margin-bottom: 8px;
  border-radius: 50%;
  box-shadow: 0 0 0 2px var(--gold), 0 0 0 7px var(--field), 0 0 0 8px rgb(210 175 117 / 55%);
}

.screen-note { font-size: 1.0625rem; }
.screen-title { font: 400 2.25rem/1.15 var(--serif); }

.medallion {
  position: relative;
  width: min(240px, 62vw);
  aspect-ratio: 1;
  margin-bottom: 6px;
}

.medallion img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  box-shadow: 0 0 0 2px var(--gold), 0 0 0 11px var(--field), 0 0 0 12px rgb(210 175 117 / 60%);
}

.sparkle { position: absolute; color: var(--gold); }
.sparkle.s1 { width: 30px; height: 30px; top: 4%; left: -13%; }
.sparkle.s2 { width: 16px; height: 16px; top: -7%; right: 6%; }
.sparkle.s3 { width: 22px; height: 22px; right: -14%; bottom: 8%; }
.sparkle.s4 { width: 13px; height: 13px; bottom: -6%; left: 12%; }

.signin-title {
  margin-top: 18px;
  font: 400 clamp(2.75rem, 2rem + 3.5vw, 4rem)/1.05 var(--serif);
  letter-spacing: .01em;
}

.signin-lead { font-size: 1.125rem; line-height: 1.55; }
.signin .button { margin-top: 10px; }
.screen .fine { max-width: 26rem; font-size: .875rem; }
.links { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 8px; }

/* The frame: a top bar, the server and sections, and the settings */

.topbar {
  --focus: #ffffff;
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 8px;
  height: var(--top-h);
  padding: 0 max(12px, env(safe-area-inset-right)) 0 max(12px, env(safe-area-inset-left));
  background: var(--chrome);
  color: #ffffff;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  margin-right: auto;
  padding-right: 6px;
  border-radius: 12px;
  color: inherit;
  text-decoration: none;
}

.brand-mark { width: 36px; height: 36px; border-radius: 50%; box-shadow: 0 0 0 1.5px var(--gold); }
.brand-name { font: 400 1.3125rem/1 var(--serif); letter-spacing: .01em; }

.search-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid rgb(255 255 255 / 26%);
  border-radius: 999px;
  background: rgb(255 255 255 / 8%);
  color: #ffffff;
  font: inherit;
  cursor: pointer;
}

.search-trigger:hover { background: rgb(255 255 255 / 16%); }

.search-trigger-label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.search-key { display: none; }

.account { display: flex; align-items: center; gap: 8px; min-width: 0; }
.account form { margin: 0; }
.avatar { width: 32px; height: 32px; border-radius: 50%; }
.user-name { display: none; }

.sidebar { --focus: #ffffff; color: #ffffff; }

.guild {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 10px 12px;
  padding: 18px max(16px, env(safe-area-inset-right)) 2px max(16px, env(safe-area-inset-left));
}

.guild-icon { flex: none; width: 44px; height: 44px; border-radius: 14px; }
.guild-pick { display: grid; flex: 1 1 12rem; gap: 4px; min-width: 0; }
.guild-label { font-size: .8125rem; font-weight: 600; }
.guild .badges { flex-basis: 100%; }
.badges:empty { display: none; }

.guild .guild-select { border-color: var(--field-control-border); background-color: var(--paper); font-weight: 600; }

/* One server: its name, not a list. */
.guild .guild-select:disabled {
  min-height: 0;
  padding: 0;
  border: 0;
  background: none;
  color: #ffffff;
  opacity: 1;
  font: 400 1.25rem/1.3 var(--serif);
}

/* On phones the sections are a bar at the bottom. */
.nav {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 25;
  display: flex;
  padding: 0 max(4px, env(safe-area-inset-right)) env(safe-area-inset-bottom) max(4px, env(safe-area-inset-left));
  background: var(--chrome);
  box-shadow: 0 -1px 0 rgb(255 255 255 / 10%);
}

.nav-item {
  position: relative;
  display: flex;
  flex: 1 1 0;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-width: 0;
  min-height: var(--nav-h);
  padding: 6px 2px 8px;
  border-radius: 14px;
  color: #ffffff;
  font-size: .75rem;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}

.nav-item:focus-visible { outline-offset: -3px; }

.nav-icon {
  display: grid;
  place-items: center;
  width: 56px;
  height: 30px;
  border-radius: 999px;
  transition: background-color .2s ease-out;
}

.nav-label { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.nav-mark {
  position: absolute;
  top: 1px;
  left: calc(50% + 23px);
  display: none;
  width: 14px;
  height: 14px;
  color: var(--gold);
}

.nav-item[aria-current="page"] .nav-icon { background: var(--pill); color: var(--ink); }
.nav-item[aria-current="page"] .nav-mark { display: block; animation: twinkle .45s ease-out; }

.content {
  padding: 22px max(16px, env(safe-area-inset-right)) calc(var(--nav-h) + 32px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
}

.view { max-width: 44rem; }

.view-head { --focus: #ffffff; margin-bottom: 20px; color: var(--on-field); }

.view-title {
  font: 400 clamp(2rem, 1.5rem + 1.6vw, 2.625rem)/1.1 var(--serif);
  letter-spacing: .005em;
}

.view-lead { max-width: 38rem; margin-top: 8px; font-size: 1.0625rem; }
.guild-name { font-weight: 650; }

.view-lead code, .subview-lead code {
  padding: 1px 6px;
  border-radius: 6px;
  background: rgb(255 255 255 / 16%);
  color: inherit;
}

/* Answers and the obey list, the two pages for masters. */
.segmented {
  display: inline-flex;
  gap: 4px;
  margin-top: 18px;
  padding: 4px;
  border-radius: 999px;
  background: rgb(255 255 255 / 14%);
}

.segmented a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 18px;
  border-radius: 999px;
  color: #ffffff;
  font-weight: 600;
  text-decoration: none;
}

.segmented a:hover { background: rgb(255 255 255 / 12%); }
.segmented a[aria-current="page"] { background: var(--pill); color: var(--ink); }

.subview-lead { --focus: #ffffff; max-width: 38rem; margin: 0 0 16px; color: var(--on-field); }

.filter { --focus: #ffffff; position: relative; margin-bottom: 16px; }

.filter .icon {
  position: absolute;
  top: 50%;
  left: 14px;
  color: var(--muted);
  transform: translateY(-50%);
  pointer-events: none;
}

.filter input[type="search"] { padding-left: 46px; border-color: var(--field-control-border); background-color: var(--paper); }

.empty-note { color: var(--on-field); }

/* Panels: one group of settings each */

.panels { display: grid; gap: 16px; }

.panel {
  padding: 20px 18px 22px;
  border-radius: 18px;
  background: var(--paper);
  color: var(--ink);
}

.panel-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 12px; margin-bottom: 6px; }
.panel-title { font: 700 1.3125rem/1.25 var(--serif); }
.panel-count { color: var(--muted); font-size: .9375rem; font-variant-numeric: tabular-nums; }
.panel-description { flex-basis: 100%; max-width: 40rem; margin-top: 2px; color: var(--muted); font-size: .9375rem; }

.panel > .notice { margin: 10px 0; }

/* What reads your messages now. */
.panel.now { display: grid; gap: 4px; background: var(--blush); }

.now-voice {
  font: 400 clamp(1.625rem, 1.3rem + 1.2vw, 2rem)/1.15 var(--serif);
  overflow-wrap: anywhere;
}

.now-detail { color: var(--muted); }
.now .chips { margin-top: 10px; }
.now .chip { padding: 3px 12px; background: var(--paper); color: var(--ink); font-size: .875rem; }

/* One setting */

.setting {
  padding: 16px 0;
  scroll-margin: calc(var(--top-h) + 24px) 0 calc(var(--nav-h) + 24px);
}

.setting + .setting { border-top: 1px solid var(--line); }
.panel-head + .setting { padding-top: 10px; }
.setting:last-child { padding-bottom: 0; }
.setting-head { margin-bottom: 10px; }
.setting-title { display: block; font-weight: 650; }
.setting-description { margin-top: 2px; color: var(--muted); font-size: .9375rem; }

/* Where search took you, for a moment. */
.found { border-radius: 6px; animation: found 2.4s ease-out; }
.panel.found { border-radius: 18px; animation-name: found-panel; }

@keyframes found {
  0%, 40% { background-color: var(--blush-strong); box-shadow: 0 0 0 12px var(--blush-strong); }
  100% { background-color: transparent; box-shadow: 0 0 0 12px transparent; }
}

@keyframes found-panel {
  0%, 40% { box-shadow: 0 0 0 4px var(--gold); }
  100% { box-shadow: 0 0 0 4px transparent; }
}

.notice { padding: 12px 14px; border-radius: 12px; font-size: .9375rem; }
.notice.info { border-left: 3px solid var(--gold-strong); background: var(--gold-soft); color: var(--ink); }
.notice.danger { background: var(--danger-soft); color: var(--danger); }
.setting .notice { margin-top: 12px; }

/* Fields */

input[type="text"], input[type="search"], input[type="number"], input[type="password"], select, textarea {
  width: 100%;
  min-height: 44px;
  padding: 9px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background-color: var(--input);
  color: var(--ink);
  font: inherit;
  appearance: none;
}

select {
  padding-right: 40px;
  background-image: var(--chevron);
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 18px 18px;
  cursor: pointer;
}

input:disabled, select:disabled, textarea:disabled { opacity: .6; cursor: not-allowed; }
textarea { min-height: 8rem; line-height: 1.5; resize: vertical; }
input[type="number"] { max-width: 8rem; }
input[type="range"] { accent-color: var(--accent); }
::placeholder { color: var(--muted); opacity: 1; }

input[type="search"]::-webkit-search-cancel-button {
  width: 16px;
  height: 16px;
  background: var(--clear) center / 16px 16px no-repeat;
  cursor: pointer;
  appearance: none;
}

.field { display: grid; gap: 6px; }
.field-label { font-size: .875rem; font-weight: 600; }
.form-grid { display: grid; gap: 12px; }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.voice-picker { display: grid; gap: 8px; }
.try-text { display: grid; gap: 6px; }
.try-text label { font-size: .875rem; font-weight: 600; }

.actions { display: flex; flex-wrap: wrap; gap: 8px; }
.inline { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.inline input[type="text"] { flex: 1; min-width: 8rem; }
.inline select { flex: 1; width: auto; min-width: 10rem; }
.inline.spread { justify-content: space-between; }

.spaces { padding: 1px 6px; border-radius: 6px; background: var(--paper-2); white-space: pre; }
.prefix-now { margin-top: 8px; }

.voice-note {
  padding: 10px 12px;
  border-left: 3px solid var(--gold-strong);
  border-radius: 0 10px 10px 0;
  background: var(--paper-2);
  font-size: .9375rem;
}

/* Switches */

.toggle-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.toggle-text { min-width: 0; }
.toggle-row .setting-title { cursor: pointer; }

.switch {
  position: relative;
  flex: none;
  width: 52px;
  height: 32px;
  margin: 0;
  border-radius: 999px;
  background: var(--line-strong);
  cursor: pointer;
  appearance: none;
  transition: background-color .15s;
}

.switch::before {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 1px 3px rgb(0 0 0 / 30%);
  transition: transform .15s ease-out;
}

/* A taller area to tap than the switch shows. */
.switch::after { content: ""; position: absolute; inset: -6px -4px; }

.switch:checked { background: var(--accent); }
.switch:checked::before { background: var(--on-accent); transform: translateX(20px); }
.switch:disabled { opacity: .55; cursor: not-allowed; }

/* Buttons */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 8px 18px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: background-color .15s, border-color .15s;
}

.button:not(:disabled):hover { background: var(--paper-2); }
.button.primary { border-color: var(--accent); background: var(--accent); color: var(--on-accent); }
.button.primary:not(:disabled):hover { border-color: var(--accent-strong); background: var(--accent-strong); }
.button.ghost { border-color: transparent; color: var(--accent); }
.button.quiet { border-color: color-mix(in srgb, currentColor 40%, transparent); color: inherit; }
.button.quiet:not(:disabled):hover { background: color-mix(in srgb, currentColor 12%, transparent); }
.button.small { min-height: 36px; padding: 4px 14px; font-size: .875rem; }
.button.large { min-height: 52px; padding: 10px 30px; font-size: 1.0625rem; }
.button.icon-only { width: 36px; padding: 0; }
.button:disabled { opacity: .5; cursor: not-allowed; }

/* Pressed. */
.button:not(:disabled):active, .search-trigger:active, .nav-item:active, .segmented a:active { opacity: .78; }
.button .icon { width: 18px; height: 18px; }

/* On the slate: gold, like her crown. */
.screen .button.primary { border-color: var(--gold); background: var(--gold); color: #1f2631; }
.screen .button.primary:not(:disabled):hover { border-color: #dfc293; background: #dfc293; }

/* The voice, with its speed, pitch and intonation */

.studio { display: grid; gap: 14px; }
.studio > .setting-head { margin-bottom: 0; }
.studio > .hint { margin: 0; }

.slider { display: grid; gap: 2px; }
.slider-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.slider-label { font-weight: 600; }
.slider .button.small { min-height: 32px; padding: 2px 10px; font-size: .8125rem; }
.rate-row { display: flex; align-items: center; gap: 12px; }
.rate-row input[type="range"] { flex: 1; min-height: 44px; margin: 0; }
.rate-value { min-width: 4.5rem; font-weight: 700; font-variant-numeric: tabular-nums; text-align: right; }

.tuning { display: grid; gap: 12px; padding: 14px 16px; border-radius: 14px; background: var(--paper-2); }
.tuning-title { font: 700 1.0625rem/1.3 var(--serif); }
.tuning .hint { margin: 0; }
.tuning .hint code { background: var(--paper); }

/* Commands for a setting, and badges */

.hint {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 6px;
  margin-top: 12px;
  color: var(--muted);
  font-size: .8125rem;
}

.hint code, .usage {
  padding: 2px 8px;
  border-radius: 6px;
  background: var(--paper-2);
  color: var(--ink);
  white-space: pre-wrap;
  word-break: break-word;
}

.badges { display: inline-flex; flex-wrap: wrap; gap: 6px; }

.badge {
  display: inline-block;
  padding: 1px 9px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--muted);
  font-size: .75rem;
  font-weight: 650;
  white-space: nowrap;
}

.badge.admin, .badge.required { border-color: var(--accent); color: var(--accent); }
.badge.master { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.badge.premium, .badge.owner { border-color: var(--gold-strong); background: var(--gold-soft); color: var(--gold-ink); }

/* On the slate, badges are white, with gold for premium. */
.guild .badge { border-color: rgb(255 255 255 / 55%); background: none; color: #ffffff; }
.guild .badge.premium { border-color: var(--gold); }

.chips { display: flex; flex-wrap: wrap; gap: 4px 6px; margin: 0; padding: 0; list-style: none; }

.chip {
  padding: 1px 10px;
  border-radius: 999px;
  background: var(--paper);
  color: var(--muted);
  font-size: .8125rem;
  font-variant-numeric: tabular-nums;
}

/* Words and the obey list: rows with lines between */

.word-list, .member-list { margin: 0; padding: 0; list-style: none; }

.word-row, .member-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 12px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}

.word-row:first-child, .member-row:first-child { border-top: 0; }
.word-list > .muted { padding: 10px 0; }
.word-pair { display: flex; flex: 1 1 14rem; flex-wrap: wrap; align-items: center; gap: 6px 8px; min-width: 0; }

.word {
  padding: 2px 8px;
  border-radius: 6px;
  background: var(--paper-2);
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.word-row .actions, .member-row .actions { gap: 4px; margin-left: auto; }
.member-name { flex: 1 1 10rem; min-width: 0; font-weight: 600; overflow-wrap: anywhere; }

/* Phrases: where a prefix has the name */

.phrase { overflow-wrap: anywhere; }

.name-slot {
  padding: 1px 6px;
  border-radius: 6px;
  background: var(--gold-soft);
  color: var(--gold-ink);
  font-family: var(--mono);
  font-size: .875em;
  white-space: nowrap;
}

.phrase-list { margin-top: 4px; border-top: 1px solid var(--line); }
/* Phrases are short, so on phones they keep their buttons beside them, not below. */
.phrase-list .word-pair { flex-basis: 8rem; }

/* Favorite voices */

.favorite-list { margin: 0; padding: 0; list-style: none; }

.favorite {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 12px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}

.favorite:first-child { border-top: 0; }
.favorite-text { display: grid; flex: 1 1 12rem; gap: 4px; min-width: 0; }
.favorite-name { font-weight: 650; overflow-wrap: anywhere; }
.favorite .chip { background: var(--paper-2); }
.favorite .actions { align-items: center; gap: 4px; margin-left: auto; }
.button.favorited .icon { color: var(--gold-strong); }

.sync-row { margin-bottom: 2px; }

/* Answers */

.providers { display: grid; gap: 12px; margin-top: 4px; }

.provider { display: grid; gap: 10px; padding: 14px 16px; border-radius: 14px; background: var(--paper-2); }
.provider-head { display: flex; align-items: center; gap: 12px; }
.provider-title { display: grid; flex: 1; gap: 4px; min-width: 0; }
.provider-title strong { font-weight: 650; overflow-wrap: anywhere; }
.provider.off .provider-title strong { color: var(--muted); }
.provider-head .actions { flex-wrap: nowrap; gap: 2px; }
.provider-status { color: var(--gold-ink); font-size: .9375rem; font-weight: 600; }
.provider-edit summary { padding: 10px 0; color: var(--accent); font-weight: 600; cursor: pointer; }
.provider-edit[open] summary { margin-bottom: 4px; }
.provider .answer { background: var(--paper); }

.answer {
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--paper-2);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.answer p + p { margin-top: 4px; }
.error-text { color: var(--danger); }

/* Commands */

.command { padding: 14px 0; border-top: 1px solid var(--line); }
.panel-head + .command { padding-top: 6px; border-top: 0; }
.command:last-child { padding-bottom: 0; }
.command-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.command > p { margin-top: 6px; }
.usage { font-family: var(--mono); font-size: .875rem; font-weight: 600; }
.params { margin: 8px 0 0; padding-left: 18px; font-size: .9375rem; }
.params li { margin: 4px 0; }
.params code { margin-right: 4px; font-weight: 650; }
.params .badge { margin-right: 6px; }
.choices { color: var(--muted); }

/* Finding a setting */

.search {
  width: min(40rem, calc(100vw - 32px));
  max-width: none;
  max-height: min(38rem, calc(100dvh - 96px));
  margin: 10vh auto auto;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 20px;
  background: var(--paper);
  color: var(--ink);
  box-shadow: var(--shadow);
}

.search[open] { display: flex; flex-direction: column; }
.search::backdrop { background: rgb(17 23 33 / 55%); }

.search-box {
  display: flex;
  flex: none;
  align-items: center;
  gap: 10px;
  padding: 8px 12px 8px 18px;
  border-bottom: 1px solid var(--line);
}

.search-box .icon { color: var(--muted); }
.search-box:focus-within { box-shadow: inset 0 -2px 0 var(--accent); }

.search-box input[type="search"] {
  flex: 1;
  min-height: 52px;
  padding: 0;
  border: 0;
  background: transparent;
  font-size: 1.125rem;
}

.search-box input[type="search"]:focus-visible { outline: none; }

.search-results { flex: 1; margin: 0; padding: 8px; overflow-y: auto; list-style: none; overscroll-behavior: contain; }

.search-option { display: grid; gap: 2px; padding: 10px 12px; border-radius: 12px; cursor: pointer; }
.search-option:hover { background: var(--paper-2); }
.search-option[aria-selected="true"] { background: var(--blush); }
.search-option-title { font-weight: 600; }
.search-option-where { color: var(--muted); font-size: .875rem; }
.search-empty { padding: 20px 22px 24px; color: var(--muted); }

/* Messages */

.toast {
  position: fixed;
  bottom: calc(var(--nav-h) + 14px + env(safe-area-inset-bottom));
  left: 50%;
  z-index: 30;
  width: max-content;
  max-width: calc(100vw - 32px);
  padding: 12px 18px;
  border-radius: 14px;
  background: var(--ink);
  color: var(--paper);
  box-shadow: var(--shadow);
  font-weight: 600;
  transform: translateX(-50%);
}

.toast.error { background: var(--danger); color: var(--paper); }

/* Motion */

@keyframes twinkle {
  0% { opacity: 0; transform: scale(.2) rotate(-35deg); }
  60% { opacity: 1; transform: scale(1.15) rotate(0deg); }
  100% { opacity: 1; transform: scale(1); }
}

@keyframes rise {
  from { opacity: 0; transform: scale(.94); }
  to { opacity: 1; transform: none; }
}

.signin .medallion img { animation: rise .7s cubic-bezier(.2, .7, .2, 1) both; }
.signin .sparkle { animation: twinkle .9s ease-out both; }
.signin .sparkle.s1 { animation-delay: .35s; }
.signin .sparkle.s2 { animation-delay: .5s; }
.signin .sparkle.s3 { animation-delay: .62s; }
.signin .sparkle.s4 { animation-delay: .74s; }

/* Sizes */

@media (max-width: 359px) {
  .brand-name { display: none; }
}

@media (max-width: 519px) {
  .pair { grid-template-columns: 1fr; }
  .studio-actions .button, .form-grid > .actions .button, .voice-picker > .actions .button { flex: 1 1 0; }
}

@media (max-width: 519px) {
  /* Try and Save side by side, and the favorite button under them. */
  .studio-actions .favorite-toggle { flex-basis: 100%; order: 3; }
}

@media (max-width: 399px) {
  .segmented a { padding: 0 12px; }
}

@media (min-width: 600px) {
  .panel { padding: 24px 26px 26px; border-radius: 22px; }
}

@media (max-width: 599px) {
  .search {
    width: 100%;
    height: 100dvh;
    max-height: none;
    margin: 0;
    border-radius: 0;
  }

  .search-box { padding-top: max(8px, env(safe-area-inset-top)); }
}

@media (pointer: coarse) {
  .button.small, .slider .button.small { min-height: 44px; }
  .button.icon-only { width: 44px; }
  .segmented a { min-height: 44px; }
}

/* On a computer the sections are a column at the left. */
@media (min-width: 900px) {
  :root { --top-h: 60px; }

  .shell {
    display: grid;
    grid-template-areas: "top top" "side main";
    grid-template-columns: 272px minmax(0, 1fr);
    grid-template-rows: auto 1fr;
    min-height: 100dvh;
  }

  .topbar {
    grid-area: top;
    display: grid;
    grid-template-columns: 288px minmax(0, 30rem) minmax(max-content, 1fr);
    gap: 0;
    padding: 0 24px;
  }

  .brand { justify-self: start; margin-right: 0; }

  .search-trigger {
    justify-content: flex-start;
    width: 100%;
    padding: 0 8px 0 14px;
    border-radius: 12px;
  }

  .search-trigger-label {
    position: static;
    width: auto;
    height: auto;
    overflow: visible;
    clip-path: none;
    color: rgb(255 255 255 / 90%);
  }

  .search-key {
    display: inline-block;
    margin-left: auto;
    padding: 3px 8px;
    border-radius: 6px;
    background: rgb(255 255 255 / 14%);
    color: #ffffff;
    font: 600 .75rem/1.2 var(--sans);
  }

  .account { justify-self: end; padding-left: 24px; }
  .user-name { display: block; max-width: 14rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

  .sidebar {
    grid-area: side;
    position: sticky;
    top: var(--top-h);
    align-self: start;
    height: calc(100dvh - var(--top-h));
    padding-bottom: 24px;
    overflow-y: auto;
    border-top: 1px solid rgb(255 255 255 / 10%);
    background: var(--chrome);
  }

  .guild { padding: 22px 20px 20px; border-bottom: 1px solid rgb(255 255 255 / 12%); }

  .nav {
    position: static;
    flex-direction: column;
    gap: 2px;
    padding: 14px 12px;
    background: none;
    box-shadow: none;
  }

  .nav-item {
    flex: none;
    flex-direction: row;
    justify-content: flex-start;
    gap: 12px;
    min-height: 48px;
    padding: 0 14px;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 550;
  }

  .nav-item:hover { background: rgb(255 255 255 / 10%); }
  .nav-item:focus-visible { outline-offset: 2px; }
  .nav-icon { width: auto; height: auto; border-radius: 0; }
  .nav-mark { position: static; width: 16px; height: 16px; margin-left: auto; }
  .nav-item[aria-current="page"] { background: var(--pill); color: var(--ink); }
  .nav-item[aria-current="page"] .nav-icon { background: none; color: inherit; }

  html { scroll-padding-bottom: 16px; }
  .content { grid-area: main; min-width: 0; padding: 44px 40px 72px; }
  .toast { bottom: 28px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }

  /* Still marked, without fading. */
  .found { animation: none !important; background-color: var(--blush-strong); box-shadow: 0 0 0 12px var(--blush-strong); }
  .panel.found { background-color: var(--paper); box-shadow: 0 0 0 4px var(--gold); }
}

@media (forced-colors: active) {
  .nav-item[aria-current="page"], .segmented a[aria-current="page"] { outline: 2px solid CanvasText; }
  .search-option[aria-selected="true"] { outline: 2px solid Highlight; }
  .switch { border: 1px solid CanvasText; }
  .switch:checked { background: Highlight; }
  .panel { border: 1px solid CanvasText; }
}
