/* ==========================================================================
   同译 · visual system
   Warm paper, ink and terracotta. Editorial, quiet, made for two.
   ========================================================================== */

:root {
  --paper: #f4efe5;
  --paper-deep: #eae0d0;
  --paper-light: #fbf7ef;
  --card: #fffdf8;
  --ink: #20302f;
  --ink-2: #2e3f3c;
  --ink-soft: #56625e;
  --muted: #8c8b80;
  --faint: #b3ad9f;
  --line: #e4dac8;
  --line-strong: #d6c8b2;
  --accent: #d25f43;
  --accent-deep: #aa432c;
  --accent-soft: #f7e4da;
  --moss: #5f7862;
  --moss-deep: #405b47;
  --moss-soft: #e5ede2;
  --gold: #c8953e;
  --gold-soft: #f6ecd2;
  --blue: #486e88;
  --blue-soft: #e2edf1;
  --danger: #b44936;
  --shadow-sm: 0 2px 8px rgba(64, 50, 30, 0.045);
  --shadow: 0 18px 48px rgba(64, 50, 30, 0.08);
  --shadow-lg: 0 28px 80px rgba(41, 34, 22, 0.17);
  --serif: "Noto Serif SC", "Source Han Serif SC", "Songti SC", "STSong", "SimSun", Georgia, serif;
  --sans: "MiSans", "PingFang SC", "Microsoft YaHei", "Noto Sans SC", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: "Cascadia Code", "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 15px;
  --radius-sm: 10px;
  --maxw: 1200px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  color: var(--ink);
  background-color: var(--paper);
  background-image:
    radial-gradient(ellipse 80% 60% at 15% -5%, rgba(255, 251, 239, 0.9), transparent 60%),
    radial-gradient(ellipse 55% 45% at 100% 20%, rgba(226, 206, 174, 0.38), transparent 70%),
    linear-gradient(180deg, #f6f1e7 0%, #f2ecdf 45%, #f5f0e6 100%);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.28;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 160 160' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.2'/%3E%3C/svg%3E");
}

[hidden] {
  display: none !important;
}

::selection {
  background: var(--accent);
  color: #fffaf2;
}

button,
input,
textarea,
select {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

svg {
  display: block;
  flex: 0 0 auto;
}

h1,
h2,
h3,
h4,
p {
  margin: 0;
}

ul,
ol {
  margin: 0;
  padding: 0;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
summary:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.ambient {
  position: fixed;
  z-index: -1;
  border-radius: 50%;
  filter: blur(90px);
  pointer-events: none;
  opacity: 0.5;
}

.ambient-one {
  width: 520px;
  height: 520px;
  top: -260px;
  right: -160px;
  background: rgba(226, 193, 149, 0.4);
}

.ambient-two {
  width: 480px;
  height: 480px;
  bottom: -300px;
  left: -200px;
  background: rgba(151, 173, 149, 0.24);
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent);
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.19em;
  line-height: 1.5;
  text-transform: uppercase;
}

.eyebrow.light {
  color: #d6b887;
}

.muted {
  color: var(--muted);
}

.hidden {
  display: none !important;
}

.icon {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}

/* --------------------------------------------------------------------------
   Brand
   -------------------------------------------------------------------------- */

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  flex: 0 0 auto;
  border-radius: 8px;
}

.brand-mark {
  position: relative;
  display: inline-block;
  width: 34px;
  height: 26px;
  flex: 0 0 auto;
}

.brand-mark i {
  position: absolute;
  top: 3px;
  display: block;
  width: 20px;
  height: 20px;
  border: 1.7px solid var(--ink);
  border-radius: 50%;
  background: transparent;
}

.brand-mark i:first-child {
  left: 0;
}

.brand-mark i:last-child {
  right: 0;
  border-color: var(--accent);
}

.brand-mark i:last-child::after {
  content: "";
  position: absolute;
  width: 4px;
  height: 4px;
  right: 2.5px;
  top: 1.5px;
  border-radius: 50%;
  background: var(--accent);
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1;
}

.brand-text strong {
  font-family: var(--serif);
  font-size: 23px;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.brand-text small {
  margin-top: 5px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 7.5px;
  letter-spacing: 0.18em;
}

.brand-mark-large {
  width: 62px;
  height: 46px;
}

.brand-mark-large i {
  width: 38px;
  height: 38px;
  border-width: 2px;
}

.brand-on-art .brand-mark i {
  border-color: #f6eddd;
}

.brand-on-art .brand-mark i:last-child {
  border-color: #e9a28c;
}

.brand-on-art .brand-text strong {
  color: #f8f1e4;
}

.brand-on-art .brand-text small {
  color: rgba(248, 241, 228, 0.52);
}

.brand-mark-small {
  width: 25px;
  height: 18px;
}

.brand-mark-small i {
  width: 14px;
  height: 14px;
  top: 2px;
  border-width: 1.2px;
}

/* --------------------------------------------------------------------------
   Boot
   -------------------------------------------------------------------------- */

.boot {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  animation: fade-in 0.35s ease both;
}

.boot .brand-mark {
  margin-bottom: 4px;
  animation: gentle-pulse 2.2s ease-in-out infinite;
}

.boot-word {
  font-family: var(--serif);
  font-size: 30px;
  font-weight: 700;
  letter-spacing: 0.2em;
  padding-left: 0.2em;
}

.boot-line {
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.05em;
}

.boot-error {
  max-width: 380px;
  margin: 8px 20px 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
  text-align: center;
}

.boot .btn {
  margin-top: 6px;
}

.loading-dots {
  display: inline-flex;
  gap: 3px;
  margin-left: 3px;
}

.loading-dots i {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--accent);
  animation: dot-bounce 1.2s infinite;
}

.loading-dots i:nth-child(2) {
  animation-delay: 0.15s;
}

.loading-dots i:nth-child(3) {
  animation-delay: 0.3s;
}

/* --------------------------------------------------------------------------
   Auth
   -------------------------------------------------------------------------- */

.auth-view {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(440px, 0.95fr);
  animation: fade-in 0.5s ease both;
}

.auth-art {
  position: relative;
  overflow: hidden;
  color: #f8f1e4;
  background:
    radial-gradient(circle at 83% 12%, rgba(199, 157, 85, 0.22), transparent 34%),
    radial-gradient(circle at 8% 90%, rgba(95, 120, 98, 0.55), transparent 42%),
    linear-gradient(145deg, #1d2e2c 0%, #243936 52%, #1d2b2a 100%);
}

.auth-art::before {
  content: "译";
  position: absolute;
  left: -5vw;
  bottom: -15vh;
  color: rgba(248, 241, 228, 0.035);
  font-family: var(--serif);
  font-size: min(52vw, 690px);
  font-weight: 700;
  line-height: 1;
  pointer-events: none;
}

.auth-art::after {
  content: "";
  position: absolute;
  inset: 22px;
  border: 1px solid rgba(248, 241, 228, 0.075);
  border-radius: 22px;
  pointer-events: none;
}

.auth-art-inner {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  width: min(100%, 720px);
  margin: 0 auto;
  padding: 42px clamp(32px, 5vw, 72px) 30px;
}

.auth-copy {
  margin-top: clamp(54px, 9vh, 104px);
  max-width: 560px;
}

.auth-copy h1 {
  font-family: var(--serif);
  font-size: clamp(35px, 3.55vw, 54px);
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 1.3;
}

.ink-underline {
  position: relative;
  display: inline-block;
  color: #efb08e;
}

.ink-underline::after {
  content: "";
  position: absolute;
  left: 2%;
  right: -1%;
  bottom: 2px;
  height: 7px;
  border-radius: 50%;
  background: rgba(226, 124, 91, 0.34);
  transform: rotate(-1.5deg);
}

.auth-lead {
  max-width: 475px;
  margin-top: 22px;
  color: rgba(248, 241, 228, 0.66);
  font-size: 14.5px;
  line-height: 1.85;
}

.auth-sample {
  position: relative;
  width: min(100%, 490px);
  margin-top: clamp(34px, 6vh, 62px);
  padding: 22px 24px 18px;
  color: var(--ink);
  background: #f8f1e3;
  border-radius: 19px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.23);
}

.auth-sample::before {
  content: "";
  position: absolute;
  top: 0;
  left: 25px;
  width: 66px;
  height: 3px;
  border-radius: 0 0 3px 3px;
  background: var(--accent);
}

.sample-top,
.sample-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.sample-tag {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.12em;
}

.sample-ai {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--moss-deep);
  font-size: 10px;
  font-weight: 600;
}

.sample-ai .spark {
  color: var(--gold);
}

.sample-source {
  margin-top: 13px;
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 600;
  line-height: 1.7;
}

.sample-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 12px 0;
}

.sample-divider span {
  flex: 1;
  height: 1px;
  background: var(--line);
}

.sample-divider em {
  color: var(--faint);
  font-family: var(--serif);
  font-size: 10px;
  font-style: italic;
}

.sample-answer {
  color: var(--ink-soft);
  font-family: Georgia, var(--serif);
  font-size: 13.5px;
  line-height: 1.65;
}

.sample-foot {
  justify-content: flex-start;
  margin-top: 14px;
  padding-top: 13px;
  border-top: 1px dashed var(--line);
  color: var(--muted);
  font-size: 10.5px;
}

.sample-score {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  border: 1px solid rgba(95, 120, 98, 0.4);
  border-radius: 50%;
  color: var(--moss-deep);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
}

.auth-values {
  display: flex;
  gap: 28px;
  margin-top: auto;
  padding-top: 38px;
  color: rgba(248, 241, 228, 0.68);
  font-size: 11.5px;
}

.auth-values div {
  display: flex;
  align-items: center;
  gap: 7px;
}

.auth-values span {
  color: #d8b27b;
  font-family: var(--mono);
  font-size: 8px;
}

.auth-art-foot {
  margin-top: 22px;
  color: rgba(248, 241, 228, 0.32);
  font-size: 9.5px;
  letter-spacing: 0.07em;
}

.auth-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 50px clamp(28px, 5vw, 76px);
  background:
    radial-gradient(ellipse 90% 60% at 100% 0%, rgba(255, 252, 244, 0.85), transparent 55%),
    var(--paper);
}

.auth-panel-inner {
  width: min(100%, 430px);
}

.auth-mobile-brand {
  display: none;
  align-items: center;
  gap: 10px;
  margin-bottom: 36px;
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.auth-heading {
  margin-bottom: 26px;
}

.auth-heading h2 {
  font-family: var(--serif);
  font-size: clamp(26px, 2.5vw, 34px);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.35;
}

.auth-heading p:last-child {
  margin-top: 10px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

.auth-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3px;
  padding: 4px;
  margin-bottom: 26px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 253, 248, 0.48);
}

.auth-tab {
  padding: 9px 8px;
  border: 0;
  border-radius: 999px;
  color: var(--muted);
  background: transparent;
  font-size: 12.5px;
  font-weight: 600;
  transition: background 0.2s, color 0.2s, box-shadow 0.2s;
}

.auth-tab:hover {
  color: var(--ink);
}

.auth-tab.active {
  color: var(--ink);
  background: var(--card);
  box-shadow: 0 2px 8px rgba(64, 50, 30, 0.07);
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 17px;
  animation: fade-up 0.3s ease both;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-width: 0;
}

.field > span {
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.field > span em {
  margin-left: 4px;
  color: var(--faint);
  font-style: normal;
  font-weight: 400;
}

.field input,
.field select {
  width: 100%;
  height: 47px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 11px;
  color: var(--ink);
  background: rgba(255, 253, 248, 0.72);
  font-size: 14px;
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}

.field input::placeholder,
.field textarea::placeholder {
  color: #b2aa9b;
}

.field input:focus,
.field select:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--card);
  box-shadow: 0 0 0 3px rgba(210, 95, 67, 0.09);
}

.field input[name="code"] {
  font-family: var(--mono);
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.field small {
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.5;
}

.field-help {
  margin-top: -4px;
  color: var(--faint);
  font-size: 10px;
  line-height: 1.6;
}

.field-row {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 13px;
}

.field-row .avatar-picker {
  margin-top: 1px;
}

.avatar-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 47px;
  align-items: center;
}

.avatar-choice {
  position: relative;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 50%;
  background: rgba(255, 253, 248, 0.56);
  font-size: 19px;
  line-height: 1;
  transition: transform 0.15s, border-color 0.15s, background 0.15s;
}

.avatar-choice:hover {
  transform: translateY(-2px);
  background: var(--card);
}

