/* ==========================================================================
   Fwocus — Programmatic SEO Landing Page & Embeddable Tool Stylesheet
   Zen Paper Aesthetic + Competitor 1:1 Functional Layout
   ========================================================================== */

:root {
  --paper: #f5f0e6;
  --paper-card: rgba(253, 251, 247, 0.94);
  --paper-card-border: rgba(80, 72, 59, 0.2);
  --ink: #252c2d;
  --muted: #716d65;
  --line: rgba(80, 72, 59, 0.22);
  --accent: #b9412d;
  --accent-hover: #9f3222;
  --accent-soft: rgba(185, 65, 45, 0.12);
  --serif: Georgia, "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  --max: 1200px;
  --content-max: 860px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 24px;
}

body {
  color: var(--ink);
  background-color: var(--paper);
  font-family: var(--serif);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

button {
  font: inherit;
  color: inherit;
  cursor: pointer;
  border: none;
  background: none;
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
a:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

svg {
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ==========================================================================
   Above the Fold — Interactive Tool Viewport
   ========================================================================== */

.tool-viewport {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background-color: var(--paper);
  background-image: url("/assets/tool/bg.webp");
  background-repeat: no-repeat;
  background-position: center bottom;
  background-size: cover;
  overflow: hidden;
}

/* Header Area */
.tool-header {
  position: relative;
  z-index: 20;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 28px 36px 0;
}

.brand-wrapper {
  display: inline-flex;
  flex-direction: column;
  text-decoration: none;
  transition: opacity 0.2s ease;
}

.brand-wrapper:hover {
  opacity: 0.85;
}

.brand-logo {
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 500;
  letter-spacing: -0.5px;
  color: var(--ink);
  line-height: 1.1;
}

.brand-subtitle {
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 3px;
}

/* Top-Right Promo Popout Banner (Matching Competitor Layout in Fwocus Aesthetic) */
.promo-banner {
  position: relative;
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--paper-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--paper-card-border);
  border-radius: 12px;
  padding: 16px 18px 16px 20px;
  max-width: 440px;
  box-shadow: 0 8px 24px rgba(37, 44, 45, 0.08);
  transition: opacity 0.25s ease, transform 0.25s ease;
  animation: bannerFadeIn 0.5s ease-out;
}

@keyframes bannerFadeIn {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.promo-banner.is-dismissed {
  opacity: 0;
  transform: translateY(-10px);
  pointer-events: none;
  display: none;
}

.banner-close-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: var(--muted);
  cursor: pointer;
  transition: color 0.15s ease, background-color 0.15s ease;
}

.banner-close-btn:hover {
  color: var(--ink);
  background: rgba(80, 72, 59, 0.1);
}

.banner-content {
  flex: 1;
  padding-right: 10px;
}

.banner-title {
  font-family: var(--serif);
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.25;
  margin-bottom: 5px;
}

.banner-desc {
  font-family: var(--sans);
  font-size: 12px;
  line-height: 1.42;
  color: var(--muted);
  margin-bottom: 12px;
}

.banner-cta-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--accent);
  color: #ffffff;
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 600;
  padding: 7px 16px;
  border-radius: 9999px;
  transition: background-color 0.15s ease, transform 0.1s ease;
}

.banner-cta-btn:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
}

.banner-thumb {
  width: 116px;
  height: 72px;
  border-radius: 7px;
  overflow: hidden;
  border: 1px solid rgba(80, 72, 59, 0.15);
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.banner-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Center Stage Tool Area */
.tool-stage {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 20px 24px;
  z-index: 10;
}

.tool-display-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.stopwatch-digits {
  font-family: var(--serif);
  font-size: clamp(68px, 13vw, 144px);
  font-weight: 400;
  line-height: 1;
  letter-spacing: -2px;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  user-select: none;
  text-shadow: 0 2px 12px rgba(245, 240, 230, 0.7);
}

.stopwatch-subtext {
  font-family: var(--sans);
  font-size: 16px;
  font-weight: 500;
  color: var(--muted);
  margin-top: 14px;
  margin-bottom: 24px;
  letter-spacing: 0.5px;
  font-variant-numeric: tabular-nums;
}

/* Pomodoro Tabs & Cycle Indicators (ref/fwocus.jpg) */
.tool-intent {
  font-family: var(--serif);
  font-size: 20px;
  color: var(--ink);
  margin-bottom: 14px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  opacity: 0.9;
}

.mode-tabs {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  margin-bottom: 16px;
}

.mode-tab-btn {
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
  padding: 4px 2px 8px;
  border-bottom: 2px solid transparent;
  transition: all 0.2s ease;
  cursor: pointer;
}

.mode-tab-btn:hover {
  color: var(--ink);
}

.mode-tab-btn.is-active {
  color: var(--ink);
  border-bottom-color: var(--accent);
}

.cycle-dots {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 14px;
}

.cycle-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  border: 1.5px solid var(--accent);
  background: transparent;
  transition: background-color 0.2s ease;
}

.cycle-dot.is-active {
  background: var(--accent);
}

.pomodoro-digits {
  font-family: var(--serif);
  font-size: clamp(76px, 14vw, 150px);
  font-weight: 400;
  line-height: 1;
  letter-spacing: -2px;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  user-select: none;
  margin-bottom: 24px;
  text-shadow: 0 2px 12px rgba(245, 240, 230, 0.7);
}

/* Control Buttons Row */
.stopwatch-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
}

.btn-primary {
  background: var(--accent);
  color: #ffffff;
  border-radius: 9999px;
  padding: 12px 34px;
  font-family: var(--sans);
  font-size: 16px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 108px;
  box-shadow: 0 4px 14px rgba(185, 65, 45, 0.28);
  transition: background-color 0.15s ease, transform 0.1s ease, box-shadow 0.15s ease;
}

.btn-primary:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(185, 65, 45, 0.35);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  background: rgba(253, 251, 247, 0.6);
  color: var(--ink);
  border: 1px solid rgba(80, 72, 59, 0.35);
  border-radius: 9999px;
  padding: 12px 28px;
  font-family: var(--sans);
  font-size: 16px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 90px;
  transition: all 0.15s ease;
}

.btn-secondary:hover:not(:disabled) {
  background: rgba(253, 251, 247, 0.95);
  border-color: var(--ink);
}

.btn-secondary:disabled {
  opacity: 0.38;
  cursor: not-allowed;
  border-color: rgba(80, 72, 59, 0.2);
}

.btn-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(80, 72, 59, 0.25);
  background: rgba(253, 251, 247, 0.65);
  color: var(--ink);
  transition: all 0.15s ease;
}

.btn-icon svg {
  width: 20px;
  height: 20px;
}

.btn-icon:hover {
  background: rgba(253, 251, 247, 0.98);
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-1px);
}

/* Laps List Overlay / Accordion */
.laps-panel {
  margin-top: 24px;
  width: min(440px, 92vw);
  max-height: 180px;
  overflow-y: auto;
  background: var(--paper-card);
  backdrop-filter: blur(8px);
  border: 1px solid var(--paper-card-border);
  border-radius: 10px;
  padding: 10px 16px;
  box-shadow: 0 4px 16px rgba(37, 44, 45, 0.05);
  display: none;
}

.laps-panel.has-laps {
  display: block;
}

.laps-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--sans);
  font-size: 13px;
}

.laps-table th {
  text-align: left;
  font-weight: 600;
  color: var(--muted);
  padding: 4px 8px;
  border-bottom: 1px solid var(--line);
}

.laps-table th:last-child,
.laps-table td:last-child {
  text-align: right;
}

