:root {
  color-scheme: light;
  --canvas: #f6f7f2;
  --surface: #fffefa;
  --ink: #162a24;
  --green: #164638;
  --green-deep: #10372c;
  --soft-green: #e4ecdf;
  --muted: #596961;
  --line: #dde4db;
  --lime: #d7eda0;
  --serif: "Iowan Old Style", Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --rail-width: 232px;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { background: var(--canvas); }
body { margin: 0; min-width: 300px; color: var(--ink); font: 1rem/1.52 var(--sans); }
body:has(dialog[open]) { overflow: hidden; }
a { color: inherit; text-decoration: none; }
button, input { color: inherit; font: inherit; }
button { cursor: pointer; }
h1, h2, h3, p, ol { margin: 0; }
h1, h2, h3 { line-height: 1.08; }
img { display: block; max-width: 100%; }
:focus-visible { outline: 3px solid #6b9357; outline-offset: 4px; }
.sr-only, .skip-link:not(:focus) {
  position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap;
}
.skip-link:focus {
  position: fixed; top: 10px; left: 10px; z-index: 4; background: var(--green); color: white; padding: 10px 15px; border-radius: 8px;
}

.rail {
  position: fixed; inset: 0 auto 0 0; z-index: 1; width: var(--rail-width); display: flex; flex-direction: column;
  padding: 29px 20px 24px; border-right: 1px solid var(--line); background: #fdfefa;
}
.brand {
  display: inline-flex; align-items: center; gap: 10px; align-self: flex-start;
  font: 700 1.51rem/1 var(--serif); letter-spacing: -.052em;
}
.rail .brand { margin: 0 0 50px 5px; }
.brand img, .install-content > img { border-radius: 25%; }
.rail-nav { display: grid; gap: 7px; }
.rail-nav a, .install-button {
  min-height: 48px; display: flex; align-items: center; gap: 12px; padding: 9px 13px;
  color: var(--muted); font-weight: 650; font-size: .925rem; border-radius: 11px;
}
.rail-nav a[aria-current="page"] { color: var(--green-deep); background: var(--soft-green); }
.rail-nav a:hover, .install-button:hover { color: var(--green-deep); background: #edf2e8; }
.nav-count { margin-left: auto; padding: 0 6px; border-radius: 6px; background: #d3e2cf; color: var(--green-deep); font-size: .78rem; }
.install-button { background: transparent; border: 0; margin-top: auto; text-align: left; }
.mobile-header, .dock { display: none; }
.workspace {
  width: min(100% - var(--rail-width), 1230px); margin-left: max(var(--rail-width), calc((100% + var(--rail-width) - 1230px)/2));
  padding: 40px clamp(23px, 4vw, 58px) 55px;
}
.masthead { display: flex; align-items: end; justify-content: space-between; gap: 12px 24px; margin-bottom: 23px; }
.edition-date {
  color: var(--muted); font-size: .83rem; font-weight: 750; letter-spacing: .075em; text-transform: uppercase; margin-bottom: 6px;
}
h1 { font: 700 clamp(2.6rem, 5vw, 3.9rem)/1 var(--serif); letter-spacing: -.057em; }
.reading-goal {
  min-width: 147px; display: grid; gap: 7px; background: var(--surface); border: 1px solid var(--line);
  padding: 10px 13px 12px; border-radius: 12px; margin-bottom: 2px;
}
.goal-label { display: flex; justify-content: space-between; gap: 12px; font-size: .8rem; color: var(--muted); font-weight: 650; }
.goal-label strong { color: var(--green); font-variant-numeric: tabular-nums; }
.goal-track { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
.goal-track span { height: 5px; border-radius: 10px; background: #e4e9e1; }
.goal-track span.done { background: #5e8a4b; }

.feature {
  position: relative; isolation: isolate; overflow: hidden; background: var(--green-deep); color: white;
  min-height: 323px; display: flex; align-items: center; border-radius: 21px;
}
.feature-art {
  position: absolute; z-index: -2; inset: 0 0 0 auto; width: 65%; height: 100%;
  object-fit: cover; object-position: center 45%;
}
.feature::after {
  content: ""; position: absolute; z-index: -1; inset: 0;
  background: linear-gradient(90deg, #123a2d 0%, #123a2d 28%, #123a2df2 42%, #123a2d46 69%, #123a2d0b 100%);
}
.feature-body { width: 61%; padding: 29px clamp(30px, 4.3vw, 54px); }
.feature-label { color: #daedb1; font-size: .85rem; font-weight: 750; letter-spacing: .055em; text-transform: uppercase; margin-bottom: 11px; }
.feature h2 { font: 700 clamp(2.14rem, 4.2vw, 3.55rem)/1.01 var(--serif); letter-spacing: -.049em; text-wrap: balance; }
.feature-summary { max-width: 39ch; margin-top: 12px; color: #f3f6eb; line-height: 1.5; }
.feature-actions { display: flex; align-items: center; gap: 13px; margin-top: 20px; }
.feature-time { color: #dde8dc; font-size: .9rem; }
.feature-save { position: absolute !important; top: 15px; right: 15px; background: #102b22eb !important; color: #fff !important; border-color: #ffffff49 !important; }
.feature-save:hover { background: var(--green-deep) !important; }
.feature-save[aria-pressed="true"] { color: var(--lime) !important; }

.button {
  min-height: 44px; display: inline-flex; gap: 8px; align-items: center; justify-content: center;
  font-size: .92rem; font-weight: 730; padding: 10px 15px; border-radius: 9px; border: 1px solid transparent; text-align: center;
}
.button.primary { color: white; background: var(--green); }
.button.primary:hover { background: var(--green-deep); }
.button.secondary { color: var(--green); background: var(--surface); border-color: #d5e0d5; }
.button.secondary:hover, .button.secondary[aria-pressed="true"] { background: var(--soft-green); }
.button.feature-cta { color: var(--green-deep); background: var(--lime); min-height: 43px; padding-inline: 16px; }
.button.feature-cta:hover { background: #edf7cb; }
.text-link, .text-button { color: var(--green); font-weight: 720; font-size: .9rem; }
.text-link:hover, .text-button:hover { text-decoration: underline; text-underline-offset: .25em; }
.text-button { min-height: 44px; padding: 5px 8px; border: 0; border-radius: 8px; background: transparent; }
.icon-button {
  position: relative; width: 44px; height: 44px; display: grid; place-items: center; padding: 0; flex: none;
  border: 1px solid var(--line); color: var(--green); background: var(--surface); border-radius: 10px;
}
.icon-button:hover { background: #eff3ea; }
.icon-button[aria-pressed="true"] { color: var(--green-deep); background: #edf3e6; }

.feed-section { margin-top: 29px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 13px; }
.section-head h2, .empty h2 { font: 700 clamp(1.48rem, 2.7vw, 2rem)/1.1 var(--serif); letter-spacing: -.04em; }
.cards {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 17px;
}
.card { position: relative; min-width: 0; border: 1px solid var(--line); border-radius: 15px; background: var(--surface); transition: border-color .16s ease, box-shadow .16s ease; }
.card:hover { border-color: #a4bba3; box-shadow: 0 4px 18px #204a2410; }
.card-hit {
  width: 100%; height: 100%; display: flex; flex-direction: column; border: 0; border-radius: inherit; background: none;
  padding: 0; text-align: left;
}
.card-media {
  display: block; width: 100%; aspect-ratio: 2.15; object-fit: cover; background: #dce5d7; border-radius: 14px 14px 0 0;
}
.card-body { display: block; flex: 1; padding: 14px 15px 16px; }
.card-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 9px; color: var(--muted); font-size: .82rem; }
.topic { display: inline-block; font-weight: 720; color: #244e40; }
.topic[data-topic="habits"] { color: #8c4a31; }
.topic[data-topic="training"] { color: #66486f; }
.topic[data-topic="business"] { color: #305488; }
.read-label { font-weight: 650; }
.card-title {
  display: block; margin-top: 7px; font: 700 clamp(1.23rem, 2.1vw, 1.52rem)/1.12 var(--serif); letter-spacing: -.035em; text-wrap: pretty;
}
.card-summary { display: block; margin-top: 6px; color: var(--muted); font-size: .93rem; line-height: 1.45; }
.card-save { position: absolute; top: 8px; right: 8px; border-color: #cbd6c6; box-shadow: 0 2px 7px #172a2430; }

.search {
  display: flex; align-items: center; gap: 11px; max-width: 570px; min-height: 50px; padding-left: 14px;
  border: 1px solid #cdd9ce; border-radius: 12px; background: var(--surface);
}
.search:focus-within { outline: 2px solid #719967; outline-offset: 2px; }
.search input {
  width: 100%; min-width: 0; margin: 0; padding: 11px 12px 11px 0; border: 0; background: transparent; outline: 0;
}
.search input::placeholder { color: #64736a; opacity: 1; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0 11px; }
.filter {
  min-height: 44px; background: var(--surface); border: 1px solid var(--line); border-radius: 24px; padding: 6px 15px;
  color: var(--green); font-weight: 650; font-size: .91rem;
}
.filter:hover { border-color: #96ae96; }
.filter[aria-pressed="true"] { color: white; background: var(--green); border-color: var(--green); }
.result-count { margin: 0 0 13px; color: var(--muted); font-size: .88rem; font-weight: 580; }
.empty { padding: 39px 24px; margin-top: 9px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); text-align: center; }
.empty p { margin: 10px auto 16px; color: var(--muted); max-width: 36ch; }
.empty-icon { margin-bottom: 12px; color: var(--green); }
.storage-note { margin-top: 16px; color: var(--muted); font-size: .88rem; }

dialog {
  margin: auto; max-width: calc(100% - 34px); padding: 0; color: var(--ink); background: var(--surface);
  border: 1px solid var(--line); border-radius: 19px; box-shadow: 0 18px 65px #0f251f43;
}
dialog::backdrop { background: #122820a0; }
.reader { width: 655px; max-height: min(90vh, 830px); max-height: min(90dvh, 830px); overflow: hidden; }
.reader[open] { display: flex; flex-direction: column; }
.reader-scroll { min-height: 0; overflow: auto; overscroll-behavior: contain; touch-action: pan-y; }
.reader-cover { width: 100%; height: clamp(138px, 24vh, 220px); object-fit: cover; }
.dialog-close { position: absolute; z-index: 2; top: 11px; right: 11px; }
.reader-content { padding: 24px clamp(20px, 5vw, 43px) 28px; }
.reader-content h2, .install-content h2 {
  margin-top: 7px; font: 700 clamp(1.9rem, 4.7vw, 2.83rem)/1.05 var(--serif); letter-spacing: -.048em;
}
.reader-intro { margin-top: 12px; font-size: 1.08rem; line-height: 1.5; font-weight: 620; }
#reader-body p { margin-top: 14px; }
.action-note { margin-top: 20px; padding: 13px 15px; border-radius: 10px; background: #eaf1e4; color: var(--green-deep); }
.action-note h3 { font: 750 .93rem/1.4 var(--sans); }
.action-note p { margin-top: 4px; }
.reader-footer {
  display: flex; flex-wrap: wrap; align-items: center; gap: 7px; justify-content: flex-start;
  background: var(--surface); border-top: 1px solid var(--line); padding: 10px clamp(10px, 4vw, 24px);
}
.next-button { margin-left: auto; }
.install-dialog { width: 455px; }
.install-content { padding: 26px; }
.install-content h2 { margin-top: 12px; font-size: clamp(1.72rem, 4vw, 2.2rem); }
.install-content ol { margin-top: 14px; padding-left: 22px; }
.install-content li + li { margin-top: 6px; }
.install-content p { margin: 13px 0 17px; color: var(--muted); }

.toast {
  position: fixed; z-index: 3; right: 18px; bottom: 17px; max-width: calc(100vw - 36px); pointer-events: none;
  color: white; background: var(--green-deep); padding: 9px 13px; border-radius: 9px; font-size: .88rem; font-weight: 650;
}
.toast:empty { padding: 0; }

.glyph { position: relative; display: inline-block; flex: none; width: 20px; height: 20px; color: inherit; }
.glyph::before, .glyph::after { position: absolute; content: ""; box-sizing: border-box; }
.glyph.home::before { inset: 8px 4px 2px; border: 1.65px solid currentColor; border-top: 0; border-radius: 0 0 3px 3px; }
.glyph.home::after { top: 3.5px; left: 4.8px; width: 10.4px; height: 10.4px; border: solid currentColor; border-width: 1.65px 0 0 1.65px; transform: rotate(45deg); border-radius: 2px 0 0; }
.glyph.compass::before { inset: 2px; border: 1.65px solid currentColor; border-radius: 100%; }
.glyph.compass::after { inset: 5px; background: currentColor; clip-path: polygon(85% 15%, 62% 62%, 15% 85%, 38% 38%); }
.glyph.bookmark::before {
  inset: 2px 4px 1px; background: currentColor;
  clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 78%, 0 100%, 0 0, 14% 10%, 14% 78%, 50% 62%, 86% 78%, 86% 10%, 14% 10%);
}
[aria-pressed="true"] > .glyph.bookmark::before { clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 78%, 0 100%); }
.glyph.phone::before { inset: 1px 5px; border: 1.65px solid currentColor; border-radius: 3px; }
.glyph.phone::after { inset: auto 8px 4px; height: 1.6px; background: currentColor; border-radius: 2px; }
.glyph.search-glyph::before { inset: 2px 6px 6px 2px; border: 1.65px solid currentColor; border-radius: 100%; }
.glyph.search-glyph::after { width: 7px; height: 1.65px; background: currentColor; border-radius: 2px; left: 11px; top: 13px; transform: rotate(45deg); }
.glyph.close::before, .glyph.close::after { width: 16px; height: 1.65px; left: 2px; top: 9px; border-radius: 2px; background: currentColor; transform: rotate(45deg); }
.glyph.close::after { transform: rotate(-45deg); }

@media (max-width: 1040px) {
  :root { --rail-width: 191px; }
  .rail { padding-inline: 15px; }
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .feature-body { width: 70%; }
}

@media (max-width: 760px) {
  .rail { display: none; }
  .mobile-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: max(9px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) 8px max(16px, env(safe-area-inset-left));
    background: #fdfefa; border-bottom: 1px solid var(--line);
  }
  .mobile-header .brand { align-self: center; font-size: 1.4rem; }
  .mobile-install { border-color: transparent; background: transparent; }
  .workspace { width: auto; margin: 0; padding: 21px 16px calc(92px + env(safe-area-inset-bottom)); }
  .dock {
    display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; z-index: 2; position: fixed; inset: auto 0 0;
    padding: 5px max(10px, env(safe-area-inset-right)) calc(5px + env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-left));
    border-top: 1px solid var(--line); background: #fdfefa;
  }
  .dock a {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 51px;
    padding: 4px 0; color: var(--muted); border-radius: 9px; font-size: .78rem; font-weight: 700;
  }
  .dock a[aria-current="page"] { background: var(--soft-green); color: var(--green-deep); }
  .toast { bottom: calc(73px + env(safe-area-inset-bottom)); }
}

@media (max-width: 490px) {
  .masthead { margin-bottom: 17px; }
  h1 { font-size: 2.75rem; }
  .edition-date { font-size: .73rem; }
  .reading-goal { min-width: 103px; padding: 7px 9px 9px; gap: 5px; }
  .goal-label { font-size: .74rem; gap: 7px; }
  .feature { min-height: 346px; border-radius: 17px; align-items: flex-end; }
  .feature-art { width: 100%; height: 75%; object-position: center 44%; }
  .feature::after { background: linear-gradient(0deg, #123a2d 12%, #123a2dfd 29%, #123a2dd3 53%, #123a2d27 86%); }
  .feature-body { width: 100%; padding: 62px 20px 19px; }
  .feature h2 { font-size: clamp(2rem, 8.5vw, 2.51rem); }
  .feature-summary { font-size: .94rem; line-height: 1.39; margin-top: 8px; }
  .feature-label { margin-bottom: 7px; font-size: .76rem; }
  .feature-actions { margin-top: 14px; }
  .feature-save { top: 10px; right: 10px; }
  .feed-section { margin-top: 22px; }
  .cards { grid-template-columns: 1fr; gap: 13px; }
  .card-hit { position: relative; min-height: 133px; padding-left: 28%; }
  .card-media { position: absolute; inset: 0 auto 0 0; width: 28%; height: 100%; border-radius: 14px 0 0 14px; }
  .card-body { padding: 11px 45px 11px 11px; }
  .card-title { font-size: 1.2rem; }
  .card-summary { font-size: .875rem; line-height: 1.38; }
  .card-meta { font-size: .76rem; gap: 4px 6px; }
  .card-save { right: 4px; top: 5px; border-color: transparent; box-shadow: none; background: transparent; }
  .reader { max-width: calc(100% - 14px); max-height: 93dvh; }
  .reader-footer { padding-bottom: max(10px, env(safe-area-inset-bottom)); gap: 5px; }
  .reader-footer .button { padding-inline: 9px; font-size: .83rem; }
  .reader-footer .text-button { font-size: .81rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0s !important; }
}
