:root {
  color-scheme: light;
  --ink: #172033;
  --muted: #677085;
  --soft: #eef3f8;
  --line: #d9e2ec;
  --card: #ffffff;
  --page: #f7f9fc;
  --primary: #1b6b68;
  --primary-dark: #12514f;
  --primary-soft: #dff4f1;
  --accent: #d56a3f;
  --accent-soft: #fff0e8;
  --good: #1f8a5b;
  --warn: #a65f00;
  --bad: #be3b3b;
  --shadow: 0 18px 45px rgba(23, 32, 51, 0.10);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  min-height: 100vh;
  margin: 0;
  background: var(--page);
  color: var(--ink);
}

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

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

:focus-visible {
  outline: 3px solid rgba(27, 107, 104, 0.35);
  outline-offset: 3px;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 22px 0;
}

.app-header {
  width: 100%;
  padding: 16px clamp(16px, 5vw, 48px);
  background: rgba(255, 255, 255, 0.86);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(14px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
}

.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: var(--primary);
  color: #fff;
  font-weight: 900;
}

.nav {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.nav a {
  color: var(--muted);
  font-weight: 700;
  padding: 8px 10px;
  border-radius: 8px;
}

.nav a.active,
.nav a:hover {
  color: var(--primary);
  background: var(--primary-soft);
}

.button {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 9px 15px;
  font-weight: 800;
  line-height: 1;
  transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

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

.button-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 10px 24px rgba(27, 107, 104, 0.22);
}

.button-primary:hover {
  background: var(--primary-dark);
}

.button-secondary {
  background: #fff;
  border-color: var(--line);
  color: var(--ink);
}

.button-danger {
  background: var(--bad);
  color: #fff;
  box-shadow: 0 10px 24px rgba(190, 59, 59, 0.2);
}

.button-danger:hover {
  background: #9f2f2f;
}

.button-google {
  width: 100%;
  background: #fff;
  border-color: var(--line);
  color: var(--ink);
  box-shadow: 0 8px 22px rgba(23, 32, 51, 0.08);
}

.button-google:hover {
  border-color: #c3ccd8;
  background: #fbfcfe;
}

.google-mark {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: #4285f4;
  font-weight: 900;
}

.button-ghost {
  background: #fff;
  color: var(--primary);
  border-color: var(--line);
}

.button-large {
  min-height: 48px;
  padding-inline: 20px;
}

.landing {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
}

.landing-hero {
  min-height: calc(100vh - 88px);
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.8fr);
  align-items: center;
  gap: clamp(28px, 6vw, 72px);
  padding-bottom: 44px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--primary);
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0;
  font-size: 0.78rem;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  font-size: clamp(2.2rem, 6vw, 5rem);
  line-height: 0.96;
  margin-bottom: 20px;
}

h2 {
  font-size: 1.12rem;
}

.hero-text {
  max-width: 620px;
  color: var(--muted);
  font-size: 1.18rem;
  line-height: 1.65;
}

.hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 28px;
}

.hero-panel,
.auth-card,
.stat-card,
.insight-card,
.paper-card,
.loading-card,
.empty-state {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.hero-panel {
  padding: clamp(22px, 4vw, 36px);
}

.panel-topline,
.paper-card-header,
.paper-actions,
.history-row,
.summary-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 5px 10px;
  font-weight: 800;
  font-size: 0.8rem;
  background: var(--soft);
  color: var(--muted);
}

.badge-good {
  background: #e2f7eb;
  color: var(--good);
}

.badge-warn {
  background: #fff5df;
  color: var(--warn);
}

.hero-score {
  font-size: 5rem;
  line-height: 1;
  font-weight: 900;
  margin: 28px 0 16px;
}

.progress-bar {
  height: 12px;
  background: var(--soft);
  border-radius: 999px;
  overflow: hidden;
}

.progress-bar span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--accent));
}

.hero-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-top: 24px;
}

.hero-grid div {
  padding: 14px;
  border-radius: 8px;
  background: var(--soft);
}

.hero-grid strong {
  display: block;
  font-size: 1.35rem;
}

.hero-grid span {
  color: var(--muted);
  font-size: 0.86rem;
}

.auth-page {
  display: grid;
  place-items: center;
  padding: 24px;
}

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

.auth-brand {
  margin-bottom: 20px;
}

.auth-card {
  padding: 28px;
}

.auth-card h1 {
  font-size: 2rem;
  line-height: 1.1;
  margin-bottom: 10px;
}

.auth-card p {
  color: var(--muted);
}

.stacked-form {
  display: grid;
  gap: 10px;
  margin-top: 22px;
}