.laps-table td {
  padding: 6px 8px;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  border-bottom: 1px solid rgba(80, 72, 59, 0.08);
}

.laps-table tr.lap-fastest td {
  color: #2b7a4b;
  font-weight: 600;
}

.laps-table tr.lap-slowest td {
  color: var(--accent);
}

/* Bottom Bar / Dock */
.tool-dock {
  position: relative;
  z-index: 20;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 12px;
  padding: 0 36px 28px;
}

.btn-dock-app {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--accent);
  color: #ffffff;
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 600;
  padding: 10px 20px;
  border-radius: 9999px;
  box-shadow: 0 4px 14px rgba(185, 65, 45, 0.28);
  transition: background-color 0.15s ease, transform 0.1s ease;
}

.btn-dock-app:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
}

.btn-dock-icon {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(253, 251, 247, 0.85);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(80, 72, 59, 0.25);
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-dock-icon svg {
  width: 20px;
  height: 20px;
}

.btn-dock-icon:hover {
  background: rgba(253, 251, 247, 1);
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-1px);
}

/* Scroll Cue to Below-the-Fold Content */
.scroll-cue {
  position: absolute;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  font-family: var(--sans);
  font-size: 12px;
  letter-spacing: 0.5px;
  color: var(--muted);
  text-decoration: none;
  opacity: 0.85;
  transition: opacity 0.2s ease;
  z-index: 15;
}

.scroll-cue:hover {
  opacity: 1;
  color: var(--ink);
}

.scroll-cue svg {
  width: 16px;
  height: 16px;
  animation: subtleBounce 2s infinite ease-in-out;
}

@keyframes subtleBounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(4px); }
}

/* Settings Modal */
.settings-dialog {
  border: none;
  border-radius: 14px;
  padding: 0;
  max-width: 420px;
  width: 90vw;
  background: var(--paper-card);
  backdrop-filter: blur(14px);
  border: 1px solid var(--paper-card-border);
  box-shadow: 0 16px 40px rgba(37, 44, 45, 0.2);
  margin: auto;
}

.settings-dialog::backdrop {
  background: rgba(37, 44, 45, 0.35);
  backdrop-filter: blur(3px);
}

.settings-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  border-bottom: 1px solid var(--line);
}

.settings-title {
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 500;
  color: var(--ink);
}

.settings-close {
  cursor: pointer;
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
  border-radius: 50%;
}

.settings-close:hover {
  color: var(--ink);
}

.settings-body {
  padding: 22px;
  font-family: var(--sans);
  font-size: 14px;
}

.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid rgba(80, 72, 59, 0.1);
}

.setting-row:last-child {
  border-bottom: none;
}

.setting-label {
  font-weight: 500;
  color: var(--ink);
}

.setting-hint {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}

/* Custom Toggle Switch */
.switch {
  position: relative;
  display: inline-block;
  width: 46px;
  height: 26px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: rgba(80, 72, 59, 0.25);
  transition: .3s;
  border-radius: 26px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .3s;
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}

input:checked + .slider {
  background-color: var(--accent);
}

input:checked + .slider:before {
  transform: translateX(20px);
}

/* ==========================================================================
   Below the Fold — SEO Editorial Content
   ========================================================================== */

.seo-content-section {
  position: relative;
  background: var(--paper);
  border-top: 1px solid var(--line);
  padding: 80px 0 60px;
}

.wrap {
  width: min(var(--max), calc(100% - 64px));
  margin-inline: auto;
}

.content-wrap {
  width: min(var(--content-max), calc(100% - 48px));
  margin-inline: auto;
}

.seo-header {
  text-align: center;
  margin-bottom: 56px;
}

.seo-kicker {
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 12px;
  display: inline-block;
}

.seo-title {
  font-size: clamp(32px, 4.2vw, 48px);
  line-height: 1.15;
  letter-spacing: -1.2px;
  font-weight: 400;
  color: var(--ink);
  margin-bottom: 20px;
}

.seo-lead {
  font-size: clamp(18px, 1.8vw, 21px);
  line-height: 1.5;
  color: var(--muted);
  max-width: 680px;
  margin-inline: auto;
}

/* Editorial Content Blocks */
.article-section {
  margin-bottom: 52px;
}

.article-section h2 {
  font-size: clamp(26px, 2.6vw, 34px);
  line-height: 1.22;
  letter-spacing: -0.8px;
  font-weight: 400;
  color: var(--ink);
  margin-bottom: 18px;
}

.article-section h3 {
  font-size: 22px;
  line-height: 1.3;
  letter-spacing: -0.4px;
  font-weight: 400;
  color: var(--ink);
  margin-top: 24px;
  margin-bottom: 12px;
}

.article-section p {
  margin-bottom: 18px;
  color: #363d3e;
}

.article-section strong {
  color: var(--accent);
  font-weight: 700;
}

.article-section p a {
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-underline-offset: 3px;
}

.article-section ul,
.article-section ol {
  margin: 0 0 24px 24px;
  color: #363d3e;
}

.article-section li {
  margin-bottom: 8px;
}

/* Author Byline & Bio Box (E-E-A-T) */
.author-byline {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-top: 18px;
  padding: 8px 16px;
  background: var(--paper-card);
  border: 1px solid var(--paper-card-border);
  border-radius: 9999px;
  font-family: var(--sans);
  font-size: 13px;
  color: var(--muted);
}

.author-byline-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  overflow: hidden;
  border: 1px solid rgba(80, 72, 59, 0.25);
  background: var(--accent);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  flex-shrink: 0;
}

.author-byline-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.author-byline a {
  color: var(--ink);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: rgba(80, 72, 59, 0.3);
  text-underline-offset: 3px;
  transition: color 0.15s ease, text-decoration-color 0.15s ease;
}

.author-byline a:hover {
  color: var(--accent);
  text-decoration-color: var(--accent);
}

.author-bio-box {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  background: var(--paper-card);
  border: 1px solid var(--paper-card-border);
  border-radius: 12px;
  padding: 24px 26px;
  margin: 48px 0 36px;
  box-shadow: 0 4px 16px rgba(37, 44, 45, 0.04);
}

.author-box-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  overflow: hidden;
  border: 1.5px solid rgba(80, 72, 59, 0.25);
  background: var(--accent);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--serif);
  font-size: 20px;
  font-weight: bold;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(185, 65, 45, 0.15);
}

.author-box-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.author-box-content {
  flex: 1;
}

.author-box-name {
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 3px;
}

.author-box-name a {
  color: inherit;
  transition: color 0.15s ease;
}

.author-box-name a:hover {
  color: var(--accent);
}

.author-box-role {
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  margin-bottom: 10px;
}

.author-box-desc {
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.55;
  color: var(--ink);
  margin-bottom: 12px;
}

.author-box-link {
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: color 0.15s ease, transform 0.1s ease;
}

.author-box-link:hover {
  color: var(--accent-hover);
  transform: translateX(2px);
}

/* Feature Grid in Content */
.guide-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 24px;
  margin: 32px 0 40px;
}

.guide-card {
  background: var(--paper-card);
  border: 1px solid var(--paper-card-border);
  border-radius: 10px;
  padding: 24px 22px;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.guide-card:hover {
  transform: translateY(-2px);
  border-color: rgba(80, 72, 59, 0.35);
}

.card-step {
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--accent);
  text-transform: uppercase;
  margin-bottom: 8px;
}

.card-title {
  font-family: var(--serif);
  font-size: 19px;
  font-weight: 500;
  color: var(--ink);
  margin-bottom: 10px;
}

.card-text {
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.5;
  color: var(--muted);
}