.avatar-choice.selected {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.avatar-choice.selected::after {
  content: "";
  position: absolute;
  right: -1px;
  bottom: -1px;
  width: 8px;
  height: 8px;
  border: 1.5px solid var(--card);
  border-radius: 50%;
  background: var(--accent);
}

.form-alert,
.form-error {
  margin: 0;
  padding: 10px 12px;
  border: 1px solid rgba(180, 73, 54, 0.22);
  border-radius: 9px;
  color: var(--danger);
  background: #fbebe6;
  font-size: 12px;
  line-height: 1.55;
}

.auth-privacy {
  margin-top: 24px;
  color: var(--faint);
  font-size: 10.5px;
  line-height: 1.7;
  text-align: center;
}

.auth-privacy span {
  color: var(--accent);
}

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 10px 19px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.01em;
  white-space: nowrap;
  transition: transform 0.16s ease, background 0.2s, border-color 0.2s, color 0.2s, box-shadow 0.2s;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

.btn:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  transform: none;
}

.btn-primary {
  color: #fff9ef;
  background: var(--accent);
  box-shadow: 0 6px 18px rgba(170, 67, 44, 0.17);
}

.btn-primary:hover:not(:disabled) {
  background: var(--accent-deep);
  box-shadow: 0 8px 24px rgba(170, 67, 44, 0.22);
}

.btn-dark {
  color: #f8f1e4;
  background: var(--ink);
}

.btn-dark:hover:not(:disabled) {
  background: #121f1e;
}

.btn-ghost {
  border-color: var(--line-strong);
  color: var(--ink-soft);
  background: transparent;
}

.btn-ghost:hover:not(:disabled) {
  border-color: var(--ink-soft);
  color: var(--ink);
  background: rgba(255, 253, 248, 0.6);
}

.btn-soft {
  color: var(--ink);
  background: var(--paper-deep);
}

.btn-soft:hover:not(:disabled) {
  background: #e2d5c1;
}

.btn-block {
  width: 100%;
  min-height: 48px;
  margin-top: 3px;
}

.btn-sm {
  min-height: 33px;
  padding: 6px 12px;
  font-size: 11.5px;
  gap: 5px;
}

.btn .btn-arrow {
  margin-left: 3px;
  transition: transform 0.2s;
}

.btn:hover .btn-arrow {
  transform: translateX(3px);
}

.btn.is-loading {
  pointer-events: none;
}

.btn.is-loading .btn-label {
  opacity: 0.55;
}

.icon-button {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--ink-soft);
  background: rgba(255, 253, 248, 0.5);
  transition: background 0.2s, color 0.2s, border-color 0.2s, transform 0.2s;
}

.icon-button:hover {
  color: var(--ink);
  border-color: var(--line-strong);
  background: var(--card);
  transform: translateY(-1px);
}

.icon-button:disabled {
  cursor: not-allowed;
  opacity: 0.32;
  transform: none;
}

.icon-button.spinning svg {
  animation: spin 0.8s linear infinite;
}

.text-button {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 0;
  border: 0;
  color: var(--accent-deep);
  background: none;
  font-size: 12px;
  font-weight: 600;
}

.text-button:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.link-button {
  padding: 0;
  border: 0;
  color: var(--muted);
  background: none;
  font-size: 11px;
  text-decoration: underline;
  text-decoration-color: var(--line-strong);
  text-underline-offset: 3px;
}

.link-button:hover {
  color: var(--accent-deep);
}

/* --------------------------------------------------------------------------
   Topbar
   -------------------------------------------------------------------------- */

.main-view {
  min-height: 100vh;
  animation: fade-in 0.4s ease both;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 30px;
  height: 78px;
  padding: 0 max(24px, calc((100vw - var(--maxw)) / 2));
  border-bottom: 1px solid rgba(214, 200, 178, 0.55);
  background: rgba(244, 239, 229, 0.8);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  margin: 0 auto;
  padding: 4px;
  border-radius: 999px;
  background: rgba(255, 253, 248, 0.4);
}

.nav-item {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 17px;
  border: 0;
  border-radius: 999px;
  color: var(--muted);
  background: transparent;
  font-size: 12.5px;
  font-weight: 600;
  transition: color 0.2s, background 0.2s, box-shadow 0.2s;
}

.nav-item:hover {
  color: var(--ink);
}

.nav-item.active {
  color: var(--ink);
  background: var(--card);
  box-shadow: 0 2px 10px rgba(64, 50, 30, 0.07);
}

.nav-item.active .nav-icon {
  color: var(--accent);
}

.nav-icon {
  display: inline-flex;
  color: var(--faint);
  transition: color 0.2s;
}

.nav-icon .icon {
  width: 15px;
  height: 15px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pair-chip {
  display: flex;
  align-items: center;
  margin-right: 5px;
  padding-right: 4px;
}

.pair-chip .mini-avatar {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 2px solid var(--paper);
  border-radius: 50%;
  background: var(--card);
  font-size: 16px;
  box-shadow: var(--shadow-sm);
}

.pair-chip .mini-avatar + .mini-avatar {
  margin-left: -9px;
}

.pair-chip .pair-join {
  margin-left: 4px;
  color: var(--faint);
  font-family: var(--serif);
  font-size: 11px;
  font-style: italic;
}

.page-content {
  width: 100%;
  max-width: var(--maxw);
  min-height: calc(100vh - 150px);
  margin: 0 auto;
  padding: 32px 24px 72px;
  animation: fade-up 0.4s ease both;
}

.site-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 20px 24px 30px;
  color: var(--faint);
  font-size: 10px;
  letter-spacing: 0.03em;
}

.site-footer .brand-mark-small i {
  border-color: var(--faint);
}

.site-footer .brand-mark-small i:last-child {
  border-color: #c98877;
}

.footer-dot {
  color: var(--line-strong);
}

/* --------------------------------------------------------------------------
   Shared page furniture
   -------------------------------------------------------------------------- */

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin: 4px 0 26px;
}

.page-head h1 {
  font-family: var(--serif);
  font-size: clamp(28px, 3vw, 38px);
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 1.3;
}

.page-head p:not(.eyebrow) {
  max-width: 620px;
  margin-top: 7px;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.7;
}

.card {
  border: 1px solid rgba(223, 211, 192, 0.9);
  border-radius: var(--radius-xl);
  background: var(--card);
  box-shadow: var(--shadow-sm);
}

.avatar {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--gold-soft);
  font-size: 21px;
  line-height: 1;
  box-shadow: inset 0 0 0 1px rgba(95, 73, 36, 0.07);
}

.avatar.avatar-lg {
  width: 52px;
  height: 52px;
  font-size: 26px;
}

.avatar.avatar-sm {
  width: 28px;
  height: 28px;
  font-size: 14px;
}

.avatar.avatar-accent {
  background: var(--accent-soft);
}

.avatar.avatar-moss {
  background: var(--moss-soft);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 9px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.meta-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

.status-pill::before {
  content: "";
  width: 4.5px;
  height: 4.5px;
  border-radius: 50%;
  background: currentColor;
}

.status-done {
  border-color: rgba(95, 120, 98, 0.2);
  color: var(--moss-deep);
  background: var(--moss-soft);
}

.status-pending {
  border-color: rgba(140, 139, 128, 0.18);
  color: var(--muted);
  background: #f3efe6;
}

.status-grading {
  border-color: rgba(200, 149, 62, 0.2);
  color: #92651f;
  background: var(--gold-soft);
}

.status-wait {
  border-color: rgba(210, 95, 67, 0.16);
  color: var(--accent-deep);
  background: var(--accent-soft);
}

/* --------------------------------------------------------------------------
   Today hero
   -------------------------------------------------------------------------- */

.day-hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
  gap: 42px;
  overflow: hidden;
  padding: clamp(28px, 3.4vw, 42px) clamp(26px, 4vw, 48px);
  border-radius: 30px;
  color: #f7f0e3;
  background:
    radial-gradient(circle at 96% 0%, rgba(206, 163, 94, 0.23), transparent 34%),
    radial-gradient(circle at 0% 110%, rgba(103, 130, 104, 0.5), transparent 48%),
    linear-gradient(135deg, #1e302e 0%, #263b36 58%, #213430 100%);
  box-shadow: 0 24px 60px rgba(44, 45, 32, 0.18);
}

.day-hero::before {
  content: "“";
  position: absolute;
  top: -74px;
  right: 31%;
  color: rgba(248, 241, 228, 0.045);
  font-family: Georgia, var(--serif);
  font-size: 330px;
  line-height: 1;
  pointer-events: none;
}

.day-hero::after {
  content: "";
  position: absolute;
  right: -60px;
  bottom: -120px;
  width: 290px;
  height: 290px;
  border: 1px solid rgba(248, 241, 228, 0.08);
  border-radius: 50%;
  pointer-events: none;
}

.hero-copy {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.hero-topline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 9px;
  color: rgba(247, 240, 227, 0.54);
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.hero-topline strong {
  color: #dfc08e;
  font-weight: 600;
}

.hero-topline .line {
  width: 22px;
  height: 1px;
  background: rgba(247, 240, 227, 0.25);
}

.day-hero h1 {
  max-width: 590px;
  margin-top: 21px;
  font-family: var(--serif);
  font-size: clamp(29px, 3.2vw, 43px);
  font-weight: 500;
  letter-spacing: -0.04em;
  line-height: 1.42;
}

.day-hero h1 em {
  position: relative;
  color: #eeb28f;
  font-style: normal;
}

.day-hero h1 em::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 1px;
  height: 5px;
  border-radius: 50%;
  background: rgba(215, 117, 81, 0.3);
}

.hero-sub {
  max-width: 500px;
  margin-top: 13px;
  color: rgba(247, 240, 227, 0.57);
  font-size: 12.5px;
  line-height: 1.75;
}

.hero-signature {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: auto;
  padding-top: 25px;
  color: rgba(247, 240, 227, 0.35);
  font-size: 9px;
  letter-spacing: 0.06em;
}

.hero-signature .tiny-line {
  width: 30px;
  height: 1px;
  background: rgba(247, 240, 227, 0.2);
}

.hero-side {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  padding-left: 34px;
  border-left: 1px solid rgba(247, 240, 227, 0.11);
}

.pair-track {
  display: flex;
  align-items: center;
  gap: 12px;
}

.track-person {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.track-person .avatar {
  width: 46px;
  height: 46px;
  font-size: 23px;
  border: 2px solid rgba(247, 240, 227, 0.2);
  background: rgba(255, 253, 248, 0.1);
  box-shadow: none;
}

.track-person .track-meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.track-meta strong {
  overflow: hidden;
  max-width: 76px;
  color: #f8f1e4;
  font-size: 12px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.track-meta span {
  margin-top: 2px;
  color: rgba(247, 240, 227, 0.38);
  font-size: 8.5px;
  letter-spacing: 0.04em;
}

.track-done .track-meta span {
  color: #c5d8bc;
}

.track-line {
  position: relative;
  flex: 1;
  min-width: 34px;
  height: 1px;
  background: rgba(247, 240, 227, 0.16);
}

.track-line::after {
  content: "";
  position: absolute;
  top: -2px;
  left: 0;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(247, 240, 227, 0.32);
}

.track-line.filled {
  background: rgba(238, 178, 143, 0.6);
}

.track-line.filled::after {
  background: #eeb28f;
}

.track-person.waiting .avatar {
  border-style: dashed;
  color: rgba(247, 240, 227, 0.45);
  font-size: 17px;
}

.hero-progress {
  margin-top: 17px;
}

.hero-progress-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  color: rgba(247, 240, 227, 0.46);
  font-size: 9.5px;
  letter-spacing: 0.05em;
}

.hero-progress-top strong {
  color: #f7f0e3;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
}

.hero-progress-bar {
  overflow: hidden;
  height: 3px;
  margin-top: 7px;
  border-radius: 999px;
  background: rgba(247, 240, 227, 0.12);
}

.hero-progress-bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #eeb28f, #d98767);
  transition: width 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.hero-metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 20px;
}

.hero-metric {
  padding: 12px 14px;
  border: 1px solid rgba(247, 240, 227, 0.1);
  border-radius: 13px;
  background: rgba(247, 240, 227, 0.045);
}

.hero-metric span {
  display: flex;
  align-items: center;
  gap: 5px;
  color: rgba(247, 240, 227, 0.46);
  font-size: 8.5px;
  letter-spacing: 0.04em;
}

.hero-metric span .icon {
  width: 11px;
  height: 11px;
  color: #dfc08e;
}

.hero-metric strong {
  display: block;
  margin-top: 4px;
  color: #f8f1e4;
  font-family: var(--serif);
  font-size: 23px;
  font-weight: 500;
  line-height: 1.25;
}

.hero-metric strong small {
  margin-left: 2px;
  color: rgba(247, 240, 227, 0.45);
  font-family: var(--sans);
  font-size: 9px;
  font-weight: 400;
}

/* --------------------------------------------------------------------------
   Alerts / setup
   -------------------------------------------------------------------------- */

.setup-banner {
  display: flex;
  align-items: center;
  gap: 13px;
  margin-top: 18px;
  padding: 12px 16px;
  border: 1px solid rgba(200, 149, 62, 0.24);
  border-radius: 14px;
  background: linear-gradient(90deg, rgba(246, 236, 210, 0.75), rgba(255, 253, 248, 0.68));
  color: #765724;
  font-size: 11.5px;
  line-height: 1.6;
}

.setup-banner .setup-icon {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: rgba(200, 149, 62, 0.12);
  color: var(--gold);
}

.setup-banner .setup-text {
  flex: 1;
  min-width: 0;
}

.setup-banner .setup-text strong {
  margin-right: 4px;
  font-weight: 600;
}

.setup-banner .btn {
  flex: 0 0 auto;
}

.invite-banner {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-top: 18px;
  padding: 17px 20px;
  border: 1px dashed rgba(210, 95, 67, 0.33);
  border-radius: 17px;
  background:
    radial-gradient(circle at 100% 0, rgba(210, 95, 67, 0.08), transparent 50%),
    rgba(255, 253, 248, 0.55);
}

.invite-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  border-radius: 13px;
  color: var(--accent-deep);
  background: var(--accent-soft);
}

