:root {
  color-scheme: light;
  --navy: #12355b;
  --navy-deep: #0b2545;
  --blue: #1f78d1;
  --blue-dark: #155da4;
  --teal: #18a999;
  --green: #17875d;
  --red: #c33c54;
  --amber: #d88000;
  --ink: #172033;
  --muted: #627087;
  --line: #d9e1eb;
  --surface: #ffffff;
  --surface-soft: #f3f6fa;
  --workspace: #e4e9ef;
  --shadow: 0 16px 40px rgba(12, 37, 69, 0.13);
  --radius: 18px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--surface-soft);
  -webkit-text-size-adjust: 100%;
}

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

body.is-busy {
  cursor: progress;
}

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

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  touch-action: manipulation;
}

a {
  color: var(--blue-dark);
}

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

.skip-link {
  position: fixed;
  z-index: 9999;
  top: 8px;
  left: 8px;
  padding: 10px 14px;
  color: #fff;
  background: var(--navy-deep);
  border-radius: 8px;
  transform: translateY(-150%);
}

.skip-link:focus {
  transform: translateY(0);
}

.app-header {
  min-height: 72px;
  padding: calc(10px + var(--safe-top)) clamp(16px, 3vw, 36px) 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  color: #fff;
  background: var(--navy-deep);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: clamp(0.96rem, 2vw, 1.15rem);
}

.brand small {
  margin-top: 2px;
  color: #bcd2e8;
  font-size: 0.76rem;
}

.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  flex: 0 0 42px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-radius: 13px;
  color: #fff;
  background: var(--blue);
  font-size: 0.82rem;
  font-weight: 900;
  letter-spacing: -0.03em;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.teacher-name {
  max-width: 210px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #dbeaf8;
}

.button {
  min-height: 48px;
  padding: 12px 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border: 1px solid transparent;
  border-radius: 13px;
  color: #fff;
  background: var(--blue);
  box-shadow: 0 4px 12px rgba(16, 83, 145, 0.2);
  font-weight: 800;
  line-height: 1.15;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}

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

.button:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 4px solid rgba(31, 120, 209, 0.28);
  outline-offset: 2px;
}

.button:disabled {
  opacity: 0.48;
  cursor: not-allowed;
}

.button-secondary {
  color: var(--navy-deep);
  background: #e6eef7;
  border-color: #c8d7e7;
  box-shadow: none;
}

.button-secondary:hover {
  background: #d7e4f1;
}

.button-danger {
  background: var(--red);
}

.button-danger:hover {
  background: #a52e44;
}

.button-quiet {
  color: inherit;
  background: transparent;
  border-color: rgba(255, 255, 255, 0.32);
  box-shadow: none;
}

.button-quiet:hover {
  background: rgba(255, 255, 255, 0.1);
}

.button-small {
  min-height: 40px;
  padding: 9px 14px;
  font-size: 0.86rem;
}

.button-icon {
  width: 52px;
  min-width: 52px;
  padding: 0;
}

.page-shell {
  width: min(1160px, calc(100% - 32px));
  margin: 0 auto;
  padding: clamp(24px, 5vw, 58px) 0 calc(40px + var(--safe-bottom));
}