/* Quote Callout */
.quote-callout {
  border-left: 3px solid var(--accent);
  padding: 16px 24px;
  margin: 36px 0;
  background: rgba(253, 251, 247, 0.6);
  border-radius: 0 8px 8px 0;
}

.quote-callout p {
  font-style: italic;
  font-size: 19px;
  color: var(--ink);
  margin-bottom: 8px;
}

.quote-callout cite {
  font-family: var(--sans);
  font-size: 13px;
  font-style: normal;
  color: var(--muted);
}

/* FAQ Accordion */
.faq-wrap {
  margin-top: 60px;
  border-top: 1px solid var(--line);
  padding-top: 50px;
}

.faq-title {
  font-size: clamp(26px, 2.6vw, 34px);
  letter-spacing: -0.8px;
  margin-bottom: 24px;
  text-align: center;
}

.faq-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 24px;
}

.faq-list details {
  background: var(--paper-card);
  border: 1px solid var(--paper-card-border);
  border-radius: 8px;
  padding: 16px 20px;
  transition: border-color 0.2s ease;
}

.faq-list details[open] {
  border-color: rgba(80, 72, 59, 0.35);
}

.faq-list summary {
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 18px;
  font-weight: 500;
  cursor: pointer;
  user-select: none;
}

.faq-list summary::-webkit-details-marker {
  display: none;
}

.faq-list summary svg {
  width: 20px;
  height: 20px;
  color: var(--muted);
  transition: transform 0.2s ease;
  flex-shrink: 0;
}

.faq-list details[open] summary svg {
  transform: rotate(180deg);
  color: var(--accent);
}

.faq-list p {
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.55;
  color: var(--muted);
  margin-top: 12px;
  margin-bottom: 0;
}

/* Bottom CTA Banner */
.bottom-cta-banner {
  background: var(--paper-card);
  border: 1px solid var(--paper-card-border);
  border-radius: 14px;
  padding: 44px 36px;
  text-align: center;
  margin: 70px 0 40px;
  box-shadow: 0 10px 30px rgba(37, 44, 45, 0.05);
}

.bottom-cta-banner h2 {
  font-size: clamp(28px, 3.2vw, 38px);
  letter-spacing: -1px;
  margin-bottom: 14px;
}

.bottom-cta-banner p {
  font-family: var(--sans);
  font-size: 16px;
  color: var(--muted);
  max-width: 580px;
  margin: 0 auto 24px;
}

.bottom-cta-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--accent);
  color: #ffffff;
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 600;
  padding: 13px 32px;
  border-radius: 9999px;
  box-shadow: 0 4px 14px rgba(185, 65, 45, 0.28);
  transition: all 0.15s ease;
}

.bottom-cta-btn:hover {
  background: var(--accent-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(185, 65, 45, 0.35);
}

/* Site Footer */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 40px 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
}

.footer-brand {
  font-family: var(--serif);
  font-size: 16px;
  color: var(--ink);
}

.footer-brand span {
  display: block;
  font-family: var(--sans);
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}

.footer-nav {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--sans);
  font-size: 13px;
  color: var(--muted);
}

.footer-nav a:hover {
  color: var(--ink);
}

.footer-seal {
  font-family: var(--serif);
  font-size: 26px;
  color: var(--accent);
  line-height: 1;
  border: 1px solid rgba(185, 65, 45, 0.4);
  border-radius: 4px;
  padding: 2px 6px;
}

/* ==========================================================================
   Responsive Breakpoints
   ========================================================================== */

@media (max-width: 900px) {
  .tool-header {
    flex-direction: column;
    gap: 16px;
    padding: 20px 20px 0;
  }

  .promo-banner {
    max-width: 100%;
    width: 100%;
  }

  .tool-dock {
    padding: 0 20px 20px;
  }

  .scroll-cue {
    display: none;
  }
}

@media (max-width: 600px) {
  .promo-banner {
    padding: 12px 14px;
    gap: 12px;
  }

  .banner-thumb {
    display: none;
  }

  .banner-desc {
    font-size: 11px;
    margin-bottom: 8px;
  }

  .stopwatch-digits {
    font-size: clamp(52px, 15vw, 76px);
  }

  .stopwatch-controls {
    gap: 10px;
  }

  .btn-primary {
    padding: 10px 26px;
    font-size: 15px;
    min-width: 90px;
  }

  .btn-secondary {
    padding: 10px 20px;
    font-size: 15px;
    min-width: 76px;
  }

  .btn-icon {
    width: 38px;
    height: 38px;
  }

  .btn-dock-app {
    padding: 8px 16px;
    font-size: 13px;
  }

  .btn-dock-icon {
    width: 36px;
    height: 36px;
  }

  .site-footer {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* ==========================================================================
   Countdown, Clock, Noise Meter & Chess Clock Tools
   ========================================================================== */

/* Countdown */
.preset-tabs {
  flex-wrap: wrap;
  gap: 8px 20px;
  max-width: 620px;
}

.countdown-digits {
  margin-bottom: 8px;
}

.countdown-digits.is-done {
  color: var(--accent);
  animation: countdown-pulse 1.6s ease-in-out infinite;
}

@keyframes countdown-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}

.countdown-status {
  font-family: var(--sans);
  font-size: 15px;
  color: var(--muted);
  min-height: 24px;
  margin-bottom: 16px;
}

/* Visual countdown: shrinking disc (--frac = fraction left) */
.visual-wrap {
  margin-bottom: 18px;
}

.visual-disc {
  --size: clamp(150px, 30vh, 240px);
  position: relative;
  width: var(--size);
  height: var(--size);
  border-radius: 50%;
  border: 2px solid rgba(37, 44, 45, 0.55);
  background:
    conic-gradient(var(--accent) calc(var(--frac, 1) * 1turn), rgba(253, 251, 247, 0.55) 0);
  box-shadow: 0 6px 22px rgba(80, 72, 59, 0.16);
}

.visual-disc-center {
  position: absolute;
  inset: 44%;
  border-radius: 50%;
  background: var(--paper);
  border: 2px solid rgba(37, 44, 45, 0.55);
}

/* Visual countdown: hourglass */
.hourglass {
  width: clamp(96px, 16vh, 132px);
  height: auto;
  overflow: visible;
}

.hourglass .hg-glass,
.hourglass .hg-cap {
  stroke: var(--ink);
  stroke-width: 2.5;
  fill: rgba(253, 251, 247, 0.45);
}

.hourglass .hg-cap {
  stroke-width: 5;
}

.hourglass .hg-sand {
  fill: #c9a46a;
  stroke: none;
}

.hourglass .hg-stream {
  stroke: #c9a46a;
  stroke-width: 2;
  transition: opacity 0.3s ease;
}

.visual-wrap + .countdown-digits {
  font-size: clamp(48px, 8vw, 84px);
}

/* Clock */
.clock-face {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 12px;
}

.clock-digits {
  font-family: var(--serif);
  font-size: clamp(72px, 16vw, 200px);
  font-weight: 400;
  line-height: 1;
  letter-spacing: -2px;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  user-select: none;
  text-shadow: 0 2px 12px rgba(245, 240, 230, 0.7);
}

.clock-period {
  font-family: var(--sans);
  font-size: clamp(16px, 2.4vw, 28px);
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 1px;
}

.clock-date {
  font-family: var(--sans);
  font-size: 16px;
  color: var(--muted);
  margin: 16px 0 28px;
  letter-spacing: 0.4px;
}

/* Flip clock */
.clock-face.is-flip .clock-digits {
  display: flex;
  align-items: center;
  gap: 6px;
  letter-spacing: 0;
  text-shadow: none;
  font-size: clamp(52px, 11vw, 150px);
}

.flip-card {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 0.72em;
  height: 1.12em;
  border-radius: 0.1em;
  background: #2b2f30;
  color: #f5f0e6;
  box-shadow: 0 6px 16px rgba(37, 44, 45, 0.28);
  perspective: 400px;
  overflow: hidden;
}

.flip-card::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 2px;
  background: rgba(245, 240, 230, 0.16);
}

