:root {
  --bg: #fff8fb;
  --surface: rgba(255, 255, 255, 0.86);
  --surface-solid: #ffffff;
  --text: #19202a;
  --muted: #6d7685;
  --line: #e4e9f1;
  --mint: #ffc2dd;
  --blue: #79b8ff;
  --coral: #ff91b8;
  --yellow: #ffd166;
  --lavender: #b69cff;
  --shadow: 0 18px 50px rgba(31, 42, 68, 0.11);
  --soft-shadow: 0 10px 28px rgba(31, 42, 68, 0.08);
  --radius: 16px;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", system-ui, sans-serif;
  background:
    radial-gradient(circle at 15% 0%, rgba(255, 194, 221, 0.32), transparent 32rem),
    radial-gradient(circle at 88% 12%, rgba(255, 209, 102, 0.18), transparent 28rem),
    radial-gradient(circle at 50% 90%, rgba(121, 184, 255, 0.14), transparent 30rem),
    var(--bg);
}

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

button {
  cursor: pointer;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
}

.sidebar {
  width: 220px;
  min-height: 100vh;
  position: sticky;
  top: 0;
  padding: 20px 14px;
  border-right: 1px solid rgba(228, 233, 241, 0.76);
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(22px);
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 8px 8px 20px;
}

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  color: white;
  font-weight: 800;
  background: linear-gradient(135deg, var(--mint), var(--coral));
  box-shadow: var(--soft-shadow);
}

.brand h1,
.brand p,
.topbar h2,
.topbar p,
.panel h3,
.panel p {
  margin: 0;
}

.brand h1 {
  font-size: 18px;
}

.brand p,
.panel p,
.eyebrow {
  color: var(--muted);
  font-size: 12px;
  margin-top: 3px;
}

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

.nav-list {
  margin-top: 8px;
}

.sidebar-actions {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.nav-item,
.side-action,
.sidebar-toggle {
  width: 100%;
  min-height: 42px;
  border: 0;
  border-radius: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  color: #3e4756;
  background: transparent;
  text-align: left;
  text-decoration: none;
}

.nav-item svg,
.side-action svg,
.sidebar-toggle svg,
.primary-btn svg,
.ghost-btn svg,
.icon-btn svg,
.ai-toggle svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

.nav-item.active {
  color: white;
  background: linear-gradient(135deg, #ffc2dd, #ff91b8);
  box-shadow: var(--soft-shadow);
}

.nav-item:not(.active):hover,
.side-action:hover {
  background: rgba(79, 141, 247, 0.09);
}

.sidebar-toggle {
  margin: 0 0 10px;
  color: #7d2a58;
  background: rgba(255, 140, 198, 0.14);
  font-weight: 800;
}

.file-action {
  cursor: pointer;
}

.file-action input {
  display: none;
}

.main {
  padding: 26px clamp(18px, 4vw, 42px) 42px;
  min-width: 0;
}

.topbar {
  min-height: 78px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
}

.topbar > div:first-child {
  flex: 1 1 220px;
  min-width: 0;
}

.topbar h2 {
  font-size: clamp(24px, 3vw, 34px);
  letter-spacing: 0;
}

.topbar-stat {
  padding: 10px 14px;
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--soft-shadow);
  display: grid;
  gap: 2px;
  min-width: 110px;
}

.topbar-stat span {
  color: var(--muted);
  font-size: 12px;
}

.topbar-stat strong {
  font-size: 14px;
}

.cloud-sync {
  max-width: 460px;
  display: grid;
  grid-template-columns: minmax(120px, 1fr) auto auto;
  gap: 8px;
  align-items: center;
  padding: 10px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(255, 170, 210, 0.28);
  box-shadow: var(--soft-shadow);
}

.cloud-sync input {
  width: 100%;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0 10px;
  font: inherit;
  background: #fff;
}

.cloud-sync span {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 12px;
}

.desktop-sync {
  max-width: 520px;
  border-color: rgba(121, 184, 255, 0.36);
}

.mini-btn {
  min-height: 34px;
  padding: 0 11px;
  border: 0;
  border-radius: 12px;
  background: rgba(255, 140, 198, 0.18);
  color: #7d2a58;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.mini-btn.muted {
  background: rgba(121, 184, 255, 0.14);
  color: #486083;
}

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

.view {
  display: none;
}

.view.active {
  display: block;
}

.section-grid {
  display: grid;
  gap: 18px;
}

.section-grid.two {
  grid-template-columns: minmax(0, 1fr) minmax(360px, 0.92fr);
}

.panel {
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.85);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
  min-width: 0;
}