.eyebrow {
  margin-bottom: 8px;
  color: var(--blue-dark);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

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

.card {
  padding: clamp(22px, 4vw, 34px);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

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

.field {
  display: grid;
  gap: 7px;
}

.field label,
.field-label {
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 800;
}

.field input,
.field select {
  width: 100%;
  min-height: 52px;
  padding: 12px 14px;
  border: 1px solid #bac7d7;
  border-radius: 12px;
  color: var(--ink);
  background: #fff;
}

.check-field {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
}

.check-field input {
  width: 22px;
  height: 22px;
}

.form-error {
  min-height: 22px;
  margin: 0;
  color: var(--red);
  font-size: 0.9rem;
  font-weight: 750;
}

.auth-page {
  display: grid;
  place-items: center;
  padding:
    calc(24px + var(--safe-top))
    18px
    calc(24px + var(--safe-bottom));
  background:
    radial-gradient(circle at 12% 18%, rgba(31, 120, 209, 0.2), transparent 28%),
    var(--surface-soft);
}

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

.auth-brand {
  margin-bottom: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: var(--navy-deep);
}

.auth-card h1 {
  margin-bottom: 8px;
  font-size: clamp(1.7rem, 5vw, 2.2rem);
}

.auth-card .button {
  width: 100%;
}

.auth-switch {
  margin: 20px 0 0;
  color: var(--muted);
  text-align: center;
}

.mode-grid {
  margin-top: 28px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
}

.mode-card {
  min-height: 300px;
  padding: clamp(26px, 4vw, 42px);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  border: 1px solid var(--line);
  border-radius: 24px;
  color: var(--ink);
  background: #fff;
  box-shadow: var(--shadow);
  text-decoration: none;
}

.mode-card:hover {
  border-color: #9db9d7;
  transform: translateY(-2px);
}

.mode-icon {
  width: 74px;
  height: 74px;
  margin-bottom: 24px;
  display: grid;
  place-items: center;
  border-radius: 22px;
  color: #fff;
  background: var(--blue);
  font-size: 2rem;
}

.mode-card h2 {
  margin-bottom: 10px;
  font-size: clamp(1.45rem, 3vw, 2rem);
}

.mode-card p {
  color: var(--muted);
  line-height: 1.55;
}

.mode-link {
  margin-top: auto;
  color: var(--blue-dark);
  font-weight: 900;
}

.phone-page {
  width: 100%;
  height: 100vh;
  height: 100dvh;
  min-height: 0;
  padding-bottom: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
  background: #eef3f8;
}

.phone-header {
  padding:
    calc(16px + var(--safe-top))
    18px
    16px;
  color: #fff;
  background: var(--navy-deep);
}

.phone-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.phone-header .brand-mark {
  width: 38px;
  height: 38px;
  flex-basis: 38px;
}

.phone-header h1 {
  margin: 0;
  font-size: 1.02rem;
}

.phone-main {
  width: min(560px, 100%);
  min-height: 0;
  margin: 0 auto;
  padding: 18px 16px 28px;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior-y: contain;
  -webkit-overflow-scrolling: touch;
}

.connection-card {
  padding: 17px 19px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 17px;
  box-shadow: 0 7px 22px rgba(12, 37, 69, 0.08);
}

.room-name {
  margin: 0 0 4px;
  font-size: clamp(1.15rem, 6vw, 1.5rem);
  font-weight: 900;
}

.connection-status {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 800;
}

.status-dot {
  width: 10px;
  height: 10px;
  flex: 0 0 10px;
  border-radius: 50%;
  background: #8b98a9;
}

.is-online .status-dot,
.status-dot.is-online {
  background: var(--teal);
  box-shadow: 0 0 0 4px rgba(24, 169, 153, 0.14);
}

.status-dot.is-warning {
  background: var(--amber);
}

.capture-zone {
  min-height: min(64vh, 560px);
  padding: 28px 6px 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.camera-button {
  width: min(76vw, 280px);
  aspect-ratio: 1;
  position: relative;
  display: grid;
  place-items: center;
  border: 10px solid #fff;
  border-radius: 50%;
  color: #fff;
  background: var(--blue);
  box-shadow:
    0 18px 42px rgba(21, 93, 164, 0.32),
    0 0 0 5px rgba(31, 120, 209, 0.14);
  cursor: pointer;
  touch-action: manipulation;
}

.camera-button:active {
  transform: scale(0.97);
}

.camera-button:disabled {
  filter: grayscale(0.55);
  opacity: 0.58;
}

.camera-glyph {
  width: 92px;
  height: 66px;
  position: relative;
  display: block;
  border: 7px solid currentColor;
  border-radius: 16px;
}

.camera-glyph::before {
  content: "";
  width: 30px;
  height: 30px;
  position: absolute;
  top: 11px;
  left: 24px;
  border: 6px solid currentColor;
  border-radius: 50%;
}

.camera-glyph::after {
  content: "";
  width: 36px;
  height: 15px;
  position: absolute;
  top: -18px;
  left: 20px;
  border-radius: 8px 8px 0 0;
  background: currentColor;
}

.camera-label {
  position: absolute;
  bottom: 38px;
  font-size: 1.05rem;
  font-weight: 950;
  letter-spacing: 0.04em;
}

.camera-button.is-scan {
  background: #128f7e;
  box-shadow:
    0 18px 42px rgba(18, 143, 126, 0.32),
    0 0 0 5px rgba(24, 169, 153, 0.16);
}

.scan-toggle {
  width: min(280px, 78vw);
  margin-top: 18px;
  padding: 12px 14px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 2px 12px;
  align-items: center;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 7px 22px rgba(12, 37, 69, 0.08);
}

.scan-toggle input {
  width: 22px;
  height: 22px;
  grid-row: span 2;
}

.scan-toggle span {
  font-size: 1rem;
  font-weight: 850;
}

.scan-toggle small {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.3;
}

.capture-input {
  width: 1px;
  height: 1px;
  position: fixed;
  left: -10000px;
  opacity: 0;
}

.upload-state {
  min-height: 48px;
  margin: 24px 0 0;
  color: var(--muted);
  font-weight: 850;
  text-align: center;
}

.progress-track {
  width: min(280px, 78vw);
  height: 7px;
  margin-top: 8px;
  overflow: hidden;
  border-radius: 99px;
  background: #d7e0ea;
}

.progress-bar {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--teal);
  transition: width 150ms ease;
}

.queue-notice {
  width: 100%;
  margin-top: 12px;
  padding: 11px 14px;
  display: none;
  color: #774800;
  background: #fff5d8;
  border: 1px solid #edd18a;
  border-radius: 12px;
  font-size: 0.87rem;
  font-weight: 760;
  text-align: center;
}

.queue-notice.is-visible {
  display: block;
}

.pairing-panel {
  margin-top: 22px;
}

.phone-remote {
  padding: 15px;
  display: grid;
  gap: 12px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 17px;
  box-shadow: 0 7px 22px rgba(12, 37, 69, 0.08);
}

.phone-slide-nav {
  display: grid;
  grid-template-columns: 50px minmax(0, 1fr) 50px 50px;
  align-items: end;
  gap: 9px;
}

.phone-slide-nav > button {
  min-width: 50px;
  min-height: 54px;
  padding: 5px;
  font-size: 1.7rem;
}

.phone-slide-nav .phone-new-slide {
  color: #fff;
  background: var(--blue);
  border-color: var(--blue);
  font-weight: 900;
}

.phone-slide-picker {
  min-width: 0;
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 850;
}

.phone-slide-picker select {
  width: 100%;
  min-height: 54px;
  padding: 8px 11px;
  color: var(--ink);
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 16px;
  font-weight: 850;
}

.phone-presentation-state {
  min-height: 22px;
  margin: 0;
  color: var(--blue-dark);
  font-size: 0.84rem;
  font-weight: 850;
  text-align: center;
}

.phone-remote-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
}

.phone-remote-actions .button {
  min-height: 50px;
}

.phone-remote-actions .is-active {
  color: #fff;
  background: var(--blue-dark);
}

.phone-save-photo {
  margin-top: 12px;
}

.phone-save-photo[hidden] {
  display: none;
}

.phone-library,
.phone-ai {
  margin-top: 14px;
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 17px;
  box-shadow: 0 7px 22px rgba(12, 37, 69, 0.08);
}

.phone-library > summary,
.phone-ai > summary {
  min-height: 62px;
  padding: 13px 44px 13px 16px;
  position: relative;
  display: grid;
  align-content: center;
  gap: 2px;
  color: var(--navy-deep);
  cursor: pointer;
  font-weight: 900;
  list-style: none;
}

.phone-library > summary::-webkit-details-marker,
.phone-ai > summary::-webkit-details-marker {
  display: none;
}

.phone-library > summary::after,
.phone-ai > summary::after {
  content: "+";
  position: absolute;
  top: 50%;
  right: 16px;
  color: var(--blue);
  font-size: 1.5rem;
  transform: translateY(-50%);
}

.phone-library[open] > summary::after,
.phone-ai[open] > summary::after {
  content: "−";
}

.phone-library > summary small,
.phone-ai > summary small {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
}

.phone-library-body {
  padding: 0 12px 14px;
}

.phone-ai-body {
  padding: 0 12px 14px;
}

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

.phone-library-grid .photo-library-card {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
}

.phone-library-grid .photo-library-card > img {
  width: 96px;
  height: 100%;
  min-height: 116px;
  grid-row: span 2;
  aspect-ratio: auto;
  object-fit: cover;
}

.phone-library-grid .photo-library-card-actions {
  padding-top: 4px;
}

.code-input {
  font-size: 1.5rem;
  font-weight: 900;
  letter-spacing: 0.2em;
  text-align: center;
}

.phone-nav {
  height: calc(70px + var(--safe-bottom));
  position: fixed;
  z-index: 20;
  right: 0;
  bottom: 0;
  left: 0;
  padding: 7px 12px var(--safe-bottom);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  background: rgba(255, 255, 255, 0.96);
  border-top: 1px solid var(--line);
  backdrop-filter: blur(14px);
  transform: translateZ(0);
}

.phone-page .phone-nav {
  width: 100%;
  position: relative;
  z-index: 20;
  right: auto;
  bottom: auto;
  left: auto;
  grid-row: 3;
  transform: none;
}

.phone-nav a,
.phone-nav button {
  min-height: 54px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  border: 0;
  border-radius: 12px;
  color: var(--muted);
  background: transparent;
  font-size: 0.72rem;
  font-weight: 850;
  text-decoration: none;
}

.phone-nav .is-active {
  color: var(--blue-dark);
  background: #e8f1fa;
}

.board-phone-nav {
  display: none;
}

.board-page {
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  background: var(--workspace);
  overscroll-behavior: none;
}

.board-page .app-header {
  height: 68px;
  min-height: 68px;
  padding-top: 9px;
  padding-bottom: 9px;
}

.board-layout {
  height: calc(100vh - 68px);
  height: calc(100dvh - 68px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.board-toolbar {
  min-height: 72px;
  padding: 9px clamp(10px, 2vw, 22px);
  display: flex;
  align-items: center;
  gap: 10px;
  overflow-x: auto;
  background: #fff;
  border-bottom: 1px solid #cfd8e3;
  box-shadow: 0 3px 12px rgba(11, 37, 69, 0.08);
}

.tool-group {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-right: 10px;
  border-right: 1px solid var(--line);
}

.tool-button {
  min-width: 58px;
  min-height: 52px;
  padding: 6px 12px;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  border: 1px solid transparent;
  border-radius: 11px;
  color: var(--ink);
  background: transparent;
  font-size: 0.72rem;
  font-weight: 850;
  text-decoration: none;
  cursor: pointer;
}

.tool-button:hover,
.tool-button:focus-visible {
  background: #edf3f8;
  border-color: #cbd9e7;
}

.tool-button.is-active {
  color: #fff;
  background: var(--blue);
  border-color: var(--blue-dark);
}

.pair-tool-button {
  color: var(--blue-dark);
  background: #e8f1fa;
  border-color: #b8d0e8;
}

.camera-mode-tool-button {
  color: #0f684e;
  background: #e5f5ee;
  border-color: #a9dbc9;
}

.tool-button:disabled {
  color: #9aa5b3;
  cursor: not-allowed;
}

.tool-icon {
  font-size: 1.35rem;
  line-height: 1;
}

.tool-danger {
  color: var(--red);
}

.board-status {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 800;
}

.tool-settings {
  position: relative;
  flex: 0 0 auto;
}

.tool-settings summary {
  min-height: 48px;
  padding: 10px 13px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface-soft);
  font-size: 0.76rem;
  font-weight: 850;
  cursor: pointer;
}

.tool-settings-panel {
  width: 290px;
  position: fixed;
  z-index: 32;
  top: 146px;
  padding: 16px;
  display: grid;
  gap: 12px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
}

.tool-settings-panel label {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 14px;
  font-size: 0.84rem;
  font-weight: 800;
}

.tool-settings-panel input[type="range"] {
  width: 140px;
}

.board-workbench {
  min-height: 0;
  display: grid;
  grid-template-columns: 238px minmax(0, 1fr);
}

.slide-rail {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  background: #f8fafc;
  border-right: 1px solid #cfd8e3;
}

.slide-rail-head {
  min-height: 64px;
  padding: 9px 10px 9px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 1px solid var(--line);
}

.slide-rail-head > div:first-child {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.slide-rail-head small {
  overflow: hidden;
  color: var(--muted);
  font-size: 0.67rem;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.slide-rail-actions .button-small {
  min-height: 36px;
  padding: 6px 10px;
  font-size: 0.75rem;
}

.slide-empty {
  margin: 12px 8px;
  font-size: 0.82rem;
}

.slide-list {
  min-height: 0;
  padding: 10px;
  display: grid;
  align-content: start;
  gap: 11px;
  overflow-y: auto;
}

.slide-item {
  padding: 5px;
  display: grid;
  gap: 5px;
  border: 2px solid transparent;
  border-radius: 11px;
  background: #fff;
  box-shadow: 0 2px 8px rgba(12, 37, 69, 0.08);
}

.slide-item.is-editing {
  border-color: var(--blue);
}

.slide-item.is-presented {
  box-shadow: 0 0 0 3px rgba(36, 150, 104, 0.38);
}

.slide-preview-button {
  min-width: 0;
  padding: 0;
  display: grid;
  gap: 5px;
  border: 0;
  color: var(--ink);
  background: transparent;
  cursor: pointer;
  text-align: left;
}

.slide-thumbnail {
  width: 100%;
  height: auto;
  display: block;
  background: #fff;
  border: 1px solid #d6dee7;
  border-radius: 6px;
}

.slide-label {
  overflow: hidden;
  font-size: 0.78rem;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.slide-badges {
  min-height: 14px;
  color: var(--green);
  font-size: 0.65rem;
  font-weight: 900;
  text-transform: uppercase;
}

.slide-actions {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 3px;
}

.slide-actions button {
  min-width: 32px;
  min-height: 32px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--ink);
  background: var(--surface-soft);
  cursor: pointer;
}

.slide-actions button:disabled {
  opacity: 0.35;
}

.workspace {
  min-height: 0;
  padding: clamp(10px, 1.5vw, 22px);
  display: grid;
  place-items: center;
  overflow: hidden;
  touch-action: none;
  background: var(--workspace);
}

.canvas-stage {
  width: 100%;
  max-width: 100%;
  max-height: 100%;
  position: relative;
  aspect-ratio: 16 / 9;
  background: #fff;
  box-shadow: 0 12px 35px rgba(12, 37, 69, 0.22);
}

.canvas-stage .canvas-container {
  width: 100% !important;
  height: 100% !important;
}

.canvas-stage canvas {
  width: 100% !important;
  height: 100% !important;
  touch-action: none;
}

.canvas-loading {
  position: absolute;
  z-index: 4;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--muted);
  background: #fff;
  font-weight: 850;
}

.canvas-loading[hidden] {
  display: none;
}

.blank-overlay {
  position: absolute;
  z-index: 10;
  inset: 0;
  pointer-events: none;
}

.blank-overlay[hidden] {
  display: none;
}

.text-format-panel {
  position: fixed;
  z-index: 28;
  right: 18px;
  bottom: 18px;
  left: max(256px, 18px);
  padding: 10px 14px;
  display: flex;
  align-items: end;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  background: rgba(255, 255, 255, 0.97);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
}

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

.text-format-panel label {
  display: grid;
  gap: 3px;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 850;
}

.text-format-panel input,
.text-format-panel select {
  min-height: 38px;
  padding: 5px 7px;
}

.text-format-panel input[type="checkbox"] {
  min-height: 22px;
}

.blank-choice-panel {
  padding: 5px;
  display: flex;
  align-items: center;
  gap: 5px;
  flex: 0 0 auto;
  color: var(--muted);
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 0.68rem;
}

.blank-choice-panel button {
  min-height: 32px;
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  font-weight: 800;
  cursor: pointer;
}

.blank-choice-panel input {
  width: 34px;
  height: 30px;
  padding: 2px;
}

.presentation-controls {
  display: none;
}

.presentation-mode .app-header,
.presentation-mode .board-toolbar,
.presentation-mode .slide-rail,
.presentation-mode .text-format-panel,
.presentation-mode .blank-choice-panel,
.presentation-mode .photo-library-drawer,
.presentation-mode .ai-generator-drawer,
.presentation-mode .slideshow-drawer {
  display: none !important;
}

.presentation-mode .board-layout {
  height: 100vh;
  height: 100dvh;
  grid-template-rows: minmax(0, 1fr);
}

.presentation-mode .board-workbench {
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
}

.presentation-mode .workspace {
  padding: 0;
  background: #10141b;
}

.presentation-mode .canvas-stage {
  box-shadow: none;
}

.presentation-mode .presentation-controls {
  display: block;
}

.presentation-controls button {
  width: 44px;
  height: 44px;
  position: fixed;
  z-index: 30;
  padding: 0;
  color: #fff;
  background: rgba(8, 22, 37, 0.76);
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 50%;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.24);
  font-size: 1.65rem;
  font-weight: 850;
  line-height: 1;
  cursor: pointer;
  opacity: 0.42;
  transition: opacity 150ms ease, background-color 150ms ease;
}

.presentation-controls button:hover,
.presentation-controls button:focus-visible,
.presentation-controls button:active {
  background: rgba(8, 22, 37, 0.94);
  opacity: 1;
}

.presentation-controls [data-present-prev] {
  top: 50%;
  left: 8px;
  left: max(8px, calc(var(--safe-left) + 4px));
  transform: translateY(-50%);
}

.presentation-controls [data-present-next] {
  top: 50%;
  right: 8px;
  right: max(8px, calc(var(--safe-right) + 4px));
  transform: translateY(-50%);
}

.presentation-controls [data-exit-presentation] {
  top: 8px;
  top: max(8px, calc(var(--safe-top) + 4px));
  right: 8px;
  right: max(8px, calc(var(--safe-right) + 4px));
  font-size: 1.35rem;
}

.presentation-tools {
  display: none;
}

.presentation-mode .presentation-tools {
  display: block;
}

.presentation-tools-toggle {
  width: 44px;
  height: 44px;
  position: fixed;
  z-index: 31;
  top: 8px;
  top: max(8px, calc(var(--safe-top) + 4px));
  left: 8px;
  left: max(8px, calc(var(--safe-left) + 4px));
  padding: 0;
  color: #fff;
  background: rgba(8, 22, 37, 0.76);
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 50%;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.24);
  font-size: 1.5rem;
  font-weight: 850;
  line-height: 1;
  cursor: pointer;
  opacity: 0.42;
  transition: opacity 150ms ease, background-color 150ms ease, transform 150ms ease;
}

.presentation-tools.is-open .presentation-tools-toggle,
.presentation-tools-toggle:hover,
.presentation-tools-toggle:focus-visible,
.presentation-tools-toggle:active {
  background: rgba(8, 22, 37, 0.94);
  opacity: 1;
}

.presentation-tools-menu {
  width: min(320px, calc(100vw - 24px));
  position: fixed;
  z-index: 31;
  top: 60px;
  top: max(60px, calc(var(--safe-top) + 56px));
  left: 8px;
  left: max(8px, calc(var(--safe-left) + 4px));
  padding: 12px;
  display: grid;
  gap: 10px;
  color: #fff;
  background: rgba(8, 22, 37, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 16px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.28);
}

.presentation-tools-menu[hidden] {
  display: none;
}

.presentation-tool-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.presentation-tool-row button {
  width: 44px;
  height: 44px;
  padding: 0;
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 12px;
  font-size: 1.15rem;
  cursor: pointer;
}

.presentation-tool-row button.is-active {
  background: var(--blue);
  border-color: #8ec2f3;
}

.presentation-tool-row button:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.presentation-tool-settings {
  display: grid;
  gap: 8px;
}

.presentation-tool-settings label {
  display: grid;
  grid-template-columns: 108px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  font-size: 0.72rem;
  font-weight: 800;
}

.presentation-tool-settings input[type="color"] {
  width: 42px;
  height: 32px;
  padding: 2px;
  border: 0;
  background: transparent;
}

.presentation-tool-settings input[type="range"] {
  width: 100%;
}

.presentation-clear-drawings {
  min-height: 44px;
  padding: 0 12px;
  color: #fff;
  background: rgba(195, 60, 84, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 12px;
  font-size: 0.82rem;
  font-weight: 850;
  cursor: pointer;
}

.board-setup {
  height: calc(100dvh - 72px);
  display: grid;
  place-items: center;
  padding: 24px;
}

.board-setup .card {
  width: min(540px, 100%);
}

.pairing-drawer,
.photo-library-drawer,
.ai-generator-drawer,
.slideshow-drawer {
  width: min(430px, calc(100vw - 30px));
  max-height: calc(100dvh - 30px);
  position: fixed;
  z-index: 50;
  top: 15px;
  right: 15px;
  padding: 26px;
  overflow: auto;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: 0 22px 70px rgba(4, 20, 39, 0.32);
}

.photo-library-drawer {
  width: min(620px, calc(100vw - 30px));
}

.pairing-drawer[hidden],
.photo-library-drawer[hidden],
.ai-generator-drawer[hidden],
.slideshow-drawer[hidden] {
  display: none;
}

.slideshow-drawer {
  width: min(520px, calc(100vw - 30px));
}

.ai-generator-drawer {
  width: min(560px, calc(100vw - 30px));
}

.slideshow-toolbar {
  margin: 16px 0 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.slideshow-list {
  display: grid;
  gap: 12px;
}

.slideshow-group-title {
  margin: 8px 0 0;
  font-size: 0.78rem;
  font-weight: 850;
  color: var(--muted);
}

.slideshow-folder {
  padding: 12px;
  display: grid;
  gap: 10px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 16px;
}

.slideshow-folder-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.slideshow-folder-actions {
  display: flex;
  gap: 6px;
}

.slideshow-card {
  padding: 12px;
  display: grid;
  gap: 10px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
}

.slideshow-card.is-open {
  border-color: var(--blue);
  box-shadow: 0 0 0 2px rgba(31, 120, 209, 0.16);
}

.slideshow-card small {
  display: block;
  color: var(--muted);
  font-weight: 700;
}

.slideshow-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.slideshow-empty {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: grid;
  place-content: center;
  gap: 12px;
  padding: 24px;
  text-align: center;
  background: rgba(255, 255, 255, 0.92);
}

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

.photos-button {
  width: min(280px, 78vw);
  margin-top: 16px;
}

.destination-dialog {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: end center;
  padding: 16px 16px calc(24px + var(--safe-bottom));
  background: rgba(8, 22, 37, 0.46);
}

.destination-dialog[hidden] {
  display: none;
}

.destination-dialog-card {
  width: min(440px, 100%);
  padding: 22px;
  display: grid;
  gap: 12px;
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 22px 70px rgba(4, 20, 39, 0.32);
}

.destination-list {
  display: grid;
  gap: 8px;
  max-height: 40vh;
  overflow: auto;
}

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

.qr-code {
  min-height: 230px;
  margin: 18px auto;
  display: grid;
  place-items: center;
}

.qr-code img,
.qr-code canvas {
  max-width: 230px;
  height: auto !important;
}

.pair-code {
  margin: 8px 0 4px;
  color: var(--navy-deep);
  font-size: clamp(2rem, 10vw, 3.2rem);
  font-weight: 950;
  letter-spacing: 0.18em;
  text-align: center;
}

.photo-library-toolbar {
  margin: 18px 0 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.photo-library-status {
  margin-bottom: 12px;
}

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

.photo-library-card {
  min-width: 0;
  overflow: hidden;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 14px;
}

.photo-library-card > img {
  width: 100%;
  aspect-ratio: 4 / 3;
  display: block;
  object-fit: contain;
  background: #dce4ed;
}

.photo-library-card-details {
  min-width: 0;
  padding: 10px 11px 4px;
  display: grid;
  gap: 2px;
}

.photo-library-card-details strong,
.photo-library-card-details small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.photo-library-card-details small {
  color: var(--muted);
}

.photo-library-card-actions {
  padding: 8px 10px 11px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 7px;
}

.photo-library-more {
  width: 100%;
  margin-top: 14px;
}

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

.ai-generator {
  display: grid;
  gap: 16px;
}

.ai-key-card {
  padding: 14px;
  display: grid;
  gap: 11px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 14px;
}

.ai-key-card p {
  margin: 3px 0 0;
}

.ai-key-form,
.ai-generation-form fieldset {
  min-width: 0;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
  border: 0;
}

.ai-key-form label,
.ai-generation-form label {
  color: var(--ink);
  font-size: 0.86rem;
  font-weight: 850;
}

.ai-key-form input,
.ai-generation-form textarea,
.ai-generation-form select {
  width: 100%;
  min-height: 48px;
  padding: 11px 13px;
  color: var(--ink);
  background: #fff;
  border: 1px solid #bac7d7;
  border-radius: 11px;
  font-size: 16px;
}

.ai-generation-form textarea {
  min-height: 112px;
  resize: vertical;
  line-height: 1.45;
}

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

.ai-option-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.ai-option-grid label {
  display: grid;
  gap: 5px;
}

.ai-generate-button {
  width: 100%;
}

.ai-cost-note,
.ai-privacy-note {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.45;
}

.ai-key-help {
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.45;
}

.ai-key-help summary {
  color: var(--blue-dark);
  font-weight: 850;
  cursor: pointer;
}

.ai-key-help ol {
  margin: 10px 0 8px;
  padding-left: 22px;
}

.ai-key-help li + li {
  margin-top: 5px;
}

.ai-key-help p {
  margin: 0;
  font-weight: 750;
}

.ai-generation-state {
  min-height: 22px;
  color: var(--blue-dark);
  font-size: 0.88rem;
  font-weight: 800;
}

.ai-generation-state.is-error {
  color: var(--red);
}

.ai-progress {
  height: 7px;
  overflow: hidden;
  background: #d9e3ee;
  border-radius: 99px;
}

.ai-progress[hidden],
.ai-preview[hidden],
[data-ai-remove-key][hidden] {
  display: none;
}

.ai-progress span {
  width: 40%;
  height: 100%;
  display: block;
  background: var(--teal);
  border-radius: inherit;
  animation: ai-progress 1.25s ease-in-out infinite alternate;
}

@keyframes ai-progress {
  from { transform: translateX(-25%); }
  to { transform: translateX(175%); }
}

.ai-preview {
  width: min(100%, 360px);
  max-height: 260px;
  margin: 0 auto;
  display: block;
  object-fit: contain;
  background: #dce4ed;
  border: 1px solid var(--line);
  border-radius: 13px;
}

.toast-region {
  position: fixed;
  z-index: 100;
  right: 18px;
  bottom: calc(18px + var(--safe-bottom));
  display: grid;
  gap: 10px;
  pointer-events: none;
}

.toast {
  width: min(360px, calc(100vw - 36px));
  padding: 13px 16px;
  color: #fff;
  background: var(--navy-deep);
  border-radius: 12px;
  box-shadow: 0 10px 28px rgba(4, 20, 39, 0.3);
  font-weight: 750;
}

.toast.is-error {
  background: #9d2840;
}

.offline-banner {
  position: fixed;
  z-index: 45;
  top: 0;
  right: 0;
  left: 0;
  padding: calc(8px + var(--safe-top)) 12px 8px;
  color: #fff;
  background: #8b4f00;
  font-size: 0.84rem;
  font-weight: 850;
  text-align: center;
  transform: translateY(-110%);
  transition: transform 180ms ease;
}

.offline-banner.is-visible {
  transform: translateY(0);
}

@media (max-width: 1050px) {
  .board-workbench {
    grid-template-columns: 190px minmax(0, 1fr);
  }

  .tool-button {
    min-width: 52px;
    padding-right: 8px;
    padding-left: 8px;
  }

  .text-format-panel {
    left: 205px;
  }
}

@media (max-width: 720px) {
  .teacher-name {
    display: none;
  }

  .mode-grid {
    grid-template-columns: 1fr;
  }

  .mode-card {
    min-height: 240px;
  }

  .app-header .brand strong {
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .board-page .app-header {
    display: none;
  }

  .board-layout {
    height: calc(100vh - 70px - var(--safe-bottom));
    height: calc(100dvh - 70px - var(--safe-bottom));
  }

  .board-phone-nav {
    display: grid;
  }

  .presentation-mode .board-phone-nav {
    display: none !important;
  }

  .presentation-mode .board-layout {
    height: 100vh;
    height: 100dvh;
  }

  .board-toolbar {
    min-height: calc(64px + var(--safe-top));
    padding-top: calc(9px + var(--safe-top));
    padding-right: max(10px, var(--safe-right));
    padding-left: max(10px, var(--safe-left));
  }

  .board-status {
    display: none;
  }

  .board-workbench {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr) 150px;
  }

  .workspace {
    grid-row: 1;
    padding: 6px;
  }

  .slide-rail {
    grid-row: 2;
    grid-template-columns: 112px minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr);
    border-top: 1px solid var(--line);
    border-right: 0;
  }

  .slide-rail-head {
    min-height: 0;
    align-items: flex-start;
    border-right: 1px solid var(--line);
    border-bottom: 0;
  }

  .slide-list {
    grid-auto-flow: column;
    grid-auto-columns: 150px;
    overflow-x: auto;
    overflow-y: hidden;
  }

  .slide-actions button {
    min-height: 28px;
  }

  .text-format-panel {
    right: 8px;
    bottom: 158px;
    left: 8px;
    max-height: 150px;
    overflow: auto;
  }

  .blank-choice-panel {
    display: none;
  }
}

@media (max-width: 540px) {
  .app-header {
    min-height: 64px;
    padding-right: 12px;
    padding-left: 12px;
  }

  .header-actions .button {
    min-height: 38px;
    padding: 8px 10px;
  }

  .brand {
    gap: 8px;
  }

  .brand-mark {
    width: 36px;
    height: 36px;
    flex-basis: 36px;
  }

  .page-shell {
    width: min(100% - 24px, 1160px);
  }

  .photo-library-drawer,
  .ai-generator-drawer,
  .slideshow-drawer {
    top: 8px;
    right: 8px;
    width: calc(100vw - 16px);
    max-height: calc(100dvh - 16px);
    padding: 18px;
  }

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

  .ai-option-grid {
    grid-template-columns: 1fr;
  }
}

@media (display-mode: standalone) {
  .phone-header {
    padding-top: calc(10px + var(--safe-top));
  }
}

/* ─── Landing page ─── */

.landing-page {
  background: #fff;
}

.landing-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}

.landing-header-inner {
  width: min(1100px, calc(100% - 32px));
  margin: 0 auto;
  padding: 14px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.landing-header .brand {
  color: var(--navy-deep);
  text-decoration: none;
}

.landing-nav {
  display: flex;
  align-items: center;
  gap: 20px;
}

.landing-nav a {
  font-weight: 800;
  text-decoration: none;
}

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

.landing-hero {
  padding: clamp(48px, 8vw, 96px) 0 clamp(40px, 7vw, 80px);
  text-align: center;
  background:
    radial-gradient(ellipse at 20% 0%, rgba(31, 120, 209, 0.1), transparent 50%),
    radial-gradient(ellipse at 80% 100%, rgba(24, 169, 153, 0.08), transparent 50%),
    #fff;
}

.landing-hero-title {
  max-width: 720px;
  margin: 0 auto 20px;
  font-size: clamp(2rem, 5.5vw, 3.2rem);
  line-height: 1.12;
  color: var(--navy-deep);
  letter-spacing: -0.02em;
}

.landing-hero-sub {
  max-width: 580px;
  margin: 0 auto 32px;
  color: var(--muted);
  font-size: clamp(1rem, 2.5vw, 1.18rem);
  line-height: 1.6;
}

.landing-hero-cta {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
}

.landing-hero-cta .button {
  min-width: 200px;
}

.landing-hero-note {
  margin-top: 14px;
  font-size: 0.88rem;
}

.landing-section {
  padding: clamp(40px, 6vw, 72px) 0;
}

.landing-section-title {
  max-width: 600px;
  margin: 0 auto 12px;
  font-size: clamp(1.5rem, 4vw, 2.1rem);
  line-height: 1.2;
  color: var(--navy-deep);
  text-align: center;
}

.landing-section > .landing-container > .eyebrow {
  text-align: center;
}

/* ── Benefits grid ── */

.landing-why {
  background: var(--surface-soft);
}

.landing-benefit-grid {
  margin-top: 36px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

.landing-benefit {
  padding: clamp(20px, 3vw, 32px);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 6px 20px rgba(12, 37, 69, 0.06);
}

.landing-benefit-icon {
  display: block;
  margin-bottom: 12px;
  font-size: 2rem;
}

.landing-benefit h3 {
  margin-bottom: 8px;
  font-size: 1.1rem;
  color: var(--navy-deep);
}

.landing-benefit p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

/* ── Steps ── */

.landing-how {
  background: #fff;
}

.landing-steps {
  margin-top: 36px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
  counter-reset: step;
}

.landing-step {
  text-align: center;
  padding: 28px 20px;
}

.landing-step-number {
  width: 52px;
  height: 52px;
  margin: 0 auto 16px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: var(--blue);
  font-size: 1.3rem;
  font-weight: 900;
}

.landing-step h3 {
  margin-bottom: 8px;
  font-size: 1.1rem;
  color: var(--navy-deep);
}

.landing-step p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

/* ── Privacy ── */

.landing-privacy {
  background: var(--surface-soft);
}

.landing-privacy-card {
  max-width: 680px;
  margin: 0 auto;
  padding: clamp(28px, 4vw, 44px);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.landing-privacy-card .landing-section-title {
  text-align: left;
  margin: 0 0 18px;
}

.landing-privacy-card .eyebrow {
  text-align: left;
}

.landing-privacy-list {
  list-style: none;
  padding: 0;
  margin: 0 0 20px;
}

.landing-privacy-list li {
  padding: 10px 0 10px 32px;
  position: relative;
  color: var(--ink);
  line-height: 1.5;
}

.landing-privacy-list li::before {
  content: '✓';
  position: absolute;
  left: 0;
  top: 10px;
  color: var(--green);
  font-weight: 900;
  font-size: 1.1rem;
}

.landing-privacy-links a {
  font-weight: 800;
}

/* ── Pricing summary ── */

.landing-pricing-summary {
  background: #fff;
  text-align: center;
}

.landing-price-cards {
  max-width: 480px;
  margin: 28px auto 24px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.landing-price-card {
  position: relative;
  padding: 24px 18px;
  background: var(--surface-soft);
  border: 2px solid var(--line);
  border-radius: var(--radius);
  text-align: center;
}

.landing-price-card h3 {
  margin-bottom: 4px;
  font-size: 0.95rem;
  color: var(--muted);
}

.landing-price {
  margin-bottom: 6px;
}

.landing-price strong {
  font-size: 2.4rem;
  color: var(--navy-deep);
}

.landing-price span {
  color: var(--muted);
  font-size: 1rem;
}

.landing-price-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.landing-price-card-highlight {
  border-color: var(--blue);
  background: #eef5fc;
}

.landing-save-badge {
  position: absolute;
  top: -11px;
  right: 14px;
  padding: 2px 10px;
  background: var(--green);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 900;
  border-radius: 6px;
}

.landing-feature-list {
  max-width: 340px;
  margin: 0 auto 28px;
  list-style: none;
  padding: 0;
  text-align: left;
}

.landing-feature-list li {
  padding: 6px 0 6px 28px;
  position: relative;
  color: var(--ink);
}

.landing-feature-list li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: var(--green);
  font-weight: 900;
}

/* ── Final CTA ── */

.landing-final-cta {
  padding: clamp(48px, 7vw, 80px) 0;
  text-align: center;
  background: var(--navy-deep);
  color: #fff;
}

.landing-final-cta h2 {
  margin-bottom: 8px;
  font-size: clamp(1.5rem, 4vw, 2rem);
  color: #fff;
}

.landing-final-cta p {
  color: #b3c8de;
}

.landing-final-cta .muted {
  color: #8da8c4;
}

.landing-final-cta .muted a {
  color: #b3d4f0;
}

.landing-final-cta .button {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}

/* ── Footer ── */

.landing-footer {
  padding: 28px 0;
  background: var(--navy-deep);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.landing-footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

.landing-footer-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #dbeaf8;
}

.landing-footer-brand .brand-mark {
  width: 34px;
  height: 34px;
  font-size: 0.72rem;
}

.landing-footer-links {
  display: flex;
  gap: 20px;
}

.landing-footer-links a {
  color: #8da8c4;
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 700;
}

.landing-footer-links a:hover {
  color: #fff;
}

/* ── Landing responsive ── */

@media (max-width: 720px) {
  .landing-benefit-grid {
    grid-template-columns: 1fr;
  }

  .landing-steps {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .landing-step {
    padding: 20px 16px;
  }

  .landing-price-cards {
    grid-template-columns: 1fr;
    max-width: 280px;
  }

  .landing-hero-cta .button {
    min-width: 0;
    width: 100%;
  }
}

@media (max-width: 540px) {
  .landing-header-inner {
    width: calc(100% - 24px);
  }

  .landing-container {
    width: calc(100% - 24px);
  }

  .landing-nav {
    gap: 12px;
  }

  .landing-nav a:not(.button) {
    font-size: 0.88rem;
  }
}

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

/* ─── Billing & Subscription ─── */

.billing-card {
  max-width: 480px;
}
.billing-status {
  padding: 1rem;
  border-radius: 8px;
  margin-bottom: 1.25rem;
}
.billing-status-active {
  background: #e8f5e9;
  border: 1px solid #a5d6a7;
}
.billing-status-trial {
  background: #fff8e1;
  border: 1px solid #ffe082;
}
.billing-status-expired {
  background: #fce4ec;
  border: 1px solid #ef9a9a;
}
.billing-plan {
  margin: 1.25rem 0;
}
.billing-plan h2 {
  font-size: 1.05rem;
  margin: 0 0 0.25rem;
}
.billing-price {
  font-size: 1.5rem;
  margin: 0.25rem 0 0.75rem;
  color: var(--brand);
}
.billing-price strong {
  font-size: 2rem;
}
.billing-features {
  list-style: none;
  padding: 0;
  margin: 0 0 1.25rem;
}
.billing-features li {
  padding: 0.3rem 0;
  padding-left: 1.4em;
  position: relative;
}
.billing-features li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: #388e3c;
  font-weight: bold;
}
.billing-notice {
  padding: 1rem;
  background: #f5f5f5;
  border-radius: 8px;
  margin: 1rem 0;
}
.billing-notice code {
  font-size: 0.82rem;
  background: #e0e0e0;
  padding: 0.1em 0.35em;
  border-radius: 3px;
}
.billing-card form {
  margin: 0.75rem 0;
}
.billing-card hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 1.5rem 0 1rem;
}

.billing-options {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1rem;
}
.billing-option {
  flex: 1;
  border: 2px solid var(--border);
  border-radius: 10px;
  padding: 0.85rem 1rem;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.billing-option:hover {
  border-color: #90caf9;
}
.billing-option-selected {
  border-color: var(--brand);
  background: #e8f0fe;
}
.billing-option-header {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
}
.billing-option-header input[type="radio"] {
  margin-top: 0.25rem;
  accent-color: var(--brand);
}
.billing-option-header label {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  cursor: pointer;
  flex: 1;
}
.billing-save {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 600;
  color: #2e7d32;
  background: #e8f5e9;
  padding: 0.1em 0.5em;
  border-radius: 4px;
  width: fit-content;
}

.trial-banner {
  padding: 0.65rem 1rem;
  border-radius: 8px;
  background: #fff8e1;
  border: 1px solid #ffe082;
  margin-bottom: 1.25rem;
  font-size: 0.92rem;
}
.trial-banner a {
  color: var(--brand);
  font-weight: 600;
}
.trial-banner-expired {
  background: #fce4ec;
  border-color: #ef9a9a;
}

/* ─── Legal pages ─── */

.legal-card {
  max-width: 600px;
  text-align: left;
}
.legal-card h2 {
  font-size: 1.05rem;
  margin: 1.5rem 0 0.5rem;
}
.legal-card h2:first-of-type {
  margin-top: 1rem;
}
.legal-card ul {
  padding-left: 1.4em;
  margin: 0.5rem 0;
}
.legal-card li {
  margin: 0.3rem 0;
}
.legal-links {
  font-size: 0.85rem;
  margin-top: 0.75rem;
}
.legal-links a {
  color: var(--muted);
}
.legal-links a:hover {
  color: var(--brand);
}

/* ─── Pricing grid ─── */

.pricing-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin: 1.5rem 0 0;
}
.pricing-tier {
  padding: 1.25rem;
  border-radius: 14px;
  border: 2px solid var(--line);
  background: var(--surface);
}
.pricing-tier-pro {
  border-color: var(--blue);
  background: #f0f6ff;
}
.pricing-tier-label {
  margin: 0 0 0.25rem;
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--blue-dark);
}
.pricing-tier-price {
  margin: 0 0 0.15rem;
  font-size: 1rem;
}
.pricing-tier-price strong {
  font-size: 2rem;
}
.pricing-tier-price span {
  color: var(--muted);
  font-size: 0.88rem;
}
.pricing-tier-alt {
  margin: 0 0 0.75rem;
  color: var(--muted);
  font-size: 0.88rem;
}
.pricing-tier .billing-features {
  margin-bottom: 1rem;
  font-size: 0.9rem;
}
.pricing-tier .button {
  width: 100%;
}
.pricing-current {
  margin: 0;
  padding: 0.5rem 0.75rem;
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--green);
  background: #e8f5e9;
  border-radius: 8px;
  text-align: center;
}

@media (max-width: 540px) {
  .pricing-grid {
    grid-template-columns: 1fr;
  }
}

/* ─── Free-plan billing status ─── */

.billing-status-free {
  background: #f0f6ff;
  border: 1px solid #b8d0e8;
}
.billing-trial-offer {
  margin: 1.25rem 0;
  padding: 1rem;
  background: #f0f6ff;
  border: 1px solid #b8d0e8;
  border-radius: 8px;
}
.billing-trial-offer h2 {
  font-size: 1rem;
  margin: 0 0 0.25rem;
}

.trial-banner-upgrade {
  background: #f0f6ff;
  border-color: #b8d0e8;
}

.pricing-facts {
  margin-top: 1.5rem;
  padding: 1rem;
  background: #f5f5f5;
  border-radius: 8px;
  text-align: left;
}
.pricing-facts h2 {
  font-size: 0.95rem;
  margin: 0 0 0.5rem;
}
.pricing-facts ul {
  padding-left: 1.4em;
  margin: 0;
}
.pricing-facts li {
  margin: 0.3rem 0;
  font-size: 0.9rem;
}