.flip-card.is-flipping .flip-face {
  animation: flip-in 0.45s ease-out;
}

@keyframes flip-in {
  from { transform: rotateX(-90deg); opacity: 0.2; }
  to { transform: rotateX(0); opacity: 1; }
}

.flip-sep {
  color: var(--ink);
  padding: 0 0.04em;
}

/* Noise meter */
.noise-wrap {
  width: min(560px, 86vw);
}

.noise-label {
  font-family: var(--serif);
  font-size: clamp(28px, 5vw, 46px);
  color: var(--ink);
  margin-bottom: 18px;
}

.noise-meter {
  position: relative;
  width: 100%;
  height: 34px;
  border-radius: 9999px;
  border: 1px solid rgba(80, 72, 59, 0.35);
  background: rgba(253, 251, 247, 0.7);
  overflow: hidden;
}

.noise-fill {
  height: 100%;
  width: 0;
  background: #7d9a7a;
  transition: background-color 0.3s ease;
}

.noise-meter[data-state="rising"] .noise-fill { background: #c9a46a; }
.noise-meter[data-state="loud"] .noise-fill { background: var(--accent); }
.noise-meter[data-state="loud"] { box-shadow: 0 0 0 4px var(--accent-soft); }

.noise-limit {
  position: absolute;
  top: -2px;
  bottom: -2px;
  width: 2px;
  background: var(--ink);
}

.noise-readout {
  margin: 12px 0 14px;
}

.noise-slider {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--sans);
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 24px;
}

.noise-slider input {
  accent-color: var(--accent);
  width: 180px;
}

.noise-privacy {
  font-family: var(--sans);
  font-size: 13px;
  color: var(--muted);
  margin-top: 16px;
}

/* Chess clock */
.chess-stage {
  gap: 14px;
}

.chess-board {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  width: min(760px, 92vw);
}

.chess-side {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: clamp(150px, 32vh, 260px);
  border-radius: 20px;
  border: 1px solid rgba(80, 72, 59, 0.3);
  background: rgba(253, 251, 247, 0.72);
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
  touch-action: manipulation;
}

.chess-side:hover {
  border-color: var(--ink);
}

.chess-side.is-active {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper);
}

