/*
 * 配色与安卓版一致：墨绿主色 + 暖珊瑚点缀 + 低饱和米白底。
 * 深色模式单独配一遍，不是反色。
 */
:root {
  --green: #1F7A5C;
  --green-soft: #E8F4EF;
  --green-strong: #155C45;
  --coral: #C2553F;
  --coral-soft: #FBEAE6;
  --amber: #C98A2B;

  --bg: #F7FAF8;
  --bg-card: #FFFFFF;
  --bg-sunken: #EFF4F1;
  --bg-raised: #F4F8F6;
  --line: #DDE6E2;
  --line-strong: #C6D2CD;
  --text: #17211D;
  --text-2: #566B63;
  --text-3: #7E9089;
  --danger: #B3261E;
  --danger-soft: #FCEEEC;

  --radius: 16px;
  --radius-lg: 20px;
  --shadow: 0 1px 2px rgba(23, 33, 29, .06), 0 8px 24px -12px rgba(23, 33, 29, .18);

  /*
   * 头图的渐变单独一组色，不跟 --green 走。
   * 深色模式下 --green 会变成浅薄荷色，拿它做头图底色会让白字几乎看不见。
   */
  --hero-1: #10493A;
  --hero-2: #1F7A5C;
  --hero-3: #2E827A;

  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Songti SC", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
          "Hiragino Sans GB", "Microsoft YaHei", sans-serif;

  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

@media (prefers-color-scheme: dark) {
  :root {
    --green: #8BD6B8;
    --green-soft: #143028;
    --green-strong: #B8EDD6;
    --coral: #FFB4A2;
    --coral-soft: #3A1D16;
    --amber: #E7B864;

    --bg: #0F1412;
    --bg-card: #161D1A;
    --bg-sunken: #101715;
    --bg-raised: #1C2522;
    --line: #26332E;
    --line-strong: #35453F;
    --text: #E4EBE8;
    --text-2: #9DB0A8;
    --text-3: #71857D;
    --danger: #FFB4AB;
    --danger-soft: #2C1412;
    --shadow: 0 1px 2px rgba(0, 0, 0, .5), 0 8px 24px -12px rgba(0, 0, 0, .7);
  }
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
  overscroll-behavior-y: none;
}

#app {
  display: flex;
  flex-direction: column;
  min-height: 100%;
  padding-top: var(--safe-top);
  padding-bottom: var(--safe-bottom);
}

button, input, textarea, select {
  font: inherit;
  color: inherit;
}
button { cursor: pointer; border: 0; background: none; }
button:disabled { opacity: .45; cursor: default; }

/* ---------------------------------------------------------------- 顶栏 */

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid var(--line);
}
.topbar.hero {
  border-bottom: 0;
  background: linear-gradient(135deg, var(--hero-1), var(--hero-2) 55%, var(--hero-3));
  color: #fff;
  padding: 18px 16px 20px;
  flex-direction: column;
  align-items: stretch;
  gap: 4px;
}
.topbar.hero .row { display: flex; align-items: center; gap: 10px; }
.topbar.hero h1 { margin: 0; font-size: 25px; line-height: 1.2; letter-spacing: -.01em; }
.topbar.hero p { margin: 2px 0 0; font-size: 13.5px; color: rgba(255, 255, 255, .87); }