.accent-panel {
  background:
    linear-gradient(145deg, rgba(255, 140, 198, 0.18), rgba(255, 209, 102, 0.14)),
    var(--surface-solid);
}

.panel-head,
.modal-head,
.ai-head,
.metric-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.panel h3 {
  font-size: 18px;
  letter-spacing: 0;
}

.progress-ring {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 800;
  color: #b72f6b;
  background: conic-gradient(var(--mint) 0deg, var(--line) 0deg);
}

.form-row,
.stack-form {
  margin-top: 16px;
}

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

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

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

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--text);
  padding: 11px 12px;
  outline: none;
}

textarea {
  min-height: 86px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(79, 141, 247, 0.7);
  box-shadow: 0 0 0 4px rgba(79, 141, 247, 0.12);
}

.primary-btn,
.ghost-btn,
.icon-btn {
  border: 0;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.primary-btn {
  min-height: 42px;
  padding: 0 14px;
  color: white;
  background: linear-gradient(135deg, var(--mint), var(--blue));
  box-shadow: var(--soft-shadow);
}

.ghost-btn {
  min-height: 38px;
  padding: 0 12px;
  color: #34507d;
  background: rgba(79, 141, 247, 0.1);
  text-decoration: none;
}

.icon-btn {
  width: 36px;
  height: 36px;
  color: #445064;
  background: rgba(25, 32, 42, 0.06);
}

.task-list,
.media-list,
.compact-list,
.digest-list {
  margin-top: 16px;
  display: grid;
  gap: 10px;
}

.task-card,
.media-card,
.compact-card,
.digest-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.78);
  padding: 12px;
}

.task-card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.task-card:hover {
  border-color: rgba(255, 145, 184, 0.34);
  box-shadow: 0 10px 26px rgba(255, 145, 184, 0.12);
}

.task-card input[type="checkbox"] {
  width: 20px;
  height: 20px;
  accent-color: #ff79b2;
  cursor: pointer;
}

.task-actions {
  display: flex;
  gap: 6px;
  align-items: center;
}

.task-edit-card {
  grid-template-columns: minmax(0, 1.4fr) minmax(130px, 0.55fr) minmax(120px, 0.55fr);
  align-items: stretch;
}

