:root {
  color-scheme: dark;
  --ink: #f7f7f2;
  --muted: #a7aaa7;
  --line: #2a2d2b;
  --line-strong: #4a4e4b;
  --paper: #050606;
  --panel: #101211;
  --panel-2: #171a18;
  --field: #080909;
  --accent: #f7f7f2;
  --accent-ink: #050606;
  --gold: #c6a15b;
  --rose: #f07585;
  --green: #76b895;
  --blue: #83a4bd;
  --sleep: #211f20;
  --hour-height: 44px;
  --untimed-height: var(--hour-height);
  --day-body-height: 1056px;
  --day-header: 48px;
  --available-height: 104px;
  --shadow: 0 20px 70px rgba(0, 0, 0, 0.42);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(118, 184, 149, 0.12), transparent 360px),
    linear-gradient(180deg, #0a0b0b 0, var(--paper) 360px);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

button,
input,
select {
  font: inherit;
}

button,
a.ghost {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-2);
  color: var(--ink);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 12px;
  text-decoration: none;
  white-space: nowrap;
}

button:hover,
a.ghost:hover {
  border-color: rgba(247, 247, 242, 0.65);
}

button:disabled {
  cursor: default;
}

.primary {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 800;
}

.primary:hover {
  background: #deded8;
}

.ghost {
  background: rgba(247, 247, 242, 0.05);
}

.danger-button {
  border: 1px solid rgba(240, 117, 133, 0.42);
  color: var(--rose);
  background: rgba(240, 117, 133, 0.08);
}

.icon-only {
  width: 40px;
  padding: 0;
  font-weight: 800;
}

.delete-mini {
  min-height: 24px;
  width: 24px;
  font-size: 0.72rem;
}

.icon-button span:first-child {
  font-weight: 900;
}

.login-shell,
.center-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-panel {
  width: min(420px, 100%);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(16, 18, 17, 0.96);
  box-shadow: var(--shadow);
  padding: 32px;
}

.brand-mark {
  width: 92px;
  height: 92px;
  display: block;
  margin-bottom: 18px;
}

.login-panel h1 {
  margin: 0 0 24px;
  font-size: 2rem;
  line-height: 1.05;
}

.stack {
  display: grid;
  gap: 16px;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 750;
}

input,
select {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--field);
  color: var(--ink);
  padding: 0 10px;
}

select option {
  background: var(--field);
  color: var(--ink);
}

input:focus,
select:focus,
button:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(247, 247, 242, 0.18);
  outline-offset: 2px;
}

.notice {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 16px;
  line-height: 1.45;
}

.danger {
  border-color: rgba(240, 117, 133, 0.42);
  color: #ffd7dd;
  background: rgba(240, 117, 133, 0.09);
}

.chinese-auth-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: clamp(18px, 3vw, 36px);
  background:
    radial-gradient(circle at 18% 12%, rgba(118, 184, 149, 0.11), transparent 340px),
    radial-gradient(circle at 84% 46%, rgba(247, 247, 242, 0.06), transparent 460px),
    linear-gradient(135deg, rgba(247, 247, 242, 0.04), transparent 44%),
    var(--paper);
}

.chinese-auth-card {
  width: min(94vw, 1460px);
  height: min(82vh, 820px);
  min-height: 680px;
  display: grid;
  grid-template-columns: 39% 61%;
  overflow: hidden;
  border: 1px solid rgba(247, 247, 242, 0.14);
  border-radius: 22px;
  background: #090b0b;
  box-shadow: 0 32px 110px rgba(0, 0, 0, 0.62);
}

.chinese-auth-form-panel {
  display: grid;
  grid-template-rows: auto 1fr;
  align-content: stretch;
  gap: clamp(20px, 4vh, 44px);
  min-width: 0;
  border-right: 1px solid rgba(247, 247, 242, 0.055);
  background:
    radial-gradient(circle at 12% 88%, rgba(247, 247, 242, 0.045), transparent 330px),
    linear-gradient(100deg, #111313 0%, #0d0f0f 58%, #0a0b0b 100%);
  padding: clamp(34px, 4.35vw, 72px);
}

.chinese-auth-content {
  align-self: center;
  display: grid;
  gap: 22px;
  min-width: 0;
  max-width: 500px;
  transform: translateY(-22px);
}

.chinese-auth-brand {
  align-self: start;
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  align-items: center;
  gap: 16px;
  color: var(--ink);
}

.chinese-auth-brand img {
  width: 50px;
  height: 50px;
  object-fit: contain;
  opacity: 0.92;
  filter: drop-shadow(0 8px 18px rgba(0, 0, 0, 0.5));
}

.chinese-auth-brand strong {
  display: block;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.25rem, 1.7vw, 1.78rem);
  font-weight: 600;
  line-height: 1;
}

.chinese-auth-brand small {
  display: block;
  margin-top: 7px;
  color: rgba(220, 220, 220, 0.48);
  font-size: 0.78rem;
  font-weight: 700;
}

.chinese-auth-card h1 {
  margin: 0;
  font-size: clamp(3.05rem, 3.8vw, 3.9rem);
  line-height: 0.98;
  letter-spacing: 0;
  text-align: left;
}

.chinese-auth-copy {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.chinese-auth-form {
  display: grid;
  gap: 18px;
  width: min(100%, 500px);
}

.chinese-auth-form label {
  gap: 10px;
}

.chinese-auth-form button {
  min-height: 60px;
  margin-top: 12px;
  border-radius: 14px;
  box-shadow: 0 18px 38px rgba(0, 0, 0, 0.32);
}

.chinese-auth-form input {
  min-height: 60px;
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 0 52px;
  box-shadow: none;
}

.chinese-auth-input-shell {
  position: relative;
  display: block;
  border: 1px solid rgba(247, 247, 242, 0.15);
  border-radius: 12px;
  background:
    linear-gradient(180deg, rgba(247, 247, 242, 0.025), rgba(247, 247, 242, 0.005)),
    rgba(2, 3, 3, 0.62);
  box-shadow:
    inset 0 1px 0 rgba(247, 247, 242, 0.035),
    0 18px 44px rgba(0, 0, 0, 0.18);
}

.chinese-auth-input-shell:focus-within {
  border-color: rgba(247, 247, 242, 0.34);
  box-shadow:
    inset 0 1px 0 rgba(247, 247, 242, 0.04),
    0 0 0 3px rgba(247, 247, 242, 0.045),
    0 18px 44px rgba(0, 0, 0, 0.18);
}

.chinese-auth-input-icon,
.chinese-auth-eye {
  position: absolute;
  top: 50%;
  display: grid;
  place-items: center;
  color: rgba(220, 220, 220, 0.42);
  font-size: 1.08rem;
  transform: translateY(-50%);
  pointer-events: none;
}

.chinese-auth-input-icon svg,
.chinese-auth-eye svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.chinese-auth-input-icon {
  left: 20px;
}

.chinese-auth-eye {
  right: 20px;
  font-size: 1.4rem;
}

.chinese-auth-form label > span,
.chinese-auth-options {
  font-size: 0.95rem;
}

.chinese-auth-form input::placeholder {
  color: rgba(220, 220, 220, 0.34);
}

.chinese-auth-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: -3px;
  color: rgba(220, 220, 220, 0.7);
}

.chinese-auth-remember {
  display: inline-flex;
  grid-template-columns: none;
  align-items: center;
  gap: 10px;
  color: rgba(220, 220, 220, 0.72);
  font-size: 0.95rem;
  font-weight: 700;
}

.chinese-auth-remember input {
  width: 18px;
  height: 18px;
  min-height: 0;
  accent-color: var(--ink);
}

.chinese-auth-notice {
  max-width: 460px;
  border: 1px solid rgba(247, 247, 242, 0.14);
  border-radius: 10px;
  padding: 12px 14px;
  color: #dce7e1;
  background: rgba(118, 184, 149, 0.1);
  line-height: 1.45;
}

.chinese-auth-notice.is-danger {
  border-color: rgba(240, 117, 133, 0.42);
  color: #ffd7dd;
  background: rgba(240, 117, 133, 0.09);
}

.chinese-auth-link {
  justify-self: end;
  color: rgba(220, 220, 220, 0.72);
  font-weight: 800;
  text-decoration-color: rgba(220, 220, 220, 0.28);
  text-underline-offset: 4px;
}

.chinese-auth-submit {
  position: relative;
  justify-content: center;
  padding-inline: 58px;
  color: #060707;
  background:
    linear-gradient(180deg, #ffffff 0%, #f2f2ed 100%);
}

.chinese-auth-submit:hover {
  background:
    linear-gradient(180deg, #ffffff 0%, #e8e8e2 100%);
}

.chinese-auth-submit-icon {
  position: absolute;
  right: 20px;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: #050606;
  color: #f7f7f2;
  font-size: 0.95rem;
  font-weight: 900;
  line-height: 1;
}

.chinese-auth-visual {
  position: relative;
  min-width: 0;
  overflow: hidden;
  background-image: url("/images/chinese/chinese-login-approved-artwork.png");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.chinese-logout-form {
  margin-top: 18px;
}

.chinese-logout-form button {
  min-width: 128px;
}

@media (max-width: 900px) {
  .chinese-auth-card {
    grid-template-columns: 1fr;
    height: auto;
    min-height: 0;
  }

  .chinese-auth-form-panel {
    border-right: 0;
    padding: clamp(24px, 7vw, 42px);
  }

  .chinese-auth-visual {
    min-height: 320px;
    border-top: 1px solid rgba(247, 247, 242, 0.08);
  }

  .chinese-auth-card h1 {
    font-size: clamp(2.85rem, 12vw, 4rem);
  }

}

.app-shell {
  min-height: 100vh;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: grid;
  grid-template-columns: 1fr;
  align-items: center;
  justify-items: center;
  gap: 18px;
  border-bottom: 1px solid var(--line);
  background: rgba(5, 6, 6, 0.92);
  backdrop-filter: blur(14px);
  padding: 14px clamp(16px, 4vw, 42px);
}

.topbar .brand,
.topbar form {
  display: none !important;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
  font-weight: 850;
}

.brand img {
  width: 42px;
  height: 42px;
}

.tabs {
  display: flex;
  justify-content: center;
  justify-self: center;
  min-width: 0;
}

.mode-switcher {
  gap: 4px;
  border: 1px solid rgba(247, 247, 242, 0.16);
  border-radius: 10px;
  background: rgba(247, 247, 242, 0.035);
  padding: 4px;
  box-shadow: inset 0 1px 0 rgba(247, 247, 242, 0.04), 0 12px 32px rgba(0, 0, 0, 0.22);
}

.tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 112px;
  min-height: 38px;
  border: 1px solid transparent;
  border-radius: 7px;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.94rem;
  font-weight: 750;
  transition: border-color 160ms ease, background 160ms ease, color 160ms ease;
}

.tab:hover,
.tab:focus-visible {
  border-color: rgba(247, 247, 242, 0.28);
  color: var(--ink);
}

.tab.is-active {
  border-color: rgba(118, 184, 149, 0.48);
  background: rgba(118, 184, 149, 0.14);
  color: var(--ink);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.2);
}

main {
  width: min(1720px, 100%);
  margin: 0 auto;
  padding: 28px clamp(14px, 3vw, 32px) 64px;
}

.docket-main {
  display: grid;
  gap: 18px;
}

.money-main {
  width: min(1500px, 100%);
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

.money-sidebar,
.money-panel,
.money-summary-card,
.account-card,
.automation-status-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(16, 18, 17, 0.88);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.22);
}

.money-sidebar {
  position: sticky;
  top: 82px;
  display: grid;
  gap: 14px;
  min-width: 0;
  padding: 14px 12px;
  align-self: start;
}

.money-sidebar-heading {
  display: grid;
  gap: 4px;
  border-bottom: 1px solid var(--line);
  padding: 0 6px 12px;
}

.money-sidebar-heading span,
.money-kicker {
  color: var(--gold);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.money-sidebar-heading strong {
  color: var(--ink);
  font-size: 1rem;
  font-weight: 750;
}

.money-nav {
  display: grid;
  gap: 5px;
}

.money-nav-item {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  min-height: 42px;
  border-radius: 8px;
  border: 1px solid transparent;
  color: var(--ink);
  text-decoration: none;
  padding: 6px 10px;
  min-width: 0;
}

.money-nav-icon {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(247, 247, 242, 0.055);
  color: #cfd7d0;
  font-size: 0.74rem;
  font-weight: 800;
  line-height: 1;
}

.money-nav-item strong {
  min-width: 0;
  color: #d7d9d6;
  font-size: 0.9rem;
  font-weight: 650;
  text-align: left;
  overflow-wrap: anywhere;
}

.money-nav-item:hover,
.money-nav-item:focus-visible {
  border-color: rgba(118, 184, 149, 0.28);
  background: rgba(247, 247, 242, 0.045);
}

.money-nav-item.is-active {
  border-color: rgba(118, 184, 149, 0.34);
  background: rgba(118, 184, 149, 0.12);
  box-shadow: inset 3px 0 0 #5097d6;
}

.money-nav-item.is-active .money-nav-icon {
  background: rgba(80, 151, 214, 0.24);
  color: var(--ink);
}

.money-nav-item.is-active strong {
  color: var(--ink);
}

.money-workspace {
  display: grid;
  gap: 14px;
  min-width: 0;
}

.money-page-header {
  display: grid;
  grid-template-columns: minmax(0, 1.85fr) minmax(300px, 0.95fr);
  gap: 14px;
  align-items: stretch;
}

.money-title-block {
  min-width: 0;
  align-self: center;
}

.money-page-header h1,
.money-placeholder h1 {
  margin: 2px 0 0;
  color: var(--ink);
  font-size: clamp(2.35rem, 3.2vw, 3rem);
  line-height: 0.98;
  font-weight: 800;
}

.money-page-header p,
.money-panel p,
.money-placeholder p {
  margin: 5px 0 0;
  color: var(--muted);
  font-weight: 450;
}

.automation-status-card {
  display: grid;
  gap: 8px;
  border-color: rgba(118, 184, 149, 0.45);
  background:
    radial-gradient(circle at 100% 0%, rgba(118, 184, 149, 0.18), transparent 34%),
    rgba(16, 18, 17, 0.88);
  padding: 14px;
}

.automation-status-card.is-paused {
  border-color: rgba(240, 117, 133, 0.45);
}

.automation-status-card > strong {
  color: var(--green);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
}

.automation-status-card.is-paused > strong {
  color: #ff9fad;
}

.automation-status-card > span {
  color: var(--ink);
  font-size: 1rem;
  font-weight: 750;
}

.automation-status-card p {
  font-size: 0.83rem;
  line-height: 1.35;
}

.automation-status-card div {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.automation-status-card button {
  min-height: 34px;
  font-size: 0.82rem;
}

.money-summary-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 9px;
}

.money-summary-card,
.account-card {
  display: grid;
  gap: 5px;
  min-width: 0;
  padding: 12px;
  align-content: start;
}

.money-summary-card span,
.account-card span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 650;
  line-height: 1.25;
}

.money-summary-card strong,
.account-card strong {
  color: var(--ink);
  font-size: 1rem;
  font-weight: 780;
  line-height: 1.12;
}

.money-summary-card small,
.account-card small {
  color: var(--muted);
  font-size: 0.75rem;
  line-height: 1.3;
}

.money-summary-card.money-tone-green,
.account-card.money-tone-green {
  border-color: rgba(118, 184, 149, 0.42);
}

.money-summary-card.money-tone-blue,
.account-card.money-tone-blue {
  border-color: rgba(80, 151, 214, 0.42);
}

.money-summary-card.money-tone-rose,
.account-card.money-tone-rose,
.account-card.money-tone-red {
  border-color: rgba(240, 117, 133, 0.42);
}

.money-summary-card.money-tone-yellow,
.account-card.money-tone-yellow {
  border-color: rgba(216, 184, 93, 0.42);
}

