:root {
  --bg: #f4f7f9;
  --panel: #ffffff;
  --text: #1e2a32;
  --muted: #65737d;
  --line: #dce5ea;
  --primary: #16716d;
  --primary-dark: #0f5552;
  --accent: #d97706;
  --success: #16803a;
  --danger: #c24132;
  --shadow: 0 18px 45px rgba(33, 50, 62, 0.12);
  --sidebar-width: 280px;
  --workspace-gap: 14px;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow: hidden;
  font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
  color: var(--text);
  background:
    linear-gradient(135deg, rgba(22, 113, 109, 0.08), transparent 36%),
    linear-gradient(315deg, rgba(217, 119, 6, 0.08), transparent 30%),
    var(--bg);
}

body.home-page {
  overflow: auto;
  background:
    radial-gradient(circle at 18% 52%, rgba(22, 113, 109, 0.1), transparent 24%),
    radial-gradient(circle at 74% 72%, rgba(217, 119, 6, 0.08), transparent 26%),
    linear-gradient(180deg, #fbfdfe 0%, #f2f7f6 100%);
}

.home-shell {
  width: min(1320px, calc(100% - 56px));
  min-height: 100vh;
  margin: 0 auto;
  padding: 28px 0 32px;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 20px;
}

.home-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.home-brand {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  color: var(--primary);
  font-size: 18px;
  text-decoration: none;
}

.home-logo {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 8px;
  color: #ffffff;
  background: linear-gradient(135deg, #43b8a3, var(--primary));
  box-shadow: 0 10px 24px rgba(22, 113, 109, 0.22);
  font-weight: 800;
}

.home-nav-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.auth-nav-status {
  max-width: 260px;
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  padding: 0 16px;
  border: 1px solid rgba(220, 229, 234, 0.8);
  border-radius: 8px;
  color: var(--primary-dark);
  background: rgba(232, 242, 241, 0.9);
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-nav-btn {
  min-height: 48px;
  padding: 0 22px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border: 1px solid rgba(220, 229, 234, 0.8);
  border-radius: 8px;
  color: #30424c;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 12px 28px rgba(33, 50, 62, 0.09);
  cursor: pointer;
  text-decoration: none;
}

.home-nav-btn span {
  color: var(--primary-dark);
  font-size: 22px;
  line-height: 1;
}

.home-hero {
  position: relative;
  align-self: center;
  display: grid;
  justify-items: center;
  gap: 18px;
  padding: 34px 0 0;
  text-align: center;
}

.home-hero h1 {
  max-width: 920px;
  color: #1c2b35;
  font-size: clamp(40px, 4.6vw, 62px);
  line-height: 1.12;
  font-weight: 900;
}

.home-lead {
  max-width: 780px;
  color: #84909a;
  font-size: 20px;
  line-height: 1.7;
}

.home-tagline {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #263943;
  font-weight: 800;
}

.home-tagline::before,
.home-tagline::after {
  content: "";
  width: 42px;
  height: 1px;
  background: var(--line);
}

.home-tagline span {
  color: var(--accent);
}

.home-actions {
  width: min(760px, 100%);
  margin: -8px auto 0;
  display: grid;
  gap: 24px;
}

.home-main-card,
.home-secondary-card {
  color: inherit;
  text-decoration: none;
}

.home-main-card {
  position: relative;
  min-height: 240px;
  overflow: hidden;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 18px;
  padding: 34px;
  border-radius: 22px;
  color: #ffffff;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.14), transparent 34%),
    linear-gradient(135deg, #47c1a9 0%, #168f7f 52%, #137266 100%);
  box-shadow: 0 24px 44px rgba(22, 113, 109, 0.26);
  text-align: center;
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}

.home-main-card::after {
  content: "";
  position: absolute;
  right: -6px;
  top: 44px;
  width: 174px;
  height: 58px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.18);
  transform: rotate(135deg);
}

.home-main-card:hover,
.home-secondary-card:hover {
  transform: translateY(-3px);
}

.home-main-card:hover {
  box-shadow: 0 28px 54px rgba(22, 113, 109, 0.32);
}

.home-main-icon {
  position: relative;
  z-index: 1;
  display: grid;
  width: 94px;
  height: 94px;
  place-items: center;
  border-radius: 50%;
  color: var(--primary);
  background: rgba(255, 255, 255, 0.96);
  font-size: 48px;
  font-weight: 300;
}

.home-main-card h2,
.home-main-card p {
  position: relative;
  z-index: 1;
}

.home-main-card h2 {
  font-size: 36px;
  line-height: 1.2;
}

.home-main-card p {
  color: rgba(255, 255, 255, 0.88);
  font-size: 17px;
  font-weight: 700;
}

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

.home-secondary-card {
  min-height: 118px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  padding: 24px 26px;
  border: 1px solid rgba(220, 229, 234, 0.86);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 18px 34px rgba(33, 50, 62, 0.09);
  transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}

.home-secondary-card:hover {
  border-color: rgba(22, 113, 109, 0.36);
  box-shadow: 0 22px 42px rgba(33, 50, 62, 0.13);
}

.home-secondary-icon {
  display: grid;
  width: 64px;
  height: 64px;
  place-items: center;
  border-radius: 50%;
  color: var(--primary);
  background: #e7f4f2;
  font-size: 32px;
  line-height: 1;
}

.accent-card .home-secondary-icon {
  color: var(--accent);
  background: #fff0df;
}

.home-secondary-card h2 {
  color: #1e2a32;
  font-size: 22px;
  line-height: 1.2;
}

.home-secondary-card p {
  margin-top: 8px;
  color: var(--muted);
  line-height: 1.45;
}

.home-secondary-card strong {
  color: #7a8b96;
  font-size: 36px;
  font-weight: 300;
}

.home-footer {
  align-self: end;
  padding-top: 6px;
  color: #8b98a3;
  font-size: 15px;
  line-height: 1.6;
  text-align: center;
}

/* Auth pages */
body.auth-page {
  background:
    radial-gradient(circle at 18% 22%, rgba(22, 113, 109, 0.08), transparent 28%),
    linear-gradient(180deg, #fbfdfe 0%, #f4f8f7 100%);
}

.auth-shell {
  width: min(520px, calc(100% - 32px));
  min-height: 100vh;
  margin: 0 auto;
  padding: 20px 0 28px;
  display: grid;
  align-content: start;
  gap: 16px;
}

.auth-topbar {
  min-height: 44px;
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr) 120px;
  align-items: center;
  gap: 12px;
}

.auth-topbar > strong {
  color: #1e2a32;
  font-size: 18px;
  text-align: center;
}

.announcement-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(15, 23, 42, 0.58);
}

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

.announcement-modal {
  width: min(560px, 100%);
  max-height: min(80vh, 680px);
  overflow: auto;
  padding: 24px;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.3);
}

.announcement-modal h2 {
  margin: 0;
  overflow-wrap: anywhere;
}

.announcement-modal-body {
  margin: 18px 0;
  color: #334155;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.announcement-modal-time {
  color: #64748b;
  font-size: 13px;
}

.auth-topbar-link {
  width: fit-content;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #30424c;
  font-size: 14px;
  font-weight: 800;
  text-decoration: none;
}

.auth-topbar-link span {
  color: var(--primary-dark);
  font-size: 20px;
  line-height: 1;
}

.auth-topbar-action {
  justify-self: end;
  color: var(--primary-dark);
}

.auth-card {
  display: grid;
  gap: 18px;
  padding: 26px 28px 22px;
  border: 1px solid rgba(220, 229, 234, 0.9);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 18px 42px rgba(33, 50, 62, 0.08);
}

.auth-card-head {
  display: grid;
  gap: 6px;
  text-align: center;
}

.auth-card-head h1 {
  color: #1c2b35;
  font-size: 28px;
  line-height: 1.2;
}

.auth-card-head p {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

.auth-form {
  display: grid;
  gap: 12px;
}

.auth-field {
  display: grid;
  gap: 6px;
}

.auth-field span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.auth-field input {
  min-height: 44px;
  border-color: #cfe4e0;
  background: rgba(251, 253, 253, 0.9);
}

.auth-field input:focus {
  border-color: #6fc2b6;
  box-shadow: 0 0 0 4px rgba(22, 113, 109, 0.1);
  outline: none;
}

.auth-consent {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.6;
}

.auth-consent input {
  width: 16px;
  height: 16px;
  min-height: 0;
  padding: 0;
  flex: 0 0 auto;
  margin-top: 3px;
}

.auth-consent span {
  flex: 1 1 auto;
  min-width: 0;
  word-break: normal;
  overflow-wrap: break-word;
}

.auth-consent a {
  color: var(--primary-dark);
}

.auth-field-action {
  margin: -4px 0 0;
  font-size: 13px;
  font-weight: 800;
  text-align: right;
}

.auth-field-action a {
  color: var(--primary-dark);
}

.verification-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 142px;
  gap: 10px;
  align-items: center;
}

.verification-button {
  min-height: 44px;
  padding: 0 14px;
  font-size: 14px;
  white-space: nowrap;
}

.auth-form .practice-page-btn {
  width: 100%;
  min-height: 46px;
  margin-top: 2px;
}

.auth-form .verification-button {
  min-height: 44px;
  margin-top: 0;
}

.auth-message {
  min-height: 20px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.5;
}

.auth-message.success {
  color: var(--success);
}

.auth-message.error {
  color: var(--danger);
}

.auth-action-link {
  display: grid;
  place-items: center;
  text-decoration: none;
}

.auth-action-link[hidden] {
  display: none;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  height: 1px;
  flex: 1;
  background: var(--line);
}

.wechat-placeholder-btn {
  min-height: 52px;
  display: grid;
  place-items: center;
  gap: 4px;
  border: 1px solid #b9e4d6;
  border-radius: 8px;
  color: #0f6b45;
  background: #eefaf4;
  box-shadow: 0 12px 26px rgba(15, 107, 69, 0.08);
  font: inherit;
  font-weight: 900;
}

.wechat-placeholder-btn small {
  color: #5f806f;
  font-size: 12px;
  font-weight: 800;
}

.wechat-placeholder-btn:hover {
  background: #e4f6ed;
}

.auth-switch {
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
  text-align: center;
}

.auth-switch a {
  color: var(--primary-dark);
}

.auth-legal {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: -6px;
  color: #8a999f;
  font-size: 13px;
}

.auth-legal a {
  color: var(--muted);
  font-weight: 700;
  text-decoration: none;
}

.auth-topbar-link:hover,
.auth-topbar-link:focus-visible,
.auth-field-action a:hover,
.auth-field-action a:focus-visible,
.auth-switch a:hover,
.auth-switch a:focus-visible,
.auth-legal a:hover,
.auth-legal a:focus-visible {
  color: var(--primary);
  text-decoration: underline;
}

body.entry-page {
  background:
    radial-gradient(circle at 16% 46%, rgba(22, 113, 109, 0.1), transparent 25%),
    radial-gradient(circle at 78% 68%, rgba(22, 113, 109, 0.09), transparent 24%),
    linear-gradient(180deg, #fbfdfe 0%, #f4f8f8 100%);
}

.entry-shell {
  width: min(1340px, calc(100% - 56px));
  min-height: 100vh;
  margin: 0 auto;
  padding: 24px 0 48px;
  display: grid;
  grid-template-rows: auto auto auto 1fr;
  gap: 34px;
}

.entry-nav-link {
  text-decoration: none;
}

.entry-card {
  width: min(1030px, 100%);
  margin: 0 auto;
  padding: 34px 30px 24px;
  display: grid;
  gap: 22px;
  border: 1px solid rgba(220, 229, 234, 0.9);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 28px 58px rgba(33, 50, 62, 0.12);
}

.entry-library-row {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  gap: 16px;
}

.entry-field {
  display: grid;
  gap: 8px;
}

.entry-field span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.entry-field input {
  min-height: 46px;
  border-color: #cfe4e0;
  background: rgba(251, 253, 253, 0.9);
}

.entry-batch-wrap:focus-within {
  border-color: #6fc2b6;
  box-shadow: 0 0 0 4px rgba(22, 113, 109, 0.1);
}

.entry-batch-icon {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 8px;
  color: var(--primary);
  background: #e5f3f1;
  font-weight: 900;
}

.entry-add-btn {
  min-height: 76px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: #ffffff;
  background: linear-gradient(135deg, #36b99e, #0f8c7a);
  box-shadow: 0 16px 30px rgba(22, 113, 109, 0.24);
  font-size: 20px;
}

.entry-add-btn:hover {
  background: linear-gradient(135deg, #2fae95, #0d796b);
}

.entry-batch-wrap {
  position: relative;
  min-height: 330px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: 22px;
  padding: 34px 20px 46px 26px;
  border: 1px solid #bfe3dd;
  border-radius: 12px;
  background: #ffffff;
}

.entry-batch-wrap textarea {
  height: 248px;
  min-height: 248px;
  max-height: 248px;
  padding: 2px 0 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  resize: none;
  background: transparent;
  color: #52616c;
  font-size: 17px;
  line-height: 1.8;
}

.entry-batch-wrap textarea:focus {
  box-shadow: none;
}

.entry-batch-wrap small {
  position: absolute;
  right: 22px;
  bottom: 18px;
  color: #758593;
  font-size: 18px;
}

.entry-current-wrap {
  min-height: 360px;
}

.entry-current-content {
  min-width: 0;
  display: grid;
  gap: 16px;
}

.entry-current-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.entry-current-head h2 {
  color: #263943;
  font-size: 24px;
}

.entry-current-head p {
  margin-top: 6px;
  color: var(--muted);
  line-height: 1.5;
}

.entry-current-head strong {
  flex: 0 0 auto;
  color: var(--primary);
  font-size: 18px;
}

.entry-current-list {
  display: grid;
  align-content: start;
  gap: 10px;
  max-height: 150px;
  margin: 0;
  padding: 0 4px 0 0;
  overflow: auto;
  list-style: none;
}

.entry-current-list li {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  padding: 12px 14px;
  border: 1px solid rgba(220, 229, 234, 0.92);
  border-radius: 10px;
  background: #fbfdfd;
}

.entry-current-list strong {
  color: var(--primary-dark);
  word-break: break-word;
}

.entry-current-list .word-title-line {
  display: block;
}

.entry-current-list .word-meaning-line {
  overflow-wrap: anywhere;
}

.entry-current-list span {
  color: var(--muted);
  line-height: 1.45;
}

.entry-current-list small {
  grid-column: 1 / -1;
  color: var(--muted);
  line-height: 1.45;
}

.entry-empty-text {
  padding: 18px;
  border: 1px dashed #bfe3dd;
  border-radius: 10px;
  color: var(--muted);
  background: #f8fcfb;
  line-height: 1.6;
}

.entry-current-list li small {
  position: static;
  right: auto;
  bottom: auto;
  font-size: inherit;
}

.entry-message {
  min-height: 22px;
  color: var(--muted);
  font-weight: 700;
}

.entry-message.success {
  color: var(--success);
}

.entry-message.error {
  color: var(--danger);
}

.input-cloud-library-status {
  color: var(--muted);
  line-height: 1.55;
}

.input-cloud-library-field {
  display: grid;
  gap: 8px;
}

.input-cloud-library-field span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.input-cloud-library-field select {
  min-height: 46px;
  padding: 0 14px;
  border: 1px solid #cfe4e0;
  border-radius: 10px;
  background: rgba(251, 253, 253, 0.9);
  color: #263943;
  font: inherit;
}

.input-cloud-library-status {
  margin: 0;
  font-weight: 800;
}

.input-cloud-library-status.error {
  color: var(--danger);
}

.input-cloud-library-status.success {
  color: var(--primary);
}

/* input.html formal product layout */
.entry-page [hidden] {
  display: none !important;
}

.entry-shell {
  width: min(1120px, calc(100% - 56px));
  padding: 24px 0 38px;
  grid-template-rows: auto auto auto auto;
  gap: 18px;
}

.entry-topbar {
  width: 100%;
}

.entry-topbar h1 {
  font-size: clamp(32px, 4vw, 48px);
}

.entry-target-bar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px 24px;
  padding: 14px 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 10px 28px rgba(39, 82, 77, 0.06);
}

.entry-target-summary,
.entry-target-controls {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 16px;
}

.entry-current-library-label {
  color: var(--primary-dark);
  font-size: 14px;
  font-weight: 900;
  white-space: nowrap;
}

.entry-current-library-name {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 8px;
}

.entry-library-name-input {
  width: clamp(190px, 25vw, 320px);
  max-width: 100%;
  min-width: 0;
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid #cfe4e0;
  border-radius: 10px;
  background: #fbfdfd;
  color: #263943;
  font: inherit;
  font-size: 14px;
}

.entry-library-name-input:focus {
  border-color: #6fc2b6;
  box-shadow: 0 0 0 4px rgba(22, 113, 109, 0.1);
}

.entry-library-name-input:disabled {
  color: #7f918e;
  background: #f4f8f7;
}

.entry-target-summary > span,
.entry-target-summary > strong {
  color: var(--muted);
  font-size: 13px;
}

.entry-target-summary > strong {
  color: var(--text);
}

.entry-target-controls .input-cloud-library-field select {
  min-width: 190px;
  min-height: 40px;
}

.entry-text-btn {
  min-height: 36px;
  padding: 0 4px;
  border: 0;
  color: var(--primary-dark);
  background: transparent;
  font-size: 14px;
  font-weight: 800;
}

.entry-text-btn:hover {
  color: var(--primary);
  background: transparent;
}

.entry-target-status {
  grid-column: 1 / -1;
  min-height: 0;
  font-size: 13px;
}

.entry-target-status:empty {
  display: none;
}

.entry-product-card {
  width: 100%;
  gap: 18px;
  padding: 24px 26px;
  border-radius: 16px;
  box-shadow: 0 18px 42px rgba(33, 50, 62, 0.09);
}

.entry-product-head {
  display: grid;
  gap: 4px;
}

.entry-product-head > span {
  color: var(--primary);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.entry-product-head h2 {
  color: #1c2b35;
  font-size: 26px;
}

.entry-product-form-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.entry-product-field {
  display: grid;
  gap: 8px;
}

.entry-product-field > span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.entry-product-field input {
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid #cfe4e0;
  border-radius: 10px;
  background: #fbfdfd;
  color: #263943;
  font: inherit;
}

.entry-product-field input:focus {
  border-color: #6fc2b6;
  box-shadow: 0 0 0 4px rgba(22, 113, 109, 0.1);
}

.entry-product-field-wide {
  grid-column: 1 / -1;
}

.entry-submit-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 18px;
}

.entry-submit-row .input-cloud-library-status {
  flex: 1;
}

.entry-submit-row .entry-add-btn {
  min-width: 170px;
  min-height: 48px;
  padding: 0 24px;
  font-size: 16px;
}

.entry-recent-section {
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.entry-recent-section .entry-current-head {
  align-items: center;
}

.entry-recent-section .entry-current-head h2 {
  font-size: 20px;
}

.entry-recent-section .entry-empty-text {
  padding: 14px;
  text-align: center;
}

.entry-recent-section .entry-current-list {
  max-height: 250px;
}

.entry-product-actions {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.entry-product-actions .practice-page-btn {
  min-width: 132px;
  text-decoration: none;
}

.quota-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.86);
}

.quota-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.quota-card-head span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.quota-card-head strong {
  color: var(--primary-dark);
}

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

.quota-grid p {
  min-width: 0;
  margin: 0;
  padding: 10px;
  border-radius: 8px;
  background: #f6faf9;
}

.quota-grid span,
.quota-grid strong {
  display: block;
}

.quota-grid span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.quota-grid strong {
  margin-top: 4px;
  color: #263943;
  font-size: 15px;
}

.quota-muted {
  margin: 0;
  color: var(--muted);
  font-weight: 800;
  line-height: 1.5;
}

.quota-rules {
  margin: 0;
  padding: 10px 12px;
  border-radius: 8px;
  color: #4f606a;
  background: #f7fbf5;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.6;
}

.quota-warning {
  color: var(--danger);
}

.practice-page {
  background:
    radial-gradient(circle at 14% 32%, rgba(22, 113, 109, 0.08), transparent 24%),
    radial-gradient(circle at 78% 80%, rgba(22, 113, 109, 0.08), transparent 24%),
    linear-gradient(180deg, #fbfdfe 0%, #f3f8f7 100%);
}

.practice-shell {
  width: min(1320px, calc(100% - 56px));
  min-height: 100vh;
  margin: 0 auto;
  padding: 34px 0 52px;
  display: grid;
  grid-template-rows: auto auto 1fr;
  gap: 34px;
}

.practice-topbar {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr) 180px;
  align-items: center;
  gap: 18px;
}

.practice-back-btn,
.practice-page-btn {
  min-height: 56px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 1px solid rgba(220, 229, 234, 0.9);
  border-radius: 8px;
  color: #263943;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 12px 28px rgba(33, 50, 62, 0.08);
  text-decoration: none;
  font-size: 18px;
  font-weight: 800;
}

.practice-back-btn span {
  font-size: 26px;
}

.practice-library-title {
  min-width: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  color: #1e2a32;
  font-size: 20px;
  text-align: center;
}

.practice-library-title span {
  color: var(--primary);
}

.practice-library-title strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.practice-progress-label {
  justify-self: end;
  color: var(--muted);
  font-size: 20px;
  font-weight: 800;
}

.practice-progress-label strong {
  color: var(--primary);
  font-size: 24px;
}

.practice-main-card {
  min-height: 560px;
  display: grid;
  grid-template-columns: minmax(0, 1.18fr) minmax(360px, 0.82fr);
  gap: 42px;
  padding: 56px 40px 34px;
  border: 1px solid rgba(220, 229, 234, 0.9);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 26px 54px rgba(33, 50, 62, 0.12);
}

.practice-left-pane {
  display: grid;
  grid-template-rows: auto auto auto auto auto auto 1fr;
  align-content: start;
  gap: 22px;
  min-width: 0;
}

.practice-meaning {
  min-height: 72px;
  color: #1e2a32;
  font-size: 30px;
  line-height: 1.55;
}

.practice-part-of-speech,
.word-part-of-speech {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  max-width: 100%;
  padding: 4px 9px;
  border-radius: 999px;
  color: var(--primary-dark);
  background: #e8f2f1;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.35;
}

.practice-part-of-speech {
  margin-bottom: -6px;
  font-size: 15px;
}

.practice-hint-row {
  display: flex;
  align-items: center;
  gap: 16px;
  color: #263943;
  font-size: 22px;
  font-weight: 800;
}

.practice-hint-icon {
  color: var(--primary);
  font-size: 28px;
}

.practice-hint-row strong {
  color: var(--primary);
  letter-spacing: 8px;
  word-break: break-word;
}

.practice-answer-input {
  min-height: 88px;
  padding: 0 28px;
  border: 1px solid #bfe3dd;
  border-radius: 12px;
  background: #ffffff;
  color: #52616c;
  font-size: 26px;
}

.practice-feedback {
  min-height: 28px;
  color: var(--muted);
  font-size: 16px;
  font-weight: 800;
}

.practice-feedback.correct {
  color: var(--success);
}

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

.practice-bottom-actions {
  align-self: end;
  display: grid;
  grid-template-columns: minmax(160px, 220px) minmax(180px, 260px);
  justify-content: space-between;
  align-items: end;
  gap: 18px;
  padding-top: 30px;
}

.practice-primary-btn {
  border-color: transparent;
  color: #ffffff;
  background: linear-gradient(135deg, #35bb9f, #0c8c79);
  box-shadow: 0 16px 30px rgba(22, 113, 109, 0.24);
}

.practice-ghost-btn {
  color: #263943;
  background: rgba(255, 255, 255, 0.92);
}

.practice-page-btn:disabled {
  opacity: 0.55;
}

.practice-example-pane {
  align-self: start;
  min-height: 380px;
  padding: 38px 42px;
  display: grid;
  align-content: start;
  gap: 26px;
  border: 1px solid rgba(220, 229, 234, 0.95);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 16px 34px rgba(33, 50, 62, 0.09);
}

.practice-example-text {
  color: #27323a;
  font-size: 28px;
  line-height: 2.15;
  white-space: pre-wrap;
}

.practice-complete-panel {
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 1px solid #bfe3dd;
  border-radius: 12px;
  background: #f4faf9;
}

.practice-complete-panel h2 {
  color: var(--primary-dark);
  font-size: 22px;
}

.practice-complete-panel p {
  color: var(--muted);
  line-height: 1.5;
}

.practice-result-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.practice-result-grid div {
  padding: 14px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fbfdfd;
}

.practice-result-grid strong {
  display: block;
  color: var(--primary-dark);
  font-size: 26px;
  line-height: 1.1;
}

.practice-result-grid small {
  display: block;
  margin-top: 6px;
  color: var(--muted);
}

.practice-complete-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.practice-complete-actions .practice-page-btn {
  min-height: 44px;
  padding: 0 16px;
  font-size: 15px;
}

.practice-cloud-test-head {
  display: grid;
  gap: 5px;
}

.practice-cloud-test-head span {
  color: var(--primary);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.practice-cloud-test-head h2 {
  color: #1e2a32;
  font-size: 24px;
}

.practice-cloud-test-head p,
.practice-cloud-status,
.practice-cloud-summary p {
  color: var(--muted);
  line-height: 1.55;
}

.practice-cloud-field {
  display: grid;
  gap: 8px;
}

.practice-cloud-field span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.practice-cloud-field select {
  min-height: 46px;
  padding: 0 14px;
  border: 1px solid #cfe4e0;
  border-radius: 10px;
  background: rgba(251, 253, 253, 0.9);
  color: #263943;
  font: inherit;
}

.practice-cloud-summary {
  display: grid;
  gap: 8px;
}

.practice-cloud-status,
.practice-cloud-summary p,
.practice-cloud-summary strong {
  margin: 0;
  font-weight: 800;
}

.practice-cloud-status.error {
  color: var(--danger);
}

.practice-cloud-status.success {
  color: var(--primary);
}

.practice-cloud-summary strong {
  color: var(--primary-dark);
}

.library-page {
  background:
    radial-gradient(circle at 16% 34%, rgba(22, 113, 109, 0.09), transparent 24%),
    radial-gradient(circle at 82% 76%, rgba(217, 119, 6, 0.06), transparent 25%),
    linear-gradient(180deg, #fbfdfe 0%, #f4f8f7 100%);
}

/* library.html formal product layout */
.library-product {
  display: grid;
  align-content: start;
  gap: 18px;
}

.library-product > .cloud-library-test-head {
  display: none;
}

.library-account-summary {
  display: flex;
  align-items: center;
  gap: 10px 22px;
  min-height: 58px;
  padding: 14px 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 10px 28px rgba(39, 82, 77, 0.06);
}

.library-account-summary > strong {
  color: var(--primary-dark);
  font-size: 16px;
}

.library-account-summary > span {
  color: var(--muted);
  font-size: 14px;
}

.library-account-summary b {
  color: var(--text);
}

.library-summary-status {
  margin-left: auto;
}

.library-product .library-workspace {
  align-items: stretch;
}

.library-product .library-sidebar-card,
.library-product .library-detail-card {
  min-height: 570px;
}

.library-icon-btn {
  width: 36px;
  min-height: 36px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--primary-dark);
  background: #fff;
  font-size: 20px;
}

.library-sidebar-search input,
.library-product select {
  width: 100%;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}

.library-create-form {
  display: grid;
  gap: 8px;
}

.library-new-btn {
  width: 100%;
  margin-top: auto;
}

.library-product-empty {
  min-height: 500px;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 10px;
  padding: 30px;
  text-align: center;
}

.library-product-empty[hidden],
.library-product [hidden] {
  display: none !important;
}

.library-empty-illustration {
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  margin-bottom: 6px;
  border-radius: 22px;
  color: var(--primary-dark);
  background: #e8f2f1;
  font-size: 25px;
  font-weight: 900;
}

.library-product-empty h2,
.library-product-empty p {
  margin: 0;
}

.library-product-empty p {
  color: var(--muted);
}

.library-product .library-detail-header {
  align-items: flex-start;
}

.library-product .library-detail-actions {
  max-width: 420px;
}

.library-more-actions {
  margin: 14px 0 20px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.library-more-actions summary {
  padding: 12px 0;
  color: var(--muted);
  cursor: pointer;
  font-weight: 700;
}

.library-more-actions > div {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-bottom: 12px;
}

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

@media (max-width: 760px) {
  .library-account-summary {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .library-summary-status {
    width: 100%;
    margin-left: 0;
  }

  .library-product .library-sidebar-card,
  .library-product .library-detail-card {
    min-height: 0;
  }

  .library-product-empty {
    min-height: 330px;
    padding: 24px 12px;
  }

  .library-product .library-detail-actions,
  .library-more-actions > div {
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 100%;
  }
}

.library-shell {
  width: min(1320px, calc(100% - 56px));
  min-height: 100vh;
  margin: 0 auto;
  padding: 30px 0 44px;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 28px;
}

.library-topbar {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr) 140px;
  align-items: center;
  gap: 18px;
}

.library-topbar h1 {
  color: #1c2b35;
  font-size: 42px;
  font-weight: 900;
  text-align: center;
}

.library-workspace {
  display: grid;
  grid-template-columns: minmax(260px, 340px) minmax(0, 1fr);
  gap: 24px;
  min-height: 0;
}

.library-sidebar-card,
.library-detail-card {
  min-height: 0;
  border: 1px solid rgba(220, 229, 234, 0.9);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 24px 48px rgba(33, 50, 62, 0.1);
}

.library-sidebar-card {
  display: flex;
  flex-direction: column;
  padding: 22px;
}

.library-card-heading,
.library-detail-header,
.library-word-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.library-card-heading span,
.library-detail-header span {
  color: var(--accent);
  font-size: 13px;
  font-weight: 900;
}

.library-card-heading h2,
.library-detail-header h2,
.library-word-head h2 {
  margin-top: 4px;
  color: #1e2a32;
  font-size: 24px;
}

.library-small-primary,
.library-small-btn {
  min-height: 36px;
  padding: 0 12px;
  border: 0;
  border-radius: 8px;
  font-weight: 800;
}

.library-small-primary {
  color: #ffffff;
  background: var(--primary);
}

.library-small-btn {
  color: var(--primary-dark);
  background: #e8f2f1;
}

.library-danger-btn {
  color: var(--danger);
  background: #fdecea;
}

.library-danger-btn:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.library-page-list {
  display: grid;
  align-content: start;
  gap: 10px;
  min-height: 0;
  margin: 18px 0 0;
  padding: 0;
  overflow: auto;
  list-style: none;
}

.library-page-item {
  width: 100%;
  min-height: 92px;
  display: grid;
  gap: 6px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--text);
  background: #fbfdfd;
  text-align: left;
}

.library-page-list li.active .library-page-item {
  border-color: var(--primary);
  background: #e8f2f1;
}

.library-page-item strong {
  overflow-wrap: anywhere;
  color: var(--primary-dark);
  font-size: 16px;
}

.library-page-item span,
.library-page-item small {
  color: var(--muted);
  line-height: 1.45;
}

.library-order-actions {
  margin-top: 8px;
}

.cloud-library-order-actions {
  display: flex;
  gap: 8px;
}

.library-detail-card {
  display: flex;
  flex-direction: column;
  padding: 26px;
  overflow: hidden;
}

.library-detail-header p {
  margin-top: 8px;
  color: var(--muted);
}

.library-detail-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.library-detail-actions .practice-page-btn {
  min-height: 42px;
  padding: 0 14px;
  font-size: 14px;
}

.library-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 160px));
  gap: 12px;
  margin: 18px 0;
}

.library-metrics div {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fbfdfd;
  text-align: center;
}

.library-metrics strong {
  display: block;
  color: var(--primary-dark);
  font-size: 28px;
}

.library-metrics small {
  color: var(--muted);
}

.library-overview {
  display: grid;
  grid-template-columns: minmax(220px, 0.82fr) minmax(0, 1.18fr);
  gap: 14px;
  margin-bottom: 18px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fbfdfd;
}

.library-overview-main {
  display: grid;
  align-content: start;
  gap: 7px;
}

.library-overview-main span {
  color: var(--accent);
  font-size: 13px;
  font-weight: 900;
}

.library-overview-main h2 {
  color: var(--primary-dark);
  font-size: 22px;
  overflow-wrap: anywhere;
}

.library-overview-main p,
.library-overview-main strong {
  color: var(--muted);
  line-height: 1.5;
}

.library-overview-main strong {
  color: var(--primary-dark);
}

.library-preview {
  display: grid;
  gap: 10px;
}

.library-preview h3 {
  margin: 0;
  color: #1e2a32;
  font-size: 16px;
}

.library-preview ul {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.library-preview li {
  display: grid;
  grid-template-columns: minmax(100px, 0.8fr) minmax(0, 1.2fr);
  gap: 10px;
  padding: 9px 10px;
  border: 1px solid rgba(220, 229, 234, 0.9);
  border-radius: 8px;
  background: #ffffff;
}

.library-preview strong {
  color: var(--primary-dark);
  word-break: break-word;
}

.library-preview span {
  color: var(--muted);
  line-height: 1.45;
}

.library-page-message {
  min-height: 22px;
  color: var(--muted);
  font-weight: 800;
}

.library-page-message.success {
  color: var(--success);
}

.library-page-message.error {
  color: var(--danger);
}

.library-search-field {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
}

.library-search-field span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.library-search-field input {
  min-height: 46px;
  border-color: #cfe4e0;
  background: rgba(251, 253, 253, 0.9);
}

.library-word-list {
  display: grid;
  align-content: start;
  gap: 12px;
  min-height: 0;
  margin: 14px 0 0;
  padding: 0 4px 0 0;
  overflow: auto;
  list-style: none;
}

.cloud-library-test-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.cloud-library-test-head span {
  color: var(--primary);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.cloud-library-test-head h2 {
  margin-top: 4px;
  font-size: 24px;
}

.cloud-library-test-head p,
.cloud-library-status {
  color: var(--muted);
  line-height: 1.6;
}

.cloud-library-status {
  margin: 0;
  font-weight: 800;
}

.cloud-library-status.error {
  color: var(--danger);
}

.cloud-library-status.success {
  color: var(--primary);
}

.cloud-library-create-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.cloud-library-create-row input {
  width: 100%;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: #263943;
  font: inherit;
}

.cloud-library-create-row input:focus {
  border-color: var(--primary);
  outline: 3px solid rgba(22, 113, 109, 0.12);
}

.cloud-word-example,
.cloud-word-flags {
  color: var(--muted);
  line-height: 1.55;
}

.cloud-word-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.cloud-word-title small {
  padding: 3px 8px;
  border-radius: 999px;
  color: var(--primary-dark);
  background: #e8f2f1;
  font-weight: 900;
}

.cloud-word-flags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 13px;
  font-weight: 800;
}

.cloud-word-flags span {
  padding: 4px 8px;
  border-radius: 999px;
  background: #f4faf9;
}

.library-word-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  padding: 16px;
  border: 1px solid rgba(220, 229, 234, 0.92);
  border-radius: 12px;
  background: #fbfdfd;
}

.library-word-content {
  display: grid;
  gap: 7px;
}

.library-word-content strong {
  color: var(--primary-dark);
  font-size: 18px;
  word-break: break-word;
}

.word-title-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.library-preview .word-part-of-speech,
.library-word-content .word-part-of-speech {
  color: var(--primary-dark);
}

.word-pos-inline {
  vertical-align: middle;
}

.word-meaning-line {
  display: block;
  color: var(--muted);
  line-height: 1.55;
}

.word-status-tag {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
}

.word-status-tag.mastered {
  color: var(--success);
  background: #eaf7ef;
}

.word-status-tag.focus {
  color: #9a4f02;
  background: #fff7ed;
}

.word-status-tag.practicing {
  color: #36556f;
  background: #eaf1f7;
}

.library-word-content span,
.library-word-content p {
  color: var(--muted);
  line-height: 1.55;
}

.library-word-content p {
  padding-top: 4px;
  border-top: 1px solid var(--line);
}

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

.wrong-shell {
  grid-template-rows: auto minmax(0, 1fr) auto;
}

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

.wrong-metrics {
  grid-template-columns: minmax(0, 160px);
}

.wrong-library-empty {
  margin-top: 18px;
}

.wrong-word-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.wrong-word-meta small {
  padding: 5px 8px;
  border-radius: 8px;
  color: var(--primary-dark);
  background: #e8f2f1;
  font-weight: 800;
}

.wrong-word-actions {
  align-items: flex-start;
}

.wrong-word-actions .practice-page-btn {
  min-height: 40px;
  padding: 0 12px;
  font-size: 14px;
}

.cloud-wrong-word-list {
  gap: 12px;
}

.cloud-wrong-word-item {
  grid-template-columns: 1fr;
}

.cloud-wrong-word-item .word-title-line small {
  padding: 5px 8px;
  border-radius: 8px;
  color: var(--muted);
  background: #f4f8f7;
  font-weight: 800;
}

/* wrong.html formal product layout */
.wrong-page [hidden] {
  display: none !important;
}

.wrong-shell {
  width: min(1180px, calc(100% - 56px));
  padding: 24px 0 40px;
  gap: 22px;
}

.wrong-product,
.wrong-product-workspace {
  min-height: 0;
}

.wrong-product-workspace {
  grid-template-columns: minmax(250px, 310px) minmax(0, 1fr);
  align-items: stretch;
}

.wrong-product .library-sidebar-card,
.wrong-detail-card {
  min-height: 560px;
}

.wrong-product .library-card-heading {
  align-items: center;
}

.wrong-product .library-card-heading h2 {
  margin-top: 0;
}

.wrong-product .library-sidebar-search {
  margin-top: 16px;
}

.wrong-product .library-sidebar-search input,
.wrong-filter-bar input,
.wrong-filter-bar select {
  width: 100%;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--text);
  font: inherit;
}

.wrong-product .cloud-library-status {
  min-height: 0;
  margin-top: 10px;
}

.wrong-product .cloud-library-status:empty,
.wrong-page-status:empty {
  display: none;
}

.wrong-product .library-page-list {
  margin-top: 12px;
}

.wrong-product .library-page-item {
  min-height: 58px;
  align-content: center;
  padding: 12px 14px;
}

.wrong-detail-card {
  padding: 26px 28px;
}

.wrong-detail-head {
  align-items: center;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.wrong-detail-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.wrong-detail-actions .practice-page-btn {
  min-width: 128px;
  min-height: 44px;
}

.wrong-count-summary {
  padding: 7px 10px;
  border-radius: 999px;
  color: var(--primary-dark);
  background: #e8f2f1;
  font-size: 13px;
  white-space: nowrap;
}

.wrong-page-status {
  margin: 12px 0 0;
}

.wrong-state {
  min-height: 410px;
  padding: 30px 20px;
}

.wrong-state .practice-page-btn {
  min-width: 128px;
  text-decoration: none;
}

.wrong-empty-illustration {
  color: #16716d;
  background: #e7f6f2;
}

.wrong-empty-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 6px;
}

.wrong-filter-bar {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(140px, 0.45fr) minmax(190px, 0.65fr);
  gap: 10px;
  margin: 18px 0 14px;
}

.wrong-filter-bar input:focus,
.wrong-filter-bar select:focus,
.wrong-product .library-sidebar-search input:focus {
  border-color: #6fc2b6;
  box-shadow: 0 0 0 4px rgba(22, 113, 109, 0.1);
  outline: none;
}

.wrong-page .cloud-wrong-word-list {
  max-height: 620px;
  padding-right: 4px;
  overflow: auto;
}

.wrong-page .cloud-wrong-word-item {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  padding: 15px 16px;
  background: #fff;
}

.wrong-page .cloud-wrong-word-item .library-word-content {
  gap: 6px;
}

.wrong-page .wrong-part-of-speech {
  padding: 3px 7px;
  border-radius: 999px;
  color: var(--primary-dark);
  background: #e8f2f1;
  font-size: 12px;
}

.wrong-word-example {
  margin: 2px 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.wrong-page .wrong-word-meta {
  gap: 6px;
}

.wrong-page .wrong-word-meta small {
  padding: 4px 7px;
  color: var(--muted);
  background: #f4f8f7;
  font-size: 12px;
  font-weight: 700;
}

.wrong-remove-btn {
  min-height: 34px;
  padding: 0 8px;
  border: 0;
  color: var(--muted);
  background: transparent;
  font-size: 13px;
  font-weight: 700;
}

.wrong-remove-btn:hover {
  color: var(--danger);
  background: #fff5f4;
}

.wrong-remove-btn:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

@media (max-width: 760px) {
  .wrong-shell {
    width: min(100% - 24px, 680px);
    padding: 18px 0 28px;
    gap: 18px;
  }

  .wrong-page .library-topbar h1 {
    order: -1;
  }

  .wrong-page .library-topbar > div[aria-hidden="true"] {
    display: none;
  }

  .wrong-product-workspace {
    grid-template-columns: 1fr;
  }

  .wrong-product .library-sidebar-card,
  .wrong-detail-card {
    min-height: 0;
  }

  .wrong-product .library-sidebar-card {
    max-height: 340px;
  }

  .wrong-detail-card {
    padding: 20px 16px;
  }

  .wrong-detail-head,
  .wrong-detail-actions {
    align-items: stretch;
    display: grid;
    grid-template-columns: 1fr auto;
  }

  .wrong-detail-head > div:first-child {
    grid-column: 1 / -1;
  }

  .wrong-detail-head > .wrong-detail-actions {
    grid-column: 1 / -1;
  }

  .wrong-detail-actions .practice-page-btn {
    min-width: 0;
  }

  .wrong-count-summary {
    align-self: center;
    justify-self: start;
  }

  .wrong-state {
    min-height: 300px;
    padding: 24px 10px;
  }

  .wrong-empty-actions,
  .wrong-filter-bar {
    grid-template-columns: 1fr;
    width: 100%;
  }

  .wrong-empty-actions {
    display: grid;
  }

  .wrong-page .cloud-wrong-word-item {
    grid-template-columns: 1fr;
  }

  .wrong-word-actions {
    justify-content: flex-end;
  }
}

.library-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(20, 31, 38, 0.42);
}

.library-modal {
  width: min(460px, 100%);
  display: grid;
  gap: 14px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 24px 52px rgba(33, 50, 62, 0.18);
}

.library-modal h2 {
  font-size: 24px;
}

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

.library-modal-fields {
  display: grid;
  gap: 12px;
}

.library-modal-field {
  display: grid;
  gap: 7px;
}

.library-modal-field span {
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
}

.library-modal-error {
  color: var(--danger) !important;
  font-weight: 800;
}

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

/* Settings page */
.settings-page {
  background:
    radial-gradient(circle at 16% 34%, rgba(22, 113, 109, 0.09), transparent 24%),
    radial-gradient(circle at 82% 76%, rgba(217, 119, 6, 0.06), transparent 25%),
    linear-gradient(180deg, #fbfdfe 0%, #f4f8f7 100%);
}

.settings-page [hidden] {
  display: none !important;
}

.settings-shell {
  width: min(960px, calc(100% - 56px));
  padding: 24px 0 36px;
  gap: 20px;
}

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

.settings-content {
  display: grid;
  gap: 16px;
}

.settings-loading-state {
  min-height: 320px;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 10px;
  padding: 32px;
  border: 1px solid rgba(220, 229, 234, 0.9);
  border-radius: 18px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 18px 42px rgba(33, 50, 62, 0.08);
}

.settings-loading-mark {
  color: var(--primary);
  font-size: 32px;
  font-weight: 900;
  letter-spacing: 5px;
}

.settings-card {
  display: grid;
  gap: 16px;
  padding: 20px 22px;
  border: 1px solid rgba(220, 229, 234, 0.9);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 18px 42px rgba(33, 50, 62, 0.08);
}

.settings-card-head h2 {
  color: #1e2a32;
  font-size: 21px;
}

.settings-account-row {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(150px, 0.8fr) auto;
  align-items: center;
  gap: 18px;
  padding-top: 2px;
}

.settings-account-identity,
.settings-membership-identity {
  display: grid;
  gap: 4px;
}

.settings-account-identity > span,
.settings-membership-identity > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.settings-account-identity > strong,
.settings-membership-identity > strong {
  overflow-wrap: anywhere;
  color: var(--primary-dark);
  font-size: 17px;
}

.settings-account-identity small {
  color: var(--muted);
}

.settings-account-identity small b {
  color: var(--text);
}

.settings-logout-btn {
  min-height: 40px;
  padding: 0 14px;
  border-color: #f1d5d2;
  color: #a9483e;
  background: #fff8f7;
  box-shadow: none;
  font-size: 14px;
}

.settings-logout-btn:hover {
  border-color: #e7bdb8;
  background: #fff1ef;
}

.settings-account-message {
  padding: 9px 12px;
  border-radius: 9px;
  color: #8a5a18;
  background: #fff8e8;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.5;
}

.settings-preference-group {
  display: grid;
  gap: 10px;
}

.settings-preference-group + .settings-preference-group {
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.settings-group-head {
  min-height: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.settings-group-head h3 {
  color: #263943;
  font-size: 15px;
}

.settings-options {
  display: grid;
  gap: 10px;
}

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

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

.settings-option {
  min-width: 0;
  min-height: 68px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fbfdfd;
  cursor: pointer;
}

.settings-option:has(input:checked) {
  border-color: #6fc2b6;
  background: #edf8f6;
  box-shadow: inset 0 0 0 1px rgba(22, 113, 109, 0.08);
}

.settings-option input {
  width: 16px;
  height: 16px;
  accent-color: var(--primary);
}

.settings-option strong {
  display: block;
  color: var(--primary-dark);
  font-size: 14px;
}

.settings-option small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.settings-message {
  min-height: 18px;
  color: transparent;
  font-size: 12px;
  font-weight: 800;
  text-align: right;
}

.settings-message.success {
  color: var(--success);
}

.settings-message.error {
  color: var(--danger);
}

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

.settings-help-links a {
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: #263943;
  background: #fbfdfd;
  text-decoration: none;
  font-size: 14px;
  font-weight: 800;
}

.settings-help-links a:hover {
  border-color: #b9dcd6;
  color: var(--primary-dark);
  background: #f4faf9;
}

.settings-help-links b {
  color: var(--primary);
  font-size: 22px;
  line-height: 1;
}

@media (max-width: 760px) {
  .settings-shell {
    width: min(100% - 24px, 680px);
    padding: 18px 0 28px;
    gap: 18px;
  }

  .settings-topbar {
    grid-template-columns: 1fr;
    justify-items: stretch;
  }

  .settings-topbar h1 {
    order: -1;
    font-size: 34px;
    text-align: left;
  }

  .settings-topbar .practice-back-btn {
    width: fit-content;
  }

  .settings-topbar > div[aria-hidden="true"] {
    display: none;
  }

  .settings-card {
    padding: 18px 14px;
  }

  .settings-account-row,
  .settings-example-options,
  .settings-order-options,
  .settings-help-links {
    grid-template-columns: 1fr;
  }

  .settings-account-row {
    align-items: start;
    gap: 12px;
  }

  .settings-logout-btn {
    width: fit-content;
  }

  .settings-option {
    min-height: 62px;
  }
}

@media (max-width: 480px) {
  .settings-group-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 2px;
  }

  .settings-message {
    min-height: 16px;
    text-align: left;
  }
}

/* Stats page */
.stats-card-link {
  grid-column: 1 / -1;
}

.stats-shell {
  width: min(1120px, calc(100% - 56px));
  min-height: 100vh;
  margin: 0 auto;
  padding: 28px 0 44px;
  display: grid;
  align-content: start;
  gap: 28px;
}

.stats-content {
  display: grid;
  gap: 22px;
}

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

.stats-card,
.stats-empty-card {
  border: 1px solid rgba(220, 229, 234, 0.9);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
}

.stats-card {
  display: grid;
  gap: 10px;
  padding: 24px;
}

.stats-card > span,
.stats-section-head span {
  color: var(--accent);
  font-size: 13px;
  font-weight: 800;
}

.stats-card > strong {
  color: var(--primary-dark);
  font-size: 42px;
  line-height: 1;
}

.stats-time-card > strong {
  font-size: 24px;
  line-height: 1.25;
}

.stats-wide-card {
  gap: 20px;
}

.stats-section-head h2 {
  margin-top: 6px;
  color: #1e2a32;
  font-size: 26px;
}

.stats-advice-card {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 20px;
  border-color: rgba(22, 113, 109, 0.24);
  background: linear-gradient(135deg, #ffffff 0%, #eef8f6 100%);
}

.stats-advice-card .stats-section-head {
  grid-column: 1 / -1;
}

.stats-advice-text {
  color: #30424c;
  font-size: 18px;
  font-weight: 800;
  line-height: 1.65;
}

.stats-advice-action {
  min-width: 132px;
}

.stats-chart {
  display: grid;
  gap: 14px;
}

.stats-chart-row {
  display: grid;
  grid-template-columns: minmax(120px, 0.42fr) minmax(0, 1fr) 72px;
  align-items: center;
  gap: 14px;
}

.stats-chart-row strong {
  color: #30424c;
  line-height: 1.35;
}

.stats-chart-row small {
  color: var(--muted);
  font-weight: 800;
  text-align: right;
}

.stats-chart-bar {
  height: 14px;
  overflow: hidden;
  border-radius: 999px;
  background: #e8f2f1;
}

.stats-chart-bar span {
  display: block;
  height: 100%;
  min-width: 10px;
  border-radius: inherit;
  background: linear-gradient(90deg, #43b8a3, var(--primary));
}

.stats-library-list {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.stats-library-list li,
.stats-library-item {
  display: grid;
  gap: 16px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #ffffff;
}

.stats-library-list strong {
  color: var(--primary-dark);
}

.stats-library-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

.stats-library-head strong {
  overflow-wrap: anywhere;
}

.stats-library-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.stats-metric-tag {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  color: var(--muted);
  background: #f4f8f7;
  font-size: 13px;
  font-weight: 800;
}

.stats-metric-tag.primary {
  color: var(--primary-dark);
  background: #e8f2f1;
}

.stats-metric-tag.success {
  color: var(--success);
  background: #eaf7ef;
}

.stats-metric-tag.danger {
  color: var(--danger);
  background: #fdecea;
}

.stats-library-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.stats-library-action {
  min-height: 38px;
  padding: 0 14px;
  font-size: 14px;
}

.stats-wrong-action {
  border: 1px solid rgba(217, 119, 6, 0.25);
  color: #9a4f02;
  background: #fff7ed;
}

.stats-library-action:disabled {
  cursor: not-allowed;
  opacity: 0.54;
}

.stats-cloud-records-card {
  gap: 16px;
}

.stats-cloud-records-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.stats-cloud-records-action {
  min-width: 168px;
}

.stats-cloud-records-status {
  color: var(--muted);
  line-height: 1.6;
}

.stats-cloud-records-status.success {
  color: var(--success);
  font-weight: 800;
}

.stats-cloud-records-status.error {
  color: var(--danger);
  font-weight: 800;
}

.stats-cloud-records-list {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.stats-cloud-record-item {
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #ffffff;
}

.stats-library-list span,
.stats-library-list small,
.stats-cloud-records-list small,
.stats-empty-text {
  color: var(--muted);
  line-height: 1.5;
}

.stats-empty-card {
  min-height: 320px;
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 16px;
  padding: 34px;
  text-align: center;
}

.stats-empty-card span {
  display: grid;
  width: 78px;
  height: 78px;
  place-items: center;
  border-radius: 50%;
  color: var(--primary);
  background: #e7f4f2;
  font-size: 36px;
}

.stats-empty-card h2 {
  color: #1e2a32;
  font-size: 28px;
}

.stats-empty-card p {
  max-width: 520px;
  color: var(--muted);
  line-height: 1.7;
}

.bulk-page {
  background:
    radial-gradient(circle at 16% 34%, rgba(22, 113, 109, 0.09), transparent 24%),
    radial-gradient(circle at 82% 76%, rgba(217, 119, 6, 0.06), transparent 25%),
    linear-gradient(180deg, #fbfdfe 0%, #f4f8f7 100%);
}

.bulk-current-card {
  display: grid;
  gap: 8px;
  padding: 20px 24px;
  border: 1px solid rgba(220, 229, 234, 0.9);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 18px 36px rgba(33, 50, 62, 0.08);
}

.bulk-current-card span {
  color: var(--accent);
  font-size: 13px;
  font-weight: 900;
}

.bulk-current-card strong {
  color: var(--primary-dark);
  font-size: 24px;
  overflow-wrap: anywhere;
}

.bulk-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(300px, 0.8fr);
  gap: 24px;
}

.bulk-panel {
  align-content: start;
}

.bulk-textarea {
  height: 360px;
  max-height: 420px;
  resize: vertical;
}

.bulk-help {
  color: var(--muted);
  line-height: 1.7;
}

.bulk-file-btn {
  min-height: 56px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 18px;
  border-radius: 8px;
  color: #ffffff;
  background: var(--primary);
  font-weight: 900;
  cursor: pointer;
}

.bulk-file-btn input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

@media (max-width: 1100px) {
  .entry-shell {
    width: min(100% - 32px, 920px);
  }

  .entry-add-btn {
    width: 100%;
  }

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

  .practice-progress-label {
    grid-column: 1 / -1;
    justify-self: center;
  }

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

  .practice-example-pane {
    min-height: 260px;
  }

  .library-workspace {
    grid-template-columns: 1fr;
  }

  .library-sidebar-card {
    max-height: 360px;
  }

  .library-page-list {
    min-height: 0;
  }

  .bulk-workspace {
    grid-template-columns: 1fr;
  }
}

button,
input,
textarea {
  font: inherit;
}

.app {
  width: min(1320px, calc(100% - 32px));
  height: 100dvh;
  margin: 0 auto;
  padding: 10px 0 12px;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.top {
  display: grid;
  gap: 2px;
  margin: 0 0 8px calc(var(--sidebar-width) + var(--workspace-gap));
}

.eyebrow {
  margin: 0 0 2px;
  color: var(--primary);
  font-size: 14px;
  font-weight: 700;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 24px;
  line-height: 1.2;
}

h2 {
  font-size: 18px;
}

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

.scoreboard div {
  min-width: 92px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
  text-align: center;
}

.scoreboard span {
  display: block;
  font-size: 21px;
  font-weight: 800;
  color: var(--primary-dark);
}

.scoreboard small {
  color: var(--muted);
  font-size: 12px;
}

.intro {
  max-width: 720px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.35;
}

.panel {
  margin-top: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
  min-height: 0;
}

.workspace {
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  gap: var(--workspace-gap);
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

.content-stack {
  min-height: 0;
}

.library-panel {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.content-stack {
  height: 100%;
  display: grid;
  grid-template-rows: minmax(230px, 44%) minmax(0, 1fr);
  gap: var(--workspace-gap);
  overflow: hidden;
}

.top-workbench {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(300px, 0.88fr);
  gap: var(--workspace-gap);
  min-height: 0;
  overflow: hidden;
}

.practice-workbench {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 280px);
  gap: var(--workspace-gap);
  min-height: 0;
  overflow: hidden;
}

.section-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 8px;
}

.section-title p {
  max-width: 470px;
  color: var(--muted);
  line-height: 1.6;
}

.compact-title {
  display: block;
}

.step {
  display: inline-block;
  margin-bottom: 3px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 800;
}

textarea {
  width: 100%;
  height: clamp(82px, 13vh, 118px);
  min-height: 82px;
  max-height: 120px;
  resize: vertical;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: #fbfcfd;
  line-height: 1.7;
  outline: none;
}

.library-create {
  display: grid;
  gap: 8px;
  flex: 0 0 auto;
}

.library-transfer {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  flex: 0 0 auto;
}

.library-transfer button {
  min-height: 34px;
}

.library-create label {
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.library-list {
  display: grid;
  align-content: start;
  gap: 6px;
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
  overflow: auto;
  min-height: 0;
}

.library-switch {
  display: grid;
  width: 100%;
  min-height: auto;
  gap: 4px;
  padding: 12px;
  border: 1px solid var(--line);
  background: #fbfcfd;
  color: var(--text);
  text-align: left;
}

.library-item {
  display: grid;
  gap: 5px;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
}

.library-item .library-switch {
  padding: 6px 4px;
  border: 0;
  background: transparent;
}

.library-item:hover,
.library-switch:hover {
  background: #f4faf9;
}

.library-item.active {
  border-color: var(--primary);
  background: #e8f2f1;
}

.library-switch.active {
  border: 0;
  background: transparent;
  color: var(--primary-dark);
}

.library-switch span {
  overflow-wrap: anywhere;
}

.library-switch small {
  color: var(--muted);
  font-weight: 600;
}

.library-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.library-action-btn {
  min-height: 32px;
  padding: 0 8px;
  font-size: 13px;
}

.rename-library-btn {
  color: var(--primary-dark);
  background: #ffffff;
}

.delete-library-btn {
  color: var(--danger);
  background: #fdecea;
}

.current-library-note {
  margin-bottom: 8px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
  color: var(--muted);
}

.current-library-note strong {
  color: var(--primary-dark);
}

.quick-add {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr) auto;
  gap: 8px;
  align-items: end;
  margin-bottom: 8px;
}

.quick-add label {
  display: none;
}

.quick-add button {
  white-space: nowrap;
}

textarea:focus,
input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(22, 113, 109, 0.12);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

button {
  min-height: 36px;
  padding: 0 12px;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 700;
  transition: transform 0.15s ease, background 0.15s ease, color 0.15s ease;
}

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

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

.primary-btn {
  color: #ffffff;
  background: var(--primary);
}

.primary-btn:hover:not(:disabled) {
  background: var(--primary-dark);
}

.ghost-btn {
  color: var(--primary-dark);
  background: #e8f2f1;
}

.danger-btn {
  color: var(--danger);
  background: #fdecea;
}

.danger-btn:hover:not(:disabled),
.delete-btn:hover:not(:disabled) {
  background: #fbd7d2;
}

.message,
.feedback {
  min-height: 20px;
  margin-top: 7px;
  color: var(--muted);
  line-height: 1.5;
}

.practice-card {
  display: grid;
  gap: 9px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
}

.practice-progress {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.practice-progress strong {
  color: var(--primary-dark);
}

.round-result {
  display: grid;
  gap: 9px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.round-result h3 {
  margin: 0;
  font-size: 17px;
}

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

.round-result-grid div {
  padding: 8px 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
  text-align: center;
}

.round-result-grid strong {
  display: block;
  color: var(--primary-dark);
  font-size: 20px;
}

.round-result-grid small {
  color: var(--muted);
}

.library-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f4faf9;
}

.library-summary strong {
  font-size: 16px;
}

.inline-actions {
  margin-top: 0;
}

.meaning-box,
.hint-box {
  display: grid;
  gap: 4px;
}

.meaning-box span,
.hint-box span,
label {
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.meaning-box strong {
  font-size: 20px;
  line-height: 1.35;
}

.hint-box strong {
  color: var(--accent);
  font-size: 20px;
  letter-spacing: 4px;
  word-break: break-word;
}

.answer-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

input {
  width: 100%;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: none;
}

.scoreboard {
  margin-top: 0;
}

.feedback.correct {
  color: var(--success);
  font-weight: 700;
}

.feedback.wrong {
  color: var(--danger);
  font-weight: 700;
}

.answer-reveal-btn {
  justify-self: start;
}

body.practice-active .top-workbench {
  display: none;
}

body.practice-active .content-stack {
  grid-template-rows: minmax(0, 1fr);
}

body.practice-active .wrong-book-toggle,
body.practice-active .wrong-book-list,
body.practice-active #emptyWrongBookText {
  display: none;
}

.word-list {
  display: grid;
  align-content: start;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.word-list-shell {
  flex: 1;
  min-height: 0;
  max-height: 100%;
  overflow: auto;
  padding-right: 2px;
}

.word-item {
  display: grid;
  grid-template-columns: minmax(120px, 0.9fr) minmax(160px, 1.5fr) auto;
  gap: 8px;
  align-items: center;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
}

.word-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.word-item strong {
  word-break: break-word;
}

.word-item span {
  color: var(--muted);
  line-height: 1.5;
}

.edit-btn,
.delete-btn {
  min-width: 74px;
}

.edit-btn {
  color: var(--primary-dark);
  background: #e8f2f1;
}

.delete-btn {
  color: var(--danger);
  background: #fdecea;
}

.empty {
  color: var(--muted);
  line-height: 1.7;
}

.input-panel,
.list-panel,
.practice-panel,
.stats-panel {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.input-panel textarea {
  flex: 0 0 auto;
}

.practice-panel .practice-card {
  flex: 1;
  min-height: 0;
  overflow: auto;
}

.stats-panel {
  gap: 12px;
  justify-content: flex-start;
}

.stats-panel .scoreboard {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.wrong-book {
  display: flex;
  min-height: 0;
  flex: 1;
  flex-direction: column;
  gap: 8px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  overflow: hidden;
}

.wrong-book-title {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 8px;
}

.wrong-book-title h3 {
  margin: 0;
  font-size: 16px;
}

.wrong-book-title span {
  grid-column: 1;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.wrong-book-toggle {
  grid-row: 1 / span 2;
  grid-column: 2;
  min-height: 32px;
  padding: 0 10px;
  font-size: 13px;
}

.wrong-book-list {
  display: grid;
  align-content: start;
  gap: 8px;
  min-height: 0;
  max-height: 100%;
  margin: 0;
  padding: 0;
  overflow: auto;
  list-style: none;
}

.wrong-book-item {
  display: grid;
  gap: 4px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
}

.wrong-book-item strong {
  word-break: break-word;
}

.wrong-book-item span,
.wrong-book-item small {
  color: var(--muted);
  line-height: 1.4;
}

.wrong-book-item small {
  color: var(--danger);
  font-weight: 700;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(20, 31, 38, 0.42);
}

.modal-dialog {
  display: grid;
  gap: 12px;
  width: min(440px, 100%);
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.modal-dialog h2 {
  margin: 0;
  font-size: 20px;
}

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

.modal-fields {
  display: grid;
  gap: 10px;
}

.modal-field {
  display: grid;
  gap: 6px;
}

.modal-field label {
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.modal-error {
  color: var(--danger) !important;
  font-weight: 700;
}

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

.modal-confirm-danger {
  color: #ffffff;
  background: var(--danger);
}

.modal-confirm-danger:hover:not(:disabled) {
  background: #9f3227;
}

@media (max-height: 760px) and (min-width: 761px) {
  .app {
    padding-top: 8px;
    padding-bottom: 8px;
  }

  .top {
    margin-bottom: 6px;
  }

  .intro {
    display: none;
  }

  h1 {
    font-size: 22px;
  }

  h2 {
    font-size: 17px;
  }

  .panel {
    padding: 10px;
  }

  .content-stack {
    grid-template-rows: minmax(210px, 42%) minmax(0, 1fr);
    gap: 10px;
  }

  .top-workbench,
  .practice-workbench {
    gap: 10px;
  }

  .section-title {
    margin-bottom: 6px;
  }

  .step {
    margin-bottom: 2px;
    font-size: 12px;
  }

  textarea {
    height: clamp(72px, 11vh, 92px);
    min-height: 72px;
    padding: 8px 10px;
  }

  button,
  input {
    min-height: 34px;
  }

  .library-summary,
  .current-library-note,
  .practice-progress {
    padding: 7px 9px;
  }

  .practice-card {
    gap: 7px;
    padding: 10px;
  }

  .meaning-box strong,
  .hint-box strong {
    font-size: 18px;
  }

  .scoreboard div {
    padding: 6px 7px;
  }

  .scoreboard span {
    font-size: 19px;
  }

  .round-result {
    gap: 7px;
    padding: 10px;
  }

  .round-result-grid div {
    padding: 6px;
  }

  .round-result-grid strong {
    font-size: 18px;
  }
}

@media (max-width: 1100px) and (min-width: 761px) {
  :root {
    --sidebar-width: 248px;
    --workspace-gap: 12px;
  }

  .app {
    width: min(100% - 24px, 1320px);
  }

  .top-workbench {
    grid-template-columns: minmax(0, 1fr) minmax(260px, 0.78fr);
  }

  .practice-workbench {
    grid-template-columns: minmax(0, 1fr) minmax(238px, 260px);
  }

  .library-summary {
    align-items: flex-start;
  }

  .inline-actions {
    justify-content: flex-end;
  }

  button {
    padding-inline: 10px;
  }
}

@media (max-width: 760px) {
  body {
    overflow: auto;
  }

  .home-shell {
    width: min(100% - 24px, 760px);
    padding: 20px 0 24px;
    gap: 22px;
  }

  .home-nav {
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 14px;
  }

  .home-brand {
    gap: 10px;
    font-size: 15px;
  }

  .home-logo {
    width: 34px;
    height: 34px;
  }

  .home-nav-actions {
    flex: 0 0 100%;
    width: 100%;
    min-width: 0;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 8px;
  }

  .auth-nav-status {
    flex: 1 1 100%;
    max-width: 100%;
    min-height: 40px;
    padding: 0 12px;
    font-size: 14px;
  }

  .home-nav-btn {
    min-height: 40px;
    padding: 0 12px;
    gap: 6px;
    font-size: 14px;
  }

  .home-nav-btn span {
    font-size: 18px;
  }

  .home-hero {
    padding-top: 16px;
    gap: 14px;
  }

  .home-hero h1 {
    font-size: 34px;
  }

  .home-lead {
    font-size: 16px;
  }

  .home-tagline {
    font-size: 14px;
  }

  .home-tagline::before,
  .home-tagline::after {
    width: 24px;
  }

  .home-actions {
    gap: 16px;
    margin-top: 0;
  }

  .home-main-card {
    min-height: 220px;
    padding: 26px 20px;
    border-radius: 18px;
  }

  .home-main-card::after {
    right: -46px;
    top: 52px;
  }

  .home-main-icon {
    width: 80px;
    height: 80px;
    font-size: 40px;
  }

  .home-main-card h2 {
    font-size: 30px;
  }

  .home-main-card p {
    font-size: 15px;
  }

  .home-secondary-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .home-secondary-card {
    min-height: 104px;
    padding: 18px;
    border-radius: 16px;
  }

  .home-secondary-icon {
    width: 56px;
    height: 56px;
    font-size: 28px;
  }

  .home-secondary-card h2 {
    font-size: 20px;
  }

  .home-secondary-card p {
    font-size: 14px;
  }

  .home-footer {
    font-size: 13px;
  }

  .auth-shell {
    width: min(100% - 24px, 520px);
    padding: 12px 0 22px;
    gap: 12px;
  }

  .auth-topbar {
    grid-template-columns: 104px minmax(0, 1fr) 52px;
    gap: 6px;
  }

  .auth-topbar-link {
    font-size: 13px;
  }

  .auth-card {
    padding: 22px 18px 20px;
    border-radius: 16px;
  }

  .auth-card-head p {
    font-size: 15px;
  }

  .verification-row {
    grid-template-columns: 1fr;
  }

  .verification-button {
    width: 100%;
  }

  .auth-legal {
    flex-wrap: wrap;
  }

  .stats-shell {
    width: min(100% - 24px, 680px);
    padding: 18px 0 28px;
    gap: 22px;
  }

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

  .stats-card {
    padding: 18px;
  }

  .stats-card > strong {
    font-size: 34px;
  }

  .stats-advice-card,
  .stats-library-head,
  .stats-cloud-records-head {
    display: grid;
  }

  .stats-advice-action,
  .stats-library-action,
  .stats-cloud-records-action {
    width: 100%;
  }

  .stats-chart-row,
  .stats-library-list li {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .stats-chart-row small {
    text-align: left;
  }

  .stats-empty-card {
    min-height: 280px;
    padding: 26px 18px;
  }

  .entry-shell {
    width: min(100% - 24px, 680px);
    padding: 18px 0 28px;
    gap: 22px;
  }

  .entry-card {
    padding: 20px 16px 18px;
    border-radius: 18px;
    gap: 16px;
  }

  .entry-library-row {
    grid-template-columns: 1fr;
  }

  .entry-add-btn {
    min-height: 62px;
  }

  .entry-batch-wrap {
    min-height: 260px;
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 18px 16px 42px;
  }

  .entry-batch-icon {
    width: 34px;
    height: 34px;
  }

  .entry-batch-wrap textarea {
    height: 174px;
    min-height: 174px;
    max-height: 174px;
    font-size: 15px;
  }

  .entry-current-head,
  .entry-current-list li {
    grid-template-columns: 1fr;
  }

  .entry-current-head {
    display: grid;
  }

  .entry-current-list {
    max-height: 180px;
  }

  .entry-batch-wrap small {
    right: 16px;
    bottom: 14px;
    font-size: 14px;
  }

  .practice-shell {
    width: min(100% - 24px, 760px);
    padding: 18px 0 28px;
    gap: 22px;
  }

  .practice-topbar {
    grid-template-columns: 1fr;
    justify-items: stretch;
  }

  .practice-back-btn {
    width: fit-content;
    min-height: 44px;
    padding: 0 14px;
    font-size: 15px;
  }

  .practice-library-title {
    justify-content: flex-start;
    font-size: 16px;
  }

  .practice-progress-label {
    justify-self: start;
    font-size: 16px;
  }

  .practice-main-card {
    min-height: 0;
    grid-template-columns: 1fr;
    gap: 24px;
    padding: 24px 16px;
    border-radius: 16px;
  }

  .practice-left-pane {
    gap: 16px;
  }

  .practice-meaning {
    min-height: auto;
    font-size: 24px;
  }

  .practice-hint-row {
    align-items: flex-start;
    flex-wrap: wrap;
    font-size: 18px;
  }

  .practice-hint-row strong {
    letter-spacing: 5px;
  }

  .practice-answer-input {
    min-height: 64px;
    padding: 0 18px;
    font-size: 20px;
  }

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

  .practice-bottom-actions {
    grid-template-columns: 1fr;
    padding-top: 10px;
  }

  .practice-page-btn {
    width: 100%;
    min-height: 50px;
    font-size: 16px;
  }

  .practice-example-pane {
    min-height: 0;
    padding: 22px 18px;
    gap: 18px;
  }

  .practice-example-text {
    font-size: 20px;
    line-height: 1.8;
  }

  .library-shell {
    width: min(100% - 24px, 760px);
    padding: 18px 0 28px;
    gap: 20px;
  }

  .library-topbar {
    grid-template-columns: 1fr;
    justify-items: stretch;
  }

  .library-topbar h1 {
    font-size: 34px;
    text-align: left;
  }

  .library-topbar .home-nav-btn,
  .library-topbar .practice-back-btn {
    width: fit-content;
  }

  .library-workspace {
    grid-template-columns: 1fr;
  }

  .library-sidebar-card,
  .library-detail-card {
    padding: 18px;
    border-radius: 16px;
  }

  .library-card-heading,
  .library-detail-header,
  .library-word-head,
  .cloud-library-test-head {
    display: grid;
  }

  .cloud-library-test-head .practice-page-btn {
    width: 100%;
  }

  .cloud-library-create-row {
    grid-template-columns: 1fr;
  }

  .cloud-library-create-row .practice-page-btn {
    width: 100%;
  }

  .library-detail-actions,
  .library-word-actions,
  .library-modal-actions {
    justify-content: stretch;
  }

  .library-detail-actions .practice-page-btn,
  .library-word-actions button,
  .library-modal-actions .practice-page-btn {
    flex: 1;
    width: auto;
  }

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

  .library-overview,
  .library-preview li {
    grid-template-columns: 1fr;
  }

  .library-word-item {
    grid-template-columns: 1fr;
  }

  .library-word-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .bulk-current-card {
    padding: 18px;
    border-radius: 16px;
  }

  .bulk-textarea {
    height: 260px;
    max-height: 320px;
  }

  .app {
    width: min(100% - 20px, 1120px);
    height: auto;
    min-height: 100vh;
    padding-top: 20px;
    display: block;
  }

  .top {
    margin-left: 0;
    margin-bottom: 16px;
  }

  .workspace,
  .content-stack,
  .top-workbench,
  .practice-workbench {
    height: auto;
    margin-left: 0;
    grid-template-columns: 1fr;
    grid-template-rows: auto;
  }

  .library-panel {
    position: static;
    width: auto;
    overflow: visible;
    margin-bottom: 16px;
  }

  .library-list {
    max-height: 260px;
  }

  .section-title {
    display: grid;
  }

  h1 {
    font-size: 28px;
  }

  .scoreboard {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .stats-panel .scoreboard {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .scoreboard div {
    min-width: 0;
    padding: 10px 8px;
  }

  .panel {
    padding: 16px;
  }

  .library-summary,
  .round-result-grid,
  .quick-add,
  .answer-row,
  .word-item {
    grid-template-columns: 1fr;
  }

  .quick-add label {
    display: block;
  }

  .library-summary {
    display: grid;
  }

  .word-list-shell {
    max-height: 320px;
  }

  .word-actions {
    justify-content: stretch;
  }

  .word-actions button {
    flex: 1;
  }

  .answer-row button,
  .actions button {
    width: 100%;
  }
}

@media (max-width: 760px) {
  .entry-topbar {
    grid-template-columns: 1fr;
    justify-items: stretch;
  }

  .entry-topbar h1 {
    order: -1;
    font-size: 34px;
    text-align: left;
  }

  .entry-topbar .practice-back-btn,
  .entry-topbar .home-nav-btn {
    width: fit-content;
  }

  .entry-target-bar {
    grid-template-columns: 1fr;
    padding: 14px;
  }

  .entry-target-summary,
  .entry-target-controls {
    align-items: stretch;
    flex-direction: column;
  }

  .entry-current-library-name {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    width: 100%;
  }

  .entry-library-name-input {
    width: 100%;
  }

  .entry-target-controls .input-cloud-library-field,
  .entry-target-controls .input-cloud-library-field select {
    width: 100%;
  }

  .entry-text-btn {
    align-self: flex-start;
  }

  .entry-product-card {
    padding: 20px 16px;
  }

  .entry-product-form-grid {
    grid-template-columns: 1fr;
  }

  .entry-product-field-wide {
    grid-column: auto;
  }

  .entry-submit-row {
    align-items: stretch;
    flex-direction: column;
  }

  .entry-submit-row .entry-add-btn {
    width: 100%;
  }

  .entry-product-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .entry-product-actions .practice-page-btn {
    min-width: 0;
  }
}

/* practice.html formal product layout */
.practice-page [hidden] {
  display: none !important;
}

.practice-shell {
  width: min(1180px, calc(100% - 56px));
  padding: 24px 0 40px;
  grid-template-rows: auto auto;
  align-content: start;
  gap: 18px;
}

.practice-topbar {
  grid-template-columns: minmax(140px, 180px) minmax(0, 1fr) minmax(96px, 180px);
  column-gap: clamp(12px, 2.4vw, 28px);
  row-gap: 12px;
}

.practice-topbar .practice-back-btn {
  width: fit-content;
  max-width: 100%;
  min-height: 48px;
  padding: 0 18px;
  font-size: 15px;
  white-space: nowrap;
}

.practice-library-title {
  min-width: 0;
  font-size: 22px;
}

.practice-library-title strong {
  min-width: 0;
  max-width: 100%;
}

.practice-progress-label {
  min-width: 0;
  font-size: 16px;
  white-space: nowrap;
}

.practice-progress-label strong {
  font-size: 18px;
}

.practice-progress-track {
  grid-column: 1 / -1;
  width: 100%;
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: #dfece9;
  box-shadow: inset 0 1px 2px rgba(33, 50, 62, 0.08);
}

.practice-progress-track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #35bb9f, #0c8c79);
  transition: width 0.28s ease;
}

.practice-prepare-card {
  width: min(1080px, 100%);
  margin: 0 auto;
  display: grid;
  gap: 22px;
  padding: 30px 32px;
  border: 1px solid rgba(220, 229, 234, 0.9);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 20px 44px rgba(33, 50, 62, 0.1);
}

.practice-prepare-card .practice-cloud-test-head h1 {
  color: #1c2b35;
  font-size: 30px;
}

.practice-prepare-fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  align-items: start;
  gap: 18px;
}

.practice-prepare-card .practice-cloud-summary {
  display: grid;
  gap: 6px;
  min-height: 24px;
}

.practice-prepare-card .practice-cloud-status {
  width: 100%;
}

.practice-prepare-card .practice-cloud-status:empty {
  display: none;
}

.practice-prepare-actions {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.practice-prepare-actions .practice-page-btn {
  min-width: 140px;
  min-height: 46px;
  padding: 0 20px;
  font-size: 15px;
}

.practice-quantity-field {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.practice-quantity-field legend {
  margin-bottom: 8px;
  padding: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.practice-quantity-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.practice-quantity-option {
  position: relative;
  cursor: pointer;
}

.practice-quantity-option input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.practice-quantity-option span {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  border: 1px solid #cfe4e0;
  border-radius: 9px;
  color: #40545e;
  background: #fbfdfd;
  font-size: 13px;
  font-weight: 800;
  transition: border-color 0.16s ease, background 0.16s ease, color 0.16s ease;
}

.practice-quantity-option input:checked + span {
  border-color: #57b5a8;
  color: var(--primary-dark);
  background: #e7f5f2;
  box-shadow: 0 0 0 3px rgba(22, 113, 109, 0.08);
}

.practice-quantity-option input:focus-visible + span {
  outline: 3px solid rgba(22, 113, 109, 0.18);
  outline-offset: 2px;
}

.practice-quantity-option input:disabled + span {
  cursor: not-allowed;
  opacity: 0.45;
  background: #f2f5f5;
}

.practice-custom-quantity {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.practice-custom-quantity input {
  width: 120px;
  min-height: 40px;
  padding: 0 10px;
  border: 1px solid #cfe4e0;
  border-radius: 9px;
  background: #ffffff;
  color: #263943;
  font: inherit;
}

.practice-custom-quantity small {
  color: var(--muted);
  font-size: 12px;
}

.practice-quantity-error {
  margin: 8px 0 0;
  color: var(--danger);
  font-size: 13px;
  font-weight: 800;
}

.practice-main-card.practice-active {
  width: min(820px, 100%);
  min-height: 0;
  margin: 2px auto 0;
  display: block;
  padding: clamp(22px, 3.2vw, 34px);
  border-radius: 18px;
}

.practice-active .practice-left-pane {
  display: grid;
  grid-template-rows: none;
  align-content: start;
  gap: 0;
}

.practice-active .practice-question-card {
  display: grid;
  gap: clamp(12px, 1.6vw, 16px);
  min-width: 0;
}

.practice-active .practice-question-header {
  width: fit-content;
  max-width: 100%;
  min-width: 0;
  justify-self: center;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  text-align: center;
}

.practice-active .practice-question-kicker {
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.practice-active .practice-question-header:has(.practice-part-of-speech:not([hidden])) .practice-question-kicker::after {
  content: "·";
  margin-left: 8px;
  color: #8ba09d;
}

.practice-active .practice-meaning {
  min-height: 0;
  min-width: 0;
  margin: -2px 0 0;
  font-size: clamp(29px, 3.6vw, 39px);
  font-weight: 800;
  line-height: 1.32;
  text-align: center;
  overflow-wrap: anywhere;
}

.practice-active .practice-part-of-speech {
  flex: 0 0 auto;
  margin: 0;
}

.practice-active .practice-example-pane {
  width: min(82%, 660px);
  min-height: 0;
  justify-self: center;
  padding: 14px 16px;
  display: grid;
  gap: 6px;
  border: 0;
  border-left: 3px solid #bfe3dd;
  border-radius: 8px;
  background: #f7fbfa;
  box-shadow: none;
}

.practice-active .practice-example-pane strong {
  color: var(--muted);
  font-size: 12px;
}

.practice-active .practice-example-text {
  min-width: 0;
  font-size: 16px;
  line-height: 1.65;
  overflow-wrap: anywhere;
}

.practice-active .practice-hint-panel {
  width: fit-content;
  max-width: 80%;
  min-width: 0;
  justify-self: center;
  padding: 12px 18px;
  display: grid;
  gap: 6px;
  border: 1px solid #d5e8e4;
  border-radius: 12px;
  background: #f4faf8;
  text-align: center;
}

.practice-active .practice-hint-panel span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.06em;
}

.practice-active .practice-hint-panel strong {
  min-width: 0;
  color: var(--primary-dark);
  font-size: clamp(17px, 2vw, 21px);
  line-height: 1.65;
  letter-spacing: 2px;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.practice-active .practice-answer-field {
  width: min(82%, 660px);
  min-width: 0;
  justify-self: center;
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.practice-active .practice-answer-input {
  width: 100%;
  min-height: 54px;
  padding: 0 18px;
  border-color: #b9d9d4;
  color: #263943;
  font-size: 22px;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.practice-active .practice-answer-input:focus {
  border-color: #269b89;
  background: #ffffff;
  box-shadow: 0 0 0 4px rgba(22, 113, 109, 0.12);
}

.practice-active .practice-feedback {
  width: min(82%, 660px);
  min-height: 22px;
  justify-self: center;
  margin: -2px 0 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.practice-active .practice-feedback.correct {
  color: var(--success);
  font-weight: 800;
}

.practice-active .practice-feedback.wrong {
  color: var(--danger);
  font-weight: 800;
}

.practice-active #practiceShowAnswerBtn {
  width: fit-content;
  justify-self: center;
  min-height: 42px;
  padding: 0 16px;
  font-size: 14px;
}

.practice-active .practice-answer-actions {
  width: fit-content;
  max-width: 100%;
  justify-self: center;
  margin-top: clamp(20px, 2.6vw, 26px);
  padding-top: 18px;
  display: grid;
  grid-template-columns: 170px 200px;
  justify-content: center;
  align-items: center;
  gap: 20px;
  border-top: 1px solid var(--line);
}

.practice-active .practice-answer-actions .practice-page-btn {
  width: 100%;
  min-width: 0;
  min-height: 46px;
  padding: 0 18px;
  font-size: 15px;
}

.practice-complete-panel {
  gap: 18px;
  padding: 26px;
  border-radius: 16px;
}

.practice-complete-panel h2 {
  font-size: 28px;
}

.practice-result-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.practice-complete-actions {
  justify-content: flex-end;
}

@media (max-width: 760px) {
  .practice-shell {
    width: min(100% - 24px, 680px);
    padding: 18px 0 28px;
    gap: 18px;
  }

  .practice-topbar {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
  }

  .practice-library-title {
    grid-column: 1 / -1;
    grid-row: 2;
    justify-content: flex-start;
    font-size: 18px;
    text-align: left;
  }

  .practice-library-title strong {
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .practice-progress-label {
    grid-column: 2;
    grid-row: 1;
  }

  .practice-progress-track {
    grid-row: 3;
  }

  .practice-prepare-card,
  .practice-main-card {
    margin-top: 0;
    padding: 20px 16px;
  }

  .practice-main-card.practice-active {
    padding: 22px 20px;
  }

  .practice-prepare-fields {
    grid-template-columns: 1fr;
  }

  .practice-prepare-actions,
  .practice-bottom-actions,
  .practice-complete-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .practice-prepare-actions {
    grid-template-columns: 1fr;
  }

  .practice-prepare-actions .practice-page-btn,
  .practice-bottom-actions .practice-page-btn,
  .practice-complete-actions .practice-page-btn {
    width: 100%;
    min-width: 0;
  }

  .practice-active .practice-meaning {
    font-size: clamp(28px, 8vw, 36px);
  }

  .practice-active .practice-answer-input {
    width: 100%;
    min-height: 52px;
  }

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

  .practice-quantity-options {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .practice-quantity-option span {
    width: 100%;
  }
}

@media (max-width: 560px) {
  .practice-active .practice-question-header {
    align-items: center;
    justify-content: center;
  }

  .practice-active .practice-example-pane,
  .practice-active .practice-hint-panel {
    width: 100%;
    max-width: 100%;
    padding: 13px 14px;
  }

  .practice-active .practice-answer-field,
  .practice-active .practice-feedback {
    width: 100%;
  }

  .practice-active .practice-answer-actions {
    width: min(100%, 360px);
    grid-template-columns: 1fr;
    gap: 12px;
  }
}

/* stats.html formal product layout */
.stats-page [hidden] {
  display: none !important;
}

.stats-shell {
  width: min(1080px, calc(100% - 56px));
  padding: 24px 0 40px;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 22px;
}

.stats-product,
.stats-product-content {
  display: grid;
  gap: 18px;
}

.stats-toolbar,
.stats-performance-card,
.stats-recent-card,
.stats-product-state,
.stats-core-card {
  border: 1px solid rgba(220, 229, 234, 0.9);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 18px 42px rgba(33, 50, 62, 0.08);
}

.stats-toolbar {
  min-height: 62px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 14px 10px 18px;
  border-radius: 14px;
}

.stats-toolbar > strong {
  overflow-wrap: anywhere;
  color: var(--primary-dark);
  font-size: 16px;
}

.stats-toolbar-controls,
.stats-toolbar-controls label {
  display: flex;
  align-items: center;
  gap: 10px;
}

.stats-toolbar-controls label > span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.stats-toolbar select {
  min-width: 150px;
  min-height: 40px;
  padding: 0 34px 0 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--text);
  font: inherit;
}

.stats-toolbar select:focus {
  border-color: #6fc2b6;
  box-shadow: 0 0 0 4px rgba(22, 113, 109, 0.1);
  outline: none;
}

.stats-product-state {
  min-height: 430px;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 12px;
  padding: 34px;
  border-radius: 18px;
  text-align: center;
}

.stats-product-state h2,
.stats-product-state p {
  margin: 0;
}

.stats-product-state h2 {
  color: #1e2a32;
  font-size: 28px;
}

.stats-product-state p {
  max-width: 520px;
  color: var(--muted);
  line-height: 1.65;
}

.stats-loading-mark {
  color: var(--primary);
  font-size: 34px;
  font-weight: 900;
  letter-spacing: 5px;
}

.stats-error-illustration {
  color: var(--danger);
  background: #fff1ef;
}

.stats-state-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 8px;
}

.stats-state-actions .practice-page-btn {
  min-width: 132px;
  text-decoration: none;
}

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

.stats-core-card {
  position: relative;
  min-height: 132px;
  display: grid;
  align-content: center;
  gap: 10px;
  padding: 20px;
  border-radius: 16px;
}

.stats-core-card > span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.stats-core-card > strong {
  color: var(--primary-dark);
  font-size: 36px;
  line-height: 1;
}

.stats-accuracy-card {
  border-color: rgba(22, 113, 109, 0.22);
  background: linear-gradient(145deg, #ffffff 0%, #edf8f6 100%);
}

.stats-inline-link {
  width: fit-content;
  color: var(--primary-dark);
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
}

.stats-inline-link:hover {
  color: var(--primary);
}

.stats-performance-card,
.stats-recent-card {
  padding: 20px 22px;
  border-radius: 16px;
}

.stats-compact-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.stats-compact-head h2 {
  color: #1e2a32;
  font-size: 21px;
}

.stats-performance-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 0.8fr)) minmax(220px, 1.6fr);
  gap: 10px;
}

.stats-performance-list > div {
  min-width: 0;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  background: #f7faf9;
}

.stats-performance-list span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.stats-performance-list strong {
  overflow-wrap: anywhere;
  color: var(--primary-dark);
  font-size: 17px;
}

.stats-performance-time strong {
  font-size: 14px;
}

.stats-page .stats-cloud-records-list {
  gap: 8px;
}

.stats-page .stats-cloud-record-item {
  gap: 8px;
  padding: 13px 14px;
  border-radius: 12px;
  background: #fbfdfd;
}

.stats-record-head,
.stats-record-context {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.stats-record-head > strong:first-child {
  overflow-wrap: anywhere;
  color: var(--primary-dark);
  font-size: 17px;
}

.stats-record-accuracy {
  color: var(--primary-dark);
  font-size: 22px;
  white-space: nowrap;
}

.stats-record-context {
  justify-content: flex-start;
  color: var(--muted);
  font-size: 13px;
}

.stats-record-mode {
  padding: 3px 7px;
  border-radius: 999px;
  color: var(--primary-dark);
  background: #e8f2f1;
  font-size: 12px;
  font-weight: 800;
}

.stats-page .stats-cloud-record-item .stats-library-metrics {
  gap: 6px;
}

.stats-page .stats-cloud-record-item .stats-metric-tag {
  min-height: 26px;
  padding: 0 8px;
  font-size: 12px;
}

.stats-page .stats-cloud-records-status.error {
  color: var(--danger);
}

@media (max-width: 760px) {
  .stats-shell {
    width: min(100% - 24px, 680px);
    padding: 18px 0 28px;
    gap: 18px;
  }

  .stats-topbar {
    grid-template-columns: 1fr;
    justify-items: stretch;
  }

  .stats-topbar h1 {
    order: -1;
    font-size: 34px;
    text-align: left;
  }

  .stats-topbar .practice-back-btn,
  .stats-topbar .home-nav-btn {
    width: fit-content;
  }

  .stats-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .stats-toolbar-controls {
    justify-content: space-between;
  }

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

  .stats-core-card {
    min-height: 118px;
    padding: 16px;
  }

  .stats-core-card > strong {
    font-size: 32px;
  }

  .stats-performance-card,
  .stats-recent-card {
    padding: 18px 14px;
  }

  .stats-performance-time {
    grid-column: 1 / -1;
  }

  .stats-product-state {
    min-height: 330px;
    padding: 26px 16px;
  }

  .stats-record-head {
    align-items: flex-start;
  }

  .stats-record-context {
    align-items: flex-start;
    flex-direction: column;
    gap: 5px;
  }
}

@media (max-width: 480px) {
  .stats-toolbar-controls,
  .stats-state-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .stats-toolbar-controls label,
  .stats-toolbar select,
  .stats-state-actions .practice-page-btn {
    width: 100%;
  }

  .stats-toolbar-controls .library-icon-btn {
    align-self: flex-end;
  }

  .stats-core-grid,
  .stats-performance-list {
    grid-template-columns: 1fr;
  }

  .stats-performance-time {
    grid-column: auto;
  }
}

/* admin.html formal product layout */
.admin-page {
  overflow-x: hidden;
  background:
    radial-gradient(circle at 16% 34%, rgba(22, 113, 109, 0.09), transparent 24%),
    radial-gradient(circle at 82% 76%, rgba(217, 119, 6, 0.06), transparent 25%),
    linear-gradient(180deg, #fbfdfe 0%, #f4f8f7 100%);
}

.admin-page [hidden] {
  display: none !important;
}

.admin-shell {
  width: min(1120px, calc(100% - 56px));
  padding: 24px 0 40px;
  grid-template-rows: auto auto;
  align-content: start;
  gap: 22px;
}

.admin-topbar {
  grid-template-columns: 180px minmax(0, 1fr) 180px;
}

.admin-topbar .admin-logout-btn {
  justify-self: end;
  color: #a9483e;
  border-color: #f1d5d2;
  background: #fff8f7;
  box-shadow: none;
}

.admin-product-state {
  min-height: 420px;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 12px;
  padding: 34px;
  border: 1px solid rgba(220, 229, 234, 0.9);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 18px 42px rgba(33, 50, 62, 0.08);
  text-align: center;
}

.admin-loading-mark {
  color: var(--primary);
  font-size: 34px;
  font-weight: 900;
  letter-spacing: 5px;
}

.admin-product-state h2 {
  color: #1e2a32;
  font-size: 28px;
}

.admin-product-state p {
  max-width: 520px;
  color: var(--muted);
  line-height: 1.6;
}

.admin-state-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 8px;
}

.admin-state-actions .practice-page-btn {
  min-width: 128px;
}

.admin-content {
  display: grid;
  align-self: start;
  align-content: start;
  grid-template-rows: auto auto;
  gap: 16px;
}

.admin-identity-bar,
.admin-user-card {
  border: 1px solid rgba(220, 229, 234, 0.9);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 18px 42px rgba(33, 50, 62, 0.08);
}

.admin-identity-bar {
  min-height: 62px;
  display: flex;
  align-items: center;
  gap: 12px 22px;
  padding: 11px 16px;
  border-radius: 14px;
}

.admin-identity-name {
  min-width: 0;
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.admin-identity-name span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.admin-identity-name strong {
  overflow-wrap: anywhere;
  color: var(--primary-dark);
  font-size: 17px;
}

.admin-role-badge,
.admin-status-tag {
  width: fit-content;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  font-weight: 800;
  white-space: nowrap;
}

.admin-role-badge {
  min-height: 28px;
  padding: 0 10px;
  color: var(--primary-dark);
  background: #e8f2f1;
  font-size: 12px;
}

.admin-masked-phone {
  margin-left: auto;
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
}

.admin-user-card {
  min-width: 0;
  min-height: 0;
  padding: 20px 22px 22px;
  border-radius: 18px;
}

.admin-card-head h2 {
  color: #1e2a32;
  font-size: 22px;
}

.admin-page .admin-search-form {
  gap: 10px;
  margin-top: 14px;
}

.admin-page .admin-search-row {
  grid-template-columns: 140px minmax(0, 1fr) 112px;
  gap: 10px;
}

.admin-page .admin-search-row select,
.admin-page .admin-search-row input {
  min-height: 44px;
  border-color: var(--line);
  border-radius: 10px;
  color: var(--text);
}

.admin-page .admin-search-row select:focus,
.admin-page .admin-search-row input:focus,
.admin-page .admin-grant-note textarea:focus {
  border-color: #6fc2b6;
  box-shadow: 0 0 0 4px rgba(22, 113, 109, 0.1);
  outline: none;
}

.admin-page .admin-search-row .practice-page-btn {
  min-height: 44px;
  padding: 0 16px;
  font-size: 15px;
}

.admin-search-feedback {
  min-height: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.admin-page .admin-search-status {
  min-height: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.admin-page .admin-search-status.is-error {
  color: var(--danger);
  font-weight: 800;
}

.admin-text-btn {
  padding: 2px 0;
  border: 0;
  color: var(--primary-dark);
  background: transparent;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
}

.admin-page .admin-table-wrap {
  margin-top: 12px;
  overflow: hidden;
  border-color: var(--line);
  border-radius: 12px;
}

.admin-page .admin-user-table {
  width: 100%;
  min-width: 0;
  table-layout: fixed;
  color: var(--text);
  font-size: 13px;
}

.admin-page .admin-user-table th,
.admin-page .admin-user-table td {
  padding: 11px 10px;
  border-bottom-color: var(--line);
  vertical-align: middle;
  white-space: normal;
  overflow-wrap: anywhere;
}

.admin-page .admin-user-table th {
  color: var(--muted);
  background: #f7faf9;
  font-size: 12px;
}

.admin-page .admin-user-table th:nth-child(1) {
  width: 25%;
}

.admin-page .admin-user-table th:nth-child(2),
.admin-page .admin-user-table th:nth-child(3) {
  width: 11%;
}

.admin-page .admin-user-table th:nth-child(4) {
  width: 17%;
}

.admin-page .admin-user-table th:nth-child(5) {
  width: 14%;
}

.admin-page .admin-user-table th:nth-child(6) {
  width: 22%;
}

.admin-user-details > strong,
.admin-user-details > span,
.admin-user-details > small {
  display: block;
}

.admin-user-details > strong {
  color: var(--primary-dark);
  font-size: 14px;
}

.admin-user-details > span {
  margin-top: 3px;
  color: var(--muted);
  font-weight: 700;
}

.admin-user-details > small {
  margin-top: 2px;
  color: #8a999f;
  font-size: 11px;
}

.admin-date-cell {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.admin-status-tag {
  min-height: 26px;
  padding: 0 8px;
  font-size: 11px;
}

.admin-status-tag.is-role,
.admin-status-tag.is-active,
.admin-status-tag.is-member {
  color: var(--primary-dark);
  background: #e8f2f1;
}

.admin-status-tag.is-inactive {
  color: #9b4a42;
  background: #fff1ef;
}

.admin-status-tag.is-free {
  color: #7a5b24;
  background: #fff7e8;
}

.admin-status-tag.is-muted {
  color: var(--muted);
  background: #f1f5f4;
}

.admin-page .admin-action-cell {
  min-width: 0;
}

.admin-page .admin-inline-btn {
  width: 100%;
  min-height: 36px;
  padding: 0 10px;
  border-color: transparent;
  border-radius: 9px;
  color: #fff;
  background: var(--primary);
  font-size: 12px;
  font-weight: 800;
}

.admin-page .admin-inline-btn:disabled {
  color: var(--muted);
  border-color: var(--line);
  background: #f4f8f7;
}

.admin-page .admin-pagination {
  justify-content: flex-end;
  gap: 8px;
  margin-top: 12px;
}

.admin-page .admin-pagination .practice-page-btn {
  min-width: 76px;
  min-height: 36px;
  padding: 0 12px;
  box-shadow: none;
  font-size: 13px;
}

.admin-page .admin-pagination-status {
  min-width: 62px;
  text-align: center;
  font-size: 13px;
}

.admin-page .admin-grant-confirm {
  margin-top: 16px;
  padding: 18px;
  border-color: rgba(22, 113, 109, 0.24);
  border-radius: 14px;
  background: #f4faf9;
}

.admin-confirm-head {
  display: grid;
  gap: 5px;
}

.admin-page .admin-confirm-head h3 {
  margin: 0;
  color: #1e2a32;
  font-size: 18px;
}

.admin-confirm-head p {
  color: var(--muted);
  line-height: 1.5;
}

.admin-grant-summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(180px, 0.7fr) auto;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fff;
}

.admin-grant-summary > div:not(.admin-grant-meta) {
  display: grid;
  gap: 3px;
}

.admin-grant-summary span,
.admin-grant-summary small {
  color: var(--muted);
  font-size: 12px;
}

.admin-grant-summary strong {
  color: var(--primary-dark);
}

.admin-grant-summary small b {
  color: var(--text);
}

.admin-grant-meta {
  display: flex;
  gap: 6px;
}

.admin-grant-meta span {
  padding: 4px 8px;
  border-radius: 999px;
  color: var(--primary-dark);
  background: #e8f2f1;
  font-weight: 800;
}

.admin-page .admin-grant-note {
  margin-top: 14px;
  color: var(--muted);
  font-weight: 800;
}

.admin-page .admin-grant-note textarea {
  min-height: 72px;
  border-color: var(--line);
  border-radius: 10px;
  color: var(--text);
}

.admin-page .admin-grant-actions {
  justify-content: flex-end;
}

.admin-page .admin-grant-actions .practice-page-btn {
  min-height: 40px;
  padding: 0 16px;
  font-size: 14px;
}

.admin-page .admin-grant-message {
  font-size: 13px;
  line-height: 1.55;
}

@media (max-width: 760px) {
  .admin-shell {
    width: min(100% - 24px, 680px);
    padding: 18px 0 28px;
    gap: 18px;
  }

  .admin-topbar {
    grid-template-columns: 1fr auto;
    gap: 12px;
  }

  .admin-topbar h1 {
    grid-column: 1 / -1;
    grid-row: 1;
    font-size: 34px;
    text-align: left;
  }

  .admin-topbar .practice-back-btn:first-child {
    grid-column: 1;
    grid-row: 2;
    width: fit-content;
  }

  .admin-topbar .admin-logout-btn {
    grid-column: 2;
    grid-row: 2;
  }

  .admin-product-state {
    min-height: 330px;
    padding: 26px 16px;
  }

  .admin-identity-bar {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .admin-identity-name {
    width: 100%;
  }

  .admin-masked-phone {
    margin-left: 0;
  }

  .admin-user-card {
    padding: 18px 14px;
  }

  .admin-page .admin-search-row {
    grid-template-columns: 1fr;
  }

  .admin-page .admin-search-row .practice-page-btn {
    width: 100%;
  }

  .admin-search-feedback {
    align-items: flex-start;
  }

  .admin-page .admin-table-wrap {
    overflow: visible;
    border: 0;
    background: transparent;
  }

  .admin-page .admin-user-table,
  .admin-page .admin-user-table tbody,
  .admin-page .admin-user-table tr,
  .admin-page .admin-user-table td {
    display: block;
    width: 100%;
  }

  .admin-page .admin-user-table thead {
    display: none;
  }

  .admin-page .admin-user-table tbody {
    display: grid;
    gap: 12px;
  }

  .admin-page .admin-user-table tr {
    padding: 6px 12px;
    border: 1px solid var(--line);
    border-radius: 13px;
    background: #fff;
  }

  .admin-page .admin-user-table td {
    min-height: 38px;
    display: grid;
    grid-template-columns: 88px minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    padding: 8px 0;
  }

  .admin-page .admin-user-table td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
  }

  .admin-page .admin-user-table td:last-child {
    border-bottom: 0;
  }

  .admin-page .admin-inline-btn {
    width: 100%;
  }

  .admin-grant-summary {
    grid-template-columns: 1fr;
  }

  .admin-page .admin-grant-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .admin-page .admin-grant-actions .practice-page-btn {
    width: 100%;
  }
}

@media (max-width: 480px) {
  .admin-state-actions,
  .admin-page .admin-grant-actions {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
  }

  .admin-state-actions .practice-page-btn {
    width: 100%;
  }

  .admin-page .admin-pagination {
    justify-content: space-between;
  }
}

/* Privacy policy, terms and help pages */
body.support-page {
  min-height: 100vh;
  overflow-x: hidden;
  overflow-y: auto;
  color: var(--text);
  background:
    radial-gradient(circle at 12% 8%, rgba(22, 113, 109, 0.08), transparent 24%),
    linear-gradient(180deg, #fbfdfe 0%, #f4f8f7 100%);
}

.support-shell {
  width: min(900px, calc(100% - 40px));
  margin: 0 auto;
  padding: 22px 0 42px;
}

.support-topbar {
  min-width: 0;
  min-height: 52px;
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr) 220px;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}

.support-topbar h1 {
  margin: 0;
  color: #1e2a32;
  font-size: 24px;
  line-height: 1.3;
  text-align: center;
}

.support-back-link,
.support-nav-links a {
  color: #30424c;
  font-size: 14px;
  font-weight: 800;
  text-decoration: none;
}

.support-back-link {
  width: fit-content;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.support-back-link span {
  color: var(--primary-dark);
  font-size: 20px;
  line-height: 1;
}

.support-nav-links {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  color: #9aa6ad;
  white-space: nowrap;
}

.support-back-link:hover,
.support-back-link:focus-visible,
.support-nav-links a:hover,
.support-nav-links a:focus-visible,
.support-toc a:hover,
.support-toc a:focus-visible {
  color: var(--primary);
  text-decoration: underline;
}

.support-card {
  padding: 32px 38px 36px;
  border: 1px solid rgba(220, 229, 234, 0.95);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.96);
}

.support-intro {
  padding: 20px 22px;
  border-left: 4px solid var(--primary);
  border-radius: 10px;
  background: #f2f8f7;
}

.support-kicker {
  margin: 0 0 4px;
  color: var(--primary-dark);
  font-size: 13px;
  font-weight: 900;
}

.support-intro h2 {
  margin: 0;
  color: #1e2a32;
  font-size: 22px;
  line-height: 1.4;
}

.support-intro p:last-child {
  margin: 8px 0 0;
}

.support-card p,
.support-card li,
.support-card dd {
  color: #465761;
  font-size: 15px;
  line-height: 1.75;
}

.support-card p {
  margin: 10px 0;
}

.support-card ul {
  margin: 12px 0 0;
  padding-left: 22px;
}

.support-card li {
  margin: 5px 0;
}

.support-toc {
  margin-top: 22px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fbfcfc;
}

.support-toc > strong {
  color: #1e2a32;
  font-size: 15px;
}

.support-toc ol {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px 28px;
  margin: 12px 0 0;
  padding-left: 22px;
}

.support-toc li {
  margin: 0;
  font-size: 14px;
}

.support-toc a {
  color: var(--primary-dark);
  font-weight: 700;
  text-decoration: none;
}

.support-section {
  scroll-margin-top: 18px;
  margin-top: 30px;
  padding-top: 2px;
}

.support-section + .support-section {
  padding-top: 28px;
  border-top: 1px solid var(--line);
}

.support-section h2 {
  margin: 0 0 10px;
  color: #1e2a32;
  font-size: 21px;
  line-height: 1.45;
}

.support-facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 16px 0 0;
}

.support-facts > div {
  min-width: 0;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f8faf9;
}

.support-facts dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.support-facts dd {
  margin: 4px 0 0;
  color: var(--primary-dark);
  font-weight: 800;
  overflow-wrap: anywhere;
}

.support-facts-single {
  grid-template-columns: minmax(0, 1fr);
  max-width: 360px;
}

.help-support-card {
  padding-top: 28px;
}

.help-intro {
  text-align: center;
  border-left: 0;
  border-top: 4px solid var(--primary);
}

.help-quick-links {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 18px;
}

.help-quick-links a {
  min-width: 0;
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: #30424c;
  background: #fff;
  font-size: 14px;
  font-weight: 800;
  text-decoration: none;
}

.help-quick-links a:hover,
.help-quick-links a:focus-visible {
  border-color: #b9dcd6;
  color: var(--primary-dark);
  background: #f4faf9;
}

.help-quick-links b {
  color: var(--primary);
  font-size: 20px;
}

.help-faq-section {
  margin-top: 28px;
}

.help-faq {
  display: grid;
  gap: 8px;
}

.help-faq details {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}

.help-faq details[open] {
  border-color: #b9dcd6;
  background: #f8fbfa;
}

.help-faq summary {
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 14px;
  color: #263943;
  font-size: 15px;
  font-weight: 800;
  line-height: 1.5;
  cursor: pointer;
  list-style: none;
}

.help-faq summary::-webkit-details-marker {
  display: none;
}

.help-faq summary::after {
  content: "+";
  flex: 0 0 auto;
  color: var(--primary);
  font-size: 22px;
  font-weight: 700;
  line-height: 1;
}

.help-faq details[open] summary::after {
  content: "−";
}

.help-faq summary:focus-visible {
  border-radius: 9px;
  outline: 3px solid rgba(22, 113, 109, 0.18);
  outline-offset: 2px;
}

.help-faq details > div {
  padding: 0 14px 13px;
  border-top: 1px solid rgba(220, 229, 234, 0.78);
}

.help-faq details > div p {
  margin: 10px 0 0;
}

.help-contact {
  padding-bottom: 2px;
}

.support-security-note {
  color: var(--muted) !important;
  font-size: 13px !important;
}

@media (max-width: 720px) {
  .support-shell {
    width: min(100% - 24px, 900px);
    padding: 12px 0 26px;
  }

  .support-topbar {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 6px 12px;
    margin-bottom: 10px;
  }

  .support-topbar h1 {
    grid-column: 1 / -1;
    grid-row: 1;
    font-size: 22px;
  }

  .support-back-link {
    grid-column: 1;
    grid-row: 2;
    font-size: 13px;
  }

  .support-nav-links {
    grid-column: 2;
    grid-row: 2;
    gap: 6px;
  }

  .support-nav-links a {
    font-size: 12px;
  }

  .support-card,
  .help-support-card {
    padding: 20px 18px 24px;
    border-radius: 14px;
  }

  .support-intro {
    padding: 16px;
  }

  .support-intro h2 {
    font-size: 20px;
  }

  .support-toc ol,
  .support-facts {
    grid-template-columns: 1fr;
  }

  .support-section,
  .help-faq-section {
    margin-top: 24px;
  }

  .support-section + .support-section {
    padding-top: 22px;
  }

  .support-section h2 {
    font-size: 19px;
  }

  .help-quick-links {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 420px) {
  .support-nav-links span {
    display: none;
  }

  .support-nav-links {
    gap: 10px;
  }

  .support-card,
  .help-support-card {
    padding-right: 14px;
    padding-left: 14px;
  }

  .help-quick-links {
    grid-template-columns: 1fr;
  }
}