.invite-copy {
  flex: 1;
  min-width: 0;
}

.invite-copy strong {
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 600;
}

.invite-copy p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10.5px;
}

.invite-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.invite-code {
  display: inline-flex;
  align-items: center;
  height: 35px;
  padding: 0 14px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  color: var(--ink);
  background: var(--card);
  font-family: var(--mono);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.19em;
}

/* --------------------------------------------------------------------------
   Workspace / task cards
   -------------------------------------------------------------------------- */

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 22px;
  margin-top: 22px;
  align-items: start;
}

.task-card {
  position: relative;
  min-width: 0;
  padding: 24px;
  border: 1px solid rgba(221, 209, 190, 0.9);
  border-radius: 25px;
  background: var(--card);
  box-shadow: var(--shadow-sm);
}

.task-card.my-task {
  box-shadow: 0 10px 30px rgba(64, 50, 30, 0.055);
}

.task-card::before {
  content: "";
  position: absolute;
  top: 24px;
  left: 0;
  width: 2px;
  height: 27px;
  border-radius: 0 3px 3px 0;
  background: var(--accent);
  opacity: 0.75;
}

.task-card.partner-task::before {
  background: var(--moss);
}

.card-head {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}

.card-head-text {
  flex: 1;
  min-width: 0;
}

.card-head-text h2 {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.4;
}

.card-head-text p {
  margin-top: 2px;
  color: var(--muted);
  font-size: 9.5px;
  letter-spacing: 0.03em;
}

.card-head-actions {
  display: flex;
  align-items: center;
  gap: 7px;
  flex: 0 0 auto;
}

.task-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  margin-top: 20px;
}

.task-meta .meta-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--muted);
  font-size: 9.5px;
  letter-spacing: 0.02em;
}

.task-meta .meta-chip .icon {
  width: 12px;
  height: 12px;
}

.direction-badge {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink-soft);
  background: var(--paper-light);
  font-family: var(--mono);
  font-size: 8.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
}

.meta-sep {
  width: 1px;
  height: 10px;
  background: var(--line);
}

.source-panel {
  position: relative;
  margin-top: 11px;
  padding: 18px 19px 16px;
  overflow: hidden;
  border: 1px solid rgba(222, 209, 187, 0.62);
  border-radius: 17px;
  background:
    radial-gradient(circle at 100% 0, rgba(200, 149, 62, 0.08), transparent 45%),
    #faf5eb;
}

.source-panel::after {
  content: "“";
  position: absolute;
  right: 12px;
  bottom: -23px;
  color: rgba(64, 50, 30, 0.055);
  font-family: Georgia, var(--serif);
  font-size: 88px;
  line-height: 1;
  pointer-events: none;
}

.source-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.source-label span:last-child {
  color: var(--faint);
  letter-spacing: 0.04em;
}

.source-text {
  position: relative;
  z-index: 1;
  margin-top: 11px;
  font-family: var(--serif);
  font-size: clamp(17px, 1.65vw, 20px);
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.75;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.source-text.lang-en {
  font-family: Georgia, var(--serif);
  font-size: clamp(17px, 1.65vw, 20px);
  font-weight: 500;
  line-height: 1.65;
}

.hint-line {
  position: relative;
  z-index: 1;
  display: flex;
  gap: 7px;
  margin-top: 13px;
  padding-top: 11px;
  border-top: 1px dashed var(--line);
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.65;
}

.hint-line .icon {
  width: 12px;
  height: 12px;
  margin-top: 2px;
  flex: 0 0 auto;
  color: var(--gold);
}

/* Composer */

.answer-composer {
  margin-top: 18px;
}

.composer-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 7px;
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 600;
}

.composer-label span:last-child {
  color: var(--faint);
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 400;
}

.answer-input {
  display: block;
  width: 100%;
  min-height: 154px;
  padding: 14px 15px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 13px;
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(250, 247, 239, 0.7), rgba(255, 253, 248, 0.9));
  font-family: Georgia, var(--serif);
  font-size: 15.5px;
  line-height: 1.85;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.answer-input::placeholder {
  color: #b6ad9e;
  font-family: var(--sans);
  font-size: 12px;
}

.answer-input:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--card);
  box-shadow: 0 0 0 3px rgba(210, 95, 67, 0.075);
}

.composer-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 10px;
}

.composer-note {
  display: flex;
  align-items: flex-start;
  gap: 5px;
  color: var(--faint);
  font-size: 9.5px;
  line-height: 1.5;
}

.composer-note .icon {
  width: 11px;
  height: 11px;
  margin-top: 1px;
  color: var(--gold);
}

.composer-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

/* Answer */

.answer-section {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.answer-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.answer-section-title {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--ink-soft);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.answer-section-title .icon {
  width: 12px;
  height: 12px;
  color: var(--moss);
}

.answer-text {
  padding: 15px 16px;
  border-left: 2px solid rgba(210, 95, 67, 0.36);
  border-radius: 0 11px 11px 0;
  color: var(--ink-2);
  background: #fcf8f0;
  font-family: Georgia, var(--serif);
  font-size: 14.8px;
  line-height: 1.9;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.partner-task .answer-text {
  border-left-color: rgba(95, 120, 98, 0.42);
}

.answer-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  margin-top: 7px;
  color: var(--faint);
  font-size: 9px;
}

.answer-meta .dot {
  width: 2px;
  height: 2px;
  border-radius: 50%;
  background: var(--faint);
}

.inline-editor {
  margin-top: 18px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: #faf6ed;
  animation: fade-up 0.25s ease both;
}

.inline-editor .answer-input {
  min-height: 140px;
  background: var(--card);
}

.inline-editor-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 9px;
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 600;
}

.reference-box {
  margin-top: 15px;
  padding: 13px 15px;
  border: 1px dashed var(--line-strong);
  border-radius: 12px;
  background: rgba(250, 247, 239, 0.65);
}

.reference-box > summary {
  list-style: none;
  cursor: pointer;
}

.reference-box > summary::-webkit-details-marker {
  display: none;
}

.reference-box[open] .reference-head span:last-child .icon {
  transform: rotate(180deg);
}

.reference-head .icon {
  transition: transform 0.2s;
}

.reference-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.03em;
}

.reference-text {
  margin-top: 6px;
  color: var(--ink-soft);
  font-family: Georgia, var(--serif);
  font-size: 12.5px;
  line-height: 1.75;
  white-space: pre-wrap;
}

/* Empty partner / waiting */

.waiting-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 305px;
  padding: 36px 22px;
  text-align: center;
}

.waiting-avatars {
  position: relative;
  display: flex;
  align-items: center;
  margin-bottom: 17px;
}

.waiting-avatars .avatar {
  width: 47px;
  height: 47px;
  font-size: 23px;
}

.waiting-avatars .avatar + .avatar {
  margin-left: -8px;
  border: 2px solid var(--card);
  border-style: dashed;
  color: var(--faint);
  background: var(--paper);
}

.waiting-dots {
  display: flex;
  gap: 4px;
  margin-top: 11px;
}

.waiting-dots i {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--line-strong);
  animation: dot-fade 1.8s infinite;
}

.waiting-dots i:nth-child(2) {
  animation-delay: 0.25s;
}

.waiting-dots i:nth-child(3) {
  animation-delay: 0.5s;
}

.waiting-state h3 {
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 600;
}

.waiting-state p {
  max-width: 290px;
  margin-top: 6px;
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.7;
}

.waiting-state .btn {
  margin-top: 16px;
}

/* --------------------------------------------------------------------------
   AI grade
   -------------------------------------------------------------------------- */

.ai-panel {
  margin-top: 15px;
  overflow: hidden;
  border: 1px solid rgba(213, 199, 177, 0.78);
  border-radius: 16px;
  background:
    radial-gradient(circle at 100% 0, rgba(200, 149, 62, 0.1), transparent 45%),
    linear-gradient(135deg, #fbf7ee, #faf5ea);
}

.ai-panel-head {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 11px 14px;
  border-bottom: 1px solid rgba(224, 213, 195, 0.7);
  color: var(--ink-soft);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.03em;
}

.ai-panel-head .ai-spark {
  color: var(--gold);
}

.ai-panel-head .ai-model {
  margin-left: auto;
  overflow: hidden;
  max-width: 180px;
  color: var(--faint);
  font-family: var(--mono);
  font-size: 8px;
  font-weight: 400;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ai-panel-body {
  padding: 14px;
}

.ai-loading {
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 3px 1px;
}

.ai-loading-line {
  color: var(--ink-soft);
  font-size: 10.5px;
}

.shimmer {
  height: 8px;
  margin-top: 3px;
  overflow: hidden;
  border-radius: 999px;
  background: #ede3d3;
}

.shimmer::after {
  content: "";
  display: block;
  width: 45%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, transparent, rgba(255, 253, 248, 0.88), transparent);
  animation: shimmer 1.4s infinite;
}

.shimmer:nth-child(3) {
  width: 75%;
}

.shimmer:nth-child(4) {
  width: 58%;
}

.grade-main {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.score-ring {
  --score: 0;
  --ring-color: var(--accent);
  position: relative;
  display: grid;
  place-items: center;
  width: 65px;
  height: 65px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: conic-gradient(var(--ring-color) calc(var(--score) * 1%), #e9dfcd 0);
}

.score-ring::before {
  content: "";
  position: absolute;
  inset: 5px;
  border-radius: 50%;
  background: #fbf7ee;
}

.score-ring-inner {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1;
}

.score-ring strong {
  color: var(--ink);
  font-family: var(--mono);
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.06em;
}

.score-ring span {
  margin-top: 3px;
  color: var(--faint);
  font-size: 7px;
  letter-spacing: 0.08em;
}

.score-ring.score-good {
  --ring-color: var(--moss);
}

.score-ring.score-mid {
  --ring-color: var(--gold);
}

.score-ring.score-low {
  --ring-color: var(--accent);
}

.grade-summary {
  flex: 1;
  min-width: 0;
}

.grade-summary-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.grade-label {
  color: var(--moss-deep);
  font-size: 10px;
  font-weight: 600;
}

.grade-band {
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--moss-deep);
  background: var(--moss-soft);
  font-size: 8px;
  font-weight: 600;
}

.grade-summary p {
  margin-top: 5px;
  color: var(--ink-soft);
  font-size: 10.5px;
  line-height: 1.7;
}

.dimension-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px 13px;
  margin-top: 14px;
}

.dimension {
  min-width: 0;
}

.dimension-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font-size: 8px;
}

.dimension-top strong {
  color: var(--ink-soft);
  font-family: var(--mono);
  font-size: 8.5px;
  font-weight: 600;
}

.dimension-bar {
  height: 2px;
  margin-top: 4px;
  overflow: hidden;
  border-radius: 999px;
  background: #e8dece;
}