.chess-side.is-flagged {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.chess-time {
  font-family: var(--serif);
  font-size: clamp(48px, 8vw, 92px);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.chess-moves {
  font-family: var(--sans);
  font-size: 14px;
  opacity: 0.75;
}

@media (max-width: 640px) {
  .chess-board {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .chess-side {
    min-height: clamp(110px, 21vh, 180px);
  }

  .chess-time {
    font-size: clamp(44px, 13vw, 64px);
  }

  /* Face-to-face play on a phone: the top clock reads the right way up for the far player */
  .chess-side-top {
    transform: rotate(180deg);
  }

  .noise-slider input {
    width: 130px;
  }
}

/* Related Tools (links to sibling tool pages, under the FAQ) */
.related-tools {
  margin-top: 60px;
  border-top: 1px solid var(--line);
  padding-top: 50px;
}

.related-tools-title {
  font-size: clamp(26px, 2.6vw, 34px);
  letter-spacing: -0.8px;
  margin-bottom: 24px;
  text-align: center;
}

.related-tools-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.related-tools-list a {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-height: 44px;
  height: 100%;
  background: var(--paper-card);
  border: 1px solid var(--paper-card-border);
  border-radius: 8px;
  padding: 16px 20px;
  color: var(--ink);
  text-decoration: none;
  transition: border-color 0.2s ease;
}

.related-tools-list a:hover,
.related-tools-list a:focus-visible {
  border-color: var(--accent);
}

.related-tools-name {
  font-family: var(--serif);
  font-size: 19px;
}

.related-tools-tag {
  font-family: var(--sans);
  font-size: 13px;
  color: var(--muted);
}

.related-tools-all {
  display: block;
  width: fit-content;
  margin: 20px auto 0;
  padding: 10px 4px;
  font-family: var(--sans);
  font-size: 15px;
  color: var(--accent);
}

.related-tools-all:hover {
  color: var(--accent-hover);
}

.related-lengths-title {
  margin-top: 44px;
}

.related-lengths {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.related-lengths a,
.related-lengths span {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  font-family: var(--sans);
  font-size: 14px;
  white-space: nowrap;
}

.related-lengths a {
  background: var(--paper-card);
  border: 1px solid var(--paper-card-border);
  color: var(--ink);
  text-decoration: none;
  transition: border-color 0.2s ease;
}

.related-lengths a:hover,
.related-lengths a:focus-visible {
  border-color: var(--accent);
}

.related-lengths span {
  background: var(--accent);
  border: 1px solid var(--accent);
  color: var(--paper-card);
}

@media (max-width: 600px) {
  .related-tools-list {
    grid-template-columns: 1fr;
  }

  .related-lengths {
    gap: 6px;
  }

  .related-lengths a,
  .related-lengths span {
    min-height: 32px;
    padding: 0 10px;
    font-size: 13px;
  }
}

/* Phones: a smaller copy of the background painting (same picture, 1440px wide) */
@media (max-width: 800px) {
  .tool-viewport {
    background-image: url("/assets/tool/bg-small.webp");
  }
}

/* Breadcrumbs (above the H1) */
.breadcrumbs ol {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 4px 8px;
  list-style: none;
  padding: 0;
  margin: 0 0 14px;
  font-family: var(--sans);
  font-size: 13px;
  color: var(--muted);
}

.breadcrumbs li + li::before {
  content: "›";
  margin-right: 8px;
  color: var(--muted);
}

.breadcrumbs a {
  color: var(--muted);
  text-decoration: none;
  display: inline-block;
  padding: 6px 0;
}

.breadcrumbs a:hover {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.breadcrumbs [aria-current="page"] {
  color: var(--ink);
  padding: 6px 0;
}

/* ==========================================================================
   Scene backgrounds (pages built on the Fwocus app's own scenes)
   The page sets one picture inline; .is-dark switches the tool to light ink.
   ========================================================================== */

/* Legibility scrim between the picture and the tool */
.tool-viewport.has-scene::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    radial-gradient(ellipse 60% 55% at 50% 50%, rgba(245, 240, 230, 0.45), rgba(245, 240, 230, 0) 75%),
    linear-gradient(to bottom, rgba(245, 240, 230, 0.4), rgba(245, 240, 230, 0) 20%, rgba(245, 240, 230, 0) 80%, rgba(245, 240, 230, 0.4));
}

/* Light scenes are busier than plain paper: darker small text with a soft glow */
.tool-viewport.has-scene:not(.is-dark) {
  --muted: #4a463f;
}

.tool-viewport.has-scene:not(.is-dark) .brand-wrapper,
.tool-viewport.has-scene:not(.is-dark) .scroll-cue,
.tool-viewport.has-scene:not(.is-dark) .mode-tab-btn,
.tool-viewport.has-scene:not(.is-dark) .tool-intent,
.tool-viewport.has-scene:not(.is-dark) .countdown-status,
.tool-viewport.has-scene:not(.is-dark) .clock-date,
.tool-viewport.has-scene:not(.is-dark) .clock-period {
  text-shadow: 0 0 4px rgba(255, 255, 255, 0.9), 0 1px 14px rgba(255, 255, 255, 0.85);
}

.tool-viewport.has-scene:not(.is-dark) .mode-tab-btn,
.tool-viewport.has-scene:not(.is-dark) .scroll-cue {
  font-weight: 600;
}

.tool-viewport.has-scene.is-dark::after {
  background:
    radial-gradient(ellipse 62% 58% at 50% 50%, rgba(12, 14, 18, 0.52), rgba(12, 14, 18, 0.14) 80%),
    linear-gradient(to bottom, rgba(12, 14, 18, 0.38), rgba(12, 14, 18, 0) 24%, rgba(12, 14, 18, 0) 76%, rgba(12, 14, 18, 0.38));
}

/* Dark scenes: light ink and translucent dark cards */
.tool-viewport.is-dark {
  --paper: #1b1e22;
  --paper-card: rgba(22, 24, 28, 0.62);
  --paper-card-border: rgba(255, 255, 255, 0.14);
  --ink: #f6f1e7;
  --muted: rgba(246, 241, 231, 0.78);
  --line: rgba(255, 255, 255, 0.16);
}

.tool-viewport.is-dark .stopwatch-digits,
.tool-viewport.is-dark .pomodoro-digits,
.tool-viewport.is-dark .clock-digits {
  text-shadow: 0 2px 24px rgba(0, 0, 0, 0.45);
}

.tool-viewport.is-dark .clock-face.is-flip .clock-digits {
  text-shadow: none;
}

.tool-viewport.is-dark .tool-intent,
.tool-viewport.is-dark .clock-date,
.tool-viewport.is-dark .countdown-status,
.tool-viewport.is-dark .mode-tab-btn,
.tool-viewport.is-dark .brand-wrapper {
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.5);
}

.tool-viewport.is-dark .cycle-dot {
  border-color: var(--ink);
}

.tool-viewport.is-dark .cycle-dot.is-active {
  background: var(--ink);
}

.tool-viewport.is-dark .btn-secondary,
.tool-viewport.is-dark .btn-icon,
.tool-viewport.is-dark .btn-dock-icon {
  background: rgba(22, 24, 28, 0.5);
  border-color: rgba(255, 255, 255, 0.24);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.tool-viewport.is-dark .btn-secondary:hover:not(:disabled),
.tool-viewport.is-dark .btn-icon:hover,
.tool-viewport.is-dark .btn-dock-icon:hover {
  background: rgba(22, 24, 28, 0.78);
  border-color: rgba(255, 255, 255, 0.55);
  color: #ffffff;
}

.tool-viewport.is-dark .banner-close-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}

.tool-viewport.is-dark .banner-thumb {
  border-color: rgba(255, 255, 255, 0.15);
}

.tool-viewport.is-dark .visual-disc {
  border-color: rgba(246, 241, 231, 0.7);
  background: conic-gradient(var(--accent) calc(var(--frac, 1) * 1turn), rgba(246, 241, 231, 0.16) 0);
  box-shadow: 0 6px 22px rgba(0, 0, 0, 0.3);
}

.tool-viewport.is-dark .visual-disc-center {
  border-color: rgba(246, 241, 231, 0.7);
}

.tool-viewport.is-dark .hourglass .hg-glass,
.tool-viewport.is-dark .hourglass .hg-cap {
  fill: rgba(246, 241, 231, 0.12);
}

/* ==========================================================================
   Widget tools: planner, palette, quotes, notepad (Phase 4)
   A paper card over the scene. Every color comes from the ink variables,
   so .is-dark scenes switch the cards to light ink automatically.
   ========================================================================== */

.tool-viewport {
  --widget-card: rgba(253, 251, 247, 0.9);
  --field-bg: rgba(255, 255, 255, 0.74);
  --field-border: rgba(80, 72, 59, 0.26);
  --soft-bg: rgba(80, 72, 59, 0.055);
  --soft-bg-strong: rgba(80, 72, 59, 0.11);
  --sticky-bg: #faf7f1;
  --chip-ink: #2a2724;
  --accent-ink: var(--accent);
  --hover-ink: var(--accent);
  --hover-border: var(--accent);
  --card-shadow: 0 14px 40px rgba(37, 44, 45, 0.12);
}

.tool-viewport.is-dark {
  --widget-card: rgba(20, 22, 26, 0.76);
  --field-bg: rgba(255, 255, 255, 0.08);
  --field-border: rgba(255, 255, 255, 0.22);
  --soft-bg: rgba(255, 255, 255, 0.06);
  --soft-bg-strong: rgba(255, 255, 255, 0.12);
  --sticky-bg: #24272c;
  --accent-ink: #f2a08a;
  --hover-ink: var(--ink);
  --hover-border: rgba(255, 255, 255, 0.6);
  --card-shadow: 0 14px 40px rgba(0, 0, 0, 0.32);
}

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

/* Card */
.widget-stage {
  padding: 8px 24px 44px;
}

.widget-card {
  position: relative;
  width: min(1080px, 100%);
  text-align: left;
  color: var(--ink);
  background: var(--widget-card);
  border: 1px solid var(--paper-card-border);
  border-radius: 18px;
  box-shadow: var(--card-shadow);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  padding: 22px 26px 16px;
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.45;
}

.tool-viewport.is-dark .widget-card {
  color-scheme: dark;
}

.planner[data-mode="list"],
.planner[data-mode="todo"] {
  width: min(760px, 100%);
}

.planner[data-mode="exam"],
.planner[data-mode="log"],
.planner[data-mode="timeline"] {
  width: min(880px, 100%);
}

.widget-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px 16px;
  margin-bottom: 16px;
}

.widget-title {
  font-family: var(--serif);
  font-size: 26px;
  font-weight: 400;
  letter-spacing: -0.4px;
  line-height: 1.15;
}

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

.widget-actions [hidden] {
  display: none;
}

.widget-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px 16px;
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.widget-note {
  font-size: 12px;
  color: var(--muted);
}

.widget-cta {
  font-size: 13px;
  font-weight: 600;
  color: var(--accent-ink);
}

.widget-cta:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.widget-empty {
  padding: 18px 8px;
  text-align: center;
  font-family: var(--serif);
  font-size: 15px;
  font-style: italic;
  color: var(--muted);
}

/* Buttons */
.pill-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 36px;
  padding: 0 16px;
  border-radius: 9999px;
  border: 1px solid var(--field-border);
  background: var(--field-bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  text-decoration: none;
  transition: border-color 0.15s ease, background-color 0.15s ease, color 0.15s ease, transform 0.1s ease;
}

.pill-btn:hover {
  border-color: var(--hover-border);
  color: var(--hover-ink);
}

.pill-btn.is-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(185, 65, 45, 0.25);
}

.pill-btn.is-primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  color: #ffffff;
  transform: translateY(-1px);
}

.pill-btn.is-quiet {
  background: transparent;
}

.pill-btn.is-armed {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent-ink);
}

.pill-btn.is-small {
  min-height: 30px;
  padding: 0 12px;
  font-size: 12px;
}

.picon {
  display: inline-flex;
}

.picon svg,
.pill-btn svg {
  width: 16px;
  height: 16px;
}

.picon svg polygon {
  fill: currentColor;
}

.picon-btn {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: var(--muted);
  transition: background-color 0.15s ease, color 0.15s ease;
}

.picon-btn:hover {
  background: var(--soft-bg-strong);
  color: var(--ink);
}

.picon-btn.is-delete:hover {
  color: var(--accent-ink);
}