label {
  font-weight: 800;
  color: var(--ink);
  font-size: 0.92rem;
}

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

input:focus,
select:focus {
  border-color: var(--primary);
}

.form-message {
  min-height: 22px;
  margin: 4px 0;
  color: var(--bad);
  font-weight: 700;
}

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

.auth-divider {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  margin: 18px 0;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
}

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

.auth-links {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 18px;
  flex-wrap: wrap;
}

.auth-links a,
.link-button {
  color: var(--primary);
  font-weight: 800;
}

.link-button {
  border: 0;
  background: transparent;
  padding: 0;
}

.app-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 34px 0 64px;
}

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

.import-button {
  white-space: nowrap;
}

.page-heading h1 {
  font-size: clamp(2rem, 5vw, 3.5rem);
  margin-bottom: 0;
}

.whatsapp-community-banner {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: clamp(14px, 3vw, 26px);
  overflow: hidden;
  margin: 0 0 24px;
  padding: clamp(20px, 4vw, 30px);
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 8px;
  background: linear-gradient(120deg, #075e54 0%, #128c7e 52%, #25d366 125%);
  color: #fff;
  box-shadow: 0 16px 38px rgba(7, 94, 84, 0.25);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  animation: whatsapp-community-glow 3.6s ease-in-out infinite;
}

.whatsapp-community-banner::after {
  content: "";
  position: absolute;
  z-index: -1;
  top: -80%;
  left: -35%;
  width: 26%;
  height: 260%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.22), transparent);
  transform: rotate(18deg);
  animation: whatsapp-community-shine 5s ease-in-out infinite;
}

.whatsapp-community-banner:hover {
  transform: translateY(-2px);
  box-shadow: 0 20px 44px rgba(7, 94, 84, 0.32);
}

.whatsapp-community-icon {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.16);
  font-size: 1.75rem;
}

.whatsapp-community-copy {
  display: grid;
  gap: 7px;
}

.whatsapp-community-copy strong {
  font-size: clamp(1.15rem, 2.4vw, 1.65rem);
  line-height: 1.15;
}

.whatsapp-community-copy > span {
  color: rgba(255, 255, 255, 0.9);
  font-size: clamp(0.92rem, 1.6vw, 1.05rem);
  line-height: 1.45;
}

.whatsapp-community-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 12px 18px;
  border-radius: 8px;
  background: #fff;
  color: #075e54;
  box-shadow: 0 8px 20px rgba(7, 42, 38, 0.18);
  font-size: 0.9rem;
  font-weight: 900;
  white-space: nowrap;
}

.whatsapp-community-button span {
  font-size: 1.2rem;
  transition: transform 0.2s ease;
}

.whatsapp-community-banner:hover .whatsapp-community-button span {
  transform: translateX(3px);
}

@keyframes whatsapp-community-glow {
  0%,
  100% {
    box-shadow: 0 16px 38px rgba(7, 94, 84, 0.22);
  }

  50% {
    box-shadow: 0 18px 44px rgba(37, 211, 102, 0.32);
  }
}

@keyframes whatsapp-community-shine {
  0%,
  62% {
    left: -35%;
  }

  82%,
  100% {
    left: 125%;
  }
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(150px, 1fr));
  gap: 14px;
}

.stat-card,
.insight-card,
.paper-card,
.loading-card,
.empty-state {
  padding: 18px;
}

.stat-card span,
.insight-card span {
  display: block;
  color: var(--muted);
  font-weight: 800;
  font-size: 0.86rem;
}

.stat-card strong {
  display: block;
  margin-top: 10px;
  font-size: 2rem;
}

.insight-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-top: 14px;
}

.subject-selection {
  display: grid;
  gap: 16px;
}

.subject-selection h2 {
  margin: 0;
  font-size: 1.35rem;
}

.subject-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}

.subject-card {
  display: grid;
  gap: 10px;
  min-height: 220px;
  padding: 18px;
  text-align: left;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  color: var(--ink);
}

.subject-card:hover {
  border-color: #aaccc7;
  transform: translateY(-2px);
}

.subject-card-main {
  display: grid;
  gap: 10px;
  width: 100%;
  border: 0;
  background: transparent;
  color: inherit;
  padding: 0;
  text-align: left;
}

.subject-card strong {
  font-size: 1.7rem;
}

.subject-card span {
  color: var(--muted);
  font-weight: 800;
}

.subject-card b {
  font-size: 1.25rem;
}

.subject-delete-button {
  justify-self: start;
  border: 0;
  background: transparent;
  color: var(--bad);
  font-weight: 900;
  padding: 6px 0 0;
}