.money-summary-card.money-tone-purple,
.account-card.money-tone-purple {
  border-color: rgba(156, 132, 211, 0.42);
}

.money-dashboard-grid,
.money-lower-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(240px, 0.7fr);
  gap: 14px;
  min-width: 0;
}

.money-lower-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.money-panel {
  min-width: 0;
  padding: 14px;
}

.money-panel-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  min-width: 0;
}

.money-panel-header h2 {
  margin: 0;
  color: var(--ink);
  font-size: 1.08rem;
  font-weight: 750;
}

.money-panel-header a {
  color: var(--ink);
  font-weight: 800;
}

.allocation-layout {
  display: grid;
  grid-template-columns: minmax(150px, 0.32fr) minmax(0, 0.68fr);
  gap: 16px;
  align-items: center;
  min-width: 0;
}

.allocation-chart-wrap {
  display: grid;
  justify-items: center;
  gap: 7px;
  text-align: center;
  min-width: 0;
}

.allocation-chart {
  display: grid;
  place-items: center;
  width: min(174px, 100%);
  aspect-ratio: 1;
  border-radius: 50%;
  background: conic-gradient(var(--allocation-gradient, #76b895 0 100%));
  position: relative;
}

.allocation-chart::after {
  content: "";
  position: absolute;
  inset: 32px;
  border-radius: 50%;
  background: #101211;
  border: 1px solid var(--line);
}

.allocation-chart span {
  position: relative;
  z-index: 1;
  color: var(--ink);
  font-size: 1.28rem;
  font-weight: 800;
}

.allocation-chart-wrap .is-good {
  color: var(--green);
}

.allocation-chart-wrap .is-bad {
  color: #ff9fad;
}

.money-table-scroll {
  min-width: 0;
  overflow-x: visible;
}

.money-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.money-table th,
.money-table td {
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  padding: 9px 7px;
  text-align: left;
  font-size: 0.84rem;
  line-height: 1.25;
  vertical-align: middle;
}

.money-table th {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 750;
  text-transform: uppercase;
}

.money-table th:nth-child(1),
.money-table td:nth-child(1) { width: 40%; }
.money-table th:nth-child(2),
.money-table td:nth-child(2) { width: 22%; }
.money-table th:nth-child(3),
.money-table td:nth-child(3) { width: 15%; white-space: nowrap; }
.money-table th:nth-child(4),
.money-table td:nth-child(4) { width: 23%; white-space: nowrap; }

.money-destination-cell {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.money-destination-cell span:last-child {
  min-width: 0;
  overflow-wrap: anywhere;
}

.money-dot {
  flex: 0 0 auto;
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #83a4bd;
}

.money-dot.money-tone-green { background: #76b895; }
.money-dot.money-tone-blue { background: #5097d6; }
.money-dot.money-tone-yellow { background: #d8b85d; }
.money-dot.money-tone-rose { background: #f07585; }
.money-dot.money-tone-purple { background: #9c84d3; }

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

.money-action-button {
  min-height: 68px;
  display: grid;
  justify-items: start;
  align-content: center;
  gap: 6px;
  border-color: rgba(247, 247, 242, 0.12);
  background: rgba(247, 247, 242, 0.045);
  white-space: normal;
  text-align: left;
}

.money-action-button:hover,
.money-action-button:focus-visible {
  border-color: rgba(118, 184, 149, 0.42);
  background: rgba(118, 184, 149, 0.08);
}

.money-action-button span {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 7px;
  background: rgba(80, 151, 214, 0.16);
  color: var(--ink);
  font-weight: 850;
}

.money-action-button strong {
  font-size: 0.86rem;
  font-weight: 750;
}

.money-account-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
  min-width: 0;
}

.account-card p {
  margin: 4px 0 0;
  color: var(--ink);
  font-size: 1.22rem;
  font-weight: 800;
}

.money-list {
  display: grid;
  gap: 7px;
}

.money-list-row {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid rgba(131, 164, 189, 0.18);
  border-radius: 8px;
  background: rgba(247, 247, 242, 0.035);
  padding: 9px;
  min-width: 0;
}

.money-list-row strong,
.money-list-row span {
  display: block;
}

.money-list-row strong {
  color: var(--ink);
  font-weight: 720;
}

.money-list-row span,
.simulation-note {
  color: var(--muted);
  font-size: 0.8rem;
}

.money-placeholder {
  min-height: 420px;
  align-content: start;
}

.placeholder-actions,
.modal-actions {
  display: flex;
  justify-content: end;
  gap: 8px;
  margin-top: 16px;
}

.button-like {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 18px;
  color: var(--ink);
  text-decoration: none;
  font-weight: 900;
}

.money-modal-card {
  width: min(760px, calc(100vw - 44px));
}

.money-modal-card h2 {
  margin-top: 0;
  color: var(--ink);
}

.language-shell {
  min-height: 100vh;
  background:
    radial-gradient(circle at 50% -18%, rgba(131, 164, 189, 0.11), transparent 520px),
    radial-gradient(circle at 0% 100%, rgba(16, 28, 44, 0.44), transparent 420px),
    radial-gradient(circle at 100% 100%, rgba(16, 28, 44, 0.34), transparent 420px);
}

.language-main {
  width: min(1640px, 100%);
  display: grid;
  align-items: start;
  padding-block: clamp(34px, 5.8vh, 58px);
}

.language-selection {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(44px, 3.7vw, 62px);
  width: min(1550px, 100%);
  min-width: 0;
  margin: 0 auto;
}

.language-tile {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 1 / 1;
  min-width: 0;
  overflow: hidden;
  border: 1px solid rgba(220, 220, 220, 0.2);
  border-radius: 15px;
  background: #070808;
  color: rgba(226, 224, 218, 0.76);
  box-shadow:
    inset 0 0 0 1px rgba(5, 6, 6, 0.82),
    inset 0 -100px 170px rgba(0, 0, 0, 0.24),
    0 24px 62px rgba(0, 0, 0, 0.28);
  isolation: isolate;
  text-decoration: none;
  padding: 0;
  transition: border-color 200ms ease, color 200ms ease, transform 200ms ease, box-shadow 200ms ease;
}

.language-tile::before,
.language-tile::after {
  content: "";
  position: absolute;
  inset: 0;
  transition: transform 240ms ease, opacity 240ms ease, border-color 240ms ease;
}

.language-tile::before {
  z-index: -2;
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
  filter: saturate(0.72) contrast(0.94) brightness(0.9);
  transform: scale(1);
}

.language-tile::after {
  z-index: -1;
  background:
    radial-gradient(circle at 50% 38%, rgba(0, 0, 0, 0.38), rgba(0, 0, 0, 0.62) 58%, rgba(0, 0, 0, 0.74)),
    rgba(0, 0, 0, 0.5);
  opacity: 1;
}

.language-tile-chinese::before {
  background-image: url("/images/languages/china-flag.svg");
  background-position: left center;
  background-size: auto 100%;
}

.language-tile-spanish::before {
  background-image: url("/images/languages/spain-flag.svg");
  background-position: center;
}

.language-tile-chinese:hover,
.language-tile-chinese:focus-visible {
  border-color: rgba(247, 247, 242, 0.34);
  color: rgba(238, 236, 230, 0.86);
  transform: translateY(-2px);
  box-shadow:
    inset 0 0 0 1px rgba(5, 6, 6, 0.8),
    inset 0 -80px 140px rgba(0, 0, 0, 0.18),
    0 20px 52px rgba(0, 0, 0, 0.22);
}

.language-tile-chinese:hover::after,
.language-tile-chinese:focus-visible::after {
  opacity: 0.86;
}

.language-tile:focus-visible {
  outline: 3px solid rgba(247, 247, 242, 0.2);
  outline-offset: 4px;
}

.language-tile-label {
  position: relative;
  z-index: 1;
  color: currentColor;
  font-size: clamp(3.8rem, 6vw, 6.1rem);
  font-weight: 700;
  line-height: 1;
  text-align: center;
  text-shadow: 0 3px 26px rgba(0, 0, 0, 0.62);
}

.language-tile.is-disabled {
  cursor: not-allowed;
}

.language-tile.is-disabled::after {
  background:
    radial-gradient(circle at 50% 38%, rgba(0, 0, 0, 0.4), rgba(0, 0, 0, 0.64) 58%, rgba(0, 0, 0, 0.76)),
    rgba(0, 0, 0, 0.52);
}

.language-maintenance-pill {
  position: absolute;
  left: 50%;
  bottom: clamp(18px, 4vw, 28px);
  z-index: 1;
  transform: translateX(-50%);
  border: 1px solid rgba(220, 220, 220, 0.2);
  border-radius: 999px;
  background: rgba(5, 6, 6, 0.58);
  color: rgba(220, 220, 220, 0.66);
  padding: 6px 12px;
  font-size: 0.74rem;
  font-weight: 650;
  white-space: nowrap;
  opacity: 0;
  transition: opacity 190ms ease, border-color 190ms ease, color 190ms ease;
}

.language-tile.is-disabled:hover .language-maintenance-pill,
.language-tile.is-disabled:focus-visible .language-maintenance-pill {
  border-color: rgba(220, 220, 220, 0.28);
  color: rgba(220, 220, 220, 0.78);
  opacity: 1;
}

.language-placeholder {
  width: min(760px, 100%);
  align-self: start;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(16, 18, 17, 0.88);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.22);
  padding: clamp(22px, 4vw, 42px);
}

.language-placeholder h1 {
  margin: 2px 0 0;
  color: var(--ink);
  font-size: clamp(2.4rem, 5vw, 4rem);
  line-height: 0.98;
}

.language-placeholder p:not(.money-kicker) {
  color: var(--muted);
  margin: 10px 0 20px;
}

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

.chinese-main {
  width: min(1500px, 100%);
  align-items: stretch;
}

.chinese-shell {
  display: grid;
  gap: 14px;
  min-width: 0;
}

.chinese-header,
.chinese-route-panel,
.chinese-dashboard-section {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(16, 18, 17, 0.88);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.2);
}

.chinese-header {
  display: grid;
  grid-template-columns: minmax(190px, 0.75fr) auto minmax(260px, 1fr);
  align-items: end;
  gap: 14px;
  padding: 16px;
}

.chinese-title-block {
  display: grid;
  gap: 3px;
}

.chinese-title-block h1 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(2.2rem, 4vw, 3.4rem);
  line-height: 0.95;
  font-weight: 850;
}

.chinese-title-block span,
.chinese-route-header p,
.chinese-media-copy small,
.chinese-media-copy em,
.chinese-progress-body small,
.chinese-placeholder-grid span {
  color: var(--muted);
}

.chinese-change-link {
  justify-self: start;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 750;
  text-decoration: none;
}

.chinese-change-link:hover,
.chinese-change-link:focus-visible {
  color: var(--ink);
}

.chinese-search {
  min-width: 0;
}

.chinese-search input {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--field);
  color: var(--ink);
  padding: 0 14px;
  font-weight: 650;
}

.chinese-search input:disabled {
  color: #5f6460;
}

.chinese-nav {
  display: flex;
  gap: 6px;
  min-width: 0;
  overflow-x: auto;
  padding: 2px 0 6px;
}

.chinese-nav a {
  flex: 0 0 auto;
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(247, 247, 242, 0.035);
  color: var(--muted);
  padding: 0 14px;
  text-decoration: none;
  font-size: 0.86rem;
  font-weight: 780;
}

.chinese-nav a:hover,
.chinese-nav a:focus-visible {
  border-color: rgba(247, 247, 242, 0.28);
  color: var(--ink);
}

.chinese-nav a.is-active {
  border-color: rgba(118, 184, 149, 0.42);
  background: rgba(118, 184, 149, 0.12);
  color: var(--ink);
}

.chinese-dashboard {
  display: grid;
  gap: 14px;
  min-width: 0;
}

.chinese-dashboard-section,
.chinese-route-panel {
  display: grid;
  gap: 12px;
  min-width: 0;
  padding: 14px;
}

.chinese-section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.chinese-section-heading h2,
.chinese-route-header h2 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(1.15rem, 2vw, 1.45rem);
  line-height: 1;
}

.chinese-progress-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.chinese-progress-card,
.chinese-media-card,
.chinese-quick-tile {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(8, 9, 9, 0.92);
  color: var(--ink);
  text-decoration: none;
  overflow: hidden;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.chinese-progress-card:hover,
.chinese-progress-card:focus-visible,
.chinese-media-card:hover,
.chinese-media-card:focus-visible,
.chinese-quick-tile:hover,
.chinese-quick-tile:focus-visible {
  transform: translateY(-2px);
  border-color: rgba(118, 184, 149, 0.38);
  background: rgba(247, 247, 242, 0.055);
}

.chinese-progress-card {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  min-height: 148px;
}

.chinese-card-art,
.chinese-media-art {
  min-height: 100%;
  background:
    radial-gradient(circle at 30% 20%, rgba(247, 247, 242, 0.18), transparent 36%),
    linear-gradient(135deg, rgba(131, 164, 189, 0.32), rgba(5, 6, 6, 0.2));
}

.chinese-progress-body,
.chinese-media-copy {
  display: grid;
  align-content: start;
  gap: 6px;
  min-width: 0;
  padding: 12px;
}

.chinese-card-meta,
.chinese-media-copy span {
  color: var(--gold);
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.chinese-progress-body strong,
.chinese-media-copy strong {
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--ink);
  font-size: 1rem;
  line-height: 1.15;
  font-weight: 800;
}

.chinese-progress-body small,
.chinese-media-copy small,
.chinese-media-copy em {
  min-width: 0;
  font-size: 0.78rem;
  font-style: normal;
  line-height: 1.3;
}

.chinese-progress-track {
  width: 100%;
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(247, 247, 242, 0.09);
}

.chinese-progress-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--green), var(--blue));
}

.chinese-resume {
  justify-self: start;
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(247, 247, 242, 0.16);
  border-radius: 999px;
  padding: 0 10px;
  color: var(--ink);
  font-size: 0.76rem;
  font-weight: 800;
}

.chinese-quick-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
}

.chinese-quick-tile {
  min-height: 74px;
  display: grid;
  place-items: center;
  padding: 10px;
}

.chinese-quick-tile span {
  font-weight: 850;
}

.chinese-media-row {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(184px, 218px);
  gap: 10px;
  min-width: 0;
  overflow-x: auto;
  padding-bottom: 6px;
}

.chinese-media-card {
  display: grid;
  grid-template-rows: 94px minmax(118px, auto);
  min-height: 230px;
}

.chinese-media-card.is-dli {
  border-color: rgba(198, 161, 91, 0.28);
}

.chinese-placeholder-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.chinese-placeholder-grid div {
  display: grid;
  gap: 4px;
  min-height: 120px;
  align-content: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(8, 9, 9, 0.8);
  padding: 12px;
}

.chinese-placeholder-grid strong {
  color: var(--ink);
}

.chinese-route-header {
  display: grid;
  gap: 6px;
}

.chinese-route-header p {
  max-width: 680px;
  margin: 0;
  line-height: 1.45;
}

.chinese-empty-state {
  margin: 0;
  border: 1px dashed rgba(247, 247, 242, 0.18);
  border-radius: 8px;
  color: var(--muted);
  padding: 24px;
  text-align: center;
}

.chinese-art-blue .chinese-card-art,
.chinese-art-blue .chinese-media-art {
  background:
    radial-gradient(circle at 34% 26%, rgba(131, 164, 189, 0.38), transparent 38%),
    linear-gradient(135deg, rgba(80, 151, 214, 0.28), rgba(8, 9, 9, 0.84));
}

.chinese-art-green .chinese-card-art,
.chinese-art-green .chinese-media-art {
  background:
    radial-gradient(circle at 34% 26%, rgba(118, 184, 149, 0.38), transparent 38%),
    linear-gradient(135deg, rgba(118, 184, 149, 0.22), rgba(8, 9, 9, 0.84));
}