/* Form fields */
.planner-form {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 10px 12px;
  margin-bottom: 14px;
}

.pfield {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.pfield.is-grow {
  flex: 1 1 200px;
}

.pfield.is-narrow input {
  width: 92px;
}

.pfield-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--muted);
}

.widget-card input[type="text"],
.widget-card input[type="date"],
.widget-card input[type="time"],
.widget-card input[type="number"],
.widget-card select {
  min-height: 38px;
  padding: 7px 11px;
  border-radius: 10px;
  border: 1px solid var(--field-border);
  background: var(--field-bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.2;
}

.widget-card input::placeholder,
.widget-card textarea::placeholder {
  color: var(--muted);
  opacity: 0.85;
}

.widget-card input:focus-visible,
.widget-card select:focus-visible,
.widget-card textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.pcheck {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  flex-shrink: 0;
  accent-color: var(--accent);
  cursor: pointer;
}

.pchip {
  display: inline-flex;
  align-items: center;
  padding: 1px 9px;
  border-radius: 9999px;
  color: var(--chip-ink);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.6;
}

/* Planner: lists (assignments, to-do, deadlines) */
.psummary {
  margin: -2px 0 10px;
  font-size: 13px;
  color: var(--muted);
}

.pscroll {
  max-height: min(46vh, 430px);
  overflow-y: auto;
  overscroll-behavior: contain;
  margin: 0 -6px;
  padding: 0 6px;
}

.plist {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.pitem {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 8px 10px 12px;
  border-radius: 12px;
  background: var(--soft-bg);
  border: 1px solid transparent;
}

.pitem:hover {
  border-color: var(--line);
}

.pitem-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.pitem-text {
  font-family: var(--serif);
  font-size: 16px;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.pitem.is-done .pitem-text {
  text-decoration: line-through;
  color: var(--muted);
}

.pitem-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
  font-size: 12px;
  color: var(--muted);
}

.pdue {
  font-weight: 600;
}

.pitem.is-soon .pdue {
  color: var(--ink);
}

.pitem.is-overdue .pdue {
  color: var(--accent-ink);
}

.pdone {
  margin-top: 12px;
}

.pdone summary {
  width: fit-content;
  padding: 6px 2px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
}

.pdone .plist {
  margin-top: 6px;
}

.ptimer {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 0 12px;
  border-radius: 9999px;
  border: 1px solid var(--field-border);
  background: var(--field-bg);
  color: var(--ink);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
}

.ptimer .picon svg {
  width: 11px;
  height: 11px;
}

.ptimer:hover {
  border-color: var(--hover-border);
  color: var(--hover-ink);
}

.ptimer.is-running,
.ptimer.is-running:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

.ptimer.is-running .picon svg rect {
  fill: currentColor;
}

.pmeta-note {
  font-variant-numeric: tabular-nums;
}

.ptype {
  padding: 1px 8px;
  border-radius: 6px;
  background: var(--chip);
  color: var(--chip-ink);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.4px;
  text-transform: uppercase;
}

/* Planner: previous / next navigation */
.pnav {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.pnav .picon-btn {
  border: 1px solid var(--field-border);
  background: var(--field-bg);
}

.pnav-label {
  display: flex;
  flex-direction: column;
  min-width: 150px;
  text-align: center;
  line-height: 1.25;
}

.pnav-label strong {
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 400;
}

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

/* Planner: week */
.week-strip {
  display: none;
}

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

.week-day {
  display: flex;
  flex-direction: column;
  min-height: 250px;
  padding: 10px 8px 8px;
  border-radius: 12px;
  background: var(--soft-bg);
  border: 1px solid var(--line);
}

.planner.is-pastel .week-day {
  background: color-mix(in srgb, var(--day-tint) 34%, transparent);
}

.week-day.is-today {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent);
}

.week-day-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 0 4px 8px;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--line);
}

.week-day-head span {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--muted);
}

.week-day-head strong {
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 400;
  line-height: 1;
}

.week-day.is-today .week-day-head strong {
  color: var(--accent-ink);
}

.week-items {
  list-style: none;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.week-item {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  padding: 4px 2px 4px 4px;
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.3;
}

.week-item:hover {
  background: var(--soft-bg-strong);
}

.week-item .pcheck {
  width: 15px;
  height: 15px;
  margin-top: 1px;
}

.week-item-text {
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
}

.week-item.is-done .week-item-text {
  text-decoration: line-through;
  color: var(--muted);
}

.week-item .picon-btn {
  width: 22px;
  height: 22px;
  opacity: 0;
}

.week-item .picon-btn svg {
  width: 13px;
  height: 13px;
}

.week-item:hover .picon-btn,
.week-item .picon-btn:focus-visible {
  opacity: 1;
}

@media (hover: none) {
  .week-item .picon-btn {
    opacity: 0.75;
  }
}

.week-add {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-top: 6px;
}

.widget-card .week-add input[type="text"] {
  flex: 1;
  min-width: 0;
  min-height: 32px;
  padding: 5px 8px;
  border-radius: 8px;
  font-size: 13px;
}

.week-add .picon-btn {
  width: 30px;
  height: 30px;
}

/* Planner: time grid (timetable and timeline) */
.tform-btns {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pswatches {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.pswatch-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 3px;
  min-height: 38px;
}

.pswatch {
  position: relative;
  display: inline-flex;
  padding: 2px;
  cursor: pointer;
}

.pswatch input {
  position: absolute;
  inset: 0;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.pswatch-dot {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid transparent;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.08);
}

.pswatch input:checked + .pswatch-dot {
  border-color: var(--ink);
  box-shadow: inset 0 0 0 2px var(--sticky-bg);
}

.pswatch input:focus-visible + .pswatch-dot {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.tgrid-scroll {
  max-height: min(46vh, 520px);
  overflow: auto;
  overscroll-behavior: contain;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--soft-bg);
}

.tgrid {
  --hour-h: 46px;
  --gutter: 58px;
  min-width: calc(var(--gutter) + var(--cols) * 96px);
}

.tgrid.is-single {
  --hour-h: 54px;
  min-width: 0;
}

.tgrid-head,
.tgrid-body {
  display: grid;
  grid-template-columns: var(--gutter) repeat(var(--cols), minmax(0, 1fr));
}

.tgrid-head {
  position: sticky;
  top: 0;
  z-index: 3;
  background: var(--sticky-bg);
  border-bottom: 1px solid var(--line);
}

.tgrid-day {
  padding: 9px 6px;
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--muted);
}

.tgrid-day.is-today {
  color: var(--accent-ink);
}

.tgrid-times {
  position: relative;
  height: calc(var(--hours) * var(--hour-h));
}

.tgrid-times span {
  position: absolute;
  right: 8px;
  top: calc(var(--at) * var(--hour-h) + 3px);
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
}

.tgrid-col {
  position: relative;
  height: calc(var(--hours) * var(--hour-h));
  border-left: 1px solid var(--line);
  background-image: repeating-linear-gradient(to bottom, var(--line) 0, var(--line) 1px, transparent 1px, transparent var(--hour-h));
  cursor: copy;
}

.tgrid-col.is-today {
  background-color: var(--accent-soft);
}

.tgrid.is-single .tgrid-col.is-today {
  background-color: transparent;
}

.tblock {
  position: absolute;
  z-index: 1;
  top: calc(var(--top) * var(--hour-h) + 1px);
  left: calc(var(--lane) / var(--lanes) * 100% + 3px);
  width: calc(100% / var(--lanes) - 6px);
  height: calc(var(--len) * var(--hour-h) - 3px);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
  overflow: hidden;
  padding: 5px 8px;
  border-radius: 9px;
  color: var(--chip-ink);
  font-size: 11.5px;
  line-height: 1.25;
  text-align: left;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.14);
  cursor: pointer;
  transition: box-shadow 0.15s ease;
}