.topbar h2 { margin: 0; font-size: 16px; font-weight: 600; }
.topbar .sub { font-size: 11.5px; color: var(--text-2); margin-top: 1px; }
.topbar .spacer { flex: 1; }

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  color: var(--text-2);
  flex: none;
}
.icon-btn:hover { background: var(--bg-sunken); }
.topbar.hero .icon-btn { color: #fff; }
.topbar.hero .icon-btn:hover { background: rgba(255, 255, 255, .16); }

/* ---------------------------------------------------------------- 布局 */

.view {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 14px 14px 24px;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.section { margin-bottom: 14px; }
.section-title {
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: .06em;
  color: var(--text-3);
  margin: 0 2px 8px;
  text-transform: uppercase;
}
.muted { color: var(--text-2); }
.tiny { font-size: 12px; }
.small { font-size: 13.5px; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  background: var(--bg-sunken);
  color: var(--text-2);
  white-space: nowrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 14px;
  border-radius: 12px;
  background: var(--bg-card);
  border: 1px solid var(--line-strong);
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  min-height: 40px;
}
.btn:hover { border-color: var(--green); }
.btn.primary {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
}
@media (prefers-color-scheme: dark) {
  .btn.primary { color: #05231A; }
}
.btn.ghost { background: transparent; border-color: transparent; color: var(--text-2); min-height: 34px; padding: 6px 8px; }
.btn.danger { color: var(--danger); border-color: var(--danger); }
.btn.row { width: 100%; }

/* ---------------------------------------------------------------- 今日学习 */

.today-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 15px;
  margin-bottom: 14px;
  text-align: left;
  width: 100%;
}
.today-card .big { font-size: 26px; font-weight: 700; letter-spacing: -.02em; color: var(--green); line-height: 1.15; }
.today-card .label { font-size: 11.5px; color: var(--text-3); font-weight: 600; letter-spacing: .05em; }
.today-card .detail { font-size: 12px; color: var(--text-2); margin-top: 3px; }
.today-card .chev { color: var(--text-3); flex: none; }

/* ---------------------------------------------------------------- 分类药丸 */

.pills {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  /* 横向滚动条要能顶到屏幕两边，否则最后一个药丸看着像被切了一半 */
  margin: 0 -14px;
  padding: 2px 14px 12px;
  scrollbar-width: none;
}
.pills::-webkit-scrollbar { display: none; }
.pill {
  flex: none;
  padding: 7px 14px;
  border-radius: 999px;
  background: var(--bg-sunken);
  color: var(--text-2);
  font-size: 13px;
  font-weight: 500;
  border: 1px solid transparent;
}
.pill[aria-pressed="true"] {
  background: var(--green);
  color: #fff;
}
@media (prefers-color-scheme: dark) {
  .pill[aria-pressed="true"] { color: #05231A; }
}

/* ---------------------------------------------------------------- 场景卡片 */

.scene-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 10px;
}
.scene {
  position: relative;
  display: flex;
  flex-direction: column;
  text-align: left;
  padding: 12px 13px 12px 17px;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.scene::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--accent, var(--green));
}
.scene:active { transform: scale(.985); }
.scene .title {
  font-size: 13.5px;
  font-weight: 650;
  line-height: 1.3;
  /* 场景标题是英文全称，截成一行会变成 "Explaining a te…"，
     两行够放下绝大多数，再长才截 */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.scene .zh { font-size: 12px; color: var(--text-2); margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* 关键词钉在卡片底部：同一行的卡片高度会被网格拉齐，靠 auto 上边距才不会留奇怪的空白。
   整行不换行、超长截断，是为了让所有卡片长得一样高——之前让关键词自由换行，
   两行的卡片会把同一行的邻居撑出一大块空白。 */
.scene .meta { display: flex; align-items: center; gap: 6px; flex-wrap: nowrap; margin-top: auto; padding-top: 9px; min-width: 0; }
.scene .meta .lv { flex: none; }
.scene .kw {
  font-size: 11px;
  color: var(--accent, var(--green));
  opacity: .9;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.lv { font-size: 10.5px; font-weight: 700; padding: 1px 6px; border-radius: 999px; }
.lv-A2 { background: #2E9463; color: #fff; }
.lv-B1 { background: #2F6FB0; color: #fff; }
.lv-B2 { background: #C98A2B; color: #fff; }
.lv-C1 { background: #C2553F; color: #fff; }

/* ---------------------------------------------------------------- 历史 */

.history-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 13px;
  width: 100%;
  text-align: left;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-bottom: 8px;
}
.history-row .body { flex: 1; min-width: 0; }
.history-row .t { display: flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 600; }
.history-row .p {
  font-size: 12px;
  color: var(--text-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-top: 2px;
}
.history-row .right { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; flex: none; }
.history-row .when { font-size: 11px; color: var(--text-3); }

/* ---------------------------------------------------------------- 对话 */

.thread {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 14px 12px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.msg { display: flex; flex-direction: column; max-width: 88%; }
.msg.user { align-self: flex-end; align-items: flex-end; }
.msg.ai { align-self: flex-start; align-items: flex-start; }

.bubble {
  padding: 10px 13px;
  border-radius: 18px;
  font-size: 15.5px;
  line-height: 1.55;
  word-break: break-word;
  white-space: pre-wrap;
  font-family: var(--serif);
}
.msg.user .bubble {
  background: var(--green);
  color: #fff;
  border-bottom-right-radius: 5px;
}
@media (prefers-color-scheme: dark) {
  .msg.user .bubble { color: #05231A; }
}
.msg.ai .bubble {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-bottom-left-radius: 5px;
}
.msg.ai .bubble.failed {
  background: var(--danger-soft);
  border-color: var(--danger);
  color: var(--danger);
  font-family: var(--sans);
  font-size: 13.5px;
}

.msg-tools { display: flex; align-items: center; gap: 2px; margin-top: 2px; padding: 0 4px; }
.tool {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 8px;
  border-radius: 9px;
  font-size: 12px;
  color: var(--text-3);
}
.tool:hover { background: var(--bg-sunken); color: var(--text-2); }
.tool.on { color: var(--green); }
.tool svg { width: 15px; height: 15px; }

.translation {
  padding: 9px 11px;
  border-radius: 12px;
  background: var(--bg-sunken);
  border-left: 3px solid var(--green);
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--text-2);
  max-width: 100%;
}

/* 译文 + 语言点整块 */
.translation-block {
  margin-top: 4px;
  max-width: 100%;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.phrases {
  padding: 8px 10px 6px;
  border-radius: 12px;
  background: var(--bg-card);
  border: 1px solid var(--line);
  max-width: 100%;
}
.phrases-title {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .08em;
  color: var(--text-3);
  margin-bottom: 6px;
}
.phrase { padding: 5px 0; border-top: 1px dashed var(--line); }
.phrase:first-of-type { border-top: 0; padding-top: 0; }
.phrase-head {
  display: flex;
  align-items: baseline;
  gap: 6px;
  flex-wrap: wrap;
}
.phrase-text {
  font-family: var(--serif);
  font-size: 14px;
  font-weight: 650;
  color: var(--text);
  /* 让短语在句中可辨识：下划虚线表示「这是个可复用的语块」 */
  text-decoration: underline dotted color-mix(in srgb, var(--green) 60%, transparent);
  text-underline-offset: 3px;
}
.phrase-kind {
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--green) 14%, transparent);
  color: var(--green-strong);
  white-space: nowrap;
}
.phrase-meaning {
  font-size: 12.5px;
  color: var(--text-2);
}
.phrase-note {
  font-size: 11.5px;
  line-height: 1.55;
  color: var(--text-3);
  margin-top: 2px;
}

.coach {
  margin-top: 6px;
  padding: 11px 12px;
  border-radius: 13px;
  background: var(--coral-soft);
  border: 1px solid color-mix(in srgb, var(--coral) 28%, transparent);
  max-width: 100%;
}
.coach .head {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  color: var(--coral);
  margin-bottom: 6px;
}
.coach .feedback { font-size: 12.5px; color: var(--text-2); margin-bottom: 6px; }
.coach .fix { font-size: 13.5px; line-height: 1.6; }
.coach .fix del { color: var(--danger); text-decoration-thickness: 1.5px; }
.coach .fix ins {
  text-decoration: none;
  color: var(--green-strong);
  font-weight: 650;
  font-family: var(--serif);
}
.coach .why { font-size: 11.5px; color: var(--text-3); margin-top: 1px; }
.coach .sug-title { font-size: 11px; color: var(--text-3); margin-top: 8px; }
.coach .sug { font-size: 13px; font-family: var(--serif); color: var(--text); }

.typing { display: inline-flex; gap: 4px; padding: 4px 0; }
.typing i {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--text-3);
  animation: blink 1.1s infinite ease-in-out;
}
.typing i:nth-child(2) { animation-delay: .16s; }
.typing i:nth-child(3) { animation-delay: .32s; }
@keyframes blink { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }

.empty {
  margin: auto;
  text-align: center;
  color: var(--text-3);
  font-size: 13.5px;
  padding: 40px 28px;
}
.empty .big-icon { opacity: .45; margin-bottom: 10px; }

/* ---------------------------------------------------------------- 输入区 */

.composer {
  flex: none;
  border-top: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(14px);
  padding: 10px 12px calc(10px + var(--safe-bottom));
  display: flex;
  flex-direction: column;
  gap: 9px;
}

/*
 * 右下角有 Netlify 徽章时把输入区抬高。
 * 那个徽章是 fixed 定位的 iframe（z-index 2147483645，实测 197×64 贴在右下角），
 * 会整个盖住发送键，连 click 都不触发。抬高 74px 让出它的位置。
 * 只有 JS 检测到徽章才加这个类，本地或其他托管完全不受影响。
 */
body.has-corner-badge .composer {
  padding-bottom: calc(74px + var(--safe-bottom));
}

.mode-switch {
  display: flex;
  align-self: center;
  gap: 2px;
  padding: 3px;
  border-radius: 999px;
  background: var(--bg-sunken);
}
.mode-switch button {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 16px;
  border-radius: 999px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-2);
}
.mode-switch button[aria-pressed="true"] {
  background: var(--green);
  color: #fff;
}
@media (prefers-color-scheme: dark) {
  .mode-switch button[aria-pressed="true"] { color: #05231A; }
}

.input-row { display: flex; align-items: flex-end; gap: 8px; }
.input-row textarea {
  flex: 1;
  min-height: 44px;
  max-height: 140px;
  padding: 11px 14px;
  border-radius: 14px;
  border: 1px solid var(--line-strong);
  background: var(--bg-card);
  font-size: 16px; /* 小于 16px 时 iOS 会强制放大页面 */
  line-height: 1.45;
  resize: none;
  outline: none;
}
.input-row textarea:focus { border-color: var(--green); }

.round-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-sunken);
  color: var(--text-2);
  flex: none;
}
.round-btn.primary { background: var(--green); color: #fff; }
@media (prefers-color-scheme: dark) {
  .round-btn.primary { color: #05231A; }
}

/* 语音模式的麦克风 */
.mic-wrap { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 4px 0 2px; }
.mic {
  position: relative;
  width: 68px;
  height: 68px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--green);
  color: #fff;
  box-shadow: 0 8px 20px -8px color-mix(in srgb, var(--green) 70%, transparent);
  touch-action: manipulation;
}
@media (prefers-color-scheme: dark) {
  .mic { color: #05231A; }
}
.mic.rec { background: var(--coral); }
.mic::after {
  content: "";
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 2px solid color-mix(in srgb, var(--green) 35%, transparent);
  opacity: 0;
}
.mic.rec::after {
  opacity: 1;
  animation: breathe 1.4s infinite ease-in-out;
}
@keyframes breathe {
  0%, 100% { transform: scale(1); opacity: .5; }
  50% { transform: scale(1.12); opacity: .18; }
}
.mic-hint { font-size: 12.5px; color: var(--text-2); min-height: 18px; text-align: center; }

/* ---------------------------------------------------------------- 提示 */

.notice {
  display: flex;
  gap: 9px;
  align-items: flex-start;
  padding: 11px 13px;
  border-radius: 13px;
  font-size: 13px;
  line-height: 1.55;
  margin-bottom: 12px;
}
.notice.warn {
  background: color-mix(in srgb, var(--amber) 12%, var(--bg-card));
  border: 1px solid color-mix(in srgb, var(--amber) 40%, transparent);
  color: var(--text);
}
.notice.error {
  background: var(--danger-soft);
  border: 1px solid color-mix(in srgb, var(--danger) 40%, transparent);
  color: var(--danger);
}
.notice.info {
  background: var(--green-soft);
  border: 1px solid color-mix(in srgb, var(--green) 30%, transparent);
  color: var(--text);
}
.notice .actions { display: flex; gap: 4px; margin-top: 8px; flex-wrap: wrap; }
.notice details { margin-top: 8px; }
.notice summary { cursor: pointer; font-size: 12px; opacity: .8; }
.notice pre {
  margin: 6px 0 0;
  font-size: 11px;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-all;
  max-height: 200px;
  overflow: auto;
  opacity: .85;
}

/* ---------------------------------------------------------------- 学习记录 */

.stat-row { display: flex; gap: 22px; flex-wrap: wrap; }
.stat .v { font-size: 17px; font-weight: 700; display: flex; align-items: center; gap: 4px; }
.stat .k { font-size: 11px; color: var(--text-3); }

.chart {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 4px;
  height: 132px;
  padding-top: 6px;
}
.chart .col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 5px; height: 100%; }
.chart .n { font-size: 10px; color: var(--text-3); }
.chart .bar {
  width: 100%;
  max-width: 20px;
  border-radius: 5px;
  background: color-mix(in srgb, var(--green) 45%, transparent);
  min-height: 6px;
}
.chart .bar.today { background: var(--green); }
.chart .bar.zero { background: var(--bg-sunken); }
.chart .d { font-size: 10px; color: var(--text-3); }

.day-row { padding: 10px 0; border-top: 1px solid var(--line); }
.day-row:first-of-type { border-top: 0; }
.day-head { display: flex; align-items: center; gap: 8px; }
.day-head .date { font-size: 13.5px; font-weight: 600; }
.day-head .n { font-size: 11.5px; color: var(--text-3); margin-left: auto; }
.scene-bar { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.scene-bar .name { width: 92px; font-size: 12px; color: var(--text-2); flex: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.scene-bar .track { flex: 1; height: 5px; border-radius: 3px; background: var(--bg-sunken); overflow: hidden; }
.scene-bar .fill { height: 100%; border-radius: 3px; background: color-mix(in srgb, var(--green) 65%, transparent); }
.scene-bar .mins { font-size: 11px; color: var(--text-3); flex: none; }

/* ---------------------------------------------------------------- 设置 */

.field { margin-bottom: 12px; }
.field label { display: block; font-size: 12.5px; color: var(--text-2); margin-bottom: 6px; }
.field input[type="text"], .field input[type="password"], .field select {
  width: 100%;
  padding: 11px 13px;
  border-radius: 12px;
  border: 1px solid var(--line-strong);
  background: var(--bg-card);
  font-size: 16px;
  outline: none;
}
.field input:focus, .field select:focus { border-color: var(--green); }

.seg { display: flex; gap: 6px; flex-wrap: wrap; }
.seg button {
  padding: 8px 13px;
  border-radius: 10px;
  border: 1px solid var(--line-strong);
  background: var(--bg-card);
  font-size: 13.5px;
  color: var(--text-2);
}
.seg button[aria-pressed="true"] {
  background: var(--green-soft);
  border-color: var(--green);
  color: var(--green-strong);
  font-weight: 600;
}

.switch-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 0;
}
.switch-row .body { flex: 1; }
.switch-row .t { font-size: 14px; }
.switch-row .d { font-size: 11.5px; color: var(--text-3); }

.switch {
  position: relative;
  width: 46px;
  height: 28px;
  border-radius: 999px;
  background: var(--line-strong);
  flex: none;
  transition: background .18s;
}
.switch[aria-checked="true"] { background: var(--green); }
.switch::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  transition: transform .18s;
}
.switch[aria-checked="true"]::after { transform: translateX(18px); }
@media (prefers-color-scheme: dark) {
  .switch::after { background: #C8D4CF; }
}

input[type="range"] { width: 100%; accent-color: var(--green); }

.kv { display: flex; justify-content: space-between; gap: 10px; padding: 5px 0; font-size: 13px; }
.kv .k { color: var(--text-2); }
.kv .v { color: var(--text); font-weight: 500; }

.footer-note {
  font-size: 11.5px;
  color: var(--text-3);
  line-height: 1.6;
  padding: 6px 2px 24px;
}

.spinner {
  width: 14px;
  height: 14px;
  border: 2px solid color-mix(in srgb, var(--text-3) 40%, transparent);
  border-top-color: var(--text-2);
  border-radius: 50%;
  animation: spin .7s linear infinite;
  display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