.dimension-bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--moss);
  opacity: 0.72;
}

.highlight-list {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 11px;
}

.highlight-chip {
  padding: 4px 7px;
  border: 1px solid rgba(95, 120, 98, 0.16);
  border-radius: 5px;
  color: var(--moss-deep);
  background: rgba(229, 237, 226, 0.5);
  font-size: 8.5px;
  line-height: 1.4;
}

.grade-details {
  margin-top: 12px;
  border-top: 1px dashed var(--line);
}

.grade-details > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 9px;
  padding: 10px 0 1px;
  color: var(--ink-soft);
  font-size: 9.5px;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}

.grade-details > summary::-webkit-details-marker {
  display: none;
}

.grade-details > summary .summary-chevron {
  transition: transform 0.2s;
}

.grade-details[open] > summary .summary-chevron {
  transform: rotate(180deg);
}

.issue-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
}

.issue {
  padding: 9px 10px;
  border: 1px solid rgba(217, 203, 182, 0.7);
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.6);
}

.issue-original {
  color: var(--accent-deep);
  font-family: Georgia, var(--serif);
  font-size: 10px;
  line-height: 1.5;
  text-decoration: line-through;
  text-decoration-color: rgba(210, 95, 67, 0.4);
  overflow-wrap: anywhere;
}

.issue-problem {
  margin-top: 3px;
  color: var(--ink-soft);
  font-size: 9px;
  line-height: 1.55;
}

.issue-suggestion {
  display: flex;
  align-items: flex-start;
  gap: 4px;
  margin-top: 4px;
  color: var(--moss-deep);
  font-family: Georgia, var(--serif);
  font-size: 9.5px;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.issue-suggestion::before {
  content: "→";
  color: var(--moss);
  font-family: var(--sans);
  font-size: 8px;
  margin-top: 1px;
}

.suggested-box {
  margin-top: 12px;
  padding: 10px 11px;
  border-radius: 9px;
  background: var(--moss-soft);
}

.suggested-box-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--moss-deep);
  font-size: 8.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.suggested-text {
  margin-top: 5px;
  color: #354b3b;
  font-family: Georgia, var(--serif);
  font-size: 10.5px;
  line-height: 1.7;
  white-space: pre-wrap;
}

.ai-note {
  margin-top: 10px;
  color: var(--faint);
  font-size: 8px;
  line-height: 1.5;
}

.ai-error,
.ai-unavailable {
  display: flex;
  align-items: flex-start;
  gap: 9px;
}

.ai-state-icon {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  border-radius: 50%;
  color: var(--gold);
  background: var(--gold-soft);
}

.ai-error .ai-state-icon {
  color: var(--danger);
  background: #fae9e3;
}

.ai-state-copy {
  flex: 1;
  min-width: 0;
}

.ai-state-copy strong {
  display: block;
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 600;
}

.ai-state-copy p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.ai-state-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  margin-top: 8px;
}

/* Comments */

.comments {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.comments-title {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--ink-soft);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.comments-title .icon {
  width: 12px;
  height: 12px;
  color: var(--accent);
}

.comment-list {
  display: flex;
  flex-direction: column;
  gap: 9px;
  margin-top: 10px;
}

.comment {
  display: flex;
  gap: 8px;
}

.comment-bubble {
  flex: 1;
  min-width: 0;
  padding: 8px 10px;
  border-radius: 3px 10px 10px 10px;
  background: var(--paper-light);
}

.comment-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--ink-soft);
  font-size: 8.5px;
  font-weight: 600;
}

.comment-head span {
  color: var(--faint);
  font-size: 7.5px;
  font-weight: 400;
}

.comment-bubble p {
  margin-top: 2px;
  color: var(--ink-soft);
  font-size: 9.5px;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.comment-form {
  display: flex;
  gap: 7px;
  margin-top: 11px;
}

.comment-input {
  flex: 1;
  min-width: 0;
  height: 36px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--ink);
  background: var(--card);
  font-size: 10px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.comment-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(210, 95, 67, 0.07);
}

.comment-form .btn {
  min-height: 36px;
  padding: 0 13px;
  font-size: 10px;
}

/* --------------------------------------------------------------------------
   History
   -------------------------------------------------------------------------- */

.stats-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 13px;
  margin-bottom: 22px;
}

.stat-card {
  padding: 16px 17px;
  border: 1px solid rgba(223, 211, 192, 0.82);
  border-radius: 17px;
  background: rgba(255, 253, 248, 0.72);
}

.stat-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: 9px;
  letter-spacing: 0.02em;
}

.stat-card-top .icon {
  width: 13px;
  height: 13px;
  color: var(--faint);
}

.stat-card strong {
  display: flex;
  align-items: baseline;
  gap: 3px;
  margin-top: 8px;
  color: var(--ink);
  font-family: var(--serif);
  font-size: 26px;
  font-weight: 500;
  line-height: 1;
}

.stat-card strong small {
  color: var(--muted);
  font-family: var(--sans);
  font-size: 9px;
  font-weight: 400;
}

.stat-card p {
  margin-top: 5px;
  color: var(--faint);
  font-size: 8.5px;
  line-height: 1.4;
}

.history-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(260px, 0.72fr);
  gap: 20px;
  align-items: start;
}

.calendar-card {
  padding: 21px;
  border: 1px solid rgba(223, 211, 192, 0.9);
  border-radius: 23px;
  background: var(--card);
  box-shadow: var(--shadow-sm);
}

.calendar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  margin-bottom: 17px;
}

.calendar-title {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.calendar-title h2 {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.calendar-title span {
  color: var(--faint);
  font-family: var(--mono);
  font-size: 8.5px;
  letter-spacing: 0.08em;
}

.calendar-nav {
  display: flex;
  gap: 5px;
}

.calendar-nav .icon-button {
  width: 29px;
  height: 29px;
}

.calendar-nav .icon-button .icon {
  width: 13px;
  height: 13px;
}

.weekday-row,
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
}

.weekday-row {
  margin-bottom: 6px;
}

.weekday-row span {
  padding: 3px 0;
  color: var(--faint);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.04em;
  text-align: center;
}

.cal-cell {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 83px;
  padding: 7px;
  border: 1px solid transparent;
  border-radius: 9px;
  color: var(--ink);
  background: rgba(247, 242, 232, 0.52);
  font: inherit;
  text-align: left;
  transition: background 0.2s, border-color 0.2s, transform 0.2s;
}

.cal-cell.empty {
  background: transparent;
}

.cal-cell.future {
  opacity: 0.38;
}

.cal-cell.today {
  border-color: rgba(210, 95, 67, 0.52);
  box-shadow: inset 0 0 0 1px rgba(210, 95, 67, 0.08);
}

.cal-cell.has-data {
  cursor: pointer;
  background: #fbf7ef;
}

.cal-cell.has-data:hover {
  border-color: var(--line-strong);
  background: var(--paper-light);
  transform: translateY(-1px);
}

.cal-cell.both-done {
  background: linear-gradient(165deg, rgba(229, 237, 226, 0.76), rgba(250, 247, 239, 0.8));
}

.cal-daynum {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 9.5px;
  line-height: 1.4;
}

.cal-cell.today .cal-daynum {
  color: var(--accent-deep);
  font-weight: 700;
}

.cal-people {
  display: flex;
  align-items: center;
  gap: 3px;
  margin-top: auto;
  padding-top: 8px;
}

.cal-person {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: #b9b1a1;
  background: var(--paper);
  font-size: 9px;
  font-weight: 600;
  filter: grayscale(1);
  opacity: 0.55;
}

.cal-person.done {
  border-color: transparent;
  color: var(--ink);
  background: var(--gold-soft);
  font-size: 10px;
  filter: none;
  opacity: 1;
}

.cal-person.done.person-b {
  background: var(--moss-soft);
}

.cal-score {
  position: absolute;
  right: 6px;
  top: 5px;
  color: var(--faint);
  font-family: var(--mono);
  font-size: 7.5px;
}

.cal-dot-both {
  position: absolute;
  right: 7px;
  bottom: 8px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--moss);
}

.calendar-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 13px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px dashed var(--line);
  color: var(--faint);
  font-size: 8.5px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 4px;
}

.legend-item .cal-person {
  width: 17px;
  height: 17px;
  font-size: 8px;
}

.legend-both {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  background: var(--moss-soft);
  border: 1px solid rgba(95, 120, 98, 0.2);
}

.history-side {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.month-card {
  position: relative;
  overflow: hidden;
  padding: 21px;
  border-radius: 23px;
  color: #f7f0e3;
  background:
    radial-gradient(circle at 100% 0%, rgba(200, 149, 62, 0.25), transparent 44%),
    linear-gradient(140deg, #223835, #1b2c2a);
  box-shadow: 0 16px 36px rgba(44, 45, 32, 0.14);
}

.month-card::after {
  content: "";
  position: absolute;
  width: 150px;
  height: 150px;
  right: -56px;
  bottom: -75px;
  border: 1px solid rgba(247, 240, 227, 0.09);
  border-radius: 50%;
}

.month-card .eyebrow {
  color: #d8b784;
}

.month-card h3 {
  font-family: var(--serif);
  font-size: 21px;
  font-weight: 500;
  line-height: 1.45;
}

.month-card h3 em {
  color: #efb28e;
  font-style: normal;
}

.month-progress {
  margin-top: 18px;
}

.month-progress-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  color: rgba(247, 240, 227, 0.48);
  font-size: 9px;
}

.month-progress-top strong {
  color: #f7f0e3;
  font-family: var(--mono);
  font-size: 17px;
  font-weight: 500;
}

.month-bar {
  height: 4px;
  margin-top: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(247, 240, 227, 0.12);
}

.month-bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #dca17d, #eabf95);
}

.month-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 18px;
  padding-top: 15px;
  border-top: 1px solid rgba(247, 240, 227, 0.11);
}

.month-person {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.month-person .avatar {
  width: 30px;
  height: 30px;
  font-size: 14px;
  background: rgba(247, 240, 227, 0.1);
}

.month-person div {
  min-width: 0;
}

.month-person strong {
  display: block;
  overflow: hidden;
  color: #f7f0e3;
  font-size: 10px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.month-person span {
  color: rgba(247, 240, 227, 0.43);
  font-size: 8px;
}

.recent-card {
  padding: 18px;
  border: 1px solid rgba(223, 211, 192, 0.9);
  border-radius: 20px;
  background: var(--card);
}

.recent-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.recent-head h3 {
  font-family: var(--serif);
  font-size: 15px;
  font-weight: 600;
}

.recent-head span {
  color: var(--faint);
  font-size: 8.5px;
}

.recent-list {
  display: flex;
  flex-direction: column;
}

.recent-item {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 8px 3px;
  border: 0;
  border-top: 1px dashed var(--line);
  color: inherit;
  background: none;
  text-align: left;
  transition: background 0.2s;
}

.recent-item:first-child {
  border-top: 0;
}

.recent-item:hover {
  background: var(--paper-light);
}

.recent-date {
  width: 38px;
  flex: 0 0 auto;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 8.5px;
  line-height: 1.4;
}

.recent-date strong {
  display: block;
  color: var(--ink);
  font-family: var(--serif);
  font-size: 15px;
  font-weight: 600;
}

.recent-people {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
}

.recent-people .cal-person {
  width: 21px;
  height: 21px;
  margin-left: -4px;
  border: 1.5px solid var(--card);
  font-size: 9px;
}

.recent-people .cal-person:first-child {
  margin-left: 0;
}

.recent-desc {
  flex: 1;
  min-width: 0;
  color: var(--muted);
  font-size: 8.5px;
  line-height: 1.4;
}

.recent-score {
  color: var(--moss-deep);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
}

.empty-mini {
  padding: 16px 5px 7px;
  color: var(--faint);
  font-size: 9.5px;
  line-height: 1.7;
  text-align: center;
}

.history-empty {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 15px;
  padding: 12px 14px;
  border-radius: 11px;
  color: var(--muted);
  background: var(--paper-light);
  font-size: 9.5px;
}

.history-empty .icon {
  width: 14px;
  height: 14px;
  color: var(--gold);
}

.history-loading {
  min-height: 360px;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 11px;
}

/* --------------------------------------------------------------------------
   Settings
   -------------------------------------------------------------------------- */

.settings-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(290px, 0.75fr);
  gap: 20px;
  align-items: start;
}

.settings-column {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.settings-card {
  padding: 23px;
  border: 1px solid rgba(223, 211, 192, 0.9);
  border-radius: 22px;
  background: var(--card);
  box-shadow: var(--shadow-sm);
}

.settings-card-head {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  margin-bottom: 18px;
}

.settings-icon {
  display: grid;
  place-items: center;
  width: 37px;
  height: 37px;
  flex: 0 0 auto;
  border-radius: 11px;
  color: var(--accent-deep);
  background: var(--accent-soft);
}

.settings-icon.moss {
  color: var(--moss-deep);
  background: var(--moss-soft);
}

.settings-icon.gold {
  color: #8b6425;
  background: var(--gold-soft);
}

.settings-icon .icon {
  width: 17px;
  height: 17px;
}

.settings-card-head-text {
  flex: 1;
  min-width: 0;
}

.settings-card-head-text h2 {
  font-family: var(--serif);
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.015em;
}

.settings-card-head-text p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.6;
}

.ai-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex: 0 0 auto;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 8.5px;
  font-weight: 600;
}