.tblock strong {
  max-width: 100%;
  font-size: 12.5px;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.tblock span {
  max-width: 100%;
  opacity: 0.8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tblock.is-short {
  flex-direction: row;
  align-items: center;
  gap: 6px;
  padding-top: 1px;
  padding-bottom: 1px;
}

.tblock.is-short strong {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tblock:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.tblock.is-editing {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.tblock:focus-visible {
  z-index: 2;
}

.tgrid.is-single .tblock {
  font-size: 12.5px;
}

.tgrid.is-single .tblock strong {
  font-size: 14px;
}

.tgrid-now {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(var(--top) * var(--hour-h));
  z-index: 2;
  height: 2px;
  background: var(--accent);
  pointer-events: none;
}

.tgrid-now::before {
  content: "";
  position: absolute;
  left: -4px;
  top: -3px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
}

/* Planner: exam plan */
.exam-setup {
  margin-bottom: 4px;
}

.planner-form.is-settings {
  margin-bottom: 12px;
}

.exam-subjects {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
}

.exam-subject {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 6px 6px 12px;
  border-radius: 12px;
  background: var(--soft-bg);
}

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

.exam-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}

.exam-split {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.exam-days {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.exam-day {
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--soft-bg);
  border: 1px solid transparent;
}

.exam-day.is-today {
  border-color: var(--accent);
}

.exam-day.is-past {
  opacity: 0.6;
}

.exam-day-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  margin-bottom: 6px;
}

.exam-day-head strong {
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 400;
}

.exam-badge {
  padding: 1px 10px;
  border-radius: 9999px;
  background: var(--accent);
  color: #ffffff;
  font-size: 12px;
  font-weight: 700;
}

.exam-sessions {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.exam-session {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 32px;
  padding: 3px 12px 3px 8px;
  border-radius: 9999px;
  background: var(--chip);
  color: var(--chip-ink);
  font-size: 13px;
  cursor: pointer;
}

.exam-session .pcheck {
  width: 15px;
  height: 15px;
  margin: 0;
}

.exam-session-name {
  font-weight: 700;
}

.exam-session-len {
  font-size: 12px;
  opacity: 0.75;
}

.exam-session.is-done {
  opacity: 0.55;
}

.exam-session.is-done .exam-session-name {
  text-decoration: line-through;
}

/* Planner: study log */
.log-tracker.is-running {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  margin-bottom: 14px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--accent);
  background: var(--accent-soft);
}

.log-live {
  flex: 1;
  font-family: var(--serif);
  font-size: 32px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.log-stats {
  display: grid;
  grid-template-columns: minmax(0, 190px) minmax(0, 1fr) minmax(0, 220px);
  align-items: center;
  gap: 18px;
  margin-bottom: 12px;
  padding: 14px 16px;
  border-radius: 14px;
  background: var(--soft-bg);
}

.log-total strong {
  display: block;
  font-family: var(--serif);
  font-size: 32px;
  font-weight: 400;
  line-height: 1.1;
}

.log-total span {
  display: block;
  font-size: 13px;
  color: var(--muted);
}

.log-diff {
  margin-top: 4px;
}

.log-bars {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.log-bars li {
  display: grid;
  grid-template-columns: minmax(64px, 110px) minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}

.log-bar-name {
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.log-bar {
  height: 10px;
  border-radius: 9999px;
  background: var(--soft-bg-strong);
  overflow: hidden;
}

.log-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
}

.log-bar-value {
  font-size: 12px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.log-days {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  align-items: end;
  gap: 6px;
  height: 96px;
}

.log-day {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  height: 100%;
}

.log-day-bar {
  flex: 1;
  display: flex;
  align-items: flex-end;
  width: 100%;
  max-width: 22px;
  border-radius: 6px;
  background: var(--soft-bg-strong);
  overflow: hidden;
}

.log-day-bar span {
  width: 100%;
  background: var(--accent);
}

.log-day-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
}

.log-day.is-today .log-day-label {
  color: var(--accent-ink);
}

.log-list .pitem {
  align-items: center;
}

.log-list-date {
  min-width: 96px;
  font-size: 12px;
  color: var(--muted);
}

/* Planner: semester overview */
.term-progress {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 20px;
  margin: 2px 0 12px;
}

.term-progress-text {
  display: flex;
  flex-direction: column;
  flex: 1 1 260px;
}

.term-progress-text strong {
  font-family: var(--serif);
  font-size: 19px;
  font-weight: 400;
}

.term-progress-text span {
  font-size: 13px;
  color: var(--muted);
}

.term-bar {
  flex: 1 1 240px;
  height: 10px;
  border-radius: 9999px;
  background: var(--soft-bg-strong);
  overflow: hidden;
}

.term-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
}

.term-weeks {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}

.term-week {
  min-height: 72px;
  padding: 9px 10px;
  border-radius: 12px;
  background: var(--soft-bg);
  border: 1px solid var(--line);
}

.term-week.is-current {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent);
}

.term-week.is-past {
  opacity: 0.55;
}

.term-week-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 6px;
}

.term-week-head strong {
  font-family: var(--serif);
  font-size: 15px;
  font-weight: 400;
}

.term-week-head span {
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
}

.term-chips {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.term-chip {
  padding: 2px 7px;
  border-radius: 6px;
  background: var(--chip);
  color: var(--chip-ink);
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.term-chip.is-done {
  opacity: 0.5;
  text-decoration: line-through;
}

.term-more {
  padding-left: 4px;
  font-size: 11px;
  color: var(--muted);
}

.term-legend {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  margin-bottom: 14px;
  font-size: 12px;
  color: var(--muted);
}

.term-legend li {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.term-legend li::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 3px;
  background: var(--chip);
}

/* Palette */
.palette {
  width: min(980px, 100%);
}

.palette-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.palette-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 0 14px 0 8px;
  border-radius: 9999px;
  border: 1px solid var(--field-border);
  background: var(--field-bg);
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}

.palette-tab:hover {
  border-color: var(--hover-border);
}

.palette-tab.is-active {
  border-color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--ink);
}

.palette-tab-strip {
  display: inline-flex;
  overflow: hidden;
  border-radius: 9999px;
}

.palette-tab-strip span {
  width: 8px;
  height: 20px;
}

.palette-chips {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.palette-chip {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 7px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--field-bg);
  text-align: left;
  transition: transform 0.12s ease, border-color 0.15s ease;
}

.palette-chip:hover {
  transform: translateY(-2px);
  border-color: var(--hover-border);
}

.palette-event {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: 74px;
  padding: 10px 12px;
  border-radius: 9px;
  background: var(--chip);
  color: var(--chip-ink);
  line-height: 1.3;
}

.palette-event strong {
  font-size: 14px;
}

.palette-event span {
  font-size: 12px;
  opacity: 0.85;
}

.palette-chip-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 4px 2px;
}

.palette-hex {
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.3px;
  color: var(--ink);
}

.palette-copy-icon {
  color: var(--muted);
}

.palette-copy-icon svg {
  width: 16px;
  height: 16px;
}

.palette-help {
  margin-top: 14px;
  font-size: 13px;
  line-height: 1.55;
  color: var(--muted);
}

.palette-help strong {
  color: var(--ink);
}

/* Palette: month view (aesthetic calendar) */
.palette[data-view="month"] {
  width: min(1080px, 100%);
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
  column-gap: 22px;
  align-items: start;
}

.palette[data-view="month"] > .widget-head,
.palette[data-view="month"] > .palette-tabs,
.palette[data-view="month"] > .palette-help,
.palette[data-view="month"] > .widget-foot {
  grid-column: 1 / -1;
}

.palette[data-view="month"] .palette-chips {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.palette[data-view="month"] .palette-event {
  min-height: 46px;
  padding: 7px 10px;
}

.palette-month-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.palette-month-head strong {
  font-family: var(--serif);
  font-size: 19px;
  font-weight: 400;
}

.palette-month-head .picon-btn {
  border: 1px solid var(--field-border);
  background: var(--field-bg);
}

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

.palette-month-wd {
  padding: 2px 0 4px;
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--muted);
}

.palette-month-cell {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-height: 62px;
  padding: 4px;
  overflow: hidden;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--field-bg);
}