.chinese-art-gold .chinese-card-art,
.chinese-art-gold .chinese-media-art {
  background:
    radial-gradient(circle at 34% 26%, rgba(198, 161, 91, 0.42), transparent 38%),
    linear-gradient(135deg, rgba(198, 161, 91, 0.22), rgba(8, 9, 9, 0.84));
}

.chinese-art-rose .chinese-card-art,
.chinese-art-rose .chinese-media-art {
  background:
    radial-gradient(circle at 34% 26%, rgba(240, 117, 133, 0.38), transparent 38%),
    linear-gradient(135deg, rgba(240, 117, 133, 0.18), rgba(8, 9, 9, 0.84));
}

.chinese-art-purple .chinese-card-art,
.chinese-art-purple .chinese-media-art {
  background:
    radial-gradient(circle at 34% 26%, rgba(156, 132, 211, 0.42), transparent 38%),
    linear-gradient(135deg, rgba(156, 132, 211, 0.2), rgba(8, 9, 9, 0.84));
}

.chinese-art-orange .chinese-card-art,
.chinese-art-orange .chinese-media-art {
  background:
    radial-gradient(circle at 34% 26%, rgba(221, 139, 76, 0.42), transparent 38%),
    linear-gradient(135deg, rgba(221, 139, 76, 0.22), rgba(8, 9, 9, 0.84));
}

.chinese-art-slate .chinese-card-art,
.chinese-art-slate .chinese-media-art {
  background:
    radial-gradient(circle at 34% 26%, rgba(157, 166, 175, 0.34), transparent 38%),
    linear-gradient(135deg, rgba(157, 166, 175, 0.18), rgba(8, 9, 9, 0.84));
}

.chinese-app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 236px minmax(0, 1fr);
  color: var(--ink);
  background:
    radial-gradient(circle at 78% 5%, rgba(118, 184, 149, 0.1), transparent 420px),
    radial-gradient(circle at 12% 8%, rgba(131, 164, 189, 0.1), transparent 360px),
    linear-gradient(135deg, #050707 0%, #080b0b 42%, #050606 100%);
}

.chinese-sidebar {
  position: sticky;
  top: 0;
  z-index: 20;
  height: 100vh;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 18px;
  border-right: 1px solid rgba(247, 247, 242, 0.1);
  background:
    linear-gradient(180deg, rgba(13, 19, 19, 0.94), rgba(7, 9, 9, 0.98)),
    radial-gradient(circle at 0% 0%, rgba(118, 184, 149, 0.14), transparent 260px);
  padding: 20px 14px;
}

.chinese-sidebar-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.chinese-brand,
.chinese-side-link,
.chinese-home-link {
  color: var(--ink);
  text-decoration: none;
}

.chinese-brand {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.04rem;
  font-weight: 900;
}

.chinese-brand strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chinese-brand-logo,
.chinese-profile-button {
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  object-fit: contain;
}

.chinese-collapse-button,
.chinese-menu-button {
  width: 38px;
  min-height: 38px;
  padding: 0;
  border-color: transparent;
  background: transparent;
  color: var(--muted);
}

.chinese-collapse-button:hover,
.chinese-collapse-button:focus-visible,
.chinese-menu-button:hover,
.chinese-menu-button:focus-visible {
  border-color: rgba(247, 247, 242, 0.16);
  background: rgba(247, 247, 242, 0.05);
  color: var(--ink);
}

.chinese-side-nav {
  display: grid;
  gap: 8px;
}

.chinese-sidebar-bottom {
  margin-top: auto;
}

.chinese-side-link {
  position: relative;
  min-height: 48px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-radius: 8px;
  color: #b6bbb8;
  padding: 0 12px;
  font-size: 0.94rem;
  font-weight: 780;
  transition: background 190ms ease, color 190ms ease, transform 190ms ease;
}

.chinese-side-link:hover,
.chinese-side-link:focus-visible {
  background: rgba(247, 247, 242, 0.055);
  color: var(--ink);
  outline: none;
}

.chinese-side-link.is-active {
  background: linear-gradient(90deg, rgba(118, 184, 149, 0.2), rgba(118, 184, 149, 0.08));
  color: var(--ink);
}

.chinese-icon {
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.chinese-app-content {
  min-width: 0;
  padding: 26px 34px 44px;
}

.chinese-top-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  gap: 18px;
  border-bottom: 1px solid rgba(247, 247, 242, 0.09);
  padding-bottom: 22px;
  margin-bottom: 18px;
}

.chinese-menu-button {
  display: none;
}

.chinese-title-block {
  display: grid;
  gap: 4px;
}

.chinese-title-block h1 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(2rem, 4vw, 3.15rem);
  line-height: 0.95;
  font-weight: 900;
}

.chinese-title-block span {
  color: var(--muted);
  font-size: 0.98rem;
}

.chinese-search {
  min-width: 0;
  width: 100%;
}

.chinese-search input {
  width: 100%;
  min-height: 46px;
  border: 1px solid rgba(247, 247, 242, 0.14);
  border-radius: 10px;
  background: rgba(14, 16, 17, 0.88);
  color: var(--ink);
  padding: 0 16px;
  font-weight: 650;
}

.chinese-search input::placeholder {
  color: #8f9593;
}

.chinese-search input:focus {
  outline: none;
  border-color: rgba(118, 184, 149, 0.5);
  box-shadow: 0 0 0 3px rgba(118, 184, 149, 0.1);
}

.chinese-profile-button {
  min-height: 44px;
  width: 44px;
  padding: 0;
  border: 0;
  background: rgba(118, 184, 149, 0.22);
}

.chinese-app-shell .chinese-dashboard,
.chinese-app-shell .chinese-route-panel {
  display: grid;
  gap: 24px;
  min-width: 0;
}

.chinese-app-shell .chinese-dashboard-section,
.chinese-app-shell .chinese-route-panel {
  border: 0;
  background: transparent;
  box-shadow: none;
  padding: 0;
}

.chinese-app-shell .chinese-section-heading {
  justify-content: flex-start;
  gap: 10px;
}

.chinese-app-shell .chinese-section-heading h2,
.chinese-route-header h2 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(1.15rem, 2vw, 1.45rem);
  line-height: 1;
  font-weight: 900;
}

.chinese-app-shell .chinese-section-heading .chinese-icon {
  color: var(--ink);
}

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

.chinese-progress-card,
.chinese-media-card,
.chinese-quick-tile,
.chinese-course-card {
  border: 1px solid rgba(247, 247, 242, 0.12);
  border-radius: 8px;
  background: rgba(17, 20, 20, 0.78);
  color: var(--ink);
  text-decoration: none;
  overflow: hidden;
  box-shadow: 0 16px 46px rgba(0, 0, 0, 0.22);
  transition: transform 190ms ease, border-color 190ms ease, background 190ms ease;
}

.chinese-progress-card:hover,
.chinese-progress-card:focus-visible,
.chinese-media-card:hover,
.chinese-media-card:focus-visible,
.chinese-quick-tile:hover,
.chinese-quick-tile:focus-visible,
.chinese-course-card:hover,
.chinese-course-card:focus-visible {
  transform: translateY(-2px);
  border-color: rgba(118, 184, 149, 0.42);
  background: rgba(24, 29, 28, 0.86);
  outline: none;
}

.chinese-progress-card {
  position: relative;
  min-height: 146px;
  display: grid;
  grid-template-columns: 136px minmax(0, 1fr);
}

.chinese-card-art,
.chinese-media-art {
  position: relative;
  min-height: 100%;
  overflow: hidden;
  background:
    radial-gradient(circle at 30% 22%, rgba(247, 247, 242, 0.16), transparent 38%),
    linear-gradient(135deg, rgba(131, 164, 189, 0.28), rgba(5, 6, 6, 0.92));
}

.chinese-card-art::after,
.chinese-media-art::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(5, 6, 6, 0.08), rgba(5, 6, 6, 0.34));
}

.chinese-progress-body,
.chinese-media-copy {
  position: relative;
  display: grid;
  align-content: center;
  gap: 8px;
  min-width: 0;
  padding: 16px 16px 14px;
}

.chinese-card-menu {
  position: absolute;
  top: 12px;
  right: 12px;
  color: var(--muted);
  font-weight: 900;
}

.chinese-progress-body strong,
.chinese-media-copy strong,
.chinese-course-copy strong {
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--ink);
  font-size: 1rem;
  line-height: 1.15;
  font-weight: 900;
}

.chinese-progress-body small,
.chinese-media-copy em,
.chinese-course-copy small,
.chinese-course-copy em,
.chinese-time-row {
  color: var(--muted);
  font-size: 0.78rem;
  font-style: normal;
  line-height: 1.35;
}

.chinese-progress-track {
  width: 100%;
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(247, 247, 242, 0.1);
}

.chinese-progress-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #76b895, #95d7bd);
}

.chinese-time-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.chinese-quick-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 10px;
}

.chinese-quick-tile {
  min-height: 70px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 10px 12px;
  font-weight: 850;
}

.chinese-quick-tile .chinese-icon {
  color: #c9d0cd;
}

.chinese-media-row {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(192px, 230px);
  gap: 14px;
  min-width: 0;
  overflow-x: auto;
  padding-bottom: 8px;
}

.chinese-media-card {
  display: grid;
  grid-template-rows: 112px minmax(96px, auto);
  min-height: 236px;
}

.chinese-media-copy {
  align-content: start;
  gap: 5px;
}

.chinese-media-copy span {
  color: var(--green);
  font-size: 0.72rem;
  font-weight: 900;
}

.chinese-course-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}

.chinese-course-card {
  min-height: 112px;
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr) 18px;
  align-items: center;
  gap: 12px;
  padding: 14px;
}

.chinese-course-emblem {
  width: 42px;
  height: 52px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(198, 161, 91, 0.6);
  color: var(--gold);
  background: rgba(198, 161, 91, 0.08);
  clip-path: polygon(50% 0, 100% 18%, 100% 78%, 50% 100%, 0 78%, 0 18%);
}

.chinese-course-copy {
  min-width: 0;
  display: grid;
  gap: 5px;
}

.chinese-course-arrow {
  color: var(--muted);
  font-size: 1.7rem;
}

.chinese-learning-card,
.chinese-stream-card,
.chinese-input-card,
.chinese-player-shell {
  border: 1px solid rgba(247, 247, 242, 0.12);
  border-radius: 10px;
  background: rgba(17, 20, 20, 0.72);
  color: var(--ink);
  text-decoration: none;
  box-shadow: 0 16px 46px rgba(0, 0, 0, 0.18);
}

.chinese-learning-card {
  min-height: 148px;
  display: grid;
  align-content: start;
  gap: 8px;
  padding: 16px;
}

.chinese-learning-card:hover,
.chinese-learning-card:focus-visible,
.chinese-stream-card:hover,
.chinese-stream-card:focus-visible {
  border-color: rgba(118, 184, 149, 0.36);
  background: rgba(23, 28, 27, 0.82);
  outline: none;
}

.chinese-learning-type,
.chinese-stream-card span,
.chinese-player-shell span {
  color: var(--green);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.02em;
}

.chinese-learning-card p,
.chinese-stream-card p,
.chinese-input-card p,
.chinese-player-shell p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
  font-size: 0.88rem;
}

.chinese-learning-meta,
.chinese-stream-card em,
.chinese-stream-card small {
  color: #9aa29f;
  font-size: 0.78rem;
  font-style: normal;
}

.chinese-pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chinese-pill-row span {
  border: 1px solid rgba(247, 247, 242, 0.12);
  border-radius: 999px;
  background: rgba(247, 247, 242, 0.045);
  color: #c6ccc9;
  padding: 8px 12px;
  font-size: 0.82rem;
  font-weight: 820;
}

.chinese-stream-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 14px;
}

.chinese-stream-card {
  min-height: 160px;
  display: grid;
  align-content: space-between;
  gap: 14px;
  padding: 16px;
}

.chinese-stream-card div {
  display: grid;
  gap: 6px;
}

.chinese-stream-card strong,
.chinese-input-card h3,
.chinese-player-shell h3 {
  color: var(--ink);
  font-size: 1.02rem;
  line-height: 1.2;
  margin: 0;
}

.chinese-stream-card a {
  color: var(--green);
  font-size: 0.84rem;
  font-weight: 850;
  text-decoration: none;
}

.chinese-input-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 16px;
}

.chinese-input-card > div {
  display: grid;
  gap: 6px;
}

.chinese-input-card button {
  width: auto;
  min-width: 132px;
  border-color: rgba(247, 247, 242, 0.14);
  background: rgba(247, 247, 242, 0.08);
  color: var(--muted);
}

.chinese-input-card small {
  grid-column: 1 / -1;
  color: #9aa29f;
  font-size: 0.8rem;
}

.chinese-player-shell {
  min-height: 160px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 130px;
  align-items: center;
  gap: 18px;
  padding: 18px;
}

.chinese-player-shell > div:first-child {
  display: grid;
  gap: 8px;
}

.chinese-player-placeholder {
  min-height: 110px;
  border: 1px solid rgba(247, 247, 242, 0.12);
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(118, 184, 149, 0.14), rgba(9, 11, 11, 0.8));
  display: grid;
  place-items: center;
  color: var(--green);
}

.chinese-route-panel {
  max-width: 1100px;
}

.chinese-route-header {
  display: grid;
  gap: 12px;
  border: 1px solid rgba(247, 247, 242, 0.1);
  border-radius: 10px;
  background: rgba(17, 20, 20, 0.62);
  padding: 18px;
}

.chinese-route-header p {
  max-width: 760px;
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.chinese-home-link {
  justify-self: start;
  color: var(--green);
  font-weight: 800;
}

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

.chinese-placeholder-grid div {
  min-height: 132px;
  display: grid;
  align-content: center;
  gap: 8px;
  border: 1px solid rgba(247, 247, 242, 0.11);
  border-radius: 10px;
  background: rgba(17, 20, 20, 0.7);
  padding: 16px;
}

.chinese-placeholder-grid span {
  color: var(--muted);
}

.chinese-empty-state {
  margin: 0;
  border: 1px dashed rgba(247, 247, 242, 0.18);
  border-radius: 10px;
  color: var(--muted);
  padding: 24px;
  text-align: center;
}

.chinese-watch-panel {
  display: grid;
  gap: 26px;
}

.chinese-watch-header {
  min-height: auto;
}

.chinese-watch-section {
  display: grid;
  gap: 14px;
}

.chinese-watch-empty {
  margin: 0;
  border: 1px dashed rgba(247, 247, 242, 0.14);
  border-radius: 12px;
  background: rgba(17, 20, 20, 0.48);
  color: var(--muted);
  padding: 18px;
  text-align: center;
}

.chinese-library-card {
  min-height: 210px;
  display: grid;
  align-content: end;
  gap: 14px;
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(247, 247, 242, 0.12);
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(5, 6, 6, 0.12), rgba(5, 6, 6, 0.88)),
    rgba(17, 20, 20, 0.76);
  color: var(--paper);
  padding: 16px;
  text-decoration: none;
  box-shadow: 0 18px 38px rgba(0, 0, 0, 0.18);
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.chinese-library-card:hover,
.chinese-library-card:focus-visible {
  transform: translateY(-2px);
  border-color: rgba(118, 184, 149, 0.36);
}

.chinese-library-card .chinese-media-art {
  position: absolute;
  inset: 0;
  opacity: 0.42;
  min-height: auto;
}

.chinese-library-card .chinese-media-art::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 0%, rgba(5, 6, 6, 0.86) 78%);
}

.chinese-library-copy {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 5px;
}

.chinese-library-copy span {
  color: var(--green);
  font-size: 0.72rem;
  font-weight: 900;
}

.chinese-library-copy strong {
  font-size: clamp(1.15rem, 2vw, 1.55rem);
  line-height: 1.18;
}

.chinese-library-copy small,
.chinese-library-copy em {
  color: var(--muted);
  font-style: normal;
  line-height: 1.35;
}

.chinese-series-detail {
  display: grid;
  gap: 20px;
}