.ai-status-badge::before {
  content: "";
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: currentColor;
}

.ai-status-badge.on {
  color: var(--moss-deep);
  background: var(--moss-soft);
}

.ai-status-badge.off {
  color: var(--muted);
  background: #f2ede4;
}

.ai-status-badge.warn {
  color: #8b6425;
  background: var(--gold-soft);
}

.switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--paper-light);
}

.switch-copy strong {
  display: block;
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 600;
}

.switch-copy p {
  margin-top: 2px;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.5;
}

.switch {
  position: relative;
  display: inline-block;
  width: 38px;
  height: 22px;
  flex: 0 0 auto;
}

.switch input {
  width: 0;
  height: 0;
  opacity: 0;
}

.switch-track {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: #d8cdbb;
  cursor: pointer;
  transition: background 0.2s;
}

.switch-track::before {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--card);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
  transition: transform 0.2s;
}

.switch input:checked + .switch-track {
  background: var(--moss);
}

.switch input:checked + .switch-track::before {
  transform: translateX(16px);
}

.switch input:focus-visible + .switch-track {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.settings-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 16px;
}

.settings-form .field > span {
  font-size: 10.5px;
}

.settings-form .field input,
.settings-form .field select {
  height: 42px;
  background: var(--card);
  font-size: 12px;
}

.form-grid-2 {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: 12px;
}

.key-row {
  display: flex;
  gap: 8px;
}

.key-row .field {
  flex: 1;
}

.key-row .btn {
  align-self: flex-end;
  margin-bottom: 1px;
}

.field-note {
  display: flex;
  align-items: flex-start;
  gap: 5px;
  margin-top: 5px;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.55;
}

.field-note .icon {
  width: 11px;
  height: 11px;
  margin-top: 1px;
  flex: 0 0 auto;
}

.provider-hint {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 11px;
  border-radius: 8px;
  color: var(--muted);
  background: var(--paper-light);
  font-size: 9px;
  line-height: 1.5;
}

.provider-hint a {
  flex: 0 0 auto;
  color: var(--accent-deep);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.settings-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 3px;
}

.test-result {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  margin-top: 2px;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 9.5px;
  line-height: 1.55;
}

.test-result.ok {
  color: var(--moss-deep);
  background: var(--moss-soft);
}

.test-result.bad {
  color: var(--danger);
  background: #fae9e3;
}

.settings-note {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed var(--line);
  color: var(--faint);
  font-size: 8.5px;
  line-height: 1.65;
}

.pair-info {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border-radius: 12px;
  background: var(--paper-light);
}

.pair-avatars {
  display: flex;
  align-items: center;
}

.pair-avatars .avatar {
  width: 34px;
  height: 34px;
  font-size: 17px;
  border: 2px solid var(--card);
}

.pair-avatars .avatar + .avatar {
  margin-left: -8px;
}

.pair-names {
  flex: 1;
  min-width: 0;
}

.pair-names strong {
  display: block;
  overflow: hidden;
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pair-names span {
  color: var(--muted);
  font-size: 8.5px;
}

.invite-box {
  margin-top: 12px;
  padding: 12px;
  border: 1px dashed var(--line-strong);
  border-radius: 11px;
}

.invite-box-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 8.5px;
}

.invite-box-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 6px;
}

.invite-big-code {
  color: var(--ink);
  font-family: var(--mono);
  font-size: 21px;
  font-weight: 600;
  letter-spacing: 0.16em;
}

.invite-box p {
  margin-top: 7px;
  color: var(--faint);
  font-size: 8.5px;
  line-height: 1.6;
}

.pin-form {
  display: flex;
  flex-direction: column;
  gap: 11px;
  margin-top: 10px;
}

.pin-form .field input {
  height: 40px;
  font-size: 12px;
}

.about-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.about-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 9.5px;
  line-height: 1.6;
}

.about-row strong {
  color: var(--ink-soft);
  font-weight: 500;
  text-align: right;
}

.about-row .version {
  font-family: var(--mono);
  font-size: 8.5px;
}

.privacy-note {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  padding: 10px;
  border-radius: 9px;
  color: var(--muted);
  background: var(--paper-light);
  font-size: 8.5px;
  line-height: 1.65;
}

.privacy-note .icon {
  width: 13px;
  height: 13px;
  margin-top: 1px;
  flex: 0 0 auto;
  color: var(--moss);
}

/* --------------------------------------------------------------------------
   Dialogs
   -------------------------------------------------------------------------- */

.modal {
  width: min(560px, calc(100vw - 32px));
  max-height: min(88vh, 860px);
  margin: auto;
  padding: 0;
  overflow: auto;
  border: 1px solid rgba(223, 211, 192, 0.9);
  border-radius: 24px;
  color: var(--ink);
  background: var(--card);
  box-shadow: var(--shadow-lg);
}

.modal.modal-wide {
  width: min(780px, calc(100vw - 32px));
}

.modal::backdrop {
  background: rgba(25, 35, 33, 0.42);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.modal-body {
  padding: 25px;
}

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.modal-head-text {
  min-width: 0;
}

.modal-head .eyebrow {
  margin-bottom: 6px;
}

.modal-head h2 {
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.4;
}

.modal-head p {
  margin-top: 5px;
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.65;
}

.modal-close {
  width: 31px;
  height: 31px;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--muted);
  background: var(--paper-light);
  font-size: 15px;
  line-height: 1;
}

.modal-close:hover {
  color: var(--ink);
  background: var(--paper);
}

.assign-form {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.segmented {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper-light);
}

.segmented label {
  position: relative;
  cursor: pointer;
}

.segmented input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.segmented span {
  display: block;
  padding: 7px 8px;
  border-radius: 7px;
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 600;
  text-align: center;
  transition: background 0.2s, color 0.2s, box-shadow 0.2s;
}

.segmented input:checked + span {
  color: var(--ink);
  background: var(--card);
  box-shadow: var(--shadow-sm);
}

.segmented input:focus-visible + span {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.assign-form textarea {
  width: 100%;
  min-height: 120px;
  padding: 12px 13px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 11px;
  color: var(--ink);
  background: var(--paper-light);
  font-family: var(--serif);
  font-size: 15px;
  line-height: 1.75;
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}

.assign-form textarea::placeholder {
  color: var(--faint);
  font-family: var(--sans);
  font-size: 11px;
}

.assign-form textarea:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--card);
  box-shadow: 0 0 0 3px rgba(210, 95, 67, 0.07);
}

.assign-form .field input {
  height: 41px;
  font-size: 12px;
  background: var(--paper-light);
}

.assign-more {
  border-top: 1px dashed var(--line);
  padding-top: 11px;
}

.assign-more > summary {
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--muted);
  font-size: 9.5px;
  cursor: pointer;
  list-style: none;
}

.assign-more > summary::-webkit-details-marker {
  display: none;
}

.assign-more-fields {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 11px;
}

.assign-info {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.6;
}

.assign-info .icon {
  width: 12px;
  height: 12px;
  margin-top: 1px;
  color: var(--gold);
}

.modal-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding-top: 3px;
}

.day-detail-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 15px;
  margin-bottom: 16px;
}

.day-date-badge {
  display: flex;
  align-items: center;
  gap: 11px;
}

.day-date-badge .day-number {
  font-family: var(--serif);
  font-size: 45px;
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.05em;
}

.day-date-badge .day-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.day-date-badge .day-meta strong {
  font-family: var(--serif);
  font-size: 15px;
  font-weight: 600;
}

.day-date-badge .day-meta span {
  color: var(--muted);
  font-size: 9px;
}

.day-pair-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 9px;
  border-radius: 999px;
  color: var(--moss-deep);
  background: var(--moss-soft);
  font-size: 8.5px;
  font-weight: 600;
}

.day-pair-status.partial {
  color: #8b6425;
  background: var(--gold-soft);
}

.day-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 13px;
}

.detail-person {
  min-width: 0;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--paper-light);
}

.detail-person-head {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 9px;
}

.detail-person-head .avatar {
  width: 28px;
  height: 28px;
  font-size: 14px;
}

