@import url("https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Manrope:wght@500;600;700;800&display=swap");

:root {
  color-scheme: dark;
  --bg: #050b14;
  --bg-top: #091625;
  --panel: rgba(14, 27, 43, 0.88);
  --panel-strong: #101f32;
  --panel-soft: rgba(19, 36, 57, 0.72);
  --line: rgba(159, 187, 224, 0.15);
  --line-strong: rgba(159, 187, 224, 0.24);
  --text: #f4f8ff;
  --muted: #92a4bd;
  --subtle: #64758e;
  --blue: #3095ff;
  --blue-bright: #5db1ff;
  --blue-soft: rgba(48, 149, 255, 0.13);
  --coral: #ff6268;
  --paper: #f7f8fa;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.38);
  --radius: 18px;
}

* { box-sizing: border-box; }

html {
  min-height: 100%;
  scroll-behavior: smooth;
  background: var(--bg);
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  color: var(--text);
  background:
    radial-gradient(circle at 18% -4%, rgba(61, 116, 201, 0.24), transparent 34rem),
    radial-gradient(circle at 92% 28%, rgba(32, 88, 156, 0.13), transparent 28rem),
    linear-gradient(160deg, var(--bg-top), var(--bg) 42%);
  font-family: "DM Sans", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  opacity: 0.2;
  background-image: linear-gradient(rgba(255,255,255,0.018) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,0.018) 1px, transparent 1px);
  background-size: 56px 56px;
  pointer-events: none;
}

.backdrop {
  position: fixed;
  z-index: -1;
  left: 50%;
  top: 7rem;
  width: min(1080px, 95vw);
  height: 460px;
  border-radius: 50%;
  background: rgba(38, 119, 232, 0.08);
  filter: blur(100px);
  transform: translateX(-50%);
  pointer-events: none;
}

button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
[hidden] { display: none !important; }

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.app-shell {
  width: min(860px, calc(100% - 32px));
  min-height: 100vh;
  margin: 0 auto;
  padding-bottom: 52px;
}

.app-header {
  min-height: 118px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  color: inherit;
  text-decoration: none;
}

.brand-icon {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  color: #dbeeff;
  filter: drop-shadow(0 0 12px rgba(48, 149, 255, 0.45));
}