.chinese-series-hero {
  background:
    radial-gradient(circle at top right, rgba(118, 184, 149, 0.12), transparent 300px),
    rgba(17, 20, 20, 0.7);
}

.chinese-series-hero > span {
  color: var(--green);
  font-size: 0.78rem;
  font-weight: 900;
}

.chinese-series-hero h2 {
  margin: 0;
  font-size: clamp(2rem, 5vw, 4.4rem);
  line-height: 1;
}

.chinese-series-meta,
.chinese-season-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.chinese-series-meta strong,
.chinese-season-tabs a {
  border: 1px solid rgba(247, 247, 242, 0.12);
  border-radius: 999px;
  background: rgba(247, 247, 242, 0.06);
  color: var(--paper);
  padding: 8px 12px;
  text-decoration: none;
}

.chinese-season-group {
  display: grid;
  gap: 12px;
}

.chinese-season-group h3 {
  margin: 0;
  font-size: 1.3rem;
}

.chinese-episode-list {
  display: grid;
  gap: 10px;
}

.chinese-episode-row {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(220px, 0.8fr);
  gap: 16px;
  align-items: center;
  border: 1px solid rgba(247, 247, 242, 0.1);
  border-radius: 12px;
  background: rgba(17, 20, 20, 0.7);
  padding: 14px;
}

a.chinese-episode-row {
  color: var(--paper);
  text-decoration: none;
  transition: border-color 180ms ease, background 180ms ease, transform 180ms ease;
}

a.chinese-episode-row:hover,
a.chinese-episode-row:focus-visible {
  border-color: rgba(118, 184, 149, 0.42);
  background: rgba(21, 30, 28, 0.88);
  transform: translateY(-1px);
}

.chinese-episode-row div {
  display: grid;
  gap: 4px;
}

.chinese-episode-row span,
.chinese-episode-row em,
.chinese-episode-row small {
  color: var(--muted);
  font-style: normal;
}

.chinese-episode-row mark {
  justify-self: start;
  border: 1px solid rgba(118, 184, 149, 0.26);
  border-radius: 999px;
  background: rgba(118, 184, 149, 0.1);
  color: var(--green);
  padding: 5px 9px;
}

.chinese-player-page {
  display: grid;
  gap: 20px;
}

.chinese-player-heading {
  display: grid;
  gap: 8px;
}

.chinese-player-heading span {
  justify-self: start;
  border: 1px solid rgba(118, 184, 149, 0.22);
  border-radius: 999px;
  background: rgba(118, 184, 149, 0.09);
  color: var(--green);
  padding: 5px 10px;
  font-size: 0.82rem;
  font-weight: 800;
}

.chinese-player-heading h2,
.chinese-player-heading p,
.chinese-player-heading small {
  margin: 0;
}

.chinese-player-heading h2 {
  font-size: clamp(2rem, 5vw, 4rem);
}

.chinese-player-heading p,
.chinese-player-heading small {
  color: var(--muted);
}

.chinese-video-shell {
  display: grid;
  gap: 14px;
}

.chinese-video-player {
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 1px solid rgba(247, 247, 242, 0.12);
  border-radius: 16px;
  background: #000;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.42);
}

.chinese-player-actions,
.chinese-player-ended,
.chinese-player-neighbors {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.chinese-player-actions button,
.chinese-player-next,
.chinese-player-prev {
  border: 1px solid rgba(247, 247, 242, 0.12);
  border-radius: 999px;
  background: rgba(247, 247, 242, 0.08);
  color: var(--paper);
  padding: 10px 14px;
  font-weight: 800;
  text-decoration: none;
}

.chinese-player-actions button:first-child,
.chinese-player-next {
  background: rgba(247, 247, 242, 0.94);
  color: #080b0b;
}

.chinese-player-message,
.chinese-player-error {
  border: 1px solid rgba(255, 110, 132, 0.28);
  border-radius: 12px;
  background: rgba(255, 110, 132, 0.08);
  color: #ffb0bd;
  padding: 12px 14px;
}

.chinese-player-ended {
  border: 1px solid rgba(118, 184, 149, 0.24);
  border-radius: 14px;
  background: rgba(118, 184, 149, 0.08);
  padding: 14px;
}

.chinese-player-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
}

.chinese-player-meta div {
  border: 1px solid rgba(247, 247, 242, 0.1);
  border-radius: 12px;
  background: rgba(17, 20, 20, 0.7);
  padding: 12px;
}

.chinese-player-meta dt,
.chinese-player-meta dd {
  margin: 0;
}

.chinese-player-meta dt {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.chinese-player-meta dd {
  margin-top: 5px;
  color: var(--paper);
  overflow-wrap: anywhere;
}

@media (max-width: 760px) {
  .chinese-episode-row {
    grid-template-columns: 1fr;
  }

  .chinese-player-meta {
    grid-template-columns: 1fr;
  }
}

.chinese-settings-panel {
  max-width: 960px;
}

.chinese-settings-card {
  display: grid;
  gap: 18px;
  border: 1px solid rgba(247, 247, 242, 0.11);
  border-radius: 14px;
  background:
    radial-gradient(circle at top right, rgba(118, 184, 149, 0.08), transparent 260px),
    rgba(17, 20, 20, 0.76);
  box-shadow: 0 22px 58px rgba(0, 0, 0, 0.24);
  padding: 20px;
}

.chinese-settings-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.chinese-settings-card h3,
.chinese-settings-card p {
  margin: 0;
}

.chinese-settings-card h3 {
  font-size: clamp(1.4rem, 3vw, 2rem);
}

.chinese-settings-card p,
.chinese-onedrive-message,
.chinese-onedrive-details {
  color: var(--muted);
}

.chinese-settings-kicker,
.chinese-onedrive-status-pill {
  color: var(--green);
  font-size: 0.74rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.chinese-onedrive-status-pill {
  flex: 0 0 auto;
  border: 1px solid rgba(118, 184, 149, 0.24);
  border-radius: 999px;
  background: rgba(118, 184, 149, 0.09);
  padding: 7px 10px;
  text-transform: none;
}

.chinese-onedrive-body {
  display: grid;
  gap: 16px;
}

.chinese-onedrive-message {
  margin: 0;
}

.chinese-onedrive-details {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
}

.chinese-onedrive-details div {
  display: grid;
  gap: 4px;
  border: 1px solid rgba(247, 247, 242, 0.09);
  border-radius: 10px;
  background: rgba(5, 6, 6, 0.34);
  padding: 12px;
}

.chinese-onedrive-details dt {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.chinese-onedrive-details dd {
  margin: 0;
  color: var(--ink);
  overflow-wrap: anywhere;
}

.chinese-onedrive-actions,
.chinese-onedrive-browser-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.chinese-onedrive-actions .primary,
.chinese-onedrive-browser-actions .primary,
.chinese-onedrive-actions .danger-button {
  min-height: 42px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 16px;
  text-decoration: none;
  white-space: nowrap;
}

.chinese-onedrive-browser {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.72);
  padding: 22px;
}

.chinese-onedrive-browser-card {
  position: relative;
  width: min(720px, 100%);
  max-height: min(78vh, 720px);
  overflow: auto;
  border: 1px solid rgba(247, 247, 242, 0.14);
  border-radius: 18px;
  background:
    radial-gradient(circle at top right, rgba(118, 184, 149, 0.1), transparent 280px),
    #0b0d0c;
  box-shadow: 0 34px 88px rgba(0, 0, 0, 0.52);
  padding: 28px;
}

.chinese-onedrive-browser-card h3 {
  margin: 0 48px 10px 0;
  font-size: clamp(1.45rem, 3.2vw, 2rem);
}

.chinese-onedrive-current {
  margin: 0 0 16px;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.chinese-onedrive-folder-list {
  display: grid;
  gap: 8px;
  margin-top: 16px;
}

.chinese-onedrive-folder {
  min-height: 48px;
  justify-content: flex-start;
  border-radius: 10px;
  background: rgba(247, 247, 242, 0.045);
  color: var(--ink);
  text-align: left;
}

.chinese-onedrive-empty {
  margin: 18px 0 0;
  border: 1px dashed rgba(247, 247, 242, 0.15);
  border-radius: 12px;
  color: var(--muted);
  padding: 18px;
  text-align: center;
}

.chinese-onedrive-scan {
  display: grid;
  gap: 12px;
  border-top: 1px solid rgba(247, 247, 242, 0.09);
  padding-top: 14px;
}

.chinese-onedrive-scan-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.chinese-onedrive-scan-message {
  margin: 0;
  color: var(--muted);
}

.chinese-onedrive-scan-counts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chinese-onedrive-scan-counts span {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  border: 1px solid rgba(247, 247, 242, 0.1);
  border-radius: 999px;
  background: rgba(247, 247, 242, 0.045);
  color: var(--muted);
  padding: 7px 10px;
}

.chinese-onedrive-scan-counts strong {
  color: var(--ink);
}

.chinese-onedrive-preview {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.74);
  padding: 22px;
}

.chinese-onedrive-preview-card {
  position: relative;
  display: grid;
  gap: 18px;
  width: min(1180px, 100%);
  max-height: min(84vh, 840px);
  overflow: auto;
  border: 1px solid rgba(247, 247, 242, 0.14);
  border-radius: 18px;
  background:
    radial-gradient(circle at top right, rgba(118, 184, 149, 0.09), transparent 300px),
    #0b0d0c;
  box-shadow: 0 34px 88px rgba(0, 0, 0, 0.54);
  padding: 28px;
}

.chinese-onedrive-preview-head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding-right: 54px;
}

.chinese-onedrive-preview-head h3,
.chinese-onedrive-preview-head p {
  margin: 0;
}

.chinese-onedrive-preview-head h3 {
  font-size: clamp(1.6rem, 3.4vw, 2.4rem);
}

.chinese-onedrive-preview-head p,
.chinese-onedrive-preview-head span {
  color: var(--muted);
}

.chinese-onedrive-preview-message {
  margin-top: 8px !important;
  color: #ff9aa8 !important;
  font-weight: 800;
}

.chinese-onedrive-preview-summary {
  display: grid;
  grid-template-columns: repeat(10, minmax(82px, 1fr));
  gap: 8px;
}

.chinese-onedrive-summary-card {
  display: grid;
  gap: 3px;
  border: 1px solid rgba(247, 247, 242, 0.1);
  border-radius: 12px;
  background: rgba(247, 247, 242, 0.045);
  padding: 11px;
}

.chinese-onedrive-summary-card strong {
  color: var(--ink);
  font-size: 1.35rem;
  line-height: 1;
}

.chinese-onedrive-summary-card span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.chinese-onedrive-preview-toolbar {
  display: grid;
  gap: 12px;
}

.chinese-onedrive-preview-filters,
.chinese-onedrive-preview-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chinese-onedrive-preview-filters button,
.chinese-onedrive-preview-actions button {
  min-height: 34px;
  border-radius: 999px;
  padding: 0 12px;
}

.chinese-onedrive-preview-filters button.active {
  border-color: rgba(118, 184, 149, 0.45);
  background: rgba(118, 184, 149, 0.16);
  color: var(--ink);
}

.chinese-onedrive-preview-table {
  display: grid;
  gap: 10px;
}

.chinese-onedrive-preview-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  border: 1px solid rgba(247, 247, 242, 0.1);
  border-radius: 14px;
  background: rgba(247, 247, 242, 0.035);
  padding: 10px;
}

.chinese-onedrive-preview-pagination span {
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 800;
}

.chinese-onedrive-preview-row {
  display: grid;
  grid-template-columns: 88px minmax(220px, 1.4fr) minmax(160px, 1fr) 136px minmax(150px, 1fr) 70px 70px;
  gap: 10px;
  align-items: end;
  border: 1px solid rgba(247, 247, 242, 0.1);
  border-radius: 14px;
  background: rgba(247, 247, 242, 0.04);
  padding: 12px;
}

.chinese-onedrive-preview-row label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.chinese-onedrive-preview-row input,
.chinese-onedrive-preview-row select {
  min-height: 38px;
  border: 1px solid rgba(247, 247, 242, 0.13);
  border-radius: 9px;
  background: rgba(0, 0, 0, 0.2);
  color: var(--ink);
  padding: 0 10px;
}

.preview-include {
  align-self: center;
}

.preview-include input {
  min-height: 18px;
}

.preview-file {
  display: grid;
  gap: 5px;
  overflow: hidden;
}

.preview-file strong,
.preview-file span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.preview-file span,
.preview-meta {
  color: var(--muted);
  font-size: 0.78rem;
}

.preview-meta,
.preview-warnings {
  grid-column: 2 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.preview-meta span,
.preview-warnings span {
  border: 1px solid rgba(247, 247, 242, 0.1);
  border-radius: 999px;
  background: rgba(247, 247, 242, 0.045);
  padding: 5px 8px;
}

.preview-warnings span {
  border-color: rgba(219, 92, 92, 0.35);
  color: #ff9f9f;
}

.preview-warnings .good {
  border-color: rgba(118, 184, 149, 0.28);
  color: var(--green);
}

.chinese-onedrive-preview-empty {
  margin: 0;
  border: 1px dashed rgba(247, 247, 242, 0.14);
  border-radius: 14px;
  color: var(--muted);
  padding: 26px;
  text-align: center;
}

.chinese-import-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.58);
  padding: 22px;
}

.chinese-import-modal[hidden] {
  display: none;
}

.chinese-import-modal-card {
  display: grid;
  gap: 18px;
  width: min(520px, 100%);
  border: 1px solid rgba(247, 247, 242, 0.14);
  border-radius: 18px;
  background:
    radial-gradient(circle at top right, rgba(118, 184, 149, 0.1), transparent 260px),
    #0b0d0c;
  box-shadow: 0 34px 88px rgba(0, 0, 0, 0.58);
  padding: 26px;
}

.chinese-import-modal-card h3,
.chinese-import-modal-card p {
  margin: 0;
}

.chinese-import-modal-card h3 {
  color: var(--ink);
  font-size: clamp(1.45rem, 3vw, 2rem);
}

.chinese-import-modal-card p {
  color: var(--muted);
  line-height: 1.6;
}

.chinese-import-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.chinese-import-summary div {
  display: grid;
  gap: 5px;
  border: 1px solid rgba(247, 247, 242, 0.11);
  border-radius: 12px;
  background: rgba(247, 247, 242, 0.045);
  padding: 12px;
}

.chinese-import-summary strong {
  color: var(--ink);
  font-size: 1.45rem;
  line-height: 1;
}

.chinese-import-summary span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.chinese-import-progress {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(247, 247, 242, 0.08);
}

.chinese-import-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, rgba(118, 184, 149, 0.78), rgba(210, 179, 103, 0.86));
  transition: width 180ms ease;
}

.chinese-import-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.chinese-import-modal-actions button {
  min-height: 42px;
  border-radius: 12px;
  padding: 0 18px;
}

.chinese-import-modal-actions .primary {
  border-color: transparent;
  background: var(--ink);
  color: #050606;
}

.chinese-modal-lock {
  overflow: hidden;
}

.chinese-logout-form {
  justify-self: start;
}