.palette-month-cell.is-blank {
  border-color: transparent;
  background: transparent;
}

.palette-month-cell.is-today {
  border-color: var(--accent);
}

.palette-month-num {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
}

.palette-month-cell.is-today .palette-month-num {
  color: var(--accent-ink);
}

.palette-month-event {
  padding: 0 5px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 600;
  line-height: 1.55;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Quotes */
.quote-card {
  width: min(720px, 100%);
  padding: 30px 40px 20px;
  text-align: center;
}

.quote-label {
  margin-bottom: 18px;
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--muted);
}

.quote-figure {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  min-height: 220px;
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.quote-figure.is-changing {
  opacity: 0;
  transform: translateY(6px);
}

.quote-text {
  font-family: var(--serif);
  font-size: clamp(24px, 2.5vw, 33px);
  line-height: 1.36;
  letter-spacing: -0.3px;
  color: var(--ink);
  text-wrap: balance;
}

.quote-text.is-long {
  font-size: clamp(20px, 2vw, 26px);
}

.quote-cite {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.quote-cite::before {
  content: "";
  width: 40px;
  height: 2px;
  margin-bottom: 10px;
  background: var(--accent);
}

.quote-author {
  font-size: 15px;
  font-weight: 700;
}

.quote-source {
  font-family: var(--serif);
  font-size: 14px;
  font-style: italic;
  color: var(--muted);
}

.quote-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 26px;
}

.quote-actions #quote-prev {
  width: 36px;
  padding: 0;
}

.quote-count {
  margin-top: 12px;
  font-size: 12px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

/* Notepad */
.notepad {
  width: min(780px, 100%);
}

.note-text {
  display: block;
  width: 100%;
  min-height: min(46vh, 420px);
  padding: 14px 18px;
  resize: vertical;
  border-radius: 12px;
  border: 1px solid var(--field-border);
  background-color: var(--field-bg);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 18px;
  line-height: 32px;
}

.notepad[data-style="lined"] .note-text {
  background-image: linear-gradient(to bottom, transparent 31px, var(--line) 31px, var(--line) 32px);
  background-size: 100% 32px;
  background-position: 0 14px;
  background-attachment: local;
}

.note-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 4px 12px;
  margin-top: 8px;
  font-size: 12px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

/* Widgets on tablets and phones */
@media (max-width: 800px) {
  .palette[data-view="month"] {
    display: block;
  }

  .palette[data-view="month"] .palette-month {
    margin-bottom: 14px;
  }

  .log-stats {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 700px) {
  .week-strip {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 4px;
    margin-bottom: 10px;
  }

  .week-strip-btn {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 6px 0 5px;
    border-radius: 10px;
    border: 1px solid var(--line);
    background: var(--soft-bg);
    color: var(--muted);
    font-size: 11px;
    font-weight: 600;
    line-height: 1.2;
  }

  .week-strip-btn strong {
    font-family: var(--serif);
    font-size: 16px;
    font-weight: 400;
    color: var(--ink);
  }

  .week-strip-btn em {
    position: absolute;
    top: 2px;
    right: 4px;
    font-size: 9px;
    font-style: normal;
  }

  .week-strip-btn.is-today {
    border-color: var(--accent);
  }

  .week-strip-btn.is-active,
  .week-strip-btn.is-active strong {
    background: var(--accent);
    border-color: var(--accent);
    color: #ffffff;
  }

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

  .week-day {
    display: none;
    min-height: 200px;
  }

  .week-day.is-shown {
    display: flex;
  }

  .week-item {
    font-size: 15px;
    padding: 6px 4px;
  }

  .week-item .picon-btn {
    width: 30px;
    height: 30px;
    opacity: 0.75;
  }
}

@media (max-width: 600px) {
  .widget-stage {
    padding: 4px 12px 32px;
  }

  .widget-card {
    padding: 16px 14px 12px;
    border-radius: 16px;
  }

  .widget-title {
    font-size: 22px;
  }

  .widget-head {
    margin-bottom: 12px;
  }

  .widget-actions .pill-btn {
    min-height: 34px;
    padding: 0 12px;
  }

  .planner-form > .pfield {
    flex: 1 1 calc(50% - 6px);
  }

  .planner-form > .pfield.is-grow,
  .planner-form > .pfield.is-full,
  .planner-form > .pswatches,
  .planner-form > .tform-btns {
    flex: 1 1 100%;
  }

  .widget-card input[type="text"],
  .widget-card input[type="date"],
  .widget-card input[type="time"],
  .widget-card input[type="number"],
  .widget-card select {
    width: 100%;
    font-size: 16px;
  }

  .widget-card .week-add input[type="text"] {
    font-size: 16px;
  }

  .planner-form > .pill-btn {
    flex: 1 1 auto;
  }

  .pscroll {
    max-height: none;
    overflow: visible;
  }

  .pitem {
    flex-wrap: wrap;
  }

  .pitem .ptimer {
    margin-left: 28px;
  }

  .pnav-label {
    flex: 1;
    min-width: 0;
  }

  .tgrid {
    --gutter: 40px;
    --hour-h: 44px;
    min-width: calc(var(--gutter) + var(--cols) * 60px);
  }

  .tgrid-times span {
    right: 4px;
    font-size: 10px;
  }

  .tgrid-day {
    padding: 8px 2px;
    font-size: 11px;
  }

  .tblock {
    padding: 3px 5px;
    font-size: 10.5px;
  }

  .tblock strong {
    font-size: 11.5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .exam-subject {
    flex-wrap: wrap;
    padding: 8px;
  }

  .exam-subject .pfield.is-grow {
    flex-basis: calc(100% - 28px);
  }

  .exam-subject .pfield:not(.is-grow) {
    flex: 1 1 40%;
  }

  .log-tracker.is-running .log-live {
    flex-basis: 100%;
    order: -1;
  }

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

  .palette-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    margin: 0 -14px 14px;
    padding: 0 14px 4px;
    scrollbar-width: none;
  }

  .palette-tabs::-webkit-scrollbar {
    display: none;
  }

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

  .palette-event {
    min-height: 56px;
  }

  .palette-month-cell {
    min-height: 44px;
    padding: 3px;
  }

  .palette-month-event {
    height: 5px;
    padding: 0;
    font-size: 0;
  }

  .quote-card {
    padding: 22px 18px 16px;
  }

  .quote-figure {
    min-height: 230px;
  }

  .quote-text {
    font-size: 22px;
  }

  .quote-text.is-long {
    font-size: 19px;
  }

  .note-text {
    min-height: 52vh;
    font-size: 17px;
    padding: 12px 14px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .quote-figure,
  .palette-chip,
  .pill-btn {
    transition: none;
  }
}