.brand-icon svg {
  width: 50px;
  fill: rgba(48, 149, 255, 0.13);
  stroke: var(--blue-bright);
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.brand-copy { display: flex; flex-direction: column; gap: 3px; }
.brand-copy strong { font: 800 clamp(1.35rem, 4vw, 1.8rem)/1.05 "Manrope", sans-serif; letter-spacing: -0.045em; }
.brand-copy small { color: var(--muted); font-size: 0.88rem; }
.header-actions { display: flex; align-items: center; gap: 10px; }

.privacy-pill {
  min-height: 38px;
  padding: 0 13px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(11, 23, 38, 0.55);
  font-size: 0.78rem;
}

.privacy-pill svg, .header-icon svg {
  width: 17px;
  fill: none;
  stroke: var(--blue-bright);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.header-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 12px;
  color: var(--muted);
  transition: 160ms ease;
}

.header-icon:hover { border-color: var(--line); background: var(--panel-soft); }
.header-icon svg { width: 22px; stroke: currentColor; }

.upload-view {
  min-height: calc(100vh - 170px);
  display: grid;
  align-content: center;
  grid-template-columns: 1fr 0.88fr;
  gap: clamp(28px, 6vw, 64px);
  padding: 36px 0 90px;
}

.upload-copy { align-self: center; }
.section-kicker { color: var(--blue-bright); font-size: 0.76rem; font-weight: 800; letter-spacing: 0.16em; }
.upload-copy h1 { margin: 18px 0 22px; font: 700 clamp(2.8rem, 7vw, 5rem)/0.98 "Manrope", sans-serif; letter-spacing: -0.065em; }
.upload-copy h1 span { color: var(--blue-bright); }
.upload-copy p { max-width: 510px; margin: 0; color: var(--muted); font-size: 1rem; line-height: 1.7; }

.drop-zone {
  position: relative;
  min-height: 330px;
  padding: 36px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 1px dashed rgba(79, 164, 255, 0.45);
  border-radius: 24px;
  background: linear-gradient(145deg, rgba(34, 74, 125, 0.23), rgba(9, 20, 34, 0.83));
  box-shadow: var(--shadow), inset 0 0 0 1px rgba(255,255,255,0.025);
  cursor: pointer;
  text-align: center;
  transition: border-color 180ms ease, transform 180ms ease, background 180ms ease;
}

.drop-zone:hover, .drop-zone.dragging {
  border-color: var(--blue-bright);
  background: linear-gradient(145deg, rgba(34, 92, 163, 0.3), rgba(9, 20, 34, 0.9));
  transform: translateY(-3px);
}

.drop-zone:focus-within { outline: 3px solid rgba(48,149,255,0.32); outline-offset: 4px; }
.drop-zone input { position: absolute; width: 1px; height: 1px; opacity: 0; }

.upload-glyph {
  width: 68px;
  height: 68px;
  margin-bottom: 20px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(74, 164, 255, 0.3);
  border-radius: 20px;
  color: var(--blue-bright);
  background: var(--blue-soft);
  box-shadow: 0 14px 36px rgba(0,0,0,0.22);
}

.upload-glyph svg { width: 31px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.drop-zone strong { font: 700 1.12rem/1.3 "Manrope", sans-serif; }
.drop-zone > span:not(.upload-glyph) { margin-top: 5px; color: var(--muted); font-size: 0.9rem; }
.drop-zone small { margin-top: 22px; color: var(--subtle); font-size: 0.75rem; line-height: 1.5; }

.loading-card {
  grid-column: 1 / -1;
  min-height: 76px;
  padding: 17px 20px;
  align-items: center;
  justify-content: center;
  gap: 15px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel);
}

.loading-card:not([hidden]) { display: flex; }
.loading-card strong, .loading-card div > span { display: block; }
.loading-card strong { font-size: 0.93rem; }
.loading-card div > span { margin-top: 3px; color: var(--muted); font-size: 0.8rem; }

.spinner {
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
  border: 2px solid rgba(120, 165, 218, 0.2);
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: spin 750ms linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.error-message {
  grid-column: 1 / -1;
  margin: 0;
  padding: 14px 16px;
  border: 1px solid rgba(255,98,104,0.25);
  border-radius: 13px;
  color: #ff9ca0;
  background: rgba(255,98,104,0.08);
  font-size: 0.88rem;
  line-height: 1.5;
}

.reader-view { display: grid; gap: 14px; }
.reader-view[hidden] { display: none; }

.document-card, .control-card, .punctuation-card, .reader-card, .page-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(145deg, rgba(20, 38, 60, 0.9), rgba(10, 21, 35, 0.91));
  box-shadow: 0 15px 45px rgba(0,0,0,0.2), inset 0 1px rgba(255,255,255,0.025);
}

.document-card {
  min-height: 92px;
  padding: 17px 20px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
}

.pdf-badge {
  width: 46px;
  height: 56px;
  display: grid;
  place-items: center;
  border-radius: 7px 14px 7px 7px;
  color: #fff;
  background: linear-gradient(145deg, #ff6d74, #ee3f4d);
  box-shadow: 0 10px 25px rgba(238, 63, 77, 0.2);
  font-size: 0.72rem;
  font-weight: 800;
}

.document-copy { min-width: 0; }
.document-copy h1 { overflow: hidden; margin: 0 0 5px; font: 700 1rem/1.3 "Manrope", sans-serif; letter-spacing: -0.02em; text-overflow: ellipsis; white-space: nowrap; }
.document-copy p { margin: 0; color: var(--muted); font-size: 0.79rem; }

.change-button {
  min-width: 108px;
  min-height: 48px;
  padding: 0 20px;
  border: 1px solid var(--line-strong);
  border-radius: 13px;
  color: var(--text);
  background: rgba(23, 42, 66, 0.85);
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
  transition: 160ms ease;
}

.change-button:hover { border-color: rgba(93,177,255,0.42); background: rgba(31, 57, 90, 0.9); }
.change-button:disabled { opacity: 0.62; cursor: wait; }

.settings-grid { display: grid; grid-template-columns: minmax(230px, 0.85fr) minmax(390px, 1.65fr); gap: 14px; }
.control-card { min-height: 148px; padding: 19px; }
.card-heading { display: flex; align-items: center; gap: 9px; }
.card-heading h2 { margin: 0; font: 650 0.92rem/1.2 "Manrope", sans-serif; letter-spacing: -0.018em; }
.heading-icon { width: 24px; height: 24px; display: grid; place-items: center; }
.heading-icon.blue { color: var(--blue-bright); }
.heading-icon.coral { color: var(--coral); }
.heading-icon svg { width: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.number-stepper {
  height: 62px;
  margin-top: 22px;
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto 40px;
  align-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background: rgba(4, 12, 22, 0.52);
}

.number-stepper button { height: 100%; border: 0; color: var(--muted); background: transparent; font-size: 1.35rem; cursor: pointer; }
.number-stepper button:hover { color: var(--blue-bright); }
.number-stepper label { min-width: 0; }
.number-stepper input { width: 100%; padding: 0 2px; border: 0; outline: 0; color: var(--text); background: transparent; text-align: right; font: 700 1.35rem/1 "Manrope", sans-serif; -moz-appearance: textfield; }
.number-stepper input::-webkit-inner-spin-button { -webkit-appearance: none; }
.number-stepper .unit { margin-left: 8px; color: var(--muted); font-size: 0.75rem; font-weight: 700; }

.pomodoro-card { position: relative; display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 18px; padding-right: 25px; }
.timer-settings { min-width: 0; }
.duration-row { margin-top: 17px; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.duration-field {
  min-height: 58px;
  padding: 9px 12px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--blue-bright);
  background: rgba(7, 17, 29, 0.5);
  font-size: 0.72rem;
}

.duration-field:first-child { border-color: rgba(48,149,255,0.48); box-shadow: inset 0 0 0 1px rgba(48,149,255,0.07); }
.duration-field > span:last-child { color: var(--text); font-size: 0.91rem; font-weight: 600; }
.duration-field input { width: 34px; padding: 0; border: 0; outline: none; color: inherit; background: transparent; font-weight: 700; -moz-appearance: textfield; }
.duration-field input::-webkit-inner-spin-button { -webkit-appearance: none; }

.timer-ring {
  width: 94px;
  height: 94px;
  padding: 7px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: conic-gradient(var(--blue) var(--timer-progress), rgba(79, 114, 157, 0.22) 0);
  box-shadow: 0 0 28px rgba(48,149,255,0.13);
  transition: background 200ms linear;
}

.timer-ring.break { background: conic-gradient(var(--coral) var(--timer-progress), rgba(79, 114, 157, 0.22) 0); box-shadow: 0 0 28px rgba(255,98,104,0.12); }
.timer-ring > div { width: 100%; height: 100%; display: grid; place-content: center; border-radius: 50%; background: #0d1a2a; text-align: center; }
.timer-ring strong, .timer-ring span { display: block; }
.timer-ring strong { font: 700 1.11rem/1.2 "Manrope", sans-serif; letter-spacing: -0.04em; }
.timer-ring span { margin-top: 2px; color: var(--muted); font-size: 0.63rem; }

.reset-timer { position: absolute; right: 10px; top: 10px; width: 28px; height: 28px; display: grid; place-items: center; border: 0; border-radius: 8px; color: var(--subtle); background: transparent; cursor: pointer; }
.reset-timer:hover { color: var(--text); background: rgba(255,255,255,0.05); }
.reset-timer svg { width: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.punctuation-card { min-height: 74px; padding: 13px 18px; display: grid; grid-template-columns: 1.4fr auto auto auto; align-items: center; gap: 14px; }
.quote-mark { width: 26px; height: 25px; color: var(--blue); font: 800 2rem/1 "Manrope", sans-serif; }
.pause-field { min-height: 40px; padding: 5px 10px; display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 10px; color: var(--muted); background: rgba(4,12,22,0.42); font-size: 0.72rem; }
.pause-field > span:last-child { color: var(--text); font-weight: 600; }
.pause-field input { width: 30px; padding: 0; border: 0; outline: 0; color: inherit; background: transparent; text-align: right; -moz-appearance: textfield; }
.pause-field input::-webkit-inner-spin-button { -webkit-appearance: none; }

.switch { position: relative; width: 48px; height: 27px; cursor: pointer; }
.switch input { position: absolute; opacity: 0; }
.switch-track { position: absolute; inset: 0; border-radius: 999px; background: #334258; transition: 160ms ease; }
.switch-track::after { content: ""; position: absolute; width: 21px; height: 21px; left: 3px; top: 3px; border-radius: 50%; background: #e9f1fa; box-shadow: 0 2px 7px rgba(0,0,0,0.32); transition: transform 160ms ease; }
.switch input:checked + .switch-track { background: var(--blue); box-shadow: 0 0 18px rgba(48,149,255,0.26); }
.switch input:checked + .switch-track::after { transform: translateX(21px); }

.reader-card { padding: 22px 20px 17px; }
.progress-heading { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 0.76rem; }
.progress-heading #progressPercent { margin-left: auto; }
.reader-expand { width: 34px; height: 34px; margin-left: 5px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 9px; color: var(--muted); background: rgba(8,19,32,0.56); cursor: pointer; transition: color 160ms ease, background 160ms ease, border-color 160ms ease; }
.reader-expand:hover { color: var(--text); border-color: rgba(93,177,255,0.4); background: rgba(31,53,82,0.72); }
.reader-expand svg { width: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.progress-track { height: 6px; margin-top: 12px; overflow: hidden; border-radius: 999px; background: rgba(117, 150, 192, 0.15); cursor: pointer; }
.progress-track span { width: 0; height: 100%; display: block; border-radius: inherit; background: linear-gradient(90deg, #267ee9, var(--blue-bright)); box-shadow: 0 0 14px rgba(48,149,255,0.45); transition: width 160ms ease; }

.word-stage { position: relative; min-height: 214px; margin-top: 20px; display: grid; place-items: center; overflow: hidden; border: 1px solid var(--line); border-radius: 17px; background: radial-gradient(circle at 50% 50%, rgba(38,117,225,0.1), transparent 45%), rgba(5,14,25,0.35); }
.word-stage::before { content: ""; position: absolute; top: 22%; bottom: 22%; left: 50%; width: 1px; background: linear-gradient(transparent, rgba(73,164,255,0.14), transparent); }
.focus-guide { position: absolute; left: 50%; width: 2px; height: 13px; border-radius: 2px; background: var(--blue); transform: translateX(-50%); box-shadow: 0 0 12px rgba(48,149,255,0.45); }
.focus-guide.top { top: 20%; }
.focus-guide.bottom { bottom: 20%; }

.word-display { position: relative; z-index: 1; width: 100%; padding: 0 16px; display: flex; justify-content: center; overflow: hidden; white-space: nowrap; font: 700 clamp(2.8rem, 10vw, 5.3rem)/1 "Manrope", sans-serif; letter-spacing: -0.055em; text-align: center; text-shadow: 0 8px 30px rgba(26, 95, 194, 0.16); }
.word-display .left { width: 50%; text-align: right; }
.word-display .pivot { color: var(--blue-bright); }
.word-display .right { width: 50%; text-align: left; }
.word-display.break-copy { color: #ffb1b4; font-size: clamp(2.3rem, 8vw, 4.3rem); }

.transport { margin-top: 21px; display: flex; align-items: flex-start; justify-content: center; gap: clamp(18px, 6vw, 46px); }
.round-button { min-width: 66px; padding: 0; display: flex; flex-direction: column; align-items: center; gap: 8px; border: 0; color: var(--muted); background: transparent; font-size: 0.7rem; cursor: pointer; }
.round-button > svg, .circle-icon { width: 48px; height: 48px; padding: 14px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 50%; background: rgba(28, 46, 69, 0.64); transition: 160ms ease; }
.round-button > svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.round-button:nth-child(1) > svg, .round-button:nth-child(3) > svg { fill: currentColor; stroke-width: 0; }
.round-button:hover > svg { color: var(--text); border-color: rgba(93,177,255,0.36); background: rgba(36, 63, 96, 0.76); }
.round-button.primary { color: var(--blue-bright); }
.circle-icon { width: 62px; height: 62px; padding: 18px; border-color: rgba(79,169,255,0.56); color: white; background: linear-gradient(145deg, #3ca5ff, #126bea); box-shadow: 0 10px 30px rgba(23,117,238,0.32); }
.circle-icon svg { width: 26px; height: 26px; fill: currentColor; stroke: currentColor; stroke-width: 1.9; }
.circle-icon .pause-icon { display: none; fill: none; }
.round-button.primary.playing .play-icon { display: none; }
.round-button.primary.playing .pause-icon { display: block; }

.page-buttons { margin-top: 19px; display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.page-buttons button { min-height: 48px; padding: 0 24px; display: flex; align-items: center; justify-content: space-between; gap: 10px; border: 1px solid var(--line); border-radius: 999px; color: var(--text); background: rgba(26,44,67,0.62); font-size: 0.79rem; font-weight: 600; cursor: pointer; transition: 160ms ease; }
.page-buttons button:hover { border-color: rgba(93,177,255,0.4); background: rgba(34,58,88,0.78); }
.page-buttons svg { width: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.page-buttons button:disabled { opacity: 0.38; cursor: not-allowed; }

.page-card { padding: 18px 18px 16px; }
.page-card-header { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.zoom-controls { display: flex; align-items: center; gap: 1px; }
.zoom-controls button, .zoom-controls output { height: 38px; min-width: 39px; display: grid; place-items: center; border: 1px solid var(--line); color: var(--muted); background: rgba(8,19,32,0.56); }
.zoom-controls button { cursor: pointer; font-size: 1.05rem; }
.zoom-controls button:first-child { border-radius: 10px 0 0 10px; }
.zoom-controls button:nth-of-type(2) { border-radius: 0 10px 10px 0; }
.zoom-controls button:hover { color: var(--text); background: rgba(31,53,82,0.72); }
.zoom-controls output { min-width: 61px; border-right: 0; border-left: 0; font-size: 0.72rem; }
.zoom-controls .expand-button { margin-left: 8px; border-radius: 10px; }
.expand-button svg { width: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.pdf-viewport { position: relative; min-height: 400px; max-height: 720px; margin-top: 15px; padding: 16px; overflow: auto; overscroll-behavior: contain; border: 1px solid var(--line); border-radius: 13px; background: #1a2431; scrollbar-color: #3d5776 #101927; }
.page-loading { position: absolute; inset: 0; z-index: 4; display: flex; align-items: center; justify-content: center; gap: 11px; color: var(--muted); background: rgba(9,19,31,0.82); font-size: 0.8rem; }
.page-canvas-wrap { position: relative; width: 100%; min-width: 0; margin: 0 auto; overflow: hidden; border-radius: 3px; background: var(--paper); box-shadow: 0 16px 34px rgba(0,0,0,0.32); transform-origin: top left; }
#pdfCanvas { width: 100%; height: auto; display: block; background: var(--paper); }
.word-overlay { position: absolute; inset: 0; }

.word-hotspot { position: absolute; min-width: 2px; min-height: 2px; margin: 0; padding: 0; border: 0; border-radius: 2px; color: transparent; background: transparent; cursor: pointer; transition: background 100ms ease, box-shadow 100ms ease; }
.word-hotspot:hover { background: rgba(255, 224, 0, .24); box-shadow: none; }
.word-hotspot.active { z-index: 2; background: rgba(255, 224, 0, .55); mix-blend-mode: multiply; box-shadow: none; border-radius: 2px 4px 2px 3px; }
.word-hotspot:focus-visible { outline: 2px solid #8a6900; outline-offset: 2px; background: rgba(255, 224, 0, .55); }

.break-overlay { position: absolute; inset: 0; z-index: 3; display: grid; place-content: center; color: #152235; background: rgba(240,244,249,0.93); text-align: center; }
.break-overlay span, .break-overlay small { display: block; }
.break-overlay span { font: 700 clamp(2rem, 7vw, 4.4rem)/1 "Manrope", sans-serif; letter-spacing: -0.05em; }
.break-overlay small { margin-top: 10px; color: #536379; font-size: 0.83rem; }

.tap-hint { margin: 14px 2px 0; display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 0.75rem; }
.tap-hint svg { width: 19px; fill: none; stroke: var(--blue-bright); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.fullscreen-tap-hint, .pdf-fullscreen-controls { display: none; }
.mobile-nav { display: none; }

.site-footer { width: min(1120px, calc(100% - 40px)); margin: 12px auto 34px; padding: 20px 4px; display: flex; justify-content: space-between; gap: 20px; border-top: 1px solid var(--line); color: var(--muted); font-size: 0.9rem; }
.site-footer p { margin: 0; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 18px; }
.site-footer a { color: var(--muted); text-decoration: none; }
.site-footer a:hover { color: var(--text); }

.info-shell { width: min(820px, calc(100% - 40px)); margin: 0 auto; padding-bottom: 58px; }
.info-card { padding: clamp(24px, 6vw, 54px); border: 1px solid var(--line); border-radius: 22px; background: var(--panel); box-shadow: var(--shadow); }
.info-card h1 { margin: 0 0 18px; font: 800 clamp(2.15rem, 7vw, 3.7rem)/1.05 "Manrope", sans-serif; letter-spacing: -0.045em; }
.info-card h2 { margin: 34px 0 10px; font: 700 1.25rem/1.3 "Manrope", sans-serif; }
.info-card h3 { margin: 24px 0 8px; font: 700 1.05rem/1.35 "Manrope", sans-serif; }
.info-card p, .info-card li { color: #b5c3d5; font-size: 1rem; line-height: 1.75; }
.info-card li + li { margin-top: 8px; }
.info-card a { color: var(--blue-bright); }
.info-card .lede { color: var(--text); font-size: 1.1rem; }
.info-card .back-link { display: inline-flex; margin-top: 28px; color: var(--blue-bright); text-decoration: none; font-weight: 600; }
.guide-list { display: grid; gap: 14px; margin-top: 28px; }
.guide-link { display: block; padding: 20px; border: 1px solid var(--line); border-radius: 15px; color: var(--text) !important; background: var(--panel-soft); text-decoration: none; }
.guide-link strong { display: block; font: 700 1.05rem/1.35 "Manrope", sans-serif; }
.guide-link span { display: block; margin-top: 6px; color: var(--muted); line-height: 1.55; }
.guide-link:hover { border-color: var(--line-strong); background: rgba(28, 52, 80, 0.78); }
.article-note { margin: 26px 0; padding: 17px 19px; border-left: 3px solid var(--blue-bright); border-radius: 0 12px 12px 0; background: var(--blue-soft); }

button:focus-visible, a:focus-visible, input:focus-visible, label:focus-visible { outline: 3px solid rgba(70,162,255,0.38); outline-offset: 3px; }
body.fullscreen-open { overflow: hidden; }

.reader-card:fullscreen, .reader-card.fallback-fullscreen {
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  background: #000;
  box-shadow: none;
}

.reader-card.fallback-fullscreen, .page-card.fallback-fullscreen { position: fixed; z-index: 80; inset: 0; }
.reader-card:fullscreen .word-stage, .reader-card.fallback-fullscreen .word-stage { position: absolute; inset: 0; min-height: 0; margin: 0; border: 0; border-radius: 0; background: #000; }
.reader-card:fullscreen .word-stage::before, .reader-card.fallback-fullscreen .word-stage::before { top: 30%; bottom: 30%; background: linear-gradient(transparent, rgba(48,149,255,0.15), transparent); }
.reader-card:fullscreen .focus-guide.top, .reader-card.fallback-fullscreen .focus-guide.top { top: 29%; }
.reader-card:fullscreen .focus-guide.bottom, .reader-card.fallback-fullscreen .focus-guide.bottom { bottom: 29%; }
.reader-card:fullscreen .word-display, .reader-card.fallback-fullscreen .word-display { padding: 0 5vw; font-size: clamp(4rem, 16vw, 11rem); text-shadow: 0 0 54px rgba(48,149,255,0.2); }
.reader-card:fullscreen .word-display.break-copy, .reader-card.fallback-fullscreen .word-display.break-copy { font-size: clamp(3.5rem, 13vw, 9rem); }

.reader-card:fullscreen .progress-heading, .reader-card.fallback-fullscreen .progress-heading { position: absolute; z-index: 6; top: calc(22px + env(safe-area-inset-top)); left: max(24px, env(safe-area-inset-left)); right: max(24px, env(safe-area-inset-right)); min-height: 44px; padding: 0 6px 0 16px; border: 1px solid rgba(125,163,211,0.2); border-radius: 14px; background: rgba(10,22,37,0.78); backdrop-filter: blur(18px); }
.reader-card:fullscreen .progress-track, .reader-card.fallback-fullscreen .progress-track { position: absolute; z-index: 6; top: calc(78px + env(safe-area-inset-top)); left: max(30px, env(safe-area-inset-left)); right: max(30px, env(safe-area-inset-right)); margin: 0; }
.reader-card:fullscreen .transport, .reader-card.fallback-fullscreen .transport { position: absolute; z-index: 6; left: 50%; bottom: calc(116px + env(safe-area-inset-bottom)); width: min(560px, calc(100% - 32px)); margin: 0; justify-content: space-evenly; transform: translateX(-50%); }
.reader-card:fullscreen .page-buttons, .reader-card.fallback-fullscreen .page-buttons { position: absolute; z-index: 6; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); width: min(620px, calc(100% - 32px)); margin: 0; transform: translateX(-50%); }

.reader-card:fullscreen .progress-heading, .reader-card:fullscreen .progress-track, .reader-card:fullscreen .transport, .reader-card:fullscreen .page-buttons,
.reader-card.fallback-fullscreen .progress-heading, .reader-card.fallback-fullscreen .progress-track, .reader-card.fallback-fullscreen .transport, .reader-card.fallback-fullscreen .page-buttons,
.page-card:fullscreen .page-card-header, .page-card:fullscreen .pdf-fullscreen-controls,
.page-card.fallback-fullscreen .page-card-header, .page-card.fallback-fullscreen .pdf-fullscreen-controls { transition: opacity 180ms ease, transform 180ms ease; }

.fullscreen-tap-hint { position: absolute; z-index: 7; top: calc(103px + env(safe-area-inset-top)); left: 50%; padding: 8px 12px; border: 1px solid rgba(125,163,211,0.16); border-radius: 999px; color: #a8b8cc; background: rgba(8,18,31,0.76); font-size: 0.72rem; white-space: nowrap; pointer-events: none; transform: translateX(-50%); animation: hint-away 4s 1s both; }
.reader-card:fullscreen .fullscreen-tap-hint, .reader-card.fallback-fullscreen .fullscreen-tap-hint, .page-card:fullscreen .fullscreen-tap-hint, .page-card.fallback-fullscreen .fullscreen-tap-hint { display: block; }
@keyframes hint-away { 0%, 60% { opacity: 1; } 100% { opacity: 0; } }

.reader-card:fullscreen.controls-hidden .progress-heading, .reader-card:fullscreen.controls-hidden .progress-track, .reader-card:fullscreen.controls-hidden .transport, .reader-card:fullscreen.controls-hidden .page-buttons, .reader-card:fullscreen.controls-hidden .fullscreen-tap-hint,
.reader-card.fallback-fullscreen.controls-hidden .progress-heading, .reader-card.fallback-fullscreen.controls-hidden .progress-track, .reader-card.fallback-fullscreen.controls-hidden .transport, .reader-card.fallback-fullscreen.controls-hidden .page-buttons, .reader-card.fallback-fullscreen.controls-hidden .fullscreen-tap-hint,
.page-card:fullscreen.controls-hidden .page-card-header, .page-card:fullscreen.controls-hidden .pdf-fullscreen-controls, .page-card:fullscreen.controls-hidden .fullscreen-tap-hint,
.page-card.fallback-fullscreen.controls-hidden .page-card-header, .page-card.fallback-fullscreen.controls-hidden .pdf-fullscreen-controls, .page-card.fallback-fullscreen.controls-hidden .fullscreen-tap-hint { opacity: 0; pointer-events: none; }

.page-card:fullscreen, .page-card.fallback-fullscreen { width: 100vw; height: 100vh; height: 100dvh; padding: 0; overflow: hidden; border: 0; border-radius: 0; background: #070c13; box-shadow: none; }
.page-card:fullscreen .page-card-header, .page-card.fallback-fullscreen .page-card-header { position: absolute; z-index: 8; top: calc(16px + env(safe-area-inset-top)); left: max(16px, env(safe-area-inset-left)); right: max(16px, env(safe-area-inset-right)); min-height: 58px; padding: 10px 12px 10px 16px; border: 1px solid rgba(125,163,211,0.2); border-radius: 15px; background: rgba(8,19,32,0.84); box-shadow: 0 10px 35px rgba(0,0,0,0.3); backdrop-filter: blur(18px); }
.page-card:fullscreen .pdf-viewport, .page-card.fallback-fullscreen .pdf-viewport { position: absolute; inset: 0; width: 100%; height: 100%; max-height: none; margin: 0; padding: 0; border: 0; border-radius: 0; background: #070c13; }
.page-card:fullscreen .page-canvas-wrap, .page-card.fallback-fullscreen .page-canvas-wrap { margin: 0 auto; border-radius: 0; }
.page-card:fullscreen .tap-hint, .page-card.fallback-fullscreen .tap-hint { display: none; }
.page-card:fullscreen .fullscreen-tap-hint, .page-card.fallback-fullscreen .fullscreen-tap-hint { top: calc(86px + env(safe-area-inset-top)); }

.page-card:fullscreen .pdf-fullscreen-controls, .page-card.fallback-fullscreen .pdf-fullscreen-controls { position: absolute; z-index: 8; left: 50%; bottom: calc(18px + env(safe-area-inset-bottom)); width: min(650px, calc(100% - 24px)); padding: 14px; display: grid; gap: 11px; border: 1px solid rgba(125,163,211,0.2); border-radius: 20px; background: rgba(8,19,32,0.86); box-shadow: 0 18px 50px rgba(0,0,0,0.42); backdrop-filter: blur(20px); transform: translateX(-50%); }
.pdf-fullscreen-controls .transport, .pdf-fullscreen-controls .page-buttons { margin: 0; }
.pdf-fullscreen-controls .transport { justify-content: space-evenly; }
.pdf-fullscreen-controls .page-buttons button { min-height: 44px; }

@media (max-height: 620px) and (orientation: landscape) {
  .reader-card:fullscreen .progress-heading, .reader-card.fallback-fullscreen .progress-heading { top: calc(10px + env(safe-area-inset-top)); }
  .reader-card:fullscreen .progress-track, .reader-card.fallback-fullscreen .progress-track { top: calc(62px + env(safe-area-inset-top)); }
  .reader-card:fullscreen .transport, .reader-card.fallback-fullscreen .transport { bottom: calc(22px + env(safe-area-inset-bottom)); }
  .reader-card:fullscreen .page-buttons, .reader-card.fallback-fullscreen .page-buttons { display: none; }
  .reader-card:fullscreen .word-display, .reader-card.fallback-fullscreen .word-display { font-size: clamp(3rem, 14vw, 7rem); }
  .page-card:fullscreen .pdf-fullscreen-controls, .page-card.fallback-fullscreen .pdf-fullscreen-controls { padding: 9px 14px; }
  .pdf-fullscreen-controls .page-buttons { display: none; }
}

@media (max-width: 760px) {
  body { padding-bottom: calc(78px + env(safe-area-inset-bottom)); }
  .app-shell { width: min(100% - 22px, 620px); padding-bottom: 30px; }
  .app-header { min-height: 96px; }
  .brand-icon { width: 46px; height: 46px; }
  .brand-icon svg { width: 43px; }
  .brand-copy strong { font-size: 1.35rem; }
  .brand-copy small { font-size: 0.78rem; }
  .privacy-pill { width: 40px; padding: 0; justify-content: center; font-size: 0; }
  .header-icon { display: none; }
  .upload-view { min-height: calc(100vh - 160px); grid-template-columns: 1fr; align-content: start; gap: 30px; padding: 35px 0 70px; }
  .upload-copy { text-align: center; }
  .upload-copy h1 { margin-top: 16px; font-size: clamp(2.75rem, 14vw, 4.5rem); }
  .upload-copy p { margin: 0 auto; font-size: 0.94rem; }
  .drop-zone { min-height: 245px; }
  .settings-grid { grid-template-columns: 1fr; }
  .control-card { min-height: 0; }
  .speed-card { display: grid; grid-template-columns: 1fr 1fr; align-items: center; gap: 12px; }
  .speed-card .number-stepper { margin-top: 0; }
  .punctuation-card { position: relative; grid-template-columns: 1fr 1fr; }
  .punctuation-heading { grid-column: 1 / -1; }
  .pause-field { justify-content: space-between; }
  .switch { position: absolute; right: 28px; top: 23px; }
  .reader-card { padding: 18px 14px 15px; }
  .word-stage { min-height: 190px; }
  .transport { gap: 8px; justify-content: space-between; }
  .round-button { min-width: 58px; }
  .round-button > svg { width: 45px; height: 45px; }
  .circle-icon { width: 58px; height: 58px; }
  .page-buttons { gap: 8px; }
  .page-buttons button { padding: 0 15px; }
  .page-card { padding: 16px 12px 13px; }
  .pdf-viewport { min-height: 280px; max-height: 560px; padding: 9px; }
  .mobile-nav:not([hidden]) { position: fixed; z-index: 20; left: 50%; bottom: 0; width: min(100%, 620px); min-height: calc(68px + env(safe-area-inset-bottom)); padding: 9px 28px calc(7px + env(safe-area-inset-bottom)); display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid var(--line); border-bottom: 0; border-radius: 20px 20px 0 0; background: rgba(9,20,34,0.94); box-shadow: 0 -15px 45px rgba(0,0,0,0.32); backdrop-filter: blur(20px); transform: translateX(-50%); }
  .mobile-nav a { display: flex; flex-direction: column; align-items: center; gap: 4px; color: var(--muted); text-decoration: none; font-size: 0.67rem; }
  .mobile-nav a:hover, .mobile-nav a.active { color: var(--blue-bright); }
  .mobile-nav svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
}

@media (max-width: 480px) {
  .app-shell { width: min(100% - 18px, 440px); }
  .app-header { min-height: 86px; }
  .document-card { min-height: 82px; padding: 13px; gap: 11px; }
  .pdf-badge { width: 42px; height: 50px; }
  .change-button { min-width: 80px; min-height: 43px; padding: 0 13px; }
  .speed-card { grid-template-columns: 1fr; }
  .speed-card .number-stepper { margin-top: 7px; }
  .pomodoro-card { grid-template-columns: 1fr auto; gap: 12px; padding: 16px 14px; }
  .duration-row { gap: 7px; }
  .duration-field { padding: 8px 9px; }
  .timer-ring { width: 82px; height: 82px; }
  .timer-ring strong { font-size: 1rem; }
  .punctuation-card { padding: 14px; gap: 8px; }
  .switch { right: 15px; }
  .progress-heading { gap: 5px; font-size: 0.69rem; }
  .word-display { padding: 0 9px; font-size: clamp(2.45rem, 14vw, 4.2rem); }
  .transport { margin-top: 17px; }
  .round-button { min-width: 52px; font-size: 0.63rem; }
  .round-button > svg { width: 42px; height: 42px; padding: 12px; }
  .circle-icon { width: 54px; height: 54px; padding: 15px; }
  .page-buttons button { min-height: 45px; padding: 0 11px; font-size: 0.71rem; }
  .page-card-header { align-items: flex-start; }
  .page-card-header .card-heading h2 { max-width: 90px; }
  .zoom-controls button, .zoom-controls output { height: 35px; min-width: 35px; }
  .zoom-controls output { min-width: 51px; }
  .zoom-controls .expand-button { margin-left: 4px; }
  .site-footer { flex-direction: column; align-items: center; text-align: center; }
  .site-footer nav { justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

.pomodoro-card .card-heading { flex-wrap: wrap; }
.pomodoro-card .pomodoro-switch { position: relative; inset: auto; flex: 0 0 48px; margin-left: auto; }
.pomodoro-switch input:focus-visible + .switch-track { outline: 2px solid var(--text); outline-offset: 4px; }
.pomodoro-off .duration-row { opacity: 0.5; }
.pomodoro-off .timer-ring { background: #334258; box-shadow: none; }
.reset-timer:disabled { opacity: 0.4; cursor: default; }


.inline-speed { display:flex; justify-content:center; align-items:center; gap:14px; color:#a8b8cc; font-size:12px; }
.inline-speed button { width:40px; height:40px; border:1px solid var(--line); border-radius:50%; color:var(--text); background:#152538; cursor:pointer; font-size:20px; }
.inline-speed label { display:flex; align-items:center; gap:8px; }
.inline-speed input { width:70px; height:38px; border:1px solid var(--line); border-radius:9px; background:#0d1a2a; color:var(--text); text-align:center; font-size:16px; }
.word-inline-speed { display:none; }
.reader-card:is(:fullscreen,.fallback-fullscreen) .word-inline-speed { display:flex; position:absolute; z-index:6; bottom:calc(83px + env(safe-area-inset-bottom)); left:50%; transform:translateX(-50%); }
.reader-card:is(:fullscreen,.fallback-fullscreen) .transport { bottom:calc(143px + env(safe-area-inset-bottom)); }
.reader-card.controls-hidden .word-inline-speed { opacity:0; pointer-events:none; }
@media(max-height:620px) and (orientation:landscape) {
 .reader-card:is(:fullscreen,.fallback-fullscreen) .word-inline-speed { bottom:calc(12px + env(safe-area-inset-bottom)); }
 .reader-card:is(:fullscreen,.fallback-fullscreen) .transport { bottom:calc(65px + env(safe-area-inset-bottom)); }
}