.task-edit-actions {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.task-card.done {
  border-color: rgba(43, 195, 143, 0.45);
  background:
    linear-gradient(135deg, rgba(214, 255, 235, 0.96), rgba(226, 244, 255, 0.9));
  box-shadow: 0 12px 30px rgba(43, 195, 143, 0.14);
}

.task-card.done .task-title {
  color: #17705d;
  text-decoration: line-through;
}

.task-card.done .task-meta {
  color: #2f836f;
}

.task-title {
  font-weight: 650;
  overflow-wrap: anywhere;
}

.task-meta,
.media-meta,
.compact-meta,
.tag-row {
  color: var(--muted);
  font-size: 12px;
  margin-top: 4px;
}

.priority {
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.priority.high {
  color: #a4332b;
  background: rgba(255, 122, 110, 0.16);
}

.priority.medium {
  color: #88650f;
  background: rgba(242, 201, 76, 0.22);
}

.priority.low {
  color: #207767;
  background: rgba(255, 140, 198, 0.18);
}

.delete-btn {
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 12px;
  color: #b83c34;
  background: rgba(255, 122, 110, 0.12);
}

.digest-card strong,
.media-card strong,
.compact-card strong {
  display: block;
  overflow-wrap: anywhere;
}

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

.notice {
  margin-top: 14px;
  padding: 12px 14px;
  border: 1px solid rgba(79, 141, 247, 0.18);
  border-radius: 16px;
  color: #34507d;
  background: rgba(79, 141, 247, 0.08);
  font-size: 13px;
  line-height: 1.6;
}

.chart-link {
  min-height: 70px;
  display: grid;
  gap: 5px;
  padding: 12px;
  border-radius: 16px;
  color: var(--text);
  text-decoration: none;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.8);
}

.chart-link span {
  color: var(--muted);
  font-size: 12px;
}

.media-card {
  display: grid;
  gap: 10px;
}

.rank-board {
  margin-top: 14px;
  display: grid;
  gap: 10px;
}

.split-heading {
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.inspo-card {
  display: grid;
  gap: 12px;
  border: 1px solid rgba(255, 140, 198, 0.25);
  border-left: 5px solid var(--mint);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.82);
  padding: 15px;
  box-shadow: 0 10px 26px rgba(255, 111, 145, 0.08);
}

.inspo-title {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-weight: 800;
  line-height: 1.45;
}

.inspo-index {
  width: 28px;
  height: 28px;
  border-radius: 10px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  color: white;
  font-size: 13px;
  background: linear-gradient(135deg, var(--mint), var(--coral));
}

.tag-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag-pill {
  padding: 4px 8px;
  border-radius: 999px;
  color: #9b2a62;
  background: rgba(255, 140, 198, 0.16);
  font-size: 12px;
  font-weight: 700;
}

.inspo-copy {
  color: #3c4658;
  font-size: 14px;
  line-height: 1.7;
}

.inspo-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.link-btn {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 12px;
  border-radius: 13px;
  color: #6d2650;
  background: rgba(255, 140, 198, 0.16);
  border: 1px solid rgba(255, 140, 198, 0.28);
  text-decoration: none;
  font-size: 13px;
  font-weight: 750;
  font-family: inherit;
  cursor: pointer;
}

.link-btn.alt {
  color: #315c95;
  background: rgba(121, 184, 255, 0.16);
  border-color: rgba(121, 184, 255, 0.28);
}

.link-btn.warm {
  color: #8a5d11;
  background: rgba(255, 209, 102, 0.2);
  border-color: rgba(255, 209, 102, 0.34);
}

.link-btn svg {
  width: 16px;
  height: 16px;
}

.rank-card {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.78);
  padding: 12px;
}

.rank-num {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  color: white;
  font-weight: 800;
  background: linear-gradient(135deg, var(--coral), var(--yellow));
}

.rank-title {
  font-weight: 750;
  overflow-wrap: anywhere;
}