.detail-person-head strong {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  font-family: var(--serif);
  font-size: 13px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.detail-source {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 8px;
  letter-spacing: 0.04em;
}

.detail-task-text {
  color: var(--ink);
  font-family: var(--serif);
  font-size: 12px;
  line-height: 1.7;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.detail-answer {
  margin-top: 10px;
  padding-top: 9px;
  border-top: 1px dashed var(--line);
}

.detail-answer-label {
  color: var(--muted);
  font-size: 8px;
  letter-spacing: 0.03em;
}

.detail-answer-text {
  margin-top: 4px;
  color: var(--ink-soft);
  font-family: Georgia, var(--serif);
  font-size: 11.5px;
  line-height: 1.75;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.detail-empty {
  padding: 14px 0;
  color: var(--faint);
  font-size: 9.5px;
  text-align: center;
}

.detail-score-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 9px;
  padding: 6px 8px;
  border-radius: 7px;
  background: var(--moss-soft);
}

.detail-score-row span {
  color: var(--moss-deep);
  font-size: 8px;
}

.detail-score-row strong {
  color: var(--moss-deep);
  font-family: var(--mono);
  font-size: 12px;
}

.detail-feedback {
  margin-top: 5px;
  color: var(--muted);
  font-size: 8.5px;
  line-height: 1.55;
}

.detail-comments {
  margin-top: 9px;
  padding-top: 8px;
  border-top: 1px dashed var(--line);
}

.detail-comment {
  margin-top: 4px;
  color: var(--ink-soft);
  font-size: 8.5px;
  line-height: 1.5;
}

.detail-comment strong {
  color: var(--accent-deep);
  font-weight: 600;
}

.day-dialog-foot {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 17px;
}

/* --------------------------------------------------------------------------
   Toast
   -------------------------------------------------------------------------- */

.toast-host {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: min(92vw, 480px);
  pointer-events: none;
  transform: translateX(-50%);
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  max-width: 100%;
  padding: 10px 15px;
  border: 1px solid rgba(255, 253, 248, 0.1);
  border-radius: 999px;
  color: #f8f1e4;
  background: rgba(30, 44, 42, 0.96);
  box-shadow: 0 12px 30px rgba(30, 44, 42, 0.24);
  font-size: 11.5px;
  line-height: 1.5;
  animation: toast-in 0.28s cubic-bezier(0.22, 1, 0.36, 1) both;
  pointer-events: auto;
}

.toast.toast-error {
  background: rgba(126, 49, 35, 0.97);
}

.toast .toast-icon {
  color: #e6b487;
  font-size: 12px;
  line-height: 1.4;
}

.toast.toast-error .toast-icon {
  color: #ffc8b7;
}

.toast.toast-out {
  animation: toast-out 0.25s ease both;
}

/* --------------------------------------------------------------------------
   Utility / states
   -------------------------------------------------------------------------- */

.spinner {
  display: inline-block;
  width: 13px;
  height: 13px;
  border: 1.5px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

.empty-page {
  padding: 60px 20px;
  text-align: center;
}

.empty-page h2 {
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 600;
}

.empty-page p {
  margin-top: 8px;
  color: var(--muted);
  font-size: 11px;
}

.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;
}

/* --------------------------------------------------------------------------
   Motion
   -------------------------------------------------------------------------- */

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes fade-up {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes gentle-pulse {
  0%, 100% { transform: scale(1); opacity: 0.9; }
  50% { transform: scale(1.04); opacity: 1; }
}

@keyframes dot-bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.5; }
  30% { transform: translateY(-3px); opacity: 1; }
}

@keyframes dot-fade {
  0%, 100% { opacity: 0.3; transform: scale(0.9); }
  50% { opacity: 0.9; transform: scale(1.1); }
}

@keyframes shimmer {
  from { transform: translateX(-120%); }
  to { transform: translateX(280%); }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(8px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes toast-out {
  from { opacity: 1; transform: translateY(0); }
  to { opacity: 0; transform: translateY(6px); }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */

@media (max-width: 1050px) {
  .auth-view {
    grid-template-columns: minmax(0, 1fr) minmax(410px, 0.95fr);
  }

  .auth-art-inner {
    padding-left: 36px;
    padding-right: 36px;
  }

  .auth-copy h1 {
    font-size: 38px;
  }

  .auth-sample {
    width: 100%;
  }

  .day-hero {
    grid-template-columns: minmax(0, 1fr) 310px;
    gap: 28px;
  }

  .history-layout {
    grid-template-columns: minmax(0, 1fr) 280px;
  }
}

@media (max-width: 900px) {
  .auth-view {
    display: block;
  }

  .auth-art {
    display: none;
  }

  .auth-panel {
    min-height: 100vh;
    padding: 38px 26px;
  }

  .auth-mobile-brand {
    display: flex;
  }

  .auth-panel-inner {
    width: min(100%, 440px);
  }

  .topbar {
    gap: 18px;
  }

  .pair-chip {
    display: none;
  }

  .page-content {
    padding-top: 25px;
  }

  .day-hero {
    grid-template-columns: minmax(0, 1fr);
    gap: 24px;
  }

  .hero-side {
    padding-top: 22px;
    padding-left: 0;
    border-top: 1px solid rgba(247, 240, 227, 0.11);
    border-left: 0;
  }

  .pair-track {
    max-width: 420px;
  }

  .hero-metrics {
    max-width: 380px;
  }

  .workspace {
    grid-template-columns: minmax(0, 1fr);
  }

  .task-card {
    padding: 23px;
  }

  .stats-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .history-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .history-side {
    order: 2;
  }

  .month-card {
    position: static;
  }

  .settings-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .settings-column {
    gap: 16px;
  }
}

@media (max-width: 760px) {
  .topbar {
    height: 64px;
    padding: 0 17px;
    background: rgba(244, 239, 229, 0.94);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  .topbar .brand-text small {
    display: none;
  }

  .topbar .brand-text strong {
    font-size: 21px;
  }

  .topbar .brand-mark {
    width: 29px;
    height: 23px;
  }

  .topbar .brand-mark i {
    width: 18px;
    height: 18px;
  }

  .topbar .brand-mark i:first-child {
    left: 0;
  }

  .topbar .brand-mark i:last-child {
    right: 0;
  }

  .topbar-actions {
    margin-left: auto;
    gap: 6px;
  }

  .topbar-actions .icon-button {
    width: 32px;
    height: 32px;
  }

  .topbar-actions .icon-button .icon {
    width: 15px;
    height: 15px;
  }

  #logout-button {
    display: none;
  }

  .main-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 60;
    display: flex;
    justify-content: space-around;
    gap: 0;
    margin: 0;
    padding: 6px 14px calc(6px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--line);
    border-radius: 0;
    background: rgba(250, 246, 237, 0.95);
    box-shadow: 0 -8px 28px rgba(64, 50, 30, 0.06);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
  }

  .nav-item {
    flex: 1;
    flex-direction: column;
    gap: 2px;
    max-width: 110px;
    padding: 5px 12px;
    border-radius: 10px;
    font-size: 9.5px;
  }

  .nav-item.active {
    background: transparent;
    box-shadow: none;
  }

  .nav-icon .icon {
    width: 19px;
    height: 19px;
  }

  .page-content {
    padding: 20px 15px 100px;
  }

  .site-footer {
    display: none;
  }

  .page-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 13px;
    margin-bottom: 18px;
  }

  .page-head h1 {
    font-size: 29px;
  }

  .page-head p:not(.eyebrow) {
    font-size: 11px;
  }

  .day-hero {
    padding: 24px 20px;
    border-radius: 22px;
  }

  .day-hero h1 {
    margin-top: 15px;
    font-size: clamp(26px, 7vw, 34px);
    line-height: 1.45;
  }

  .hero-sub {
    font-size: 11.5px;
  }

  .hero-signature {
    display: none;
  }

  .hero-side {
    padding-top: 18px;
  }

  .track-person .avatar {
    width: 39px;
    height: 39px;
    font-size: 19px;
  }

  .hero-metric {
    padding: 10px 12px;
  }

  .hero-metric strong {
    font-size: 20px;
  }

  .setup-banner {
    align-items: flex-start;
    flex-wrap: wrap;
    padding: 11px 13px;
  }

  .setup-banner .setup-icon {
    width: 24px;
    height: 24px;
  }

  .setup-banner .btn {
    margin-left: 37px;
  }

  .invite-banner {
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 12px;
    padding: 14px;
  }

  .invite-icon {
    width: 34px;
    height: 34px;
  }

  .invite-actions {
    width: 100%;
    justify-content: flex-end;
  }

  .workspace {
    gap: 15px;
    margin-top: 15px;
  }

  .task-card {
    padding: 19px 17px;
    border-radius: 20px;
  }

  .task-card::before {
    top: 18px;
    height: 22px;
  }

  .card-head {
    gap: 9px;
  }

  .avatar {
    width: 37px;
    height: 37px;
    font-size: 18px;
  }

  .card-head-text h2 {
    font-size: 16px;
  }

  .card-head-actions .btn {
    min-height: 30px;
    padding: 5px 9px;
    font-size: 10px;
  }

  .task-meta {
    margin-top: 16px;
  }

  .source-panel {
    padding: 15px 15px 13px;
  }

  .source-text,
  .source-text.lang-en {
    font-size: 17px;
  }

  .composer-foot {
    align-items: stretch;
    flex-direction: column;
    gap: 9px;
  }

  .composer-actions {
    width: 100%;
  }

  .composer-actions .btn {
    width: 100%;
  }

  .answer-input {
    min-height: 140px;
    font-size: 14.5px;
  }

  .answer-text {
    font-size: 14px;
  }

  .grade-main {
    gap: 11px;
  }

  .score-ring {
    width: 58px;
    height: 58px;
  }

  .score-ring strong {
    font-size: 17px;
  }

  .ai-panel-body {
    padding: 12px;
  }

  .dimension-grid {
    gap: 6px 10px;
  }

  .comments {
    margin-top: 13px;
  }

  .stats-row {
    gap: 9px;
    margin-bottom: 15px;
  }

  .stat-card {
    padding: 13px 14px;
    border-radius: 14px;
  }

  .stat-card strong {
    font-size: 23px;
  }

  .calendar-card {
    padding: 15px;
    border-radius: 19px;
  }

  .calendar-head {
    margin-bottom: 12px;
  }

  .calendar-title h2 {
    font-size: 19px;
  }

  .weekday-row,
  .calendar-grid {
    gap: 4px;
  }

  .cal-cell {
    min-height: 61px;
    padding: 5px;
    border-radius: 7px;
  }

  .cal-daynum {
    font-size: 8.5px;
  }

  .cal-people {
    gap: 2px;
    padding-top: 4px;
  }

  .cal-person {
    width: 17px;
    height: 17px;
    font-size: 8px;
  }

  .cal-person.done {
    font-size: 8.5px;
  }

  .cal-score {
    display: none;
  }

  .cal-dot-both {
    right: 5px;
    bottom: 6px;
    width: 3px;
    height: 3px;
  }

  .calendar-legend {
    gap: 9px;
    font-size: 7.5px;
  }

  .month-card,
  .recent-card {
    border-radius: 19px;
  }

  .settings-card {
    padding: 18px;
    border-radius: 19px;
  }

  .settings-card-head {
    margin-bottom: 15px;
  }

  .settings-card-head-text h2 {
    font-size: 17px;
  }

  .form-grid-2 {
    grid-template-columns: minmax(0, 1fr);
  }

  .modal {
    width: calc(100vw - 20px);
    max-height: calc(100dvh - 24px);
    border-radius: 20px;
  }

  .modal-body {
    padding: 19px;
  }

  .modal-head h2 {
    font-size: 21px;
  }

  .day-detail-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .day-date-badge .day-number {
    font-size: 39px;
  }

  .toast-host {
    bottom: 82px;
  }

  .toast {
    border-radius: 14px;
    font-size: 10.5px;
  }

  .field-row {
    grid-template-columns: minmax(0, 1fr);
  }

  .auth-panel {
    padding: 28px 20px 38px;
  }

  .auth-mobile-brand {
    margin-bottom: 27px;
  }

  .auth-heading h2 {
    font-size: 27px;
  }

  .auth-tabs {
    margin-bottom: 21px;
  }
}

@media (max-width: 380px) {
  .page-content {
    padding-left: 12px;
    padding-right: 12px;
  }

  .cal-cell {
    min-height: 55px;
    padding: 4px;
  }

  .cal-person {
    width: 15px;
    height: 15px;
    font-size: 7px;
  }

  .invite-actions {
    flex-wrap: wrap;
  }

  .hero-metrics {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   v2 · question bank, politics questions, photo records
   ========================================================================== */

.page-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.badge-politics {
  border-color: rgba(200, 149, 62, 0.28);
  color: #7c5a22;
  background: var(--gold-soft);
  font-family: var(--sans);
  font-size: 9px;
  letter-spacing: 0.02em;
}

.politics-source {
  background:
    radial-gradient(circle at 100% 0, rgba(180, 75, 55, 0.055), transparent 48%),
    linear-gradient(160deg, #faf5eb, #fbf7ef);
}

.politics-source .source-label span:first-child {
  color: #a36c30;
}

/* Photo editor inside the answer composer */

.photo-editor {
  margin-top: 11px;
  padding: 11px 12px;
  border: 1px dashed var(--line-strong);
  border-radius: 12px;
  background: rgba(250, 247, 239, 0.65);
}

.photo-editor-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: 9.5px;
}

.photo-editor-head > span:first-child {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
}

.photo-editor-head .icon {
  color: var(--accent);
}

.photo-editor-head em {
  color: var(--faint);
  font-style: normal;
  font-size: 8.5px;
}

.photo-count {
  flex: 0 0 auto;
  font-family: var(--mono);
  font-size: 8px;
}

.photo-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 9px;
}

.photo-tile {
  position: relative;
  width: 66px;
  height: 66px;
  flex: 0 0 auto;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
}

.photo-tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.photo-tile.pending {
  border-color: rgba(210, 95, 67, 0.3);
}

.photo-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  display: grid;
  place-items: center;
  width: 23px;
  height: 23px;
  padding: 0;
  border: 1px solid rgba(255, 253, 248, 0.6);
  border-radius: 50%;
  color: #fffdf8;
  background: rgba(32, 48, 47, 0.62);
}

.photo-remove:hover {
  background: var(--accent-deep);
}

.photo-add {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  width: 66px;
  height: 66px;
  flex: 0 0 auto;
  padding: 0;
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  color: var(--ink-soft);
  background: rgba(255, 253, 248, 0.55);
  font-size: 8.5px;
}

.photo-add:hover {
  color: var(--accent-deep);
  border-color: var(--accent);
  background: var(--accent-soft);
}

.photo-add.album {
  color: var(--muted);
}

.photo-add .icon {
  width: 17px;
  height: 17px;
}

.photo-processing {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  color: var(--muted);
  font-size: 8px;
}

.submission-photos {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.submission-photo {
  width: 80px;
  height: 80px;
  flex: 0 0 auto;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--paper);
}

.submission-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.25s ease;
}

.submission-photo:hover img {
  transform: scale(1.045);
}

.photo-only-note {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 12px;
  border-radius: 8px;
  color: var(--muted);
  background: var(--paper-light);
  font-size: 10px;
}

.photo-only-note .icon {
  color: var(--accent);
}

.modal-photo {
  width: min(900px, calc(100vw - 28px));
  max-height: 92vh;
  background: #121b1a;
  border-color: rgba(255, 253, 248, 0.12);
}

.photo-viewer {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 200px;
  padding: 14px;
}

.photo-viewer > img {
  display: block;
  max-width: 100%;
  max-height: calc(90vh - 90px);
  border-radius: 10px;
  object-fit: contain;
}

.photo-viewer-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid rgba(255, 253, 248, 0.25);
  border-radius: 50%;
  color: #f8f1e4;
  background: rgba(20, 30, 28, 0.6);
}