.chinese-art-city .chinese-card-art,
.chinese-art-city .chinese-media-art {
  background:
    linear-gradient(90deg, rgba(16, 20, 26, 0.2), rgba(5, 6, 6, 0.72)),
    radial-gradient(circle at 72% 28%, rgba(221, 139, 76, 0.2), transparent 28%),
    linear-gradient(145deg, #26303a 0%, #111617 52%, #2c1f1d 100%);
}

.chinese-art-moon .chinese-card-art,
.chinese-art-moon .chinese-media-art {
  background:
    radial-gradient(circle at 64% 24%, rgba(131, 164, 189, 0.42), transparent 13%),
    linear-gradient(145deg, #122033 0%, #0a1118 54%, #060707 100%);
}

.chinese-art-forest .chinese-card-art,
.chinese-art-forest .chinese-media-art {
  background:
    linear-gradient(90deg, rgba(10, 15, 11, 0.16), rgba(5, 6, 6, 0.72)),
    radial-gradient(circle at 70% 28%, rgba(118, 184, 149, 0.26), transparent 30%),
    linear-gradient(145deg, #26352a 0%, #111714 58%, #050606 100%);
}

.chinese-art-story .chinese-card-art,
.chinese-art-story .chinese-media-art {
  background: linear-gradient(135deg, #7a2024 0%, #441515 50%, #171717 100%);
}

.chinese-story-art,
.chinese-dli-art {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: grid;
  place-items: center;
  color: rgba(247, 247, 242, 0.78);
  font-weight: 950;
  font-size: 1.35rem;
  line-height: 0.95;
  text-align: center;
}

.chinese-art-wave .chinese-card-art,
.chinese-art-wave .chinese-media-art {
  background: linear-gradient(135deg, #0f2435 0%, #081018 64%, #050606 100%);
}

.chinese-wave-art {
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    repeating-linear-gradient(90deg, transparent 0 8px, rgba(131, 164, 189, 0.5) 9px 11px, transparent 12px 18px);
  mask-image: radial-gradient(ellipse at center, #000 0 34%, transparent 64%);
}

.chinese-art-dli .chinese-card-art,
.chinese-art-dli .chinese-media-art {
  background:
    radial-gradient(circle at 50% 52%, rgba(198, 161, 91, 0.24), transparent 42%),
    linear-gradient(135deg, #3a3322, #101211 72%);
}

.chinese-art-portrait .chinese-card-art,
.chinese-art-portrait .chinese-media-art {
  background:
    radial-gradient(circle at 72% 40%, rgba(240, 117, 133, 0.25), transparent 28%),
    linear-gradient(135deg, #4c1e1d, #171a18 72%);
}

.chinese-art-river .chinese-card-art,
.chinese-art-river .chinese-media-art {
  background:
    radial-gradient(circle at 65% 18%, rgba(118, 184, 149, 0.28), transparent 32%),
    linear-gradient(135deg, #2f4438, #121917 70%);
}

.chinese-art-mountain .chinese-card-art,
.chinese-art-mountain .chinese-media-art {
  background:
    linear-gradient(155deg, rgba(131, 164, 189, 0.2), transparent 50%),
    linear-gradient(135deg, #344555, #151a1b 72%);
}

.chinese-art-radio .chinese-card-art,
.chinese-art-radio .chinese-media-art,
.chinese-art-music .chinese-card-art,
.chinese-art-music .chinese-media-art,
.chinese-art-vocab .chinese-card-art,
.chinese-art-vocab .chinese-media-art {
  background:
    radial-gradient(circle at 35% 30%, rgba(118, 184, 149, 0.28), transparent 34%),
    linear-gradient(135deg, #1c2b29, #080909 72%);
}

.chinese-app-shell.is-collapsed {
  grid-template-columns: 72px minmax(0, 1fr);
}

.chinese-app-shell.is-collapsed .chinese-sidebar {
  padding-inline: 10px;
  align-items: center;
}

.chinese-app-shell.is-collapsed .chinese-brand strong,
.chinese-app-shell.is-collapsed .chinese-side-link span {
  display: none;
}

.chinese-app-shell.is-collapsed .chinese-sidebar-top {
  display: grid;
  justify-items: center;
}

.chinese-app-shell.is-collapsed .chinese-brand {
  justify-content: center;
}

.chinese-app-shell.is-collapsed .chinese-brand-logo {
  width: 42px;
  height: 42px;
}

.chinese-app-shell.is-collapsed .chinese-side-link {
  width: 48px;
  justify-content: center;
  padding: 0;
}

.chinese-app-shell.is-collapsed .chinese-side-link::after {
  content: attr(data-tooltip);
  position: absolute;
  left: calc(100% + 10px);
  top: 50%;
  z-index: 30;
  transform: translateY(-50%);
  pointer-events: none;
  opacity: 0;
  border: 1px solid rgba(247, 247, 242, 0.12);
  border-radius: 8px;
  background: rgba(8, 9, 9, 0.96);
  color: var(--ink);
  padding: 7px 9px;
  white-space: nowrap;
  box-shadow: var(--shadow);
  transition: opacity 160ms ease;
}

.chinese-app-shell.is-collapsed .chinese-side-link:hover::after,
.chinese-app-shell.is-collapsed .chinese-side-link:focus-visible::after {
  opacity: 1;
}

.chinese-drawer-scrim {
  display: none;
}

.chinese-drawer-lock {
  overflow: hidden;
}

@media (prefers-reduced-motion: reduce) {
  .chinese-progress-card,
  .chinese-media-card,
  .chinese-quick-tile,
  .chinese-course-card,
  .chinese-side-link {
    transition: none;
  }
}

.rule-editor {
  display: grid;
  gap: 10px;
}

.rule-editor label {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 120px;
  align-items: center;
  gap: 10px;
}

.docket-hero {
  display: none;
}

.docket-status {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 240px;
  gap: 10px;
  align-items: stretch;
  border-bottom: 1px solid var(--line);
  padding-bottom: 12px;
}

.weather-widget,
.time-widget {
  display: grid;
  gap: 4px;
  min-height: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(16, 18, 17, 0.78);
  padding: 10px;
}

.weather-widget {
  min-width: 0;
}

.time-widget {
  justify-items: stretch;
  align-content: stretch;
  min-width: 0;
  width: 100%;
  margin-left: 0;
  overflow: hidden;
}

.weather-widget strong {
  font-size: 1.18rem;
  line-height: 1;
}

.time-widget strong {
  font-size: clamp(2rem, 4vw, 3.25rem);
  line-height: 0.92;
}

.weather-widget span,
.time-widget span {
  color: var(--muted);
  font-size: 0.82rem;
}

.clock-panel {
  display: grid;
  gap: 2px;
  justify-items: center;
  text-align: center;
  align-content: center;
  min-height: 166px;
}

.time-toggle {
  display: inline-flex;
  gap: 4px;
  justify-self: end;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(5, 6, 6, 0.55);
  padding: 3px;
}

.time-toggle button {
  min-height: 26px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  padding: 0 8px;
  font-size: 0.72rem;
}

.time-toggle button.is-active {
  background: rgba(247, 247, 242, 0.12);
  color: var(--ink);
}

.timer-panel {
  display: grid;
  gap: 6px;
  align-content: center;
  min-width: 0;
  min-height: 166px;
}

.timer-panel[hidden],
.clock-panel[hidden] {
  display: none;
}

.timer-panel #timer-display {
  font-size: clamp(1.9rem, 3vw, 2.75rem);
  line-height: 0.9;
  justify-self: center;
}

.timer-panel #timer-display[hidden] {
  display: none;
}

.timer-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 122px;
  gap: 6px;
  align-items: start;
}

.timer-form button {
  min-height: 34px;
}

.timer-form > input[name="title"] {
  min-height: 40px;
  align-self: start;
}

.timer-form button:first-of-type,
.timer-form button:last-of-type {
  grid-column: span 1;
}

.timer-duration-editor {
  display: grid;
  grid-template-columns: 54px 8px 54px;
  gap: 4px;
  align-items: start;
  align-self: start;
}

.timer-stepper {
  display: grid;
  gap: 3px;
  justify-items: center;
}

.timer-stepper input {
  width: 100%;
  min-height: 40px;
  padding: 0 4px;
  text-align: center;
  font-size: 0.96rem;
  font-weight: 900;
}

.timer-stepper span {
  color: var(--muted);
  font-size: 0.58rem;
  font-weight: 850;
  text-transform: uppercase;
}

.timer-colon {
  align-self: start;
  color: var(--ink);
  font-weight: 900;
  text-align: center;
  padding-top: 9px;
}

.timer-controls,
.timer-presets {
  display: grid;
  gap: 6px;
}

.timer-controls:empty {
  display: none;
}

.timer-controls {
  grid-template-columns: minmax(0, 1fr) repeat(3, auto);
  align-items: center;
}

.timer-controls span {
  min-width: 0;
  color: var(--ink);
  font-weight: 850;
}

.timer-controls button {
  min-height: 30px;
  padding: 0 8px;
  font-size: 0.72rem;
}

.timer-preset {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 30px;
  gap: 6px;
  align-items: center;
}

.timer-preset > button:first-child {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
  min-height: 34px;
  padding: 0 8px;
}

.timer-preset strong,
.timer-preset span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.floating-timer {
  position: fixed;
  left: 18px;
  bottom: 18px;
  z-index: 20;
  display: grid;
  gap: 2px;
  min-width: 150px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: rgba(5, 6, 6, 0.93);
  box-shadow: var(--shadow);
  padding: 10px 12px;
}

.floating-timer span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
}

.floating-timer strong {
  color: var(--ink);
  font-size: 1.35rem;
  line-height: 1;
}

.weather-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px;
  align-items: end;
  align-self: start;
  min-width: 150px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(5, 6, 6, 0.46);
  padding: 8px;
}

.weather-form[hidden] {
  display: none;
}

.weather-form label span {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 850;
  text-transform: uppercase;
}

.weather-form button {
  min-height: 28px;
  padding: 0 8px;
  font-size: 0.72rem;
}

.weather-form input {
  min-height: 28px;
  padding: 0 8px;
  font-size: 0.76rem;
}

.weather-topline {
  display: none;
}

.weather-zip-link {
  min-height: auto;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  padding: 0;
  font-size: 0.72rem;
  text-decoration: underline;
  opacity: 0.7;
}

.weather-zip-link:hover {
  opacity: 1;
  border-color: transparent;
}

.weather-report {
  display: grid;
  gap: 6px;
  align-items: start;
}

.weather-report > div:first-child {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: baseline;
}

.weather-week {
  display: grid;
  grid-template-columns: minmax(250px, 0.58fr) minmax(520px, 1.42fr);
  gap: 8px;
  min-width: 0;
}

.weather-period {
  display: grid;
  gap: 3px;
  align-content: start;
  align-items: start;
  justify-content: stretch;
  min-width: 0;
  min-height: 88px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(5, 6, 6, 0.5);
  padding: 7px;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  white-space: normal;
}

.weather-period:hover,
.weather-period.is-active {
  border-color: rgba(198, 161, 91, 0.72);
  background: rgba(198, 161, 91, 0.08);
}

.weather-period strong,
.weather-period span,
.weather-period small {
  display: block;
}

.weather-period strong {
  font-size: 0.74rem;
}

.weather-period span {
  color: var(--ink);
  font-size: 0.92rem;
  font-weight: 900;
  line-height: 1.1;
}

.weather-period small {
  color: var(--muted);
  font-size: 0.64rem;
  line-height: 1.18;
  overflow-wrap: anywhere;
}

.weather-today {
  display: grid;
  gap: 7px;
  border-right: 1px solid var(--line);
  padding-right: 10px;
}

.weather-today-main {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 8px;
  align-items: center;
}

.weather-today-main strong,
.weather-today-main span,
.weather-today-main small {
  display: block;
}

.weather-today-main strong {
  font-size: 0.8rem;
}

.weather-today-main span {
  color: var(--ink);
  font-size: 1.18rem;
  font-weight: 900;
}

.weather-today-main small {
  color: var(--muted);
  font-size: 0.68rem;
}

.weather-hourly article {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(5, 6, 6, 0.42);
  padding: 5px;
}

.weather-hourly strong,
.weather-hourly span {
  display: block;
}

.weather-hourly strong {
  font-size: 0.64rem;
}

.weather-hourly span {
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 900;
}

.weather-hourly-shell {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) 18px;
  gap: 4px;
  align-items: center;
}

.weather-hour-nav {
  align-self: stretch;
  min-height: 100%;
  width: 18px;
  padding: 0;
  border-radius: 6px;
  font-size: 0.7rem;
}

.weather-hour-nav:disabled {
  opacity: 0.32;
  cursor: default;
}

.weather-hourly {
  display: grid;
  grid-template-columns: repeat(5, minmax(44px, 1fr));
  gap: 4px;
}

.weather-week-list {
  display: grid;
  grid-template-columns: repeat(7, minmax(74px, 1fr));
  gap: 5px;
  overflow: visible;
}

.weather-icon {
  position: relative;
  display: inline-block;
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
}

.weather-icon::before,
.weather-icon::after,
.weather-icon span::before,
.weather-icon span::after {
  content: "";
  position: absolute;
  display: block;
}

.weather-icon--sunny::before,
.weather-icon--partly::before {
  width: 19px;
  height: 19px;
  left: 4px;
  top: 4px;
  border-radius: 50%;
  background: #f5c95f;
  box-shadow: 0 0 0 5px rgba(245, 201, 95, 0.2);
}

.weather-icon--cloudy::before,
.weather-icon--rain::before,
.weather-icon--storm::before,
.weather-icon--snow::before,
.weather-icon--fog::before,
.weather-icon--partly::after {
  width: 21px;
  height: 10px;
  left: 3px;
  top: 14px;
  border-radius: 12px;
  background: #d8dedd;
  box-shadow:
    6px -7px 0 1px #d8dedd,
    13px -3px 0 0 #d8dedd;
}

.weather-icon--partly::after {
  left: 7px;
  top: 15px;
}

.weather-icon--rain span::before,
.weather-icon--rain span::after {
  width: 3px;
  height: 7px;
  top: 21px;
  border-radius: 3px;
  background: #78aee8;
  transform: rotate(16deg);
}

.weather-icon--rain span::before {
  left: 9px;
}

.weather-icon--rain span::after {
  left: 18px;
}

.weather-icon--storm span::before {
  left: 12px;
  top: 18px;
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 3px solid transparent;
  border-top: 11px solid #f5c95f;
  transform: skewX(-14deg);
}

.weather-icon--snow span::before,
.weather-icon--snow span::after {
  top: 21px;
  color: #dff2ff;
  font-size: 10px;
  line-height: 1;
  content: "*";
}

.weather-icon--snow span::before {
  left: 8px;
}

.weather-icon--snow span::after {
  left: 18px;
}

.weather-icon--fog::after {
  left: 4px;
  top: 22px;
  width: 20px;
  height: 7px;
  border-top: 2px solid #bfc5c4;
  border-bottom: 2px solid #bfc5c4;
}

.docket-board {
  display: grid;
  grid-template-columns: minmax(240px, 292px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.side-rail {
  display: grid;
  grid-column: 1;
  grid-row: 1;
  gap: 14px;
  position: sticky;
  top: 92px;
  border: 1px solid rgba(131, 164, 189, 0.24);
  border-radius: 18px;
  background:
    radial-gradient(circle at 18% 0%, rgba(80, 151, 214, 0.16), transparent 32%),
    linear-gradient(180deg, #07131f 0%, #06101a 48%, #05090d 100%);
  box-shadow:
    inset 0 1px 0 rgba(247, 247, 242, 0.06),
    0 18px 58px rgba(0, 0, 0, 0.34);
  padding: 18px;
  overflow: hidden;
}

.docket-calendar {
  grid-column: 2;
  grid-row: 1;
}

.view {
  display: none;
}

.view.is-active {
  display: block;
}

.docket-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(16, 18, 17, 0.84);
  box-shadow: 0 14px 52px rgba(0, 0, 0, 0.26);
  padding: 16px;
}

.side-rail .docket-panel {
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  padding: 0;
}

.side-rail .docket-panel + .docket-panel {
  border-top: 1px solid rgba(131, 164, 189, 0.18);
  padding-top: 14px;
}

.view-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.side-rail .view-header {
  align-items: center;
  margin-bottom: 14px;
}

.side-rail .view-header h2,
.sleep-schedule-panel h2 {
  color: var(--ink);
  font-size: clamp(1.45rem, 2.2vw, 2rem);
  letter-spacing: 0;
}

.side-rail .metric-row {
  gap: 8px;
}

.side-rail .metric {
  min-width: 76px;
  border-color: rgba(131, 164, 189, 0.24);
  border-radius: 12px;
  background: rgba(5, 10, 17, 0.62);
}

.view-header h2 {
  margin: 0;
  font-size: clamp(1.35rem, 2.3vw, 2.2rem);
  line-height: 1;
}

.eyebrow {
  display: none;
}

.metric-row,
.week-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: end;
}

.calendar-range-label {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--ink);
  font-size: 1.05rem;
  font-weight: 900;
  padding: 0 8px;
}

.calendar-title-row {
  display: grid;
  grid-template-columns: minmax(140px, 1fr) auto minmax(140px, 1fr);
  align-items: center;
  gap: 12px;
}

.calendar-title-row h2 {
  margin: 0;
  font-size: clamp(1.55rem, 2.2vw, 2.4rem);
  line-height: 1;
}

.calendar-title-row .calendar-range-label {
  justify-self: center;
}

.calendar-title-row #event-form-toggle {
  justify-self: end;
  min-width: 132px;
}

.calendar-nav {
  display: grid;
  gap: 18px;
  margin: 0 0 12px;
}

.calendar-nav .calendar-range-label {
  justify-content: center;
  min-height: 24px;
  padding: 0;
}

.calendar-date-row {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) 40px;
  gap: 8px;
  align-items: center;
}

.calendar-date-row input {
  min-width: 0;
  width: 100%;
}

.metric {
  min-width: 90px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--field);
  padding: 9px 10px;
}

.metric strong {
  display: block;
  font-size: 1.35rem;
  line-height: 1;
}

.metric span {
  color: var(--muted);
  font-size: 0.78rem;
}

.tool-panel {
  display: grid;
  gap: 12px;
  align-items: end;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(5, 6, 6, 0.62);
  padding: 14px;
  margin-bottom: 16px;
}

.tool-panel[hidden] {
  display: none;
}

.tool-panel label {
  min-width: 0;
}

.event-form {
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
}

.event-form .wide {
  grid-column: span 2;
}

.event-repeat-days {
  grid-column: 1 / -1;
}

.color-swatch-field {
  display: grid;
  gap: 7px;
  min-width: 0;
  border: 0;
  padding: 0;
  margin: 0;
}

.color-swatch-field legend {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 750;
}

.color-swatch-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.color-swatch-field.is-compact {
  position: relative;
  align-self: end;
  width: 42px;
}

.color-swatch-field.is-compact legend {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.color-swatch-field.is-compact .color-swatch-list {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 8;
  width: 162px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(5, 6, 6, 0.96);
  box-shadow: var(--shadow);
  padding: 8px;
}

.color-swatch-button {
  display: grid;
  place-items: center;
  width: 32px;
  min-height: 32px;
  border-color: var(--line);
  border-radius: 8px;
  background: rgba(5, 6, 6, 0.66);
  padding: 0;
}

.color-swatch-toggle {
  display: grid;
  place-items: center;
  width: 40px;
  min-height: 40px;
  border-color: var(--line);
  background: rgba(5, 6, 6, 0.66);
  padding: 0;
}

.color-swatch-toggle span {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #83a4bd;
  box-shadow: inset 0 0 0 1px rgba(247, 247, 242, 0.28);
}

.color-swatch-button span {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #83a4bd;
  box-shadow: inset 0 0 0 1px rgba(247, 247, 242, 0.28);
}

.color-swatch-default span {
  background: #83a4bd;
}

.color-swatch-blue span {
  background: #5097d6;
}

.color-swatch-green span {
  background: #76b895;
}

.color-swatch-gold span {
  background: #c6a15b;
}

.color-swatch-rose span {
  background: #f07585;
}

.color-swatch-purple span {
  background: #9c84d3;
}

.color-swatch-orange span {
  background: #dd8b4c;
}

.color-swatch-slate span {
  background: #9da6af;
}

.color-swatch-button.is-active {
  border-color: rgba(247, 247, 242, 0.74);
  box-shadow: 0 0 0 2px rgba(247, 247, 242, 0.12);
}

.event-color-default {
  --event-bg: #26333f;
  --event-border: rgba(131, 164, 189, 0.72);
}

.event-color-blue {
  --event-bg: #143b5e;
  --event-border: rgba(80, 151, 214, 0.82);
}

.event-color-green {
  --event-bg: #1f4a37;
  --event-border: rgba(118, 184, 149, 0.82);
}

.event-color-gold {
  --event-bg: #5b4826;
  --event-border: rgba(198, 161, 91, 0.82);
}

.event-color-rose {
  --event-bg: #5a2b32;
  --event-border: rgba(240, 117, 133, 0.8);
}

.event-color-purple {
  --event-bg: #3e315d;
  --event-border: rgba(156, 132, 211, 0.82);
}

.event-color-orange {
  --event-bg: #5b341d;
  --event-border: rgba(221, 139, 76, 0.82);
}

.event-color-slate {
  --event-bg: #353b40;
  --event-border: rgba(157, 166, 175, 0.72);
}

.monthly-repeat-group {
  grid-column: 1 / -1;
}

.monthly-builder {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) auto minmax(120px, 1fr) minmax(120px, 1fr) auto;
  gap: 8px;
  align-items: end;
}

.monthly-rule-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.monthly-rule-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-2);
  color: var(--ink);
  padding: 0 6px 0 10px;
  font-size: 0.76rem;
  font-weight: 800;
}