.rank-detail {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

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

.rank-preview {
  grid-column: 1 / -1;
}

.embed-box {
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  background: #eef3f8;
  display: grid;
  place-items: center;
}

.embed-box iframe,
.embed-box video,
.embed-box audio {
  width: 100%;
  height: 100%;
  border: 0;
}

.embed-placeholder {
  padding: 18px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}

.embed-placeholder a,
.media-card a,
.compact-card a {
  color: #2c70d8;
  text-decoration: none;
}

.upload-box {
  display: grid;
  gap: 8px;
  padding: 14px;
  border: 1px dashed rgba(79, 141, 247, 0.45);
  border-radius: 16px;
  color: #34507d;
  background: rgba(79, 141, 247, 0.07);
}

.upload-box span {
  font-size: 13px;
  font-weight: 700;
}

.upload-box.dragging {
  border-color: rgba(255, 145, 184, 0.8);
  background: rgba(255, 145, 184, 0.12);
  box-shadow: 0 0 0 3px rgba(255, 145, 184, 0.12) inset;
}

.pages-preview-card {
  display: grid;
  gap: 10px;
  margin-bottom: 12px;
  padding: 14px;
  border-radius: 16px;
  border: 1px solid rgba(255, 145, 184, 0.22);
  background: rgba(255, 247, 251, 0.94);
  box-shadow: var(--soft-shadow);
}

.pages-preview-card img {
  width: 100%;
  border-radius: 14px;
  border: 1px solid var(--line);
  display: block;
}

.media-thumbs {
  min-width: 210px;
  display: grid;
  grid-template-columns: repeat(2, minmax(90px, 1fr));
  gap: 8px;
}

.media-thumb {
  min-height: 86px;
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  background: #eef3f8;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 12px;
}

.media-thumb img,
.media-thumb video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.tabs {
  display: inline-flex;
  padding: 4px;
  gap: 4px;
  background: rgba(255, 255, 255, 0.8);
  border-radius: 16px;
  box-shadow: var(--soft-shadow);
  margin-bottom: 18px;
}

.tab-btn {
  min-width: 132px;
  height: 38px;
  border: 0;
  border-radius: 13px;
  color: var(--muted);
  background: transparent;
}

.tab-btn.active {
  color: white;
  background: var(--blue);
}

.tab-view {
  display: none;
}

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

.insight-box {
  margin-top: 14px;
  padding: 14px;
  border-radius: 16px;
  background: linear-gradient(145deg, rgba(255, 140, 198, 0.16), rgba(139, 124, 246, 0.14));
  line-height: 1.65;
}

.metric-row {
  margin-bottom: 18px;
}

.metric-row div {
  min-width: 0;
}

.metric-row span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.metric-row strong {
  display: block;
  margin-top: 4px;
  font-size: 24px;
}

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

.sport-chip {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.86);
}

.sport-chip.active {
  color: white;
  border-color: transparent;
  background: linear-gradient(135deg, var(--coral), var(--lavender));
}

.heatmap {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.heat-cell {
  min-height: 74px;
  border-radius: 16px;
  background: #e9edf4;
  padding: 10px;
  display: grid;
  align-content: space-between;
  color: #465166;
}

.heat-cell.level-1 {
  background: rgba(67, 198, 172, 0.25);
}

.heat-cell.level-2 {
  background: rgba(67, 198, 172, 0.48);
}

.heat-cell.level-3 {
  color: white;
  background: var(--mint);
}

.heat-cell b {
  font-size: 12px;
}

.heat-cell span {
  font-size: 12px;
}

.sleep-calendar {
  display: grid;
  gap: 10px;
  margin: 14px 0;
}

.sleep-calendar-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-end;
}

.sleep-calendar-head span {
  color: var(--muted);
  font-size: 12px;
}

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

.sleep-weekdays span {
  color: #7d2a58;
  font-size: 12px;
  font-weight: 850;
  text-align: center;
}

.sleep-day {
  min-height: 58px;
  display: grid;
  align-content: space-between;
  gap: 2px;
  padding: 7px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.78);
  color: #263247;
}

.sleep-day strong,
.sleep-day span,
.sleep-day small {
  line-height: 1.1;
}

.sleep-day span,
.sleep-day small {
  font-size: 11px;
  color: var(--muted);
}

.sleep-day.excellent,
.sleep-score-pill.excellent {
  background: rgba(209, 250, 229, 0.96);
  border-color: rgba(43, 195, 143, 0.34);
  color: #17705d;
}

.sleep-day.normal,
.sleep-score-pill.normal {
  background: rgba(219, 234, 254, 0.96);
  border-color: rgba(121, 184, 255, 0.34);
  color: #23568f;
}

.sleep-day.warning,
.sleep-score-pill.warning {
  background: rgba(255, 237, 213, 0.96);
  border-color: rgba(251, 146, 60, 0.34);
  color: #9a4a0d;
}

.sleep-day.empty {
  opacity: 0;
}

.sleep-record-card {
  position: relative;
  padding-right: 52px;
}