.photo-viewer-foot {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 10px;
  color: rgba(248, 241, 228, 0.65);
  font-family: var(--mono);
  font-size: 10px;
}

.photo-viewer-foot .icon-button {
  border-color: rgba(255, 253, 248, 0.2);
  color: #f8f1e4;
  background: rgba(255, 253, 248, 0.08);
}

/* Politics objective questions */

.objective-composer .composer-label {
  margin-bottom: 8px;
}

.choice-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.choice-option {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--ink-soft);
  background: var(--paper-light);
  cursor: pointer;
  transition: border-color 0.18s, background 0.18s, box-shadow 0.18s;
}

.choice-option:hover {
  border-color: var(--line-strong);
  background: var(--card);
}

.choice-option.selected {
  border-color: rgba(210, 95, 67, 0.5);
  background: #fdf3eb;
  box-shadow: 0 0 0 2px rgba(210, 95, 67, 0.06);
}

.choice-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.choice-key {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  color: var(--muted);
  background: var(--card);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
}

.choice-option.selected .choice-key {
  border-color: var(--accent);
  color: #fff9ef;
  background: var(--accent);
}

.choice-text {
  flex: 1;
  min-width: 0;
  padding-top: 1px;
  font-size: 12px;
  line-height: 1.65;
  overflow-wrap: anywhere;
}

.choice-mark {
  display: none;
  color: var(--accent);
}

.choice-option.selected .choice-mark {
  display: inline-flex;
  padding-top: 4px;
}

.choice-mark .icon {
  width: 13px;
  height: 13px;
}

.objective-note {
  margin-top: 10px;
  border-top: 1px dashed var(--line);
  padding-top: 8px;
}

.objective-note > summary {
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--muted);
  font-size: 9.5px;
  cursor: pointer;
  list-style: none;
}

.objective-note > summary::-webkit-details-marker {
  display: none;
}

.objective-note > summary span {
  color: var(--faint);
}

.note-input {
  display: block;
  width: 100%;
  min-height: 68px;
  margin-top: 7px;
  padding: 9px 11px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--ink);
  background: var(--card);
  font-family: var(--sans);
  font-size: 11px;
  line-height: 1.65;
}

.note-input:focus {
  outline: none;
  border-color: var(--accent);
}

.objective-note-text {
  display: flex;
  gap: 7px;
  margin-top: 10px;
  padding: 10px 11px;
  border-radius: 9px;
  color: var(--ink-soft);
  background: var(--paper-light);
}

.objective-note-text .icon {
  color: var(--gold);
  margin-top: 2px;
}

.objective-note-text strong {
  display: block;
  color: var(--muted);
  font-size: 8.5px;
  font-weight: 600;
}

.objective-note-text p {
  margin-top: 2px;
  font-size: 10.5px;
  line-height: 1.65;
  white-space: pre-wrap;
}

.option-results {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 12px;
}

.option-result {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--ink-soft);
  background: var(--paper-light);
}

.option-result .choice-text {
  font-size: 11px;
}

.option-result.is-selected {
  border-color: rgba(72, 110, 136, 0.3);
}

.option-result.is-correct {
  border-color: rgba(95, 120, 98, 0.42);
  background: var(--moss-soft);
}

.option-result.is-wrong {
  border-color: rgba(180, 73, 54, 0.3);
  background: #faece7;
}

.option-result.is-correct .choice-key {
  border-color: var(--moss);
  color: #fffdf8;
  background: var(--moss);
}

.option-result.is-wrong .choice-key {
  border-color: var(--danger);
  color: #fffdf8;
  background: var(--danger);
}

.option-markers {
  display: flex;
  gap: 4px;
  flex: 0 0 auto;
  padding-top: 4px;
}

.marker-correct {
  color: var(--moss-deep);
}

.marker-wrong {
  color: var(--danger);
}

.marker-selected {
  color: var(--blue);
}

.option-markers .icon {
  width: 13px;
  height: 13px;
}

.objective-result {
  display: flex;
  gap: 10px;
  margin-top: 12px;
  padding: 12px;
  border-radius: 11px;
}

.objective-result.correct {
  color: var(--moss-deep);
  background: var(--moss-soft);
}

.objective-result.wrong {
  color: #8f3c2b;
  background: #fae9e3;
}

.objective-result.pending {
  color: var(--muted);
  background: var(--paper-light);
}

.objective-result-icon {
  flex: 0 0 auto;
  padding-top: 1px;
}

.objective-result-copy {
  flex: 1;
  min-width: 0;
}

.objective-result-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  font-size: 11px;
}

.objective-result-head span {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
}

.objective-result-copy p {
  margin-top: 3px;
  color: var(--ink-soft);
  font-size: 10px;
  line-height: 1.6;
}

.correct-answer {
  display: inline-block;
  margin-top: 5px;
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 600;
}

.objective-explanation {
  margin-top: 7px;
  padding-top: 7px;
  border-top: 1px dashed rgba(64, 50, 30, 0.15);
}

.objective-explanation > summary {
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--ink-soft);
  font-size: 9px;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}

.objective-explanation > summary::-webkit-details-marker {
  display: none;
}

.objective-explanation p {
  margin-top: 5px;
  color: var(--ink-soft);
  font-size: 9.5px;
  line-height: 1.7;
  white-space: pre-wrap;
}

/* Library */

.library-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 17px;
}

.filter-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  padding: 4px;
  border-radius: 999px;
  background: rgba(255, 253, 248, 0.55);
  border: 1px solid var(--line);
}

.filter-tab {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 12px;
  border: 0;
  border-radius: 999px;
  color: var(--muted);
  background: transparent;
  font-size: 10.5px;
  font-weight: 600;
}

.filter-tab span {
  color: var(--faint);
  font-family: var(--mono);
  font-size: 8px;
}

.filter-tab:hover {
  color: var(--ink);
}

.filter-tab.active {
  color: var(--ink);
  background: var(--card);
  box-shadow: var(--shadow-sm);
}

.filter-tab.active span {
  color: var(--accent);
}

.library-search {
  display: flex;
  align-items: center;
  gap: 7px;
  width: min(260px, 100%);
  height: 36px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--faint);
  background: rgba(255, 253, 248, 0.62);
}

.library-search:focus-within {
  border-color: var(--accent);
  background: var(--card);
}

.library-search .icon {
  width: 14px;
  height: 14px;
}

.library-search input {
  width: 100%;
  min-width: 0;
  padding: 0;
  border: 0;
  outline: none;
  color: var(--ink);
  background: transparent;
  font-size: 11px;
}

.library-search input::placeholder {
  color: var(--faint);
}

.library-notice {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 15px;
  padding: 9px 12px;
  border-radius: 9px;
  color: var(--muted);
  background: var(--paper-light);
  font-size: 9.5px;
}

.library-notice .icon {
  color: var(--gold);
}

.material-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.material-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 17px;
  border: 1px solid rgba(223, 211, 192, 0.9);
  border-radius: 18px;
  background: var(--card);
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s, box-shadow 0.2s;
}

.material-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(64, 50, 30, 0.07);
}

.material-card[hidden] {
  display: none;
}

.material-top {
  display: flex;
  align-items: center;
  gap: 6px;
}

.material-kind {
  display: inline-flex;
  align-items: center;
  padding: 3px 7px;
  border-radius: 4px;
  font-size: 8px;
  font-weight: 600;
}

.material-kind.kind-translation {
  color: var(--blue);
  background: var(--blue-soft);
}

.material-kind.kind-politics {
  color: #855c1f;
  background: var(--gold-soft);
}

.material-type {
  color: var(--faint);
  font-size: 8.5px;
}

.material-owner {
  margin-left: auto;
  color: var(--faint);
  font-size: 8.5px;
}

.material-card h2 {
  margin-top: 10px;
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 600;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.material-snippet {
  margin-top: 5px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.65;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  overflow-wrap: anywhere;
}

.material-options-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 9px;
}

.material-options-preview span {
  padding: 3px 6px;
  border-radius: 4px;
  color: var(--ink-soft);
  background: var(--paper-light);
  font-size: 8px;
  line-height: 1.4;
}

.material-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 9px;
  margin-top: auto;
  padding-top: 13px;
  border-top: 1px dashed var(--line);
  color: var(--faint);
  font-size: 8px;
}

.material-actions {
  display: flex;
  align-items: center;
  gap: 5px;
}

.material-actions .btn {
  min-height: 29px;
  padding: 4px 9px;
  font-size: 9.5px;
}

.material-edit,
.material-delete {
  width: 29px;
  height: 29px;
}

.material-edit .icon,
.material-delete .icon {
  width: 12px;
  height: 12px;
}

.material-delete {
  color: var(--faint);
}

.material-delete:hover {
  color: var(--danger);
  border-color: rgba(180, 73, 54, 0.3);
}

.library-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 270px;
  padding: 40px 20px;
  border: 1px dashed var(--line-strong);
  border-radius: 22px;
  background: rgba(255, 253, 248, 0.45);
  text-align: center;
}

.library-empty[hidden] {
  display: none;
}

.library-empty-mark {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  margin-bottom: 13px;
  border-radius: 50%;
  color: var(--gold);
  background: var(--gold-soft);
}

.library-empty-mark .icon {
  width: 26px;
  height: 26px;
}

.library-empty h2 {
  font-family: var(--serif);
  font-size: 21px;
  font-weight: 600;
}

.library-empty p {
  max-width: 360px;
  margin-top: 6px;
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.7;
}

.library-empty-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 15px;
}

.library-foot-note {
  display: flex;
  align-items: flex-start;
  gap: 5px;
  margin-top: 17px;
  color: var(--faint);
  font-size: 8.5px;
  line-height: 1.6;
}

/* Shared question form */

.question-form {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.question-kind-switch {
  margin-bottom: 2px;
}

.question-fields {
  display: flex;
  flex-direction: column;
  gap: 13px;
}

.question-fields[hidden] {
  display: none;
}

.question-textarea {
  width: 100%;
  min-height: 116px;
  padding: 11px 13px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 11px;
  color: var(--ink);
  background: var(--paper-light);
  font-family: var(--serif);
  font-size: 14px;
  line-height: 1.7;
  transition: border-color 0.2s, background 0.2s;
}

.question-textarea.short {
  min-height: 76px;
  font-size: 12px;
}

.question-textarea::placeholder {
  color: var(--faint);
  font-family: var(--sans);
  font-size: 10.5px;
}

.question-textarea:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--card);
}

.question-form .field > span {
  font-size: 10.5px;
}

.question-form .field input {
  background: var(--paper-light);
}

.question-form .modal-actions {
  margin-top: 2px;
}

/* Make question option textareas nicer on narrow screens */

@media (max-width: 760px) {
  .page-actions {
    width: 100%;
  }

  .page-actions .btn {
    flex: 1;
  }

  .library-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .filter-tabs {
    justify-content: space-between;
  }

  .filter-tab {
    flex: 1;
    justify-content: center;
    padding: 7px 6px;
    font-size: 9.5px;
  }

  .library-search {
    width: 100%;
  }

  .material-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
  }

  .material-card {
    padding: 15px;
    border-radius: 15px;
  }

  .material-card h2 {
    font-size: 16px;
  }

  .material-foot {
    flex-wrap: wrap;
    gap: 8px;
  }

  .material-actions {
    margin-left: auto;
  }

  .photo-tile,
  .photo-add {
    width: 60px;
    height: 60px;
  }

  .submission-photo {
    width: 68px;
    height: 68px;
  }

  .choice-option {
    padding: 9px 10px;
  }

  .choice-text {
    font-size: 11.5px;
  }

  .modal-photo {
    width: calc(100vw - 20px);
  }

  .photo-viewer {
    padding: 10px;
  }

  .photo-viewer > img {
    max-height: calc(92vh - 90px);
  }
}

@media (max-width: 380px) {
  .photo-tile,
  .photo-add {
    width: 53px;
    height: 53px;
  }

  .photo-editor-head em {
    display: none;
  }
}

.cal-cell-flags {
  display: flex;
  align-items: center;
  gap: 3px;
  min-width: 0;
}

.cal-kind-mini {
  display: inline-grid;
  place-items: center;
  height: 13px;
  padding: 0 3px;
  border-radius: 3px;
  color: #8a6223;
  background: var(--gold-soft);
  font-family: var(--sans);
  font-size: 7px;
  font-weight: 600;
  line-height: 1;
}

.cal-photo-mini {
  display: inline-flex;
  align-items: center;
  gap: 1px;
  color: var(--faint);
  font-family: var(--mono);
  font-size: 7px;
}