.subject-delete-button:hover {
  text-decoration: underline;
}

.selector-steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 18px;
}

.selector-steps span {
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 900;
  padding: 8px;
  text-align: center;
}

.selector-steps span.active,
.selector-steps span.done {
  background: var(--primary-soft);
  border-color: #b8deda;
  color: var(--primary);
}

.subject-selector-body {
  display: grid;
  gap: 14px;
}

.subject-selector-body h3 {
  margin-bottom: 0;
}

.selector-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 10px;
}

.selector-option {
  min-height: 74px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--page);
  color: var(--ink);
  padding: 14px;
  text-align: left;
}

.selector-option:hover {
  border-color: #aaccc7;
  background: #fff;
}

.selector-confirm {
  display: grid;
  gap: 6px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--page);
}

.selector-confirm strong {
  font-size: 1.45rem;
}

.subject-toolbar {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 18px;
}

.subject-toolbar h2 {
  margin: 0;
  font-size: clamp(1.5rem, 4vw, 2.3rem);
}

.insight-card strong {
  display: block;
  margin-top: 8px;
  font-size: 1.15rem;
}

.filter-panel {
  display: grid;
  grid-template-columns: 1.2fr repeat(5, 1fr);
  gap: 10px;
  align-items: end;
  padding: 16px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-bottom: 16px;
}

.import-panel {
  display: grid;
  gap: 14px;
  padding: 16px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-bottom: 16px;
}

.import-panel h2 {
  margin-bottom: 6px;
}

.import-panel p,
.muted-text {
  color: var(--muted);
  margin-bottom: 0;
}

.imported-catalogues {
  display: grid;
  gap: 10px;
}

.imported-catalogue {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--page);
}

.imported-catalogue strong,
.imported-catalogue span {
  display: block;
}

.imported-catalogue span {
  color: var(--muted);
  font-size: 0.88rem;
  margin-top: 3px;
}

.import-result {
  padding: 12px;
  border: 1px solid #f2c5c5;
  border-radius: 8px;
  background: #fff3f3;
  color: var(--bad);
  font-weight: 700;
}

.import-result.success {
  border-color: #bce7cd;
  background: #effaf3;
  color: var(--good);
}

.import-result ul {
  margin: 8px 0 0;
  padding-left: 20px;
}

.import-result dl {
  display: grid;
  grid-template-columns: repeat(4, minmax(90px, 1fr));
  gap: 10px;
  margin: 12px 0 0;
}

.import-result dt {
  color: var(--muted);
  font-size: 0.78rem;
}

.import-result dd {
  margin: 3px 0 0;
  color: var(--ink);
}

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

.filter-panel label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

.summary-strip {
  padding: 14px 16px;
  background: var(--primary-soft);
  border: 1px solid #b8dfd9;
  border-radius: 8px;
  margin-bottom: 16px;
  color: var(--primary-dark);
  font-weight: 800;
}

.paper-list {
  display: grid;
  gap: 14px;
}

.paper-checklist {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

.tracker-breadcrumbs {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-weight: 800;
}

.tracker-breadcrumbs button {
  border: 0;
  background: transparent;
  color: var(--primary);
  font-weight: 900;
  padding: 4px 0;
}

.tracker-breadcrumbs button:hover {
  text-decoration: underline;
}

.tracker-breadcrumbs b {
  color: #9aa6b7;
}

.tracker-step {
  display: grid;
  gap: 16px;
  padding: 18px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.tracker-step h3 {
  margin: 0;
  font-size: clamp(1.35rem, 3vw, 2rem);
}

.tracker-choice-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
}

.tracker-choice {
  min-height: 86px;
  display: grid;
  align-content: center;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--page);
  color: var(--ink);
  padding: 16px;
  text-align: left;
}

.tracker-choice:hover {
  background: #fff;
  border-color: #aaccc7;
  transform: translateY(-1px);
}

.tracker-choice strong {
  font-size: 1.25rem;
}

.tracker-choice span {
  color: var(--muted);
  font-weight: 800;
}

.tracker-paper-list {
  display: grid;
  gap: 10px;
}

.checklist-paper {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto auto;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--page);
}

.checklist-paper-main {
  display: flex;
  align-items: center;
  gap: 12px;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  padding: 0;
}

.checkmark {
  font-size: 1.35rem;
  color: var(--primary);
}

.checklist-paper-main strong,
.checklist-paper-main em,
.checklist-paper-main small,
.checklist-score strong,
.checklist-score span {
  display: block;
}

.checklist-paper-main em {
  color: var(--muted);
  font-style: normal;
  font-size: 0.9rem;
  margin-top: 3px;
}