.sleep-record-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
}

.sleep-score-pill {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 4px 9px;
  border-radius: 999px;
  border: 1px solid var(--line);
  font-weight: 900;
}

.recurring-card {
  position: relative;
  padding-right: 52px;
}

.recurring-actions {
  position: absolute;
  right: 10px;
  top: 10px;
  display: flex;
  gap: 6px;
  align-items: center;
}

.recurring-edit-card {
  padding-right: 12px;
}

.tomorrow-card {
  margin-top: 14px;
  padding: 14px;
  border-radius: 16px;
  border: 1px solid rgba(121, 184, 255, 0.28);
  background: rgba(239, 246, 255, 0.78);
}

.tomorrow-card h3 {
  margin-bottom: 10px;
}

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

.tomorrow-item {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid var(--line);
}

.tomorrow-item span {
  font-weight: 800;
}

.tomorrow-item small {
  color: #23568f;
  font-weight: 850;
  white-space: nowrap;
}

.journal-card {
  position: relative;
  padding-right: 52px;
}

.table-wrap {
  margin-top: 14px;
  overflow: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 980px;
  font-size: 14px;
}

th,
td {
  padding: 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.ai-toggle {
  position: fixed;
  right: 24px;
  bottom: 24px;
  width: 58px;
  height: 58px;
  border: 0;
  border-radius: 20px;
  color: white;
  background: linear-gradient(135deg, var(--mint), var(--lavender));
  box-shadow: 0 18px 40px rgba(79, 141, 247, 0.35);
  z-index: 20;
}

.ai-toggle svg {
  width: 25px;
  height: 25px;
}

.ai-panel {
  position: fixed;
  right: 24px;
  bottom: 94px;
  width: min(410px, calc(100vw - 36px));
  display: none;
  gap: 12px;
  padding: 16px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
  z-index: 21;
}

.ai-panel.open {
  display: grid;
}

.ai-head p,
.ai-result {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.ai-panel textarea {
  min-height: 130px;
}

dialog {
  width: min(760px, calc(100vw - 32px));
  border: 0;
  border-radius: 22px;
  padding: 18px;
  box-shadow: var(--shadow);
}

dialog::backdrop {
  background: rgba(25, 32, 42, 0.28);
  backdrop-filter: blur(5px);
}

.weekly-content {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.weekly-card {
  padding: 14px;
  border-radius: 16px;
  background: #fff4f8;
  border: 1px solid var(--line);
  line-height: 1.65;
}

.assessment-grid,
.english-drills,
.phonetic-list,
.word-check-list,
.sentence-check-list {
  display: grid;
  gap: 10px;
}

.english-check-hidden {
  display: none !important;
}

.english-ready .english-diagnostic-form-panel + .panel {
  grid-column: 1 / -1;
}

.assessment-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 150px;
  gap: 10px;
  align-items: center;
  padding: 12px;
  border-radius: 16px;
  background: #fff6fa;
  border: 1px solid rgba(255, 170, 210, 0.24);
}

.assessment-row strong {
  display: block;
  font-size: 14px;
}

.assessment-row span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-top: 3px;
  line-height: 1.45;
}

.english-score {
  font-size: 18px;
  font-weight: 900;
}

.english-card,
.phonetic-card,
.word-inspector {
  padding: 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid var(--line);
  box-shadow: 0 8px 22px rgba(31, 42, 68, 0.06);
}

.english-line {
  font-size: 18px;
  font-weight: 850;
  line-height: 1.45;
}

.ipa {
  color: #315c95;
  font-size: 13px;
  margin-top: 5px;
}

.word-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 10px 0;
}

.word-chip {
  border: 0;
  border-radius: 999px;
  padding: 6px 10px;
  color: #6d2650;
  background: rgba(255, 140, 198, 0.14);
  font-weight: 800;
}

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