.cal-photo-mini .icon {
  width: 8px;
  height: 8px;
}

.recent-desc em {
  display: block;
  margin-top: 1px;
  overflow: hidden;
  color: var(--faint);
  font-style: normal;
  font-size: 7.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 760px) {
  .cal-kind-mini {
    height: 12px;
    padding: 0 2px;
    font-size: 6.5px;
  }

  .cal-photo-mini {
    font-size: 6.5px;
  }
}

.choice-option:focus-within {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.photo-add:focus-visible,
.submission-photo:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ==========================================================================
   v3 · multi-question day, custom subjects, daily plan
   ========================================================================== */

.segmented.question-kind-switch.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.segmented.question-kind-switch.three span {
  padding-left: 4px;
  padding-right: 4px;
  font-size: 10px;
}

.badge-custom {
  border-color: rgba(72, 110, 136, 0.25);
  color: #3f6179;
  background: var(--blue-soft);
  font-family: var(--sans);
  font-size: 9px;
  letter-spacing: 0.02em;
}

.custom-source {
  background:
    radial-gradient(circle at 100% 0, rgba(72, 110, 136, 0.07), transparent 45%),
    linear-gradient(160deg, #f8f6ef, #fbf8f1);
}

.custom-source .source-label span:first-child {
  color: var(--blue);
}

.material-kind.kind-custom {
  color: var(--blue);
  background: var(--blue-soft);
}

.daily-plan-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper-light);
}

.daily-plan-copy {
  min-width: 0;
}

.daily-plan-copy strong {
  display: block;
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 600;
}

.daily-plan-copy p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.55;
}

.stepper {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: 0 0 auto;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
}

.stepper-btn {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: var(--ink-soft);
  background: transparent;
  font-size: 18px;
  line-height: 1;
}

.stepper-btn:hover {
  color: var(--accent-deep);
  background: var(--accent-soft);
}

.stepper-value {
  display: grid;
  place-items: center;
  width: 34px;
  color: var(--ink);
  font-family: var(--mono);
  font-size: 16px;
  font-weight: 600;
}

.daily-plan-card .settings-actions {
  margin-top: 11px;
}

/* Multiple questions in one person's card */

.task-switcher {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 15px;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--paper-light);
}

.task-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  flex: 1;
  min-width: 0;
}

.task-chip {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-width: 47px;
  height: 32px;
  padding: 0 8px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--muted);
  background: rgba(255, 253, 248, 0.45);
  font-size: 9px;
}

.task-chip:hover {
  color: var(--ink);
  border-color: var(--line-strong);
  background: var(--card);
}

.task-chip.active {
  color: var(--ink);
  border-color: rgba(210, 95, 67, 0.38);
  background: var(--accent-soft);
  box-shadow: 0 0 0 2px rgba(210, 95, 67, 0.06);
}

.task-chip.done {
  color: var(--moss-deep);
}

.task-chip-index {
  font-family: var(--mono);
  font-size: 8px;
  opacity: 0.7;
}

.task-chip-kind {
  font-family: var(--serif);
  font-size: 11px;
  font-weight: 600;
}

.task-chip-state {
  display: inline-grid;
  place-items: center;
  width: 11px;
  height: 11px;
  color: var(--moss);
}

.task-chip-state .icon {
  width: 9px;
  height: 9px;
}

.task-switcher-count {
  flex: 0 0 auto;
  color: var(--faint);
  font-family: var(--mono);
  font-size: 9px;
}

.selected-task {
  margin-top: 13px;
  animation: fade-up 0.2s ease both;
}

.selected-task-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 9px;
  border-bottom: 1px dashed var(--line);
}

.selected-task-label {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 600;
}

.selected-task-type {
  color: var(--faint);
  font-size: 8.5px;
  font-weight: 400;
}

.selected-task-actions {
  display: flex;
  align-items: center;
  gap: 9px;
}

.task-done-label {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  color: var(--moss-deep);
  font-size: 8.5px;
  white-space: nowrap;
}

.task-done-label .icon {
  width: 11px;
  height: 11px;
}

.task-delete {
  color: var(--faint);
  font-weight: 500;
}

.task-delete:hover {
  color: var(--danger);
}

.waiting-state.compact {
  min-height: 160px;
  padding: 25px 20px;
}

.waiting-state.compact .waiting-avatars {
  margin-bottom: 8px;
}

.waiting-state.compact h3 {
  font-size: 15px;
}

.card-head .task-switcher + .selected-task .source-panel {
  margin-top: 12px;
}

/* Mobile adjustments */

@media (max-width: 760px) {
  .task-switcher {
    align-items: flex-start;
    gap: 5px;
    padding: 6px;
  }

  .task-chips {
    gap: 4px;
  }

  .task-chip {
    min-width: 42px;
    height: 30px;
    padding: 0 6px;
  }

  .task-chip-index {
    font-size: 7px;
  }

  .task-chip-kind {
    font-size: 10px;
  }

  .task-switcher-count {
    padding-top: 8px;
    font-size: 8px;
  }

  .selected-task-head {
    align-items: flex-start;
  }

  .selected-task-actions {
    gap: 6px;
  }

  .daily-plan-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .stepper {
    align-self: flex-end;
  }

  .segmented.question-kind-switch.three span {
    font-size: 9px;
  }
}

.cal-person.partial {
  opacity: 0.62;
  filter: grayscale(0.55);
  border-style: dashed;
}

.cal-fraction {
  color: var(--muted);
  font-size: 7px;
  letter-spacing: -0.02em;
}

.cal-kind-mini.custom {
  color: #3f6179;
  background: var(--blue-soft);
}

/* Multi-question history detail */

.detail-task-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.detail-task-item {
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(255, 253, 248, 0.55);
  overflow: hidden;
}

.detail-task-item > summary {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 8px;
  color: var(--ink-soft);
  font-size: 8.5px;
  cursor: pointer;
  list-style: none;
}

.detail-task-item > summary::-webkit-details-marker {
  display: none;
}

.detail-task-item[open] > summary {
  border-bottom: 1px solid var(--line);
  background: var(--paper-light);
}

.detail-task-index {
  color: var(--faint);
  font-family: var(--mono);
  font-size: 7.5px;
}

.detail-task-kind {
  flex: 0 0 auto;
  color: var(--accent-deep);
  font-size: 8px;
  font-weight: 600;
}

.detail-task-brief {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.detail-task-status {
  flex: 0 0 auto;
  color: var(--faint);
  font-family: var(--mono);
  font-size: 8px;
}

.detail-task-status.done {
  color: var(--moss-deep);
}

.detail-task-body {
  padding: 8px;
}

.detail-task-body .detail-task-source {
  color: var(--ink-soft);
  font-family: var(--serif);
  font-size: 10.5px;
  line-height: 1.6;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.detail-task-body .option-results {
  margin-top: 7px;
}

.detail-task-body .option-result {
  padding: 5px 7px;
}

.detail-task-body .option-result .choice-text {
  font-size: 9.5px;
}

.detail-task-body .detail-answer-text {
  margin-top: 7px;
  padding-top: 7px;
  border-top: 1px dashed var(--line);
  font-size: 10px;
}

.detail-task-body .submission-photos {
  margin-top: 7px;
}

.detail-task-body .submission-photo {
  width: 55px;
  height: 55px;
}

.detail-task-body .objective-result {
  margin-top: 7px;
  padding: 8px;
}

.detail-task-body .detail-feedback {
  margin-top: 5px;
  font-size: 8.5px;
}

.detail-task-body .detail-comments {
  margin-top: 6px;
}

.detail-task-body .detail-empty {
  padding: 8px 0;
  font-size: 8.5px;
}

.cal-fraction {
  font-size: 6.5px;
}

.detail-answer-label {
  margin-top: 8px;
  padding-top: 7px;
  border-top: 1px dashed var(--line);
  color: var(--faint);
  font-size: 7.5px;
  letter-spacing: 0.04em;
}

.detail-reference {
  margin-top: 6px;
  border-top: 1px dashed var(--line);
  padding-top: 5px;
  color: var(--muted);
  font-size: 8px;
}

.detail-reference summary {
  cursor: pointer;
  color: var(--accent-deep);
  font-size: 8px;
}

.detail-reference p {
  margin: 5px 0 0;
  line-height: 1.6;
  white-space: pre-wrap;
}

/* ==========================================================================
   v4 · English / Math sections, photo-to-question, fixed daily plan
   ========================================================================== */

.subject-tabs {
  display: flex;
  gap: 5px;
  margin-top: 15px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper-light);
}

.subject-tab {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 7px 6px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--muted);
  background: transparent;
  font-size: 9.5px;
}

.subject-tab strong {
  color: var(--faint);
  font-family: var(--mono);
  font-size: 8px;
  font-weight: 500;
}

.subject-tab.active {
  color: var(--ink);
  border-color: rgba(210, 95, 67, 0.245);
  background: var(--card);
  box-shadow: 0 1px 4px rgba(70, 55, 35, 0.05);
}

.subject-tab.active strong {
  color: var(--accent-deep);
}

.subject-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 190px;
  padding: 30px 20px;
  text-align: center;
}

.subject-empty-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  margin-bottom: 10px;
  border: 1px dashed var(--line-strong);
  border-radius: 50%;
  color: var(--faint);
}

.subject-empty h3 {
  color: var(--ink-soft);
  font-size: 16px;
}

.subject-empty p {
  max-width: 330px;
  margin: 6px auto 14px;
  color: var(--muted);
  font-size: 9.5px;
  line-height: 1.65;
}

.daily-plan-number {
  flex: 0 0 auto;
  color: var(--accent-deep);
  font-family: var(--serif);
  font-size: 26px;
  font-weight: 600;
  line-height: 1;
}

.quick-create-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 16px;
}

.quick-create {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 15px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--ink);
  background: var(--card);
  text-align: left;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.quick-create:hover {
  transform: translateY(-1px);
  border-color: rgba(210, 95, 67, 0.28);
  box-shadow: 0 8px 22px rgba(70, 55, 35, 0.06);
}

.quick-create-icon {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  border-radius: 11px;
  color: var(--accent-deep);
  background: var(--accent-soft);
}

.quick-math .quick-create-icon {
  color: var(--blue);
  background: var(--blue-soft);
}

.quick-create > span:nth-child(2) {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex: 1;
  min-width: 0;
}

.quick-create strong {
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 600;
}

.quick-create em {
  color: var(--muted);
  font-size: 8.5px;
  font-style: normal;
  line-height: 1.45;
}

.quick-create-arrow {
  color: var(--faint);
  font-size: 15px;
}

.source-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin: 7px 0 8px;
}

.source-tools .btn {
  min-height: 30px;
  padding: 5px 8px;
  font-size: 9px;
}

.source-ocr-status {
  color: var(--moss-deep);
  font-size: 8px;
}

.source-ai-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 9px;
  margin: 4px 0 11px;
  color: var(--faint);
  font-size: 8px;
  line-height: 1.55;
}

.source-ai-row .btn {
  color: var(--accent-deep);
  border-color: rgba(210, 95, 67, 0.25);
  background: var(--accent-soft);
}

.badge-exam {
  color: #8b4a35;
  background: var(--accent-soft);
  border-color: rgba(210, 95, 67, 0.22);
}

.badge-essay {
  color: #596c3e;
  background: #edf0e2;
  border-color: rgba(102, 126, 67, 0.2);
}

.cal-kind-mini.exam {
  color: #8b4a35;
  background: var(--accent-soft);
}

.cal-kind-mini.essay {
  color: #596c3e;
  background: #edf0e2;
}

.material-kind.kind-english {
  color: var(--accent-deep);
  background: var(--accent-soft);
}

.track-math .source-label span:first-child {
  color: var(--blue);
}

@media (max-width: 760px) {
  .quick-create-row {
    grid-template-columns: 1fr;
    gap: 7px;
  }

  .quick-create {
    padding: 12px;
  }

  .subject-tabs {
    margin-top: 12px;
  }

  .subject-tab {
    font-size: 9px;
  }

  .quick-create em {
    font-size: 8px;
  }
}

.legacy-banner {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: -2px 0 14px;
  padding: 10px 13px;
  border: 1px solid rgba(176, 138, 57, 0.22);
  border-radius: 10px;
  color: #756034;
  background: #fcf6e7;
  font-size: 9.5px;
  line-height: 1.55;
}

.legacy-banner strong {
  color: #5d4a22;
  font-weight: 600;
}
