@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@300;400;500&display=swap');

:root {
  --ink: #252525;
  --muted: #858585;
  --line: #cfcfcf;
  --soft: #f0f1ee;
  --accent: #344d3b;
  --page-width: 80%;
  --max-width: 1400px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: #fff;
  color: var(--ink);
  font-family: 'Montserrat', Arial, sans-serif;
  font-weight: 300;
}
button, input, select { font: inherit; }
button, a, select { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
button { color: inherit; }
.site-header {
  min-height: 76px;
  padding: 0 10%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  z-index: 5;
  background: #fff;
}
.brand { font-size: 25px; letter-spacing: 2.5px; white-space: nowrap; }
.top-nav { display: flex; align-items: center; gap: 34px; font-size: 14px; letter-spacing: 1px; }
.top-nav a, .menu-toggle { transition: opacity .2s; }
.top-nav a:hover, .menu-toggle:hover { opacity: .55; }
.menu-toggle { border: 0; background: transparent; cursor: pointer; letter-spacing: 1px; padding: 8px 0; }
.menu-toggle span { font-size: 19px; margin-left: 5px; }
.mobile-menu {
  position: absolute;
  top: 65px;
  right: 10%;
  width: 210px;
  padding: 15px 20px;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: 0 8px 25px rgba(0,0,0,.06);
}
.mobile-menu a { display: block; padding: 10px 0; font-size: 12px; letter-spacing: 1px; }
.mobile-menu[hidden] { display: none; }

.learning-dashboard {
  width: var(--page-width);
  max-width: var(--max-width);
  margin: 35px auto 50px;
  padding: 25px 0;
  display: grid;
  grid-template-columns: 1.25fr 1fr .95fr;
  gap: 28px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.dashboard-panel { min-width: 0; }
.panel-heading { min-height: 43px; display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 20px; }
.eyebrow { margin: 0; color: var(--muted); font-size: 10px; letter-spacing: 1.5px; }
.panel-heading h2 { margin: 7px 0 0; font-size: 17px; font-weight: 300; letter-spacing: .4px; }
.panel-note { color: var(--muted); font-size: 10px; letter-spacing: 1px; padding-top: 3px; }
.weekly-chart { height: 125px; display: flex; justify-content: space-around; align-items: stretch; gap: 12px; }
.chart-day { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 8px; }
.chart-track { width: 100%; height: 100px; background: #f0f1ee; display: flex; align-items: flex-end; }
.chart-fill { width: 100%; min-height: 0; background: #b9c2b7; transition: height .25s ease; }
.chart-day.today .chart-fill { background: var(--accent); }
.chart-day span { color: var(--muted); font-size: 9px; letter-spacing: .5px; }
.chart-caption { margin: 10px 0 0; color: var(--muted); font-size: 9px; }
.calendar-heading { display: block; }
.calendar-controls { display: flex; align-items: center; justify-content: space-between; margin-top: 12px; }
.calendar-controls strong { font-size: 12px; font-weight: 400; letter-spacing: .7px; }
.calendar-controls button { width: 25px; height: 23px; border: 1px solid transparent; background: transparent; cursor: pointer; font-size: 19px; line-height: 1; }
.calendar-controls button:hover { border-color: var(--line); }
.calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; text-align: center; }
.calendar-cell { min-height: 27px; display: flex; align-items: center; justify-content: center; position: relative; font-size: 10px; color: #555; }
.calendar-cell.weekday { min-height: 20px; color: #999; font-size: 8px; letter-spacing: .3px; }
.calendar-cell.learned:not(.today)::after { content: ''; position: absolute; bottom: 1px; width: 4px; height: 4px; border-radius: 50%; background: #91a18f; }
.calendar-cell.today { color: #fff; background: var(--accent); }
.calendar-cell.today.learned::after { content: ''; position: absolute; bottom: 1px; width: 4px; height: 4px; border-radius: 50%; background: #fff; }
.calendar-legend { display: flex; gap: 14px; margin-top: 12px; color: var(--muted); font-size: 9px; }
.calendar-legend span { display: flex; align-items: center; gap: 5px; }
.legend-dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; }
.legend-dot.learned { background: #91a18f; }
.legend-dot.today-dot { background: var(--accent); }
.time-panel { padding-left: 25px; border-left: 1px solid var(--line); }
.time-number { margin: 7px 0 2px; font-size: 34px; font-weight: 300; letter-spacing: -.8px; font-variant-numeric: tabular-nums; }
.muted, .remaining-time { margin: 0; color: var(--muted); font-size: 10px; }
.time-divider { margin: 17px 0; border-top: 1px solid #e0e0e0; }
.goal-number { margin: 7px 0 9px; font-size: 24px; font-weight: 300; font-variant-numeric: tabular-nums; }
.goal-number strong { font-weight: 300; }
.goal-number span { color: var(--muted); font-size: 11px; }
.goal-progress { height: 5px; width: 100%; background: #ededeb; }
.goal-progress div { height: 100%; width: 0; background: var(--accent); transition: width .25s; }
.remaining-time { margin-top: 8px; }
.timer-actions { display: flex; gap: 8px; margin-top: 13px; }
.timer-actions button { min-height: 32px; padding: 0 10px; cursor: pointer; font-size: 9px; letter-spacing: .5px; }
.button-dark { border: 1px solid var(--accent); background: var(--accent); color: #fff; }
.button-light { border: 1px solid #999; background: #fff; }
.timer-actions button:hover { opacity: .75; }
.goal-setting { display: flex; align-items: center; gap: 9px; margin-top: 12px; color: var(--muted); font-size: 9px; letter-spacing: 1px; }
.goal-setting select { border: 0; background: transparent; color: var(--ink); font-size: 9px; cursor: pointer; }
.timer-status { margin: 9px 0 0; color: var(--muted); font-size: 9px; letter-spacing: 1px; }

.category-nav { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; width: 90%; margin: 0 auto 75px; }
.category-nav a { padding: 10px 17px; border: 1px solid #999; font-size: 12px; letter-spacing: .4px; transition: background .2s, color .2s; }
.category-nav a:hover, .category-nav a.active { background: var(--ink); color: #fff; border-color: var(--ink); }

.search-section { width: var(--page-width); max-width: var(--max-width); margin: 0 auto; }
.filters { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; }
.filters select, .filters input { width: 100%; min-width: 0; height: 49px; padding: 0 11px; border: 1px solid #777; border-radius: 0; background: #fff; color: #444; font-size: 10px; letter-spacing: .5px; }
.search-bar { display: grid; grid-template-columns: 1fr 135px 110px; gap: 12px; margin-top: 13px; }
.search-bar input, .search-bar button { height: 55px; border: 1px solid #555; border-radius: 0; background: #fff; padding: 0 22px; }
.search-bar input { min-width: 0; font-size: 17px; letter-spacing: 1px; }
.search-bar input::placeholder { color: #888; }
.search-bar button { cursor: pointer; font-size: 12px; letter-spacing: .5px; }
.search-button { color: #c94b4b; }
.search-bar button:hover { background: var(--ink); color: #fff; }

.archive-intro { width: var(--page-width); max-width: var(--max-width); margin: 25px auto 55px; padding-top: 24px; border-top: 1px solid var(--line); display: grid; grid-template-columns: 1fr 2fr; gap: 35px; }
.archive-intro small { color: var(--muted); font-size: 10px; letter-spacing: 1px; }
.archive-intro h1 { margin: 6px 0 0; font-size: 29px; font-weight: 300; letter-spacing: .3px; }
.archive-intro p { max-width: 800px; margin: 0; font-size: 16px; line-height: 1.65; color: #444; }
.results-section { width: var(--page-width); max-width: var(--max-width); margin: 0 auto 80px; }
.results-heading { display: flex; justify-content: space-between; align-items: baseline; gap: 15px; padding-bottom: 15px; margin-bottom: 25px; border-bottom: 1px solid #ddd; }
.results-heading h2 { margin: 0; font-size: 20px; font-weight: 300; }
.results-heading span { color: var(--muted); font-size: 9px; letter-spacing: 1px; }
.result-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 35px 24px; }
.result-card { min-width: 0; cursor: pointer; }
.result-card img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: var(--soft); }
.image-placeholder { width: 100%; aspect-ratio: 4 / 3; display: flex; align-items: center; justify-content: center; background: #f0f1ee; color: #999; font-size: 11px; letter-spacing: 1px; }
.result-card small { display: block; margin-top: 13px; color: var(--muted); font-size: 9px; letter-spacing: .8px; }
.result-card h3 { margin: 8px 0 5px; font-size: 17px; font-weight: 400; }
.result-card p { margin: 0; color: #777; font-size: 11px; line-height: 1.6; }
.result-card:hover h3 { text-decoration: underline; text-underline-offset: 4px; }
.empty-state { grid-column: 1 / -1; padding: 35px 0; color: var(--muted); font-size: 13px; }

.document-page { width: var(--page-width); max-width: 1100px; margin: 15px auto 90px; }
.back-link { display: inline-block; margin: 0 0 35px; color: var(--muted); font-size: 10px; letter-spacing: 1px; }
.document-meta { color: var(--muted); font-size: 10px; letter-spacing: 1px; }
.document-page h1 { margin: 12px 0; font-size: clamp(32px, 5vw, 55px); font-weight: 300; }
.document-description { max-width: 750px; color: #666; font-size: 15px; line-height: 1.7; }
.document-body { max-width: 850px; margin-top: 45px; line-height: 1.8; }
.document-body h2 { margin: 35px 0 15px; font-size: 20px; font-weight: 400; }
.vocab-row { display: grid; grid-template-columns: 1fr 1fr 1.5fr; gap: 15px; padding: 12px 0; border-bottom: 1px solid #e5e5e5; font-size: 13px; }
.vocab-row strong { font-weight: 500; }
.expression { padding: 15px 0; border-bottom: 1px solid #e5e5e5; }
.expression strong { font-size: 17px; font-weight: 400; }
.expression p { margin: 4px 0; color: #777; font-size: 13px; }
.document-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 25px; }
.document-tags span { padding: 6px 10px; border: 1px solid #ddd; color: #777; font-size: 10px; }
.site-footer { display: flex; justify-content: space-between; gap: 20px; padding: 22px 10%; border-top: 1px solid var(--line); color: var(--muted); font-size: 9px; letter-spacing: 1px; }

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

@media (max-width: 1050px) {
  :root { --page-width: 88%; }
  .learning-dashboard { grid-template-columns: 1fr 1fr; }
  .time-panel { grid-column: 1 / -1; padding: 22px 0 0; border-left: 0; border-top: 1px solid var(--line); }
  .filters { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 650px) {
  :root { --page-width: 90%; }
  .site-header { min-height: 68px; padding: 12px 5%; align-items: flex-start; flex-direction: column; gap: 12px; }
  .brand { font-size: 19px; }
  .top-nav { width: 100%; justify-content: space-between; gap: 12px; font-size: 11px; }
  .mobile-menu { top: 95px; right: 5%; }
  .learning-dashboard { grid-template-columns: 1fr; gap: 28px; margin-top: 20px; }
  .time-panel { grid-column: auto; }
  .category-nav { width: 90%; margin-bottom: 45px; gap: 7px; }
  .category-nav a { padding: 9px 11px; font-size: 10px; }
  .filters { grid-template-columns: 1fr 1fr; gap: 8px; }
  .filters select, .filters input { height: 43px; font-size: 9px; }
  .search-bar { grid-template-columns: 1fr 1fr; gap: 8px; }
  .search-bar input { grid-column: 1 / -1; height: 48px; font-size: 14px; }
  .search-bar button { height: 43px; }
  .archive-intro { grid-template-columns: 1fr; gap: 15px; margin-bottom: 40px; }
  .archive-intro p { font-size: 14px; }
  .result-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 25px 14px; }
  .result-card h3 { font-size: 14px; }
  .results-heading { align-items: flex-start; flex-direction: column; }
  .site-footer { padding: 20px 5%; flex-direction: column; }
  .vocab-row { grid-template-columns: 1fr; gap: 2px; }
}


/* V1.3 compatibility for the supplied page structure.
   Existing V1.2 visual language and layout are retained. */
.header { /* shares the original .site-header styling */ }
.logo { /* shares the original .brand styling */ }
.header-nav { /* shares the original .top-nav styling */ }
.dashboard { /* shares the original .learning-dashboard styling */ }
.activity-panel, .calendar-panel { min-width: 0; }
.small { color: var(--muted); font-size: 10px; }
.empty { color: var(--muted); font-size: 12px; line-height: 1.7; }
.daily-tasks {
  margin-top: 27px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}
.daily-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 14px;
}
.daily-heading h3 {
  margin: 7px 0 0;
  font-size: 15px;
  font-weight: 300;
  letter-spacing: .4px;
}
.daily-heading .small { text-align: right; font-size: 9px; }
.daily-task-date {
  margin: 0 0 7px;
  color: var(--muted);
  font-size: 9px;
  letter-spacing: .7px;
}
.daily-task-title {
  margin: 0 0 8px;
  font-size: 15px;
  font-weight: 400;
  line-height: 1.5;
}
.daily-task-description {
  margin: 0 0 13px;
  color: #666;
  font-size: 11px;
  line-height: 1.7;
}
.daily-focus { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 14px; }
.daily-focus span {
  padding: 4px 8px;
  border: 1px solid #ddd;
  color: #777;
  font-size: 9px;
}
.daily-task-link {
  display: inline-block;
  padding-bottom: 3px;
  border-bottom: 1px solid var(--accent);
  color: var(--accent);
  font-size: 9px;
  letter-spacing: .6px;
}
.daily-task-link:hover { opacity: .65; }
.categories a { text-transform: uppercase; }
.filters { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.progress { height: 5px; width: 100%; background: #ededeb; }
.progress > div { height: 100%; width: 0; background: var(--accent); transition: width .25s; }
.goal-number { display: flex; align-items: baseline; gap: 4px; }
.calendar-legend { display: flex; align-items: center; gap: 5px; }
.calendar-legend span { color: #91a18f; }
@media (max-width: 1050px) {
  .filters { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 650px) {
  .filters { grid-template-columns: 1fr 1fr; }
  .daily-heading { flex-direction: row; }
}


/* ---------------------------------------------------------
   V1.4 REFINEMENT — minimal dashboard and daily feature
--------------------------------------------------------- */

.activity-panel > .eyebrow {
  margin-bottom: 18px;
}

.daily-tasks {
  margin-top: 30px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.daily-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 17px;
}

.daily-heading h3 {
  margin: 7px 0 0;
  font-size: 15px;
  font-weight: 300;
  letter-spacing: .35px;
}

.daily-heading .small {
  flex: 0 0 auto;
  text-align: right;
  font-size: 9px;
}

.daily-task-card {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(125px, .75fr);
  align-items: stretch;
  gap: 22px;
  min-height: 150px;
}

.daily-task-main {
  min-width: 0;
}

.daily-task-date {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 9px;
  letter-spacing: .7px;
}

.daily-task-title {
  margin: 0 0 9px;
  font-size: 16px;
  font-weight: 300;
  line-height: 1.4;
}

.daily-task-description {
  margin: 0;
  color: #666;
  font-size: 11px;
  line-height: 1.75;
}

.daily-task-side {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
  padding-left: 17px;
  border-left: 1px solid #e5e5e5;
}

.daily-focus {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
}

.daily-focus span {
  padding: 5px 7px;
  border: 1px solid #e1e1e1;
  color: #777;
  font-size: 8px;
  letter-spacing: .45px;
  line-height: 1.4;
}

.daily-task-link {
  display: inline-block;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--accent);
  color: var(--accent);
  font-size: 9px;
  letter-spacing: .65px;
  white-space: nowrap;
}

.daily-task-link:hover {
  opacity: .65;
}

.empty {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.6;
}

.category-nav a {
  text-transform: uppercase;
}

@media (max-width: 1050px) {
  .daily-task-card {
    grid-template-columns: minmax(0, 1.2fr) minmax(115px, .8fr);
  }
}

@media (max-width: 650px) {
  .daily-task-card {
    grid-template-columns: 1fr;
    gap: 14px;
    min-height: 0;
  }

  .daily-task-side {
    min-height: 65px;
    padding: 13px 0 0;
    border-left: 0;
    border-top: 1px solid #e5e5e5;
  }

  .daily-heading {
    align-items: flex-start;
  }
}


/* V1.5 — precise layout refinements; existing visual language retained */

/* Daily feature fills the available width of the learning-activity column. */
.daily-task-card {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, .95fr);
  width: 100%;
  min-width: 0;
  min-height: 0;
  align-items: stretch;
  gap: 18px;
}

.daily-task-main,
.daily-task-side {
  min-width: 0;
}

.daily-task-side {
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding-left: 16px;
}

.daily-focus {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-content: center;
  align-items: center;
  gap: 6px;
  margin: 0;
}

.daily-focus span {
  max-width: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
}

.daily-task-link {
  flex: 0 0 auto;
  align-self: center;
}

/* Theme tags stay within the same page-width guides as the search section. */
.category-nav {
  box-sizing: border-box;
  width: var(--page-width);
  max-width: var(--max-width);
  min-width: 0;
  margin-left: auto;
  margin-right: auto;
  padding-left: 0;
  padding-right: 0;
  justify-content: center;
  gap: 8px;
}

.category-nav a {
  flex: 0 1 auto;
  max-width: 100%;
  white-space: nowrap;
}

/* Date is entered in a fixed English format on every operating-system locale. */
#dateFilter {
  font-family: 'Montserrat', Arial, sans-serif;
  letter-spacing: .4px;
}

#dateFilter::placeholder {
  color: #777;
  opacity: 1;
}

@media (max-width: 1050px) {
  .daily-task-card {
    grid-template-columns: minmax(0, 1fr) minmax(0, .9fr);
  }
  .daily-task-side {
    flex-wrap: wrap;
  }
}

@media (max-width: 650px) {
  .daily-task-card {
    grid-template-columns: 1fr;
    gap: 13px;
  }
  .daily-task-side {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    padding: 12px 0 0;
    border-left: 0;
    border-top: 1px solid #e5e5e5;
  }
  .category-nav {
    width: var(--page-width);
    gap: 7px;
    margin-bottom: 45px;
  }
  .category-nav a {
    white-space: normal;
    text-align: center;
  }
}


/* ---------------------------------------------------------
   V1.6 — three balanced dashboard columns
   Weekly chart sits directly below the learning calendar.
--------------------------------------------------------- */

.learning-dashboard {
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) minmax(0, .95fr);
  align-items: stretch;
  column-gap: 28px;
}

.activity-panel {
  display: flex;
  flex-direction: column;
  min-height: 100%;
}

.activity-panel > .eyebrow {
  margin-bottom: 22px;
}

.daily-tasks {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  justify-content: flex-start;
  min-width: 0;
  width: 100%;
  margin-top: 0;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.daily-task-card {
  width: 100%;
  min-height: 0;
  grid-template-columns: minmax(0, 1fr) minmax(112px, .72fr);
  gap: 18px;
}

.daily-task-main {
  min-width: 0;
}

.daily-task-side {
  min-width: 0;
  align-items: flex-start;
  flex-direction: column;
  justify-content: space-between;
  gap: 16px;
}

.daily-focus {
  width: 100%;
  align-content: flex-start;
}

.calendar-panel {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.calendar-legend {
  margin-bottom: 18px;
}

.weekly-activity {
  margin-top: auto;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.weekly-activity > .eyebrow {
  margin-bottom: 12px;
}

.weekly-activity .weekly-chart {
  height: 92px;
  gap: 8px;
}

.weekly-activity .chart-track {
  height: 68px;
}

.weekly-activity .chart-caption {
  margin-top: 7px;
}

.time-panel {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

@media (max-width: 1050px) {
  .learning-dashboard {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: start;
  }

  .activity-panel {
    min-height: 100%;
  }

  .time-panel {
    grid-column: 1 / -1;
  }

  .weekly-activity {
    margin-top: 28px;
  }
}

@media (max-width: 650px) {
  .learning-dashboard {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .activity-panel {
    min-height: auto;
  }

  .daily-task-card {
    grid-template-columns: minmax(0, 1fr) minmax(105px, .75fr);
  }

  .calendar-panel {
    padding-top: 22px;
    border-top: 1px solid var(--line);
  }

  .weekly-activity {
    margin-top: 22px;
  }

  .time-panel {
    grid-column: auto;
  }
}


/* V1.7 — navigation destinations */
.category-nav {
  scroll-margin-top: 18px;
}

.archive-intro,
.results-section,
.document-page {
  scroll-margin-top: 24px;
}


/* ---------------------------------------------------------
   V1.8 — balanced dashboard height and fixed site navigation
--------------------------------------------------------- */

/* Keep the navigation visible while the page scrolls. */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(255, 255, 255, .97);
  backdrop-filter: blur(8px);
}

/* All three dashboard columns stretch to the calendar + chart height. */
.learning-dashboard {
  align-items: stretch;
}

.activity-panel,
.calendar-panel,
.time-panel {
  min-height: 100%;
}

/* Daily task fills its column without an internal divider. */
.activity-panel {
  display: flex;
  flex-direction: column;
}

.activity-panel > .eyebrow {
  margin-bottom: 28px;
}

.daily-tasks {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  width: 100%;
  min-height: 100%;
  margin: 0;
  padding: 0;
  border-top: 0;
}

.daily-heading {
  margin-bottom: 28px;
}

#dailyTaskContent {
  display: flex;
  flex: 1 1 auto;
  min-height: 0;
}

.daily-task-card {
  display: grid;
  flex: 1 1 auto;
  grid-template-columns: minmax(0, 1fr) minmax(112px, .72fr);
  align-items: stretch;
  min-height: 100%;
  gap: 18px;
}

.daily-task-main {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.daily-task-description {
  max-width: 100%;
  line-height: 1.9;
}

.daily-task-side {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: flex-start;
  min-width: 0;
  padding-left: 18px;
  border-left: 1px solid var(--line);
}

.daily-focus {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  margin: 0;
}

.daily-task-link {
  margin-top: auto;
}

/* Timer content is grouped and distributed over the full dashboard height. */
.time-panel {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 100%;
  padding-left: 28px;
  border-left: 1px solid var(--line);
}

.time-summary,
.time-goal,
.timer-controls {
  width: 100%;
}

.time-divider {
  margin: 0 0 26px;
}

.time-goal {
  margin-top: auto;
  margin-bottom: auto;
  padding: 26px 0;
}

.timer-controls {
  padding-top: 22px;
}

.timer-actions {
  margin-top: 0;
}

.goal-setting {
  margin-top: 20px;
}

.timer-status {
  margin-top: 14px;
}

/* On narrower screens the columns stack naturally; avoid forced tall panels. */
@media (max-width: 1050px) {
  .activity-panel,
  .calendar-panel,
  .time-panel {
    min-height: auto;
  }

  .time-panel {
    justify-content: flex-start;
    padding-left: 0;
    border-left: 0;
    border-top: 1px solid var(--line);
    padding-top: 22px;
  }

  .time-goal {
    margin: 22px 0 0;
    padding: 0;
  }

  .timer-controls {
    padding-top: 20px;
  }

  .daily-tasks {
    min-height: 260px;
  }
}

@media (max-width: 650px) {
  .site-header {
    min-height: 64px;
    padding-left: 5%;
    padding-right: 5%;
  }

  .daily-tasks {
    min-height: auto;
  }

  .daily-task-card {
    min-height: 190px;
  }
}


/* ---------------------------------------------------------
   V1.9 — image space on the left; daily task below timer
--------------------------------------------------------- */

/* Left column is now reserved for user-selected images. */
.image-panel {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 100%;
}

.image-panel > .eyebrow {
  margin-bottom: 18px;
}

.image-upload-area {
  position: relative;
  display: flex;
  flex: 1 1 auto;
  min-height: 300px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 10px;
  border: 1px dashed #d8d8d5;
  cursor: pointer;
  color: var(--muted);
  transition: border-color .2s, background .2s;
}

.image-upload-area:hover,
.image-upload-area.is-dragover {
  border-color: #9b9b95;
  background: #fafaf9;
}

.image-upload-area input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  overflow: hidden;
}

.image-upload-mark {
  font-size: 28px;
  font-weight: 200;
  line-height: 1;
}

.image-upload-label {
  font-size: 9px;
  letter-spacing: 1.3px;
}

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

.image-preview-item {
  position: relative;
  min-width: 0;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: #f0f0ed;
}

.image-preview-item img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.image-preview-remove {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 22px;
  height: 22px;
  border: 0;
  background: rgba(255,255,255,.9);
  color: #333;
  cursor: pointer;
  font-size: 14px;
}

/* Daily task now occupies the lower part of the timer column. */
.time-panel {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  min-width: 0;
}

.timer-controls {
  padding-top: 18px;
}

.timer-daily-task {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-width: 0;
  margin-top: 30px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.timer-daily-task .daily-heading {
  margin-bottom: 18px;
}

.timer-daily-task #dailyTaskContent {
  display: block;
  min-width: 0;
}

.timer-daily-task .daily-task-card {
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-height: 0;
}

.timer-daily-task .daily-task-main {
  display: block;
}

.timer-daily-task .daily-task-side {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 16px;
  padding: 0;
  border: 0;
}

.timer-daily-task .daily-focus {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
}

.timer-daily-task .daily-task-link {
  margin-top: 4px;
}

@media (max-width: 1050px) {
  .image-upload-area {
    min-height: 240px;
  }

  .timer-daily-task {
    flex: 0 0 auto;
  }
}

@media (max-width: 650px) {
  .image-upload-area {
    min-height: 220px;
  }

  .timer-daily-task {
    margin-top: 24px;
  }
}


/* ---------------------------------------------------------
   V1.10 — compact dashboard, horizontal tags, fixed green nav
--------------------------------------------------------- */

/* Compact fixed header: remains visible during page scrolling. */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  width: 100%;
  min-height: 62px;
  padding: 0 5%;
  background: #e8efe5;
  border-bottom: 1px solid #d7e0d3;
  box-sizing: border-box;
}

.site-header .brand {
  font-size: 21px;
  letter-spacing: 2px;
}

.site-header .top-nav {
  gap: 26px;
  font-size: 12px;
}

.site-header a,
.site-header .menu-toggle {
  color: #26372b;
}

/* Keep all three dashboard columns compact and naturally sized. */
.learning-dashboard {
  align-items: start;
  margin-top: 22px;
  margin-bottom: 34px;
  padding-top: 20px;
  padding-bottom: 20px;
  gap: 24px;
}

/* Image upload area has a defined, shorter height rather than stretching. */
.image-panel {
  min-height: 0;
  height: auto;
}

.image-upload-area {
  flex: 0 0 360px;
  min-height: 360px;
  max-height: 360px;
}

/* Calendar and weekly chart sit close together with no auto-filled gap. */
.calendar-panel {
  align-self: start;
}

.calendar-legend {
  margin-bottom: 12px;
}

.weekly-activity {
  margin-top: 10px;
  padding-top: 14px;
}

.weekly-activity > .eyebrow {
  margin-bottom: 9px;
}

.weekly-activity .weekly-chart {
  height: 82px;
  gap: 7px;
}

.weekly-activity .chart-track {
  height: 60px;
}

.weekly-activity .chart-caption {
  margin-top: 5px;
}

/* The status text is redundant; timer controls remain functional. */
.timer-status {
  display: none !important;
}

/* Daily task tags are displayed horizontally and wrap only when necessary. */
.timer-daily-task .daily-task-side {
  display: block;
  padding: 0;
  border: 0;
}

.timer-daily-task .daily-focus {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  width: 100%;
  margin: 0;
}

.timer-daily-task .daily-focus span {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  padding: 5px 9px;
}

.timer-daily-task .daily-task-link {
  display: inline-block;
  margin-top: 14px;
}

/* Reduce the daily feature's vertical footprint. */
.timer-daily-task {
  flex: 0 0 auto;
  margin-top: 22px;
  padding-top: 18px;
}

.timer-daily-task .daily-heading {
  margin-bottom: 12px;
}

.timer-daily-task .daily-task-description {
  margin-bottom: 8px;
  line-height: 1.6;
}

@media (max-width: 1050px) {
  .learning-dashboard {
    align-items: start;
  }

  .image-upload-area {
    flex-basis: 280px;
    min-height: 280px;
    max-height: 280px;
  }

  .weekly-activity {
    margin-top: 12px;
  }
}

@media (max-width: 650px) {
  .site-header {
    min-height: 58px;
    padding: 0 4%;
  }

  .site-header .brand {
    font-size: 16px;
    letter-spacing: 1.3px;
  }

  .site-header .top-nav {
    gap: 12px;
    font-size: 10px;
  }

  .image-upload-area {
    flex-basis: 220px;
    min-height: 220px;
    max-height: 220px;
  }
}


/* ---------------------------------------------------------
   V1.11 — balanced dashboard height + refined sage navigation
--------------------------------------------------------- */

:root {
  --nav-surface: #e7ebe3;
  --nav-ink: #344238;
  --nav-border: #d4dbd0;
}

/* Refined title/header band and matching navigation tabs. */
.site-header {
  background: var(--nav-surface);
  border-bottom: 1px solid var(--nav-border);
  color: var(--nav-ink);
}

.site-header .brand,
.site-header .top-nav a {
  color: var(--nav-ink);
}

.site-header .top-nav {
  gap: 8px;
}

.site-header .top-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 13px;
  background: var(--nav-surface);
  border: 1px solid transparent;
  transition: background .2s ease, border-color .2s ease;
}

.site-header .top-nav a:hover,
.site-header .top-nav a:focus-visible {
  background: #dce3d8;
  border-color: #cbd5c8;
  opacity: 1;
}

/* Let the tallest dashboard column define a compact shared height. */
.learning-dashboard {
  align-items: stretch;
  gap: 24px;
}

.activity-panel,
.calendar-panel,
.time-panel {
  min-width: 0;
  min-height: 0;
}

/* The image upload surface uses the available height of its column. */
.image-panel {
  display: flex;
  flex-direction: column;
}

.image-upload-area {
  flex: 1 1 auto;
  height: auto;
  min-height: 420px;
  max-height: none;
}

/* Keep calendar and chart grouped; remove excess space below the chart. */
.calendar-panel {
  display: flex;
  flex-direction: column;
  align-self: stretch;
}

.calendar-legend {
  margin: 10px 0 12px;
}

.weekly-activity {
  margin-top: 14px;
  padding-top: 13px;
}

.weekly-activity .weekly-chart {
  height: 76px;
  min-height: 76px;
}

.weekly-activity .chart-track {
  height: 55px;
}

.weekly-activity .chart-caption {
  margin: 5px 0 0;
}

/* Remove the large artificial gaps inside the timer column. */
.time-panel {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-self: stretch;
  padding-left: 26px;
}

.time-goal {
  margin: 22px 0 0;
  padding: 0;
}

.time-divider {
  margin: 0 0 20px;
}

.timer-controls {
  padding-top: 17px;
  margin-top: 0;
}

.timer-actions {
  margin-top: 0;
}

.goal-setting {
  margin-top: 13px;
}

.timer-status {
  display: none !important;
}

.timer-daily-task {
  flex: 0 0 auto;
  margin-top: 22px;
  padding-top: 17px;
}

.timer-daily-task .daily-heading {
  margin-bottom: 12px;
}

.timer-daily-task .daily-task-description {
  line-height: 1.55;
  margin-bottom: 9px;
}

.timer-daily-task .daily-focus {
  flex-direction: row;
  flex-wrap: wrap;
  gap: 6px;
}

.timer-daily-task .daily-focus span {
  white-space: nowrap;
}

/* Responsive layout: do not force desktop panel heights on smaller screens. */
@media (max-width: 1050px) {
  .learning-dashboard {
    align-items: start;
  }

  .image-upload-area {
    flex: 0 0 280px;
    min-height: 280px;
    max-height: 280px;
  }

  .calendar-panel {
    display: block;
  }

  .time-panel {
    justify-content: flex-start;
    padding-left: 0;
  }

  .time-goal {
    margin: 22px 0 0;
    padding: 0;
  }

  .timer-controls {
    padding-top: 18px;
  }
}

@media (max-width: 650px) {
  .site-header .top-nav {
    gap: 5px;
  }

  .site-header .top-nav a {
    min-height: 30px;
    padding: 0 8px;
    font-size: 9px;
  }

  .image-upload-area {
    flex: 0 0 220px;
    min-height: 220px;
    max-height: 220px;
  }
}


/* V1.12 — A.D.A. brand lockup (header title only) */
.site-header .brand-lockup {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 3px;
  line-height: 1;
  white-space: nowrap;
}

.site-header .brand-lockup .brand-name {
  font-size: 25px;
  font-weight: 300;
  letter-spacing: 3px;
}

.site-header .brand-lockup .brand-tagline {
  font-size: 9px;
  font-weight: 300;
  letter-spacing: 2px;
  line-height: 1.3;
}

@media (max-width: 650px) {
  .site-header .brand-lockup .brand-name {
    font-size: 20px;
    letter-spacing: 2.5px;
  }

  .site-header .brand-lockup .brand-tagline {
    font-size: 8px;
    letter-spacing: 1.5px;
  }
}


/* V1.13 — precise navigation anchors + full-height weekly activity chart */
/* The sticky header is accounted for in the JS scroll calculation. */
#categories,
#archive {
  scroll-margin-top: 0;
}

/* Stretch the calendar column to the full dashboard row height. */
.learning-dashboard {
  align-items: stretch;
}

.calendar-panel {
  display: flex;
  flex-direction: column;
  align-self: stretch;
  height: 100%;
  min-height: 100%;
}

.weekly-activity {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-height: 190px;
  margin-top: 14px;
}

.weekly-activity .weekly-chart {
  display: flex;
  flex: 1 1 auto;
  align-items: stretch;
  height: auto;
  min-height: 150px;
}

.weekly-activity .chart-day {
  height: 100%;
  justify-content: flex-end;
}

.weekly-activity .chart-track {
  flex: 1 1 auto;
  height: auto;
  min-height: 110px;
}

.weekly-activity .chart-caption {
  flex: 0 0 auto;
  margin-top: 8px;
}

@media (max-width: 1050px) {
  .learning-dashboard {
    align-items: start;
  }

  .calendar-panel {
    display: block;
    height: auto;
    min-height: 0;
  }

  .weekly-activity {
    display: block;
    min-height: 0;
  }

  .weekly-activity .weekly-chart {
    height: 150px;
    min-height: 150px;
  }

  .weekly-activity .chart-track {
    height: 110px;
    min-height: 110px;
  }
}


/* V1.14 — archive opens directly on its image collection */
.archive-image-gallery {
  margin-top: 26px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}
.archive-image-gallery .result-grid {
  margin-top: 0;
}


/* ---------------------------------------------------------
   A.D.A. — HOME AND ARCHIVE IMAGE SYSTEM
--------------------------------------------------------- */
.home-cover {
  position: relative;
  flex: 1 1 auto;
  width: 100%;
  min-height: 300px;
  overflow: hidden;
  background: #eeefeb;
}
.home-cover img {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 300px;
  object-fit: cover;
}
.home-cover-caption {
  position: absolute;
  left: 18px;
  bottom: 18px;
  z-index: 2;
  color: #fff;
  font-size: 9px;
  letter-spacing: 1.5px;
  text-shadow: 0 1px 5px rgba(0,0,0,.45);
}
.home-cover-fallback {
  display: none;
  position: absolute;
  inset: 0;
  align-items: center;
  justify-content: center;
  color: #888;
  font-size: 10px;
  letter-spacing: 1.5px;
}
.home-cover.image-missing .home-cover-fallback { display: flex; }
.home-cover.image-missing .home-cover-caption { display: none; }

.archive-cover {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: #eeefeb;
}
.archive-cover img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .5s ease;
}
.result-card:hover .archive-cover img { transform: scale(1.04); }
.archive-cover-fallback {
  display: none;
  position: absolute;
  inset: 0;
  align-items: center;
  justify-content: center;
  color: #888;
  font-size: 10px;
  letter-spacing: 1.5px;
}
.archive-cover.image-missing .archive-cover-fallback { display: flex; }
.document-cover {
  position: relative;
  width: 100%;
  max-height: 480px;
  aspect-ratio: 16 / 9;
  margin: 25px 0;
  overflow: hidden;
  background: #eeefeb;
}
.document-cover img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.document-cover .archive-cover-fallback { display: none; }
.document-cover.image-missing .archive-cover-fallback { display: flex; }


/* ---------------------------------------------------------
   V1.6 — ARCHIVE DETAIL REFINEMENT
   Full conversation + differentiated language colors
--------------------------------------------------------- */

/* Match homepage content width */
.document-page {
  width: var(--page-width);
  max-width: var(--max-width);
  margin: 15px auto 90px;
  box-sizing: border-box;
}

/* Main content */
.document-body {
  width: 100%;
  max-width: none;
  margin-top: 45px;
  line-height: 1.8;
}

.document-body section {
  margin-bottom: 55px;
}

.document-body h2 {
  margin: 35px 0 22px;
  padding-bottom: 13px;
  border-bottom: 1px solid var(--line);
  font-size: 17px;
  font-weight: 400;
  letter-spacing: 1px;
}

/* Full conversation */
.conversation-list {
  display: flex;
  flex-direction: column;
  gap: 17px;
  width: 100%;
}

.chat-message {
  max-width: 82%;
  padding: 13px 17px;
  border: 1px solid #e5e5e5;
  background: #fafaf8;
}

.chat-message.ada {
  align-self: flex-start;
  border-left: 3px solid #8a9b83;
}

.chat-message.chris {
  align-self: flex-end;
  border-right: 3px solid #9a91aa;
  background: #f7f6fa;
}

.chat-speaker {
  display: block;
  margin-bottom: 6px;
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: #777;
}

.chat-message p {
  margin: 0;
  color: #333;
  font-size: 13px;
  font-weight: 300;
  line-height: 1.8;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/* Vocabulary */
.vocab-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1.5fr;
  gap: 15px;
  padding: 14px 0;
  border-bottom: 1px solid #e5e5e5;
  font-size: 13px;
}

.vocab-row strong {
  color: #292929;
  font-weight: 500;
}

/* Pinyin and English must use different colors */
.pinyin-text {
  color: #8a6f9e !important;
  font-size: 13px;
}

.english-text {
  color: #526e5b !important;
  font-size: 13px;
}

/* Expressions */
.expression {
  padding: 17px 0;
  border-bottom: 1px solid #e5e5e5;
}

.expression strong {
  color: #292929;
  font-size: 16px;
  font-weight: 400;
}

.expression p {
  margin: 6px 0;
  line-height: 1.7;
}

/* Keywords */
.document-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 20px;
}

.document-tags span {
  padding: 7px 11px;
  border: 1px solid #ddd;
  color: #666;
  font-size: 10px;
  letter-spacing: .3px;
}

/* Responsive */
@media (max-width: 650px) {
  .document-page {
    width: var(--page-width);
    margin-top: 10px;
  }

  .chat-message {
    max-width: 94%;
    padding: 11px 13px;
  }

  .chat-message p {
    font-size: 12px;
  }

  .vocab-row {
    grid-template-columns: 1fr;
    gap: 3px;
  }

  .document-body section {
    margin-bottom: 38px;
  }
}

/* =========================================
   ARCHIVE DETAIL — FIX GRID COLUMN CONSTRAINT
   ========================================= */

/* Normal archive gallery: keep 3-column grid */
.result-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

/* Detail page: remove the 3-column grid */
.result-grid.is-document {
    display: block !important;
    width: 100%;
    min-width: 0;
}

/* Detail article occupies the entire archive container */
.result-grid.is-document > .document-page {
    display: block;
    width: 100% !important;
    max-width: none !important;
    min-width: 0;
    margin: 15px 0 90px;
    box-sizing: border-box;
}

/* Detail content */
.result-grid.is-document .document-body {
    width: 100%;
    max-width: none;
}

/* Responsive gallery */
@media (max-width: 650px) {
    .result-grid {
        grid-template-columns: 1fr;
    }
}