.word-check-card,
.sentence-check-card {
  padding: 12px;
  border-radius: 16px;
  background: #fff6fa;
  border: 1px solid rgba(255, 170, 210, 0.24);
}

.student-list,
.table-preview {
  display: grid;
  gap: 10px;
}

.student-card,
.share-card,
.salary-card {
  padding: 12px;
  border-radius: 16px;
  background: #fff6fa;
  border: 1px solid rgba(255, 170, 210, 0.24);
}

.student-card.active {
  outline: 2px solid rgba(255, 145, 184, 0.8);
}

.student-card strong,
.salary-card strong {
  display: block;
  font-size: 15px;
}

.student-card p,
.salary-card p,
.share-card p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.student-meta,
.salary-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

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

.class-summary-list,
.salary-list {
  display: grid;
  gap: 10px;
  margin-top: 10px;
}

.salary-table-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  border-radius: 16px;
  border: 1px solid rgba(255, 170, 210, 0.28);
  background: rgba(255, 255, 255, 0.86);
  box-shadow: var(--soft-shadow);
}

.salary-table-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.salary-table-head strong {
  display: block;
  font-size: 16px;
}

.salary-table-head p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.salary-total-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.lesson-hours-pill,
.income-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.lesson-hours-pill {
  color: #23568f;
  background: rgba(121, 184, 255, 0.18);
  border: 1px solid rgba(121, 184, 255, 0.3);
}

.income-pill {
  color: #9b2a62;
  background: rgba(255, 145, 184, 0.2);
  border: 1px solid rgba(255, 145, 184, 0.34);
}

.salary-table-wrap {
  overflow-x: auto;
  border-radius: 14px;
  border: 1px solid var(--line);
}

.salary-table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
  background: rgba(255, 255, 255, 0.96);
}

.salary-table th,
.salary-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  font-size: 13px;
  vertical-align: top;
}

.salary-table th {
  color: #7d2a58;
  background: rgba(255, 246, 250, 0.98);
  font-weight: 900;
}

.salary-table tr:last-child td {
  border-bottom: 0;
}

.summary-stack {
  display: grid;
  gap: 10px;
}

.summary-box {
  padding: 12px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(255, 170, 210, 0.24);
}

.summary-box.soft {
  background: rgba(121, 184, 255, 0.1);
  border-color: rgba(121, 184, 255, 0.22);
}

.summary-box.lesson,
.lesson-block-main {
  background: rgba(255, 209, 102, 0.13);
  border-color: rgba(255, 209, 102, 0.28);
}

.summary-box-head,
.lesson-card-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
}

.summary-box-head span {
  color: #9b2a62;
  font-size: 12px;
  font-weight: 800;
}

.lesson-card {
  display: grid;
  gap: 10px;
}

.lesson-card.pending {
  border-color: rgba(255, 209, 102, 0.45);
}