.monthly-rule-chip button {
  width: 22px;
  min-height: 22px;
  padding: 0;
  border-color: transparent;
  background: rgba(247, 247, 242, 0.08);
  color: var(--muted);
  font-size: 0.68rem;
}

.monthly-rule-empty {
  color: var(--muted);
  font-size: 0.78rem;
}

.event-form button {
  align-self: end;
}

.day-toggle-group {
  grid-column: 1 / -1;
}

.goal-sidebar {
  display: grid;
  gap: 9px;
}

.goal-category {
  border: 1px solid rgba(131, 164, 189, 0.2);
  border-radius: 16px;
  background: rgba(9, 21, 34, 0.72);
  color: var(--ink);
  overflow: hidden;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.goal-category-header {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 14px;
  min-height: 64px;
  padding: 11px 12px;
  cursor: pointer;
  user-select: none;
}

.goal-category.is-open .goal-category-header {
  background: linear-gradient(90deg, rgba(22, 128, 255, 0.92), rgba(31, 151, 255, 0.76));
  box-shadow: inset 0 1px 0 rgba(247, 247, 242, 0.18);
}

.goal-category:hover {
  border-color: rgba(80, 151, 214, 0.48);
  background: rgba(10, 28, 46, 0.82);
}

.goal-category-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: rgba(247, 247, 242, 0.08);
  color: var(--ink);
  box-shadow: inset 0 0 0 1px rgba(247, 247, 242, 0.08);
  font-weight: 900;
  font-size: 1.1rem;
}

.goal-category.is-open .goal-category-icon {
  background: rgba(5, 10, 17, 0.2);
}

.goal-category h3,
.goal-category p {
  margin: 0;
}

.goal-category h3 {
  font-size: 1rem;
  color: var(--ink);
}

.goal-category p {
  color: rgba(247, 247, 242, 0.64);
  font-size: 0.78rem;
}

.task-count-badge {
  display: grid;
  place-items: center;
  min-width: 32px;
  height: 28px;
  border: 1px solid rgba(247, 247, 242, 0.1);
  border-radius: 999px;
  background: rgba(22, 128, 255, 0.34);
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 900;
  line-height: 1;
  padding: 0 8px;
}

.task-count-badge.is-zero {
  background: rgba(247, 247, 242, 0.08);
  color: rgba(247, 247, 242, 0.48);
}

.category-add {
  width: 34px;
  min-height: 34px;
  padding: 0;
  border-color: rgba(247, 247, 242, 0.18);
  background: rgba(247, 247, 242, 0.92);
  color: #07131f;
  font-size: 1.2rem;
  font-weight: 900;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.24);
}

.goal-category-body {
  display: grid;
  gap: 10px;
  border-top: 1px solid rgba(247, 247, 242, 0.12);
  padding: 10px;
  background: rgba(5, 10, 17, 0.42);
}

.goal-add-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  border: 1px solid rgba(131, 164, 189, 0.22);
  border-radius: 14px;
  background: rgba(5, 10, 17, 0.74);
  padding: 10px;
}

.goal-add-form .wide,
.goal-add-form button {
  grid-column: 1 / -1;
}

.goal-add-form label {
  color: rgba(247, 247, 242, 0.68);
}

.goal-add-form input {
  border-color: rgba(131, 164, 189, 0.28);
  background: rgba(3, 8, 13, 0.72);
  color: var(--ink);
}

.goal-section-list {
  display: grid;
  gap: 8px;
}

.goal-nav-item {
  display: grid;
  grid-template-columns: 24px 1fr auto;
  gap: 10px;
  align-items: flex-start;
  border: 1px solid rgba(131, 164, 189, 0.18);
  border-radius: 14px;
  background: rgba(247, 247, 242, 0.06);
  padding: 10px;
}

.goal-nav-item h4,
.goal-nav-item p {
  margin: 0;
}

.goal-nav-item h4 {
  font-size: 0.92rem;
  color: var(--ink);
}

.goal-nav-item p {
  color: rgba(247, 247, 242, 0.6);
  font-size: 0.78rem;
}

.goal-nav-item .check-box {
  border-color: rgba(247, 247, 242, 0.42);
  background: rgba(5, 10, 17, 0.54);
  color: var(--ink);
}

.goal-nav-item .ghost {
  border-color: rgba(247, 247, 242, 0.14);
  background: rgba(247, 247, 242, 0.08);
  color: var(--ink);
}

.sleep-schedule-panel {
  display: grid;
  gap: 12px;
}

.sleep-panel-header {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  min-height: 64px;
  border: 1px solid rgba(131, 164, 189, 0.2);
  border-radius: 16px;
  background: rgba(9, 21, 34, 0.72);
  padding: 11px 12px;
}

.sleep-schedule-panel h2 {
  margin: 0;
  line-height: 1;
}

.sleep-panel-header p {
  margin: 3px 0 0;
  color: rgba(247, 247, 242, 0.64);
  font-size: 0.78rem;
}

.sleep-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  border: 1px solid rgba(131, 164, 189, 0.2);
  border-radius: 16px;
  background: rgba(9, 21, 34, 0.62);
  padding: 12px;
}

.sleep-form .wide,
.sleep-form .sleep-repeat-days,
.sleep-form button {
  grid-column: 1 / -1;
}

.sleep-form label {
  min-width: 0;
}

.sleep-form label span,
.sleep-repeat-days legend {
  color: rgba(247, 247, 242, 0.68);
}

.sleep-form input,
.sleep-form select {
  border-color: rgba(131, 164, 189, 0.28);
  background: rgba(3, 8, 13, 0.72);
  color: var(--ink);
}

.sleep-form .primary {
  border-color: rgba(247, 247, 242, 0.12);
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(22, 128, 255, 0.96), rgba(31, 151, 255, 0.78));
  color: var(--ink);
}

.sleep-repeat-days {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}

.sleep-repeat-days[hidden] {
  display: none;
}

.sleep-schedule-list {
  display: grid;
  gap: 8px;
}

.sleep-schedule-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 34px;
  gap: 8px;
  align-items: center;
  border: 1px solid rgba(131, 164, 189, 0.18);
  border-radius: 14px;
  background: rgba(247, 247, 242, 0.06);
  padding: 10px;
}

.sleep-schedule-item strong,
.sleep-schedule-item span {
  display: block;
}

.sleep-schedule-item strong {
  color: var(--ink);
  font-size: 0.95rem;
}

.sleep-schedule-item span {
  color: var(--muted);
  font-size: 0.76rem;
}

fieldset {
  border: 0;
  margin: 0;
  padding: 0;
}

legend {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 750;
  margin-bottom: 8px;
}

.day-toggle-group {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
}

.day-toggle-group label {
  display: block;
  cursor: pointer;
}

.day-toggle-group input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.day-toggle-group span {
  display: grid;
  min-height: 34px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: var(--field);
  font-size: 0.78rem;
  font-weight: 800;
}

.day-toggle-group input:checked + span {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--accent-ink);
}

.planner-frame {
  position: relative;
  overflow: hidden;
  border-radius: 8px;
}

.planner-shell {
  position: relative;
  overflow-x: auto;
  overflow-y: hidden;
  border: 2px solid var(--line-strong);
  border-radius: 8px;
  background: rgba(5, 6, 6, 0.62);
}

.planner-shell:has(.day-expand-strip) {
  border-top: 0;
}

.calendar-scroll-button {
  display: none;
}

.calendar-grid {
  box-sizing: border-box;
  display: grid;
  grid-template-columns: 72px repeat(7, minmax(150px, 1fr));
  grid-template-rows: var(--day-header) var(--untimed-height, 76px) var(--day-body-height);
  min-width: 1122px;
  position: relative;
}

.day-expand-strip {
  box-sizing: border-box;
  display: grid;
  grid-template-columns: 72px repeat(7, minmax(150px, 1fr));
  min-width: 1122px;
  border-top: 2px solid var(--line-strong);
  border-bottom: 0;
  border-radius: 8px 8px 0 0;
  background: rgba(5, 6, 6, 0.72);
}

.day-expand-gutter,
.day-expand-cell {
  min-height: 24px;
  display: grid;
  align-items: center;
  border-right: 2px solid var(--line-strong);
  padding: 4px 0;
}

.day-expand-gutter {
  background: #090a0a;
}

.available-grid {
  box-sizing: border-box;
  display: grid;
  grid-template-columns: 72px repeat(7, minmax(150px, 1fr));
  min-width: 1122px;
  border-top: 2px solid var(--line-strong);
  background: rgba(5, 6, 6, 0.82);
}

.planner-head {
  display: flex;
  align-items: center;
  justify-content: center;
  border-right: 2px solid var(--line-strong);
  border-bottom: 2px solid var(--line-strong);
  background: #171514;
  color: var(--ink);
  font-weight: 900;
  text-transform: uppercase;
}

.day-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 10px;
  text-transform: none;
}

.day-head .header-day-expand {
  display: none;
}

.day-head span {
  color: var(--muted);
  font-weight: 800;
}

.day-head strong {
  font-size: 1rem;
}

.planner-time-head {
  font-size: 0.82rem;
}

.unspecified-gutter,
.untimed-day-column {
  min-height: var(--untimed-height, 76px);
  border-right: 2px solid var(--line-strong);
  border-bottom: 2px solid var(--line-strong);
  background: #090a0a;
}

.unspecified-gutter {
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 0.58rem;
  font-weight: 900;
  text-align: center;
  text-transform: uppercase;
}

.untimed-day-column {
  display: grid;
  grid-auto-rows: auto;
  gap: 6px;
  align-content: start;
  align-items: stretch;
  overflow: visible;
  padding: 5px 7px;
}

.untimed-day-column > span {
  display: grid;
  place-items: center;
  width: 100%;
  color: rgba(167, 170, 167, 0.46);
  font-size: 0.74rem;
  font-weight: 800;
}

.untimed-event {
  display: grid;
  grid-template-columns: 22px minmax(80px, 1fr);
  align-items: start;
  gap: 6px;
  min-width: 0;
  max-width: none;
  border: 1px solid var(--event-border, rgba(131, 164, 189, 0.72));
  border-radius: 7px;
  background: var(--event-bg, rgba(131, 164, 189, 0.18));
  padding: 6px;
  overflow: hidden;
}

.untimed-event strong,
.untimed-event small {
  display: block;
}

.untimed-event small {
  color: var(--muted);
  font-size: 0.68rem;
}

.time-rail,
.calendar-day-column {
  height: var(--day-body-height);
  min-height: var(--day-body-height);
}

.time-rail {
  display: grid;
  grid-template-rows: repeat(24, var(--hour-height));
  background: #090a0a;
  border-right: 2px solid var(--line-strong);
  overflow: visible;
  z-index: 2;
}

.planner-hour-label {
  position: relative;
  min-height: 0;
  display: grid;
  place-items: start center;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 800;
  line-height: 1;
  pointer-events: none;
}

.planner-hour-label::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 1px;
  background: rgba(247, 247, 242, 0.36);
}