.checklist-paper-main small {
  color: var(--primary);
  font-size: 0.82rem;
  font-weight: 900;
  margin-top: 5px;
}

.checklist-score {
  text-align: right;
}

.checklist-score span {
  color: var(--muted);
  font-size: 0.86rem;
  margin-top: 3px;
}

.paper-card {
  display: grid;
  gap: 16px;
}

.notes-shell {
  width: min(1280px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 64px;
}

.notes-header {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 18px;
  align-items: start;
  margin-bottom: 18px;
}

.notes-header h1 {
  font-size: clamp(2rem, 5vw, 3.8rem);
  margin-bottom: 10px;
}

.notes-paper-meta {
  color: var(--muted);
  font-weight: 900;
  margin-bottom: 8px;
}

.notes-toolbar {
  position: sticky;
  top: 73px;
  z-index: 8;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 12px;
  margin-bottom: 16px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 10px 28px rgba(23, 32, 51, 0.08);
  backdrop-filter: blur(12px);
}

.notes-toolbar.hidden {
  display: none;
}

.notes-toolbar label,
.save-status {
  color: var(--muted);
  font-weight: 900;
  font-size: 0.9rem;
}

.save-status {
  margin-left: auto;
  color: var(--good);
}

.save-status.error {
  color: var(--bad);
}

.tool-button {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 7px 10px;
  font-weight: 900;
}

.tool-button.active {
  background: var(--primary-soft);
  border-color: #b8deda;
  color: var(--primary);
}

.notes-quick-card {
  display: grid;
  gap: 10px;
  padding: 16px;
  margin-bottom: 16px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 10px 28px rgba(23, 32, 51, 0.08);
}

.notes-quick-card label {
  color: var(--primary);
  font-size: 0.88rem;
  text-transform: uppercase;
}

.notes-quick-card textarea {
  width: 100%;
  min-height: 150px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
  color: var(--ink);
  padding: 14px;
  line-height: 1.5;
}

.notes-quick-card .save-status {
  margin-left: 0;
}

.notes-board {
  position: relative;
  min-height: 68vh;
  overflow: auto;
  background:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px),
    #fbfcfe;
  background-size: 32px 32px;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.55);
}

.notes-board.notes-list-mode {
  min-height: 240px;
  display: grid;
  align-content: start;
  gap: 14px;
  padding: 16px;
  overflow: visible;
  background: #fbfcfe;
}

.notes-board-empty {
  min-height: 68vh;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 12px;
  padding: 28px;
  text-align: center;
  color: var(--muted);
}

.notes-board-empty h2 {
  margin: 0;
  color: var(--ink);
  font-size: 1.55rem;
}

.notes-board-empty p {
  max-width: 420px;
  margin: 0;
}

.sticky-note {
  position: relative;
  min-width: 240px;
  min-height: 190px;
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid rgba(23, 32, 51, 0.12);
  border-radius: 8px;
  box-shadow: 0 16px 34px rgba(23, 32, 51, 0.16);
}

.notes-list-mode .sticky-note {
  width: 100%;
  min-height: 190px;
}

.sticky-note-text {
  grid-template-rows: auto minmax(120px, 1fr);
}

.sticky-note-drawing {
  grid-template-rows: auto minmax(170px, 1fr);
}

.sticky-note-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.sticky-note select {
  max-width: 128px;
  border: 1px solid rgba(23, 32, 51, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.62);
  padding: 6px;
  font-weight: 900;
}

.sticky-note-actions {
  display: flex;
  gap: 6px;
}

.sticky-note-actions button {
  border: 1px solid rgba(23, 32, 51, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.62);
  padding: 6px 8px;
  font-size: 0.78rem;
  font-weight: 900;
}

.sticky-note textarea {
  width: 100%;
  min-width: 0;
  height: 100%;
  min-height: 120px;
  resize: none;
  border: 1px solid rgba(23, 32, 51, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.5);
  color: var(--ink);
  padding: 10px;
  line-height: 1.35;
}

.sticky-note canvas {
  width: 100%;
  height: 100%;
  min-height: 96px;
  border: 1px dashed rgba(23, 32, 51, 0.22);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.42);
  touch-action: none;
}

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

.note-type-choice {
  min-height: 120px;
  display: grid;
  align-content: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--page);
  color: var(--ink);
  padding: 16px;
  text-align: left;
}

.note-type-choice:hover {
  background: #fff;
  border-color: #aaccc7;
}

.note-type-choice strong,
.note-type-choice span {
  display: block;
}