.lesson-meta {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.lesson-block {
  padding: 12px;
  border-radius: 16px;
  border: 1px solid rgba(255, 170, 210, 0.22);
  background: rgba(255, 246, 250, 0.88);
}

.lesson-block span {
  display: block;
  margin-bottom: 4px;
  color: #9b2a62;
  font-size: 12px;
  font-weight: 850;
}

.lesson-summary-text {
  white-space: pre-wrap;
  line-height: 1.7;
}

.lesson-block-bottom {
  background: rgba(255, 255, 255, 0.82);
}

.lesson-transcript {
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(121, 184, 255, 0.08);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.lesson-transcript summary {
  cursor: pointer;
  color: #315c95;
  font-weight: 800;
}

.sheet-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.sheet-table th,
.sheet-table td {
  border-bottom: 1px solid var(--line);
  padding: 6px 8px;
  text-align: left;
  vertical-align: top;
}

.word-check-head,
.sentence-check-head,
.accent-control {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.word-check-head strong,
.sentence-check-head strong {
  font-size: 16px;
}

.check-state {
  display: inline-flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.check-btn,
.accent-btn {
  min-height: 32px;
  border: 1px solid rgba(255, 140, 198, 0.24);
  border-radius: 999px;
  padding: 0 10px;
  background: rgba(255, 255, 255, 0.72);
  color: #6d2650;
  font-weight: 800;
}

.check-btn.active,
.accent-btn.active {
  color: white;
  background: linear-gradient(135deg, #ffc2dd, #ff91b8);
  border-color: transparent;
}

.accent-control {
  padding: 12px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid var(--line);
}

.accent-control span {
  color: var(--muted);
  font-size: 12px;
}

.recording-bar,
.conversation-box {
  padding: 12px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid var(--line);
  margin-bottom: 10px;
}

.recording-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.recording-bar span {
  color: #7d2a58;
  font-weight: 850;
}

.conversation-box strong {
  display: block;
  font-size: 16px;
  margin-bottom: 6px;
}

.record-audio {
  width: 100%;
  margin-top: 8px;
}

.phonetic-symbol {
  display: inline-grid;
  place-items: center;
  min-width: 52px;
  min-height: 42px;
  padding: 0 10px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(255, 194, 221, 0.45), rgba(121, 184, 255, 0.22));
  font-size: 24px;
  font-weight: 900;
  color: #6d2650;
  margin-right: 10px;
}

@media (max-width: 980px) {
  .app-shell {
    grid-template-columns: 176px minmax(0, 1fr);
  }

  .sidebar {
    width: 176px;
    min-height: 100vh;
    position: sticky;
    top: 0;
    border-right: 1px solid rgba(228, 233, 241, 0.76);
    border-bottom: 0;
    padding: 12px 8px;
    overflow-y: auto;
    z-index: 10;
  }

  .nav-list {
    grid-template-columns: 1fr;
  }

  .sidebar-actions {
    grid-template-columns: 1fr;
  }

  .section-grid.two {
    grid-template-columns: 1fr;
  }

  body.sidebar-collapsed .app-shell {
    grid-template-columns: 86px minmax(0, 1fr);
  }

  body.sidebar-collapsed .sidebar {
    width: 86px;
  }

  body.sidebar-collapsed .brand {
    justify-content: center;
    padding: 4px 0 10px;
  }

  body.sidebar-collapsed .brand > div:not(.brand-mark),
  body.sidebar-collapsed .sidebar-actions,
  body.sidebar-collapsed .sidebar-toggle span {
    display: none;
  }

  body.sidebar-collapsed .nav-item {
    min-height: 56px;
    justify-content: center;
    flex-direction: column;
    gap: 4px;
    padding: 6px 4px;
    text-align: center;
  }

  body.sidebar-collapsed .nav-item span {
    max-width: 72px;
    font-size: 11px;
    line-height: 1.15;
  }

  body.sidebar-collapsed .sidebar-toggle {
    justify-content: center;
    padding: 0;
  }
}

@media (max-width: 640px) {
  .main {
    padding: 10px 10px 86px;
  }

  .topbar {
    min-height: auto;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px 10px;
    margin-bottom: 12px;
  }

  .topbar h2 {
    font-size: 20px;
  }

  .topbar .eyebrow {
    font-size: 11px;
  }

  .topbar-stat {
    width: auto;
    min-width: 84px;
    padding: 7px 9px;
  }

  .topbar-stat span {
    display: none;
  }

  .cloud-sync {
    grid-column: 1 / -1;
    width: 100%;
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 6px;
    padding: 8px;
  }

  .desktop-sync {
    display: none;
  }

  .form-row,
  .form-grid,
  .transcribe-key-row,
  .link-grid,
  .sport-picker,
  .task-edit-card {
    grid-template-columns: 1fr;
  }

  .nav-list,
  .sidebar-actions {
    grid-template-columns: 1fr;
  }

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

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

  .rank-card {
    grid-template-columns: 42px minmax(0, 1fr);
  }

  .rank-actions {
    grid-column: 1 / -1;
    justify-content: flex-end;
  }
}