.planner-hour-label:first-child::before {
  display: none;
}

.planner-hour-label span {
  position: relative;
  z-index: 1;
  display: inline-block;
  background: #090a0a;
  padding: 0 7px;
  transform: translateY(-50%);
}

.planner-hour-label:not(:first-child) {
  transform: translateY(-1px);
}

.calendar-day-column {
  position: relative;
  border-right: 2px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.012);
  overflow: hidden;
}

.day-background-layer,
.day-block-layer,
.day-interaction-layer {
  position: absolute;
  inset: 0;
}

.day-background-layer {
  z-index: 1;
  display: grid;
  grid-template-rows: repeat(24, var(--hour-height));
  pointer-events: none;
}

.day-block-layer {
  z-index: 5;
  pointer-events: none;
  overflow: hidden;
}

.day-interaction-layer {
  z-index: 3;
  display: grid;
  grid-template-rows: repeat(96, calc(var(--hour-height) / 4));
}

.planner-hour-cell {
  min-height: 0;
  border-bottom: 1px solid rgba(247, 247, 242, 0.36);
  user-select: none;
}

.planner-slot-cell {
  min-height: 0;
  cursor: crosshair;
  user-select: none;
}

.time-block {
  position: absolute;
  left: 6px;
  right: 6px;
  z-index: 1;
  min-height: 0;
  margin: 0;
  display: flex;
  align-items: flex-start;
  gap: 6px;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  padding: 7px;
  font-size: 0.74rem;
  line-height: 1.2;
  pointer-events: auto;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.28);
}

.calendar-event:not(.sleep-event),
.untimed-event {
  cursor: pointer;
}

.time-block strong,
.time-block span,
.time-block em,
.time-block small {
  display: block;
}

.time-block strong {
  font-size: 0.77rem;
}

.time-block span,
.time-block small {
  color: var(--muted);
}

.time-block em {
  color: var(--green);
  font-style: normal;
}

.sleep-time-block {
  pointer-events: none;
  align-items: flex-start;
  padding: 4px 8px;
  color: var(--ink);
  background:
    repeating-linear-gradient(
      135deg,
      rgba(247, 247, 242, 0.95) 0,
      rgba(247, 247, 242, 0.95) 3px,
      transparent 3px,
      transparent 18px
    ),
    var(--sleep);
  background-position: 0 var(--block-offset, 0), 0 0;
  border-color: rgba(247, 247, 242, 0.6);
}

.sleep-time-block strong,
.sleep-time-block span {
  display: inline;
  white-space: nowrap;
  position: relative;
  z-index: 1;
}

.sleep-time-block span {
  color: rgba(247, 247, 242, 0.82);
  font-size: 0.72rem;
}

.sleep-time-block strong {
  border-radius: 999px;
  background: rgba(5, 6, 6, 0.82);
  padding: 1px 6px;
  line-height: 1.1;
}

.planner-slot-cell.is-selected {
  background: rgba(118, 184, 149, 0.18);
  box-shadow: inset 0 0 0 1px rgba(118, 184, 149, 0.72);
}

.sleep-block {
  pointer-events: none;
  color: var(--ink);
  background:
    repeating-linear-gradient(
      135deg,
      rgba(247, 247, 242, 0.95) 0,
      rgba(247, 247, 242, 0.95) 3px,
      transparent 3px,
      transparent 18px
    ),
    var(--sleep);
  border-color: rgba(247, 247, 242, 0.6);
}

.sleep-block span {
  color: rgba(247, 247, 242, 0.82);
}

.calendar-event {
  background: var(--event-bg, #26333f);
  border-color: var(--event-border, rgba(131, 164, 189, 0.72));
}

.calendar-event.sleep-event {
  align-items: flex-start;
  pointer-events: auto;
  cursor: context-menu;
  background:
    repeating-linear-gradient(
      135deg,
      rgba(247, 247, 242, 0.95) 0,
      rgba(247, 247, 242, 0.95) 3px,
      transparent 3px,
      transparent 18px
    ),
    var(--sleep);
  border-color: rgba(247, 247, 242, 0.6);
}

.calendar-event.sleep-event strong {
  display: inline-block;
  width: max-content;
  border-radius: 999px;
  background: rgba(5, 6, 6, 0.86);
  color: var(--ink);
  padding: 2px 8px;
  font-size: 0.78rem;
  line-height: 1.1;
}

.goal-block {
  background: rgba(118, 184, 149, 0.16);
  border-color: rgba(118, 184, 149, 0.72);
}

.check-box {
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  min-height: 22px;
  border-radius: 6px;
  padding: 0;
  border-color: rgba(247, 247, 242, 0.56);
  background: rgba(5, 6, 6, 0.75);
  color: var(--ink);
  font-size: 0.72rem;
  font-weight: 900;
}

.is-complete h4,
.is-complete strong,
.is-complete p,
.is-complete span,
.is-complete em {
  text-decoration: line-through;
  opacity: 0.62;
}

.day-goals {
  min-height: 76px;
  padding: 10px;
  background: rgba(247, 247, 242, 0.03);
}

.day-goals h3 {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 0.74rem;
  text-transform: uppercase;
}

.compact-goal {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-2);
  padding: 8px;
  margin-top: 6px;
}

.compact-goal strong,
.compact-goal span {
  display: block;
}

.compact-goal strong {
  font-size: 0.82rem;
}

.compact-goal span {
  color: var(--muted);
  font-size: 0.74rem;
}

.available-dock {
  display: grid;
  gap: 3px;
  border-top: 1px solid var(--line);
  background: #0b0c0c;
  padding: 10px;
  min-height: 78px;
}

.planner-footer {
  display: grid;
  grid-template-rows: minmax(76px, auto) minmax(78px, auto);
  border-right: 2px solid var(--line-strong);
  background: rgba(5, 6, 6, 0.82);
}

.available-gutter {
  display: grid;
  grid-template-rows: minmax(76px, auto) minmax(78px, auto);
  min-height: 154px;
  border-right: 2px solid var(--line-strong);
  background: #090a0a;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 900;
  text-transform: uppercase;
}

.available-gutter div {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
  text-align: center;
}

.available-gutter div + div {
  border-top: 1px solid var(--line);
}

.available-dock strong {
  font-size: 1.2rem;
}

.available-dock span,
.available-dock small {
  color: var(--muted);
  font-size: 0.74rem;
}

.item-list,
.checklist-list {
  display: grid;
  gap: 10px;
}

.checklist-day {
  display: grid;
  gap: 6px;
}

.checklist-day h3 {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
}

.checklist-day h3 span {
  color: var(--line-strong);
}

.check-item,
.sleep-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-2);
  padding: 10px;
}

.check-item > div:nth-child(2),
.sleep-item > div:nth-child(2) {
  min-width: 0;
  flex: 1;
}

.check-item h4,
.sleep-item h3 {
  margin: 0 0 4px;
  font-size: 0.92rem;
}

.check-item p,
.sleep-item p {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
}

.item-actions {
  display: inline-flex;
  gap: 6px;
  flex: 0 0 auto;
}

.sleep-swatch {
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
  border: 1px solid rgba(247, 247, 242, 0.72);
  border-radius: 6px;
  background:
    repeating-linear-gradient(
      135deg,
      rgba(247, 247, 242, 0.95) 0,
      rgba(247, 247, 242, 0.95) 3px,
      transparent 3px,
      transparent 11px
    ),
    var(--sleep);
}

.is-muted {
  opacity: 0.56;
}

.empty,
.empty-small {
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: rgba(247, 247, 242, 0.03);
  text-align: center;
}

.empty {
  padding: 24px 14px;
}

.empty-small {
  margin: 0;
  padding: 10px 8px;
  font-size: 0.78rem;
}

.docket-footer {
  display: flex;
  justify-content: flex-end;
  padding: 2px 4px 0;
}

.docket-footer a {
  color: var(--muted);
  font-size: 0.72rem;
  opacity: 0.42;
  text-decoration: none;
}

.docket-footer a:hover,
.docket-footer a:focus-visible {
  opacity: 0.9;
  text-decoration: underline;
}

.event-modal,
.weather-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(0, 0, 0, 0.62);
}

.event-modal-card,
.weather-modal-card {
  position: relative;
  width: min(680px, 100%);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0d0f0e;
  box-shadow: var(--shadow);
  padding: 22px;
}

.weather-modal-card {
  width: min(360px, 100%);
}

.event-modal-card h2,
.weather-modal-card h2 {
  margin: 0 0 16px;
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  line-height: 1;
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
}

.quick-event-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.quick-event-form .wide,
.quick-event-form .quick-repeat-days,
.modal-footer,
.modal-delete-row,
.modal-actions {
  grid-column: 1 / -1;
}

.event-description-field textarea {
  min-height: 92px;
  resize: vertical;
}

.modal-footer {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
  margin-top: 4px;
}

.modal-delete-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  min-height: 42px;
  padding: 0;
}

.modal-delete-row[hidden],
.delete-repeat-choices[hidden] {
  display: none;
}

.delete-repeat-choices {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 0;
}

body.modal-open {
  overflow: hidden;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  transform: translateY(16px);
  opacity: 0;
  pointer-events: none;
  z-index: 10;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--accent);
  color: var(--accent-ink);
  padding: 12px 14px;
  transition: opacity 160ms ease, transform 160ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.sidebar-panel-backdrop {
  display: none;
}

body.sidebar-modal-open {
  overflow: hidden;
}

body.sidebar-modal-open .sidebar-panel-backdrop {
  position: fixed;
  inset: 0;
  z-index: 2147483000;
  display: block;
  border: 0;
  border-radius: 0;
  background: rgba(0, 0, 0, 0.62);
}

.side-rail.sidebar-menu {
  align-content: start;
  border: 0;
  background: transparent;
  box-shadow: none;
  padding: 8px 4px;
  overflow: visible;
}

.sidebar-nav-list {
  display: grid;
  gap: 8px;
}

.sidebar-row-icon {
  display: grid;
  place-items: center;
  width: 34px;
  min-height: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  background: rgba(247, 247, 242, 0.07);
  color: var(--ink);
  padding: 0;
  font-size: 1.05rem;
  font-weight: 900;
}

.sidebar-emoji-button {
  cursor: pointer;
}

.sidebar-emoji-button:hover,
.sidebar-emoji-button:focus-visible {
  background: rgba(247, 247, 242, 0.16);
}

.sidebar-nav-heading {
  margin: 16px 8px 4px;
  color: var(--ink);
  font-size: 0.94rem;
  font-weight: 900;
}

.sidebar-menu-row {
  border: 0;
  border-radius: 14px;
  background: transparent;
  box-shadow: none;
  overflow: visible;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 54px;
  padding: 8px 10px;
  color: var(--ink);
  text-align: left;
  font-weight: 900;
}

.sidebar-row-label {
  min-height: 36px;
  border: 0;
  background: transparent;
  color: inherit;
  padding: 0;
  text-align: left;
  font: inherit;
  cursor: pointer;
}

.sidebar-menu-row-button,
.sidebar-row-label {
  cursor: pointer;
}

.sidebar-menu-row:hover,
.sidebar-menu-row:focus-visible {
  background: rgba(247, 247, 242, 0.04);
}

.sidebar-menu-row.is-mock {
  cursor: default;
}

.sidebar-menu-row.is-mock:hover {
  background: transparent;
}

.sidebar-menu-row.is-primary {
  background: linear-gradient(90deg, rgba(22, 128, 255, 0.92), rgba(31, 151, 255, 0.78));
  box-shadow:
    inset 0 1px 0 rgba(247, 247, 242, 0.2),
    0 10px 26px rgba(22, 128, 255, 0.2);
}

.sidebar-menu-row.is-primary .sidebar-row-icon {
  background: rgba(5, 10, 17, 0.2);
}

.sidebar-menu-row:disabled {
  opacity: 0.72;
  cursor: default;
}

.sidebar-modal {
  position: fixed;
  inset: 0;
  z-index: 2147483200;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 0;
  background: rgba(0, 0, 0, 0.72);
  padding: 22px;
}

.sidebar-modal[hidden] {
  display: none;
}

.sidebar-popup-card {
  position: relative;
  width: min(820px, calc(100vw - 44px));
  max-height: calc(100vh - 44px);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #0d0f0e !important;
  box-shadow: var(--shadow);
  padding: 18px;
}

.sidebar-popup-card > div > .docket-panel {
  display: grid;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  padding: 0;
}

.sidebar-popup-card .view-header,
.sidebar-popup-card .sleep-panel-header {
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  margin: 0 0 14px;
  padding: 0 0 14px;
  cursor: default;
}

.sidebar-popup-card .sleep-panel-header {
  grid-template-columns: 38px minmax(0, 1fr);
}

.sidebar-popup-card .view-header h2,
.sidebar-popup-card .sleep-panel-header h2 {
  font-size: clamp(1.5rem, 3vw, 2.1rem);
}

.sidebar-popup-card .view-header .metric-row,
.sidebar-popup-card .goal-sidebar,
.sidebar-popup-card .sleep-form,
.sidebar-popup-card .sleep-schedule-list {
  display: grid;
}

.sidebar-popup-card .view-header .metric-row {
  display: flex;
}

.sidebar-popup-card .sleep-panel-header #sleep-schedule-count {
  display: none;
}

.sidebar-modal-close {
  position: absolute;
  top: 18px;
  right: 18px;
  z-index: 1;
  display: grid;
}

.emoji-modal-card {
  width: min(520px, calc(100vw - 44px));
}

.emoji-form {
  display: grid;
  gap: 14px;
}

.emoji-choice-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 7px;
}

.emoji-choice-grid button {
  min-height: 40px;
  border-color: var(--line);
  border-radius: 10px;
  background: rgba(247, 247, 242, 0.06);
  padding: 0;
  font-size: 1.22rem;
}

.emoji-choice-grid button:hover,
.emoji-choice-grid button:focus-visible {
  border-color: rgba(80, 151, 214, 0.7);
  background: rgba(80, 151, 214, 0.16);
}

.sleep-schedule-item {
  cursor: context-menu;
}

.day-expand-button {
  width: 100%;
  min-height: 14px;
  border: 1px solid rgba(131, 164, 189, 0.24);
  border-left: 0;
  border-right: 0;
  border-radius: 0;
  background: rgba(247, 247, 242, 0.05);
  color: rgba(247, 247, 242, 0.64);
  padding: 0;
  font-size: 0.78rem;
  font-weight: 900;
  line-height: 1;
}

.day-expand-button:hover,
.day-expand-button:focus-visible {
  border-color: rgba(118, 184, 149, 0.74);
  color: var(--ink);
}

.day-modal-card {
  width: min(780px, 100%);
}

.day-detail-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.day-detail-section,
.day-rating-field,
.positive-fieldset,
.day-detail-form .wide,
.day-detail-form .modal-actions {
  grid-column: 1 / -1;
}

.day-detail-section {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(247, 247, 242, 0.04);
  padding: 12px;
}

.day-detail-section h3,
.positive-fieldset legend {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
}

.day-detail-list {
  display: grid;
  gap: 8px;
}

.day-detail-item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(5, 6, 6, 0.6);
  padding: 8px 10px;
}

.day-detail-item span {
  color: var(--muted);
}

.day-rating-field {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr) 70px;
  align-items: center;
  gap: 10px;
}