.note-type-choice strong {
  font-size: 1.2rem;
}

.note-type-choice span {
  color: var(--muted);
  font-weight: 700;
  line-height: 1.4;
}

.note-resize-handle {
  position: absolute;
  right: 7px;
  bottom: 7px;
  width: 18px;
  height: 18px;
  border-right: 3px solid rgba(23, 32, 51, 0.34);
  border-bottom: 3px solid rgba(23, 32, 51, 0.34);
  cursor: nwse-resize;
}

.paper-title {
  display: grid;
  gap: 5px;
}

.paper-title h2 {
  margin: 0;
}

.paper-title p {
  margin: 0;
  color: var(--muted);
}

.paper-meta {
  display: grid;
  grid-template-columns: repeat(6, minmax(100px, 1fr));
  gap: 10px;
}

.paper-meta div {
  background: var(--soft);
  border-radius: 8px;
  padding: 10px;
}

.paper-meta span {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.paper-meta strong {
  display: block;
  margin-top: 4px;
}

.file-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.file-links a,
.file-links span {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 10px;
  color: var(--muted);
  font-weight: 800;
  font-size: 0.82rem;
}

.file-links a {
  color: var(--primary);
  background: var(--primary-soft);
}

.loading-card,
.empty-state {
  color: var(--muted);
  text-align: center;
}

.empty-state {
  padding: 34px;
}

.empty-state h2 {
  color: var(--ink);
}

.hidden {
  display: none !important;
}

.modal {
  border: 0;
  background: transparent;
  padding: 18px;
  width: min(460px, 100%);
}

.modal[open] {
  display: block;
  position: fixed;
  inset: 0;
  margin: auto;
  max-height: min(90vh, 620px);
}

.modal-wide {
  width: min(620px, 100%);
}

.modal::backdrop {
  background: rgba(23, 32, 51, 0.52);
  backdrop-filter: blur(4px);
}

.modal-card {
  position: relative;
  background: #fff;
  border-radius: 8px;
  padding: 24px;
  box-shadow: var(--shadow);
}

.modal-card h2 {
  font-size: 1.6rem;
  margin-bottom: 18px;
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  font-size: 1.3rem;
}

.score-entry {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 12px;
}

.score-entry span {
  font-size: 1.6rem;
  font-weight: 900;
}

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

.modal-actions-stacked {
  flex-wrap: wrap;
}

.warning-text {
  color: var(--bad);
  font-weight: 800;
}

.history-list {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.history-row {
  padding: 12px;
  background: var(--soft);
  border-radius: 8px;
}

.history-row strong {
  display: block;
}

.history-row span {
  color: var(--muted);
  font-size: 0.86rem;
}

.toast-region {
  position: fixed;
  right: 18px;
  bottom: 18px;
  display: grid;
  gap: 10px;
  z-index: 30;
}

.toast {
  max-width: 340px;
  padding: 13px 15px;
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
  box-shadow: var(--shadow);
  font-weight: 800;
}

.toast.error {
  background: var(--bad);
}

@media (max-width: 900px) {
  .landing-hero,
  .insight-grid {
    grid-template-columns: 1fr;
  }

  .landing-hero {
    padding-top: 36px;
  }

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

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

@media (max-width: 620px) {
  .site-header,
  .app-header,
  .page-heading,
  .subject-toolbar,
  .notes-header,
  .paper-card-header,
  .paper-actions,
  .summary-strip,
  .imported-catalogue {
    align-items: stretch;
    flex-direction: column;
  }

  .nav,
  .hero-actions,
  .modal-actions {
    width: 100%;
  }

  .nav .button,
  .hero-actions .button,
  .modal-actions .button {
    flex: 1;
  }

  h1 {
    font-size: 2.35rem;
  }

  .hero-score {
    font-size: 3.4rem;
  }

  .hero-grid,
  .stats-grid,
  .filter-panel,
  .paper-meta,
  .import-result dl {
    grid-template-columns: 1fr;
  }

  .checklist-paper {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .checklist-score {
    text-align: left;
  }

  .notes-toolbar {
    top: 96px;
  }

  .note-type-grid {
    grid-template-columns: 1fr;
  }

  .whatsapp-community-banner {
    grid-template-columns: auto minmax(0, 1fr);
    padding: 18px;
  }

  .whatsapp-community-icon {
    width: 48px;
    height: 48px;
    font-size: 1.45rem;
  }

  .whatsapp-community-button {
    grid-column: 1 / -1;
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .whatsapp-community-banner,
  .whatsapp-community-banner::after,
  .whatsapp-community-button span {
    animation: none;
    transition: none;
  }
}