.positive-fieldset {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.positive-fieldset legend {
  grid-column: 1 / -1;
}

@media (max-width: 1180px) {
  .docket-board {
    grid-template-columns: 1fr;
  }

  .docket-calendar,
  .side-rail {
    grid-column: auto;
    grid-row: auto;
    position: static;
  }

  .money-main {
    grid-template-columns: 1fr;
  }

  .money-sidebar {
    position: static;
  }

  .money-nav {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .money-page-header,
  .money-dashboard-grid,
  .money-lower-grid {
    grid-template-columns: 1fr;
  }

  .money-summary-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

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

  .chinese-header {
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
  }

  .chinese-search {
    width: 100%;
  }

  .chinese-progress-grid {
    grid-template-columns: 1fr;
  }

  .chinese-quick-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 1050px) {
  .topbar {
    grid-template-columns: 1fr;
  }

  .tabs {
    grid-column: auto;
    grid-row: auto;
    justify-content: center;
  }

  .event-form {
    grid-template-columns: repeat(2, minmax(180px, 1fr));
  }

  .event-form .wide {
    grid-column: span 2;
  }

  .docket-status {
    display: grid;
    grid-template-columns: 1fr;
  }

  .time-widget {
    justify-items: start;
    margin-left: 0;
  }

  .weather-report,
  .weather-week {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 720px) {
  .login-panel {
    padding: 24px;
  }

  .money-main {
    padding-inline: 10px;
  }

  .money-nav {
    display: flex;
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .money-nav-item {
    min-width: 156px;
  }

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

  .money-account-grid,
  .allocation-layout,
  .quick-action-grid {
    grid-template-columns: 1fr;
  }

  .money-page-header h1,
  .money-placeholder h1 {
    font-size: clamp(2rem, 11vw, 2.55rem);
  }

  .money-table th,
  .money-table td {
    font-size: 0.78rem;
    padding-inline: 5px;
  }

  .money-table th:nth-child(2),
  .money-table td:nth-child(2) {
    display: none;
  }

  .money-table th:nth-child(1),
  .money-table td:nth-child(1) { width: 48%; }
  .money-table th:nth-child(3),
  .money-table td:nth-child(3) { width: 20%; }
  .money-table th:nth-child(4),
  .money-table td:nth-child(4) { width: 32%; }

  .language-selection {
    grid-template-columns: 1fr;
    width: min(520px, 100%);
    gap: 22px;
  }

  .chinese-main {
    padding-inline: 10px;
  }

  .chinese-quick-grid,
  .chinese-placeholder-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .chinese-progress-card {
    grid-template-columns: 92px minmax(0, 1fr);
  }

  .chinese-media-row {
    grid-auto-columns: minmax(168px, 78vw);
  }

  .rule-editor label {
    grid-template-columns: 1fr;
  }

  .topbar {
    grid-template-columns: 1fr;
    align-items: center;
  }

  .topbar form {
    justify-self: start;
  }

  .view-header {
    display: grid;
  }

  .metric-row,
  .week-controls {
    justify-content: start;
  }

  .calendar-nav .calendar-range-label {
    justify-content: start;
  }

  .event-form,
  .goal-add-form,
  .quick-event-form {
    grid-template-columns: 1fr;
  }

  .event-form .wide,
  .goal-add-form .wide,
  .quick-event-form .wide {
    grid-column: auto;
  }

  .day-toggle-group {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .monthly-builder {
    grid-template-columns: 1fr;
  }

  .calendar-grid,
  .available-grid {
    grid-template-columns: 64px repeat(14, minmax(180px, 1fr));
  }
}

@media (max-width: 520px) {
  .money-summary-grid {
    grid-template-columns: 1fr;
  }

  .chinese-quick-grid,
  .chinese-placeholder-grid {
    grid-template-columns: 1fr;
  }

  .chinese-progress-card {
    grid-template-columns: 1fr;
  }

  .chinese-card-art {
    min-height: 90px;
  }

  .mode-switcher {
    width: min(100%, 300px);
  }

  .tab {
    min-width: 0;
    flex: 1 1 0;
  }
}

@media (max-width: 1180px) {
  .chinese-top-header {
    grid-template-columns: minmax(0, 1fr);
  }

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

  .chinese-quick-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

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

@media (max-width: 900px) {
  .chinese-app-shell,
  .chinese-app-shell.is-collapsed {
    grid-template-columns: 1fr;
  }

  .chinese-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: min(84vw, 282px);
    transform: translateX(-105%);
    transition: transform 200ms ease;
  }

  .chinese-app-shell.is-drawer-open .chinese-sidebar {
    transform: translateX(0);
  }

  .chinese-app-shell.is-drawer-open .chinese-drawer-scrim {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 15;
    width: auto;
    min-height: 0;
    border: 0;
    border-radius: 0;
    background: rgba(0, 0, 0, 0.58);
    padding: 0;
  }

  .chinese-collapse-button {
    display: none;
  }

  .chinese-app-shell.is-collapsed .chinese-sidebar {
    align-items: stretch;
    padding: 20px 14px;
  }

  .chinese-app-shell.is-collapsed .chinese-sidebar-top {
    display: flex;
    justify-items: stretch;
  }

  .chinese-app-shell.is-collapsed .chinese-brand strong,
  .chinese-app-shell.is-collapsed .chinese-side-link span {
    display: inline;
  }

  .chinese-app-shell.is-collapsed .chinese-side-link {
    width: auto;
    justify-content: flex-start;
    padding: 0 12px;
  }

  .chinese-app-shell.is-collapsed .chinese-side-link::after {
    display: none;
  }

  .chinese-menu-button {
    display: inline-flex;
  }

  .chinese-app-content {
    padding: 18px 16px 34px;
  }

  .chinese-top-header {
    grid-template-columns: 42px minmax(0, 1fr);
    align-items: center;
  }

  .chinese-search {
    grid-column: auto;
  }

  .chinese-progress-grid,
  .chinese-course-grid,
  .chinese-placeholder-grid {
    grid-template-columns: 1fr;
  }

  .chinese-settings-card-head,
  .chinese-onedrive-details,
  .chinese-input-card,
  .chinese-player-shell {
    grid-template-columns: 1fr;
  }

  .chinese-settings-card-head {
    display: grid;
  }

  .chinese-media-row {
    grid-auto-columns: minmax(190px, 72vw);
  }
}

@media (max-width: 560px) {
  .chinese-top-header {
    gap: 12px;
  }

  .chinese-title-block h1 {
    font-size: 2.2rem;
  }

  .chinese-progress-card {
    grid-template-columns: 1fr;
  }

  .chinese-card-art {
    min-height: 96px;
  }

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

/* Compact Watch rails */
.chinese-watch-panel {
  max-width: none;
  min-width: 0;
  gap: clamp(24px, 3vw, 32px);
  overflow: hidden;
}

.chinese-watch-header {
  margin-bottom: -4px;
}

.chinese-watch-section {
  min-width: 0;
  gap: 12px;
}

.chinese-watch-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
}

.chinese-watch-section-head h3 {
  margin: 0;
  color: #f7f7f2;
  font-size: clamp(1.04rem, 1.5vw, 1.24rem);
  line-height: 1.15;
  font-weight: 900;
  letter-spacing: 0;
}

.chinese-media-rail-wrap {
  position: relative;
  min-width: 0;
}

.chinese-media-rail {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: clamp(220px, 18vw, 260px);
  gap: 14px;
  min-width: 0;
  overflow-x: auto;
  overflow-y: visible;
  padding: 2px 2px 12px;
  scroll-padding-inline: 2px;
  scroll-snap-type: x proximity;
  scrollbar-width: none;
}

.chinese-media-rail::-webkit-scrollbar {
  display: none;
}

.chinese-rail-button {
  position: absolute;
  top: calc((clamp(220px, 18vw, 260px) * 9 / 16) / 2);
  z-index: 3;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  min-height: 36px;
  border: 1px solid rgba(247, 247, 242, 0.16);
  border-radius: 999px;
  background: rgba(5, 6, 6, 0.76);
  color: #f7f7f2;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.36);
  transform: translateY(-50%);
  transition: opacity 180ms ease, border-color 180ms ease, background 180ms ease;
}

.chinese-rail-button.is-prev {
  left: 8px;
}

.chinese-rail-button.is-next {
  right: 8px;
  font-size: 1.8rem;
  line-height: 1;
}

.chinese-rail-button svg {
  width: 16px;
  height: 16px;
}

.chinese-rail-button:hover,
.chinese-rail-button:focus-visible {
  border-color: rgba(118, 184, 149, 0.48);
  background: rgba(17, 20, 20, 0.92);
}

.chinese-rail-button:disabled,
.chinese-rail-button[hidden] {
  display: none;
}

.chinese-watch-panel .chinese-library-card {
  display: grid;
  grid-template-rows: auto minmax(88px, auto);
  align-content: stretch;
  gap: 0;
  width: 100%;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  border: 1px solid rgba(247, 247, 242, 0.13);
  border-radius: 14px;
  background: rgba(14, 17, 17, 0.96);
  color: #f7f7f2;
  padding: 0;
  scroll-snap-align: start;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.22);
  transition: transform 190ms ease, border-color 190ms ease, box-shadow 190ms ease;
}

.chinese-watch-panel .chinese-library-card:hover,
.chinese-watch-panel .chinese-library-card:focus-visible {
  transform: translateY(-2px);
  border-color: rgba(118, 184, 149, 0.38);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.3);
}

.chinese-watch-panel .chinese-library-card .chinese-media-art {
  position: relative;
  inset: auto;
  display: grid;
  place-items: center;
  aspect-ratio: 16 / 9;
  min-height: 0;
  width: 100%;
  overflow: hidden;
  opacity: 1;
  background:
    radial-gradient(circle at 24% 18%, rgba(118, 184, 149, 0.2), transparent 32%),
    linear-gradient(135deg, rgba(42, 50, 48, 0.95), rgba(7, 9, 9, 0.98));
}

.chinese-watch-panel .chinese-library-card .chinese-media-art::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(5, 6, 6, 0.04), rgba(5, 6, 6, 0.42) 76%, rgba(5, 6, 6, 0.72)),
    radial-gradient(circle at 50% 58%, transparent 0, rgba(0, 0, 0, 0.26) 70%);
  pointer-events: none;
}

.chinese-watch-panel .chinese-library-initial {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: rgba(247, 247, 242, 0.18);
  font-size: clamp(3rem, 5.2vw, 4.8rem);
  line-height: 1;
  font-weight: 900;
  text-shadow: 0 2px 28px rgba(0, 0, 0, 0.4);
  transform: translateY(2px);
}

.chinese-watch-panel .chinese-library-copy {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 10px 12px 12px;
  background: linear-gradient(180deg, rgba(17, 20, 20, 0.98), rgba(9, 11, 11, 0.98));
}

.chinese-watch-panel .chinese-library-copy span {
  color: rgba(118, 184, 149, 0.92);
  font-size: 0.68rem;
  line-height: 1.1;
  font-weight: 900;
}

.chinese-watch-panel .chinese-library-copy strong {
  color: #f7f7f2;
  font-size: 0.98rem;
  line-height: 1.18;
  font-weight: 900;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chinese-watch-panel .chinese-library-copy small,
.chinese-watch-panel .chinese-library-copy em {
  color: rgba(215, 218, 214, 0.74);
  font-size: 0.78rem;
  line-height: 1.22;
  font-style: normal;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chinese-watch-panel .chinese-progress-track {
  height: 5px;
  margin-top: 5px;
  border-radius: 999px;
  background: rgba(247, 247, 242, 0.12);
  overflow: hidden;
}

.chinese-watch-panel .chinese-progress-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #76b895, #b9e4c8);
}

.chinese-reader-page {
  display: grid;
  gap: 18px;
  max-width: none;
  min-height: calc(100vh - 96px);
}

.chinese-reader-heading {
  display: grid;
  gap: 8px;
  max-width: 980px;
}

.chinese-reader-heading > span {
  width: fit-content;
  border: 1px solid rgba(118, 184, 149, 0.28);
  border-radius: 999px;
  padding: 5px 10px;
  color: rgba(185, 228, 200, 0.9);
  background: rgba(118, 184, 149, 0.08);
  font-size: 0.72rem;
  font-weight: 900;
}

.chinese-reader-heading h2 {
  margin: 0;
  color: #f7f7f2;
  font-size: clamp(2rem, 4vw, 4rem);
  line-height: 1.02;
  letter-spacing: 0;
}

.chinese-reader-heading p {
  margin: 0;
  color: rgba(215, 218, 214, 0.72);
  font-size: clamp(1rem, 1.3vw, 1.15rem);
}

.chinese-reader-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 8px 0 0;
}

.chinese-reader-meta div {
  display: grid;
  gap: 2px;
  min-width: 112px;
  border: 1px solid rgba(247, 247, 242, 0.1);
  border-radius: 12px;
  padding: 9px 11px;
  background: rgba(12, 15, 15, 0.78);
}

.chinese-reader-meta dt {
  color: rgba(215, 218, 214, 0.55);
  font-size: 0.68rem;
  font-weight: 900;
}

.chinese-reader-meta dd {
  margin: 0;
  color: rgba(247, 247, 242, 0.9);
  font-weight: 900;
}

.chinese-reader-controls {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  border: 1px solid rgba(247, 247, 242, 0.1);
  border-radius: 14px;
  padding: 10px;
  background: rgba(7, 9, 9, 0.9);
  backdrop-filter: blur(16px);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.2);
}

.chinese-reader-controls button {
  min-height: 38px;
  border: 1px solid rgba(247, 247, 242, 0.14);
  border-radius: 10px;
  padding: 0 14px;
  color: #f7f7f2;
  background: rgba(247, 247, 242, 0.06);
  font-weight: 900;
}

.chinese-reader-controls button:hover,
.chinese-reader-controls button:focus-visible {
  border-color: rgba(118, 184, 149, 0.42);
  background: rgba(118, 184, 149, 0.13);
}

.chinese-reader-position {
  margin-inline: auto;
  color: rgba(215, 218, 214, 0.76);
  font-size: 0.92rem;
  font-weight: 900;
}

.chinese-reader-message {
  margin: 0;
  border: 1px solid rgba(240, 117, 133, 0.32);
  border-radius: 12px;
  padding: 12px 14px;
  color: #ffd4da;
  background: rgba(240, 117, 133, 0.08);
}

.chinese-pdf-shell,
.chinese-epub-shell {
  min-height: min(74vh, 860px);
  border: 1px solid rgba(247, 247, 242, 0.12);
  border-radius: 18px;
  overflow: hidden;
  background: rgba(11, 13, 13, 0.96);
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.3);
}

.chinese-pdf-frame {
  display: block;
  width: 100%;
  height: min(78vh, 900px);
  border: 0;
  background: #111;
}

.chinese-epub-shell {
  display: grid;
  grid-template-rows: auto 1fr;
}

.chinese-epub-toolbar {
  border-bottom: 1px solid rgba(247, 247, 242, 0.1);
  padding: 12px;
  background: rgba(5, 6, 6, 0.72);
}

.chinese-epub-toolbar select {
  width: min(100%, 420px);
  min-height: 42px;
  border: 1px solid rgba(247, 247, 242, 0.14);
  border-radius: 10px;
  color: #f7f7f2;
  background: rgba(12, 15, 15, 0.96);
  padding: 0 12px;
  font-weight: 800;
}

.chinese-epub-content {
  max-width: 860px;
  width: 100%;
  margin: 0 auto;
  padding: clamp(24px, 4vw, 54px);
  color: rgba(247, 247, 242, 0.88);
  font-size: clamp(1.05rem, 1.35vw, 1.25rem);
  line-height: 1.8;
}

.chinese-epub-content h1,
.chinese-epub-content h2,
.chinese-epub-content h3 {
  color: #f7f7f2;
  line-height: 1.25;
}

.chinese-epub-content a {
  color: #b9e4c8;
}

@media (max-width: 980px) {
  .chinese-media-rail {
    grid-auto-columns: clamp(205px, 34vw, 250px);
  }

  .chinese-rail-button {
    top: calc((clamp(205px, 34vw, 250px) * 9 / 16) / 2);
  }
}

@media (max-width: 620px) {
  .chinese-media-rail {
    grid-auto-columns: clamp(180px, 76vw, 232px);
    gap: 12px;
  }

  .chinese-rail-button {
    display: none;
  }

  .chinese-watch-panel .chinese-library-copy strong {
    white-space: normal;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
  }

  .chinese-reader-controls {
    position: static;
  }

  .chinese-reader-position {
    order: -1;
    width: 100%;
    margin: 0;
  }
}
