:root {
  --reading-font: Georgia, Cambria, "Times New Roman", Times, serif;
  --brand: #2f6b50;
  --brand-dark: #24583f;
  --brand-soft: #e4f1e9;
  --mint: #d8fdd2;
  --ink: #151817;
  --muted: #7b817e;
  --line: #e5e8e7;
  --surface: #ffffff;
  --surface-soft: #f5f6f6;
  --chat-canvas: #efebe2;
  --chat-text-size: 14px;
  --sidebar-width: 320px;
  --shadow: 0 12px 34px rgba(27, 40, 34, 0.09);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--surface-soft);
}
:root[data-chat-size="0"] { --chat-text-size: 12px; }
:root[data-chat-size="1"] { --chat-text-size: 13px; }
:root[data-chat-size="2"] { --chat-text-size: 14px; }
:root[data-chat-size="3"] { --chat-text-size: 15.5px; }
:root[data-chat-size="4"] { --chat-text-size: 17px; }
:root[data-chat-size="5"] { --chat-text-size: 19px; }

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { width: 100%; min-height: 100%; margin: 0; }
body { overflow: hidden; background: var(--surface-soft); }
button, textarea { font: inherit; }
button { cursor: pointer; }
button:focus-visible, textarea:focus-visible { outline: 3px solid rgba(47, 107, 80, .25); outline-offset: 2px; }

.shell {
  position: relative; width: 100%; height: 100vh; height: 100dvh; display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr); overflow: hidden; background: var(--surface);
}
.sidebar {
  min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 20px;
  padding: 24px 22px 20px; border-right: 1px solid var(--line); background: var(--surface); z-index: 4;
}
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand-mark, .login-mark, .loading-mark, .chat-avatar {
  display: block; flex: 0 0 auto; object-fit: cover; object-position: center;
  border-radius: 50%; background: var(--brand); box-shadow: 0 5px 14px rgba(47, 107, 80, .18);
}
.brand-mark { width: 46px; height: 46px; }
.brand-copy { min-width: 0; }
.brand-copy h1 { margin: 0; color: #101312; font-size: 25px; font-weight: 800; letter-spacing: -.04em; }
.brand-copy p { margin: 2px 0 0; overflow: hidden; color: var(--muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-close {
  width: 32px; height: 32px; flex: 0 0 32px; display: grid; place-items: center; margin-left: auto;
  border: 0; border-radius: 9px; background: var(--surface-soft); color: var(--muted); font-size: 25px; line-height: 1;
}
.sidebar-close:hover { background: var(--brand-soft); color: var(--brand); }
.sidebar-resizer {
  position: absolute; top: 0; bottom: 0; left: calc(var(--sidebar-width) - 4px); z-index: 12;
  width: 8px; cursor: col-resize; touch-action: none;
}
.sidebar-resizer::after {
  content: ""; position: absolute; top: 0; bottom: 0; left: 3px; width: 2px;
  background: transparent; transition: background .15s ease;
}
.sidebar-resizer:hover::after, .sidebar-resizer:focus-visible::after, .sidebar-resizing .sidebar-resizer::after { background: var(--brand); }
.sidebar-resizing, .sidebar-resizing * { cursor: col-resize !important; user-select: none !important; }
.eyebrow { margin: 0 0 6px; color: var(--brand); font-size: 10px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
h1, h2 { margin: 0; }

.user-block {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 12px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.user-copy { min-width: 0; display: grid; gap: 2px; }
.user-copy strong, .user-copy span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-copy strong { font-size: 12px; }
.user-copy span { color: var(--muted); font-size: 10px; }
.user-block button { border: 0; background: transparent; color: var(--brand); font-size: 10px; font-weight: 700; padding: 6px; }
.user-block button:hover { color: var(--brand-dark); }

.threads-panel { min-height: 0; flex: 0 0 auto; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.section-heading h2 { font-size: 15px; font-weight: 800; }
.new-thread-button {
  width: 31px; height: 31px; border: 0; border-radius: 10px; background: var(--surface-soft);
  color: var(--brand); font-size: 19px; line-height: 1;
}
.new-thread-button:hover { background: var(--brand-soft); }
.thread-list { display: grid; gap: 4px; overflow: visible; margin-top: 10px; }
.thread-list.expanded { max-height: min(42vh, 420px); overflow-y: auto; padding-right: 4px; scrollbar-gutter: stable; }
.thread-row { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) 34px; align-items: center; border-radius: 11px; }
.thread-row:hover { background: var(--surface-soft); }
.thread-row.active { background: var(--brand-soft); }
.thread-row.active::before { content: ""; width: 3px; height: 24px; position: absolute; border-radius: 3px; background: var(--brand); }
.thread-select, .thread-menu { border: 0; background: transparent; }
.thread-select { min-width: 0; overflow: hidden; display: grid; gap: 2px; padding: 8px 8px 8px 12px; color: #343937; text-align: left; }
.thread-title {
  overflow: hidden; font-family: inherit; font-size: var(--chat-text-size); font-weight: 500;
  line-height: 1.3; text-overflow: ellipsis; white-space: nowrap;
}
.thread-date { color: var(--muted); font-family: inherit; font-size: 10px; font-weight: 500; }
.thread-row.active .thread-title { color: var(--brand-dark); font-weight: 750; }
.thread-actions { position: relative; display: grid; place-items: center; }
.thread-menu { width: 30px; height: 30px; border-radius: 8px; color: var(--muted); }
.thread-menu:hover, .thread-menu[aria-expanded="true"] { background: rgba(47, 107, 80, .09); color: var(--brand); }
.thread-action-menu {
  position: absolute; top: 31px; right: 0; z-index: 30; width: 126px; padding: 5px;
  border: 1px solid var(--line); border-radius: 11px; background: var(--surface); box-shadow: var(--shadow);
}
.thread-action-menu button { width: 100%; border: 0; border-radius: 7px; padding: 8px 9px; background: transparent; color: var(--ink); font-size: 11px; text-align: left; }
.thread-action-menu button:hover { background: var(--surface-soft); }
.thread-action-menu button.danger { color: #a23f35; }
.thread-action-menu button.danger:hover { background: #fff0ee; }
.thread-list.expanded .thread-row:nth-last-child(-n+2) .thread-action-menu { top: auto; bottom: 31px; }
.thread-list-toggle { width: 100%; margin-top: 7px; border: 0; border-radius: 9px; padding: 8px; background: transparent; color: var(--brand); font-size: 10px; font-weight: 750; }
.thread-list-toggle:hover { background: var(--brand-soft); }

.sidebar-spacer { flex: 1; }
.privacy-copy { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: start; gap: 7px 9px; color: var(--muted); font-size: 10px; line-height: 1.45; }
.privacy-copy > span { grid-column: 1; grid-row: 1; color: var(--brand); font-size: 18px; }
.privacy-copy > p { grid-column: 2; margin: 0; }
.journey-data-actions { grid-column: 2; display: flex; flex-wrap: wrap; gap: 5px; }
.journey-data-actions button { border: 0; padding: 2px 0; background: transparent; color: var(--brand-dark); font-size: 8px; font-weight: 750; text-decoration: underline; text-underline-offset: 2px; }
.journey-data-actions button + button { color: #8a453f; }

.loading-screen, .login-screen {
  min-height: 100vh; display: grid; place-items: center; padding: 24px;
  background: radial-gradient(circle at 50% 25%, #edf5f0, var(--surface-soft) 46%);
}
.loading-card { display: grid; justify-items: center; gap: 12px; color: var(--muted); }
.loading-card p { margin: 0; font-size: 16px; font-weight: 650; }
.loading-mark { width: 58px; height: 58px; }
.loading-dots { display: flex; gap: 5px; }
.loading-dots i { width: 5px; height: 5px; border-radius: 50%; background: var(--brand); animation: loading-pulse 1.1s infinite ease-in-out; }
.loading-dots i:nth-child(2) { animation-delay: .15s; }
.loading-dots i:nth-child(3) { animation-delay: .3s; }
@keyframes loading-pulse { 0%, 60%, 100% { opacity: .25; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-3px); } }
.login-card {
  width: min(430px, 100%); padding: 40px; text-align: center; border: 1px solid var(--line);
  border-radius: 26px; background: var(--surface); box-shadow: var(--shadow);
}
.login-mark { width: 64px; height: 64px; margin: 0 auto 20px; }
.login-card h1 { font-size: 31px; font-weight: 800; letter-spacing: -.035em; }
.login-card > p:not(.eyebrow):not(.login-error) { margin: 16px 0 24px; color: var(--muted); font-size: 14px; line-height: 1.55; }
.login-card button { border: 0; border-radius: 14px; padding: 13px 19px; background: var(--brand); color: white; font-weight: 750; }
.login-card button:hover { background: var(--brand-dark); }
.login-error { min-height: 1.4em; margin: 13px 0 0; color: #9c3f35; font-size: 12px; }

.sidebar-scrim { display: none; }
.chat-panel { min-width: 0; height: 100vh; height: 100dvh; display: grid; grid-template-rows: auto minmax(0, 1fr) auto auto auto; background: var(--chat-canvas); }
.chat-header {
  min-height: 76px; padding: 10px 20px; display: flex; align-items: center; gap: 11px;
  border-bottom: 1px solid var(--line); background: var(--surface); box-shadow: 0 2px 10px rgba(24, 31, 27, .04); z-index: 5;
}
.sidebar-toggle {
  width: 38px; height: 38px; flex: 0 0 38px; display: grid; place-items: center;
  border: 0; border-radius: 11px; background: var(--surface-soft); color: var(--brand); font-size: 24px; line-height: 1;
}
.sidebar-toggle-expand { display: none; }
.sidebar-toggle-menu { display: inline; font-size: 17px; }
.sidebar-toggle:hover { background: var(--brand-soft); }
.chat-identity { min-width: 0; flex: 1; display: flex; align-items: center; gap: 11px; }
.chat-avatar { width: 44px; height: 44px; }
.chat-guide-copy { min-width: 0; }
.chat-header h2 { font-size: 17px; font-weight: 800; letter-spacing: -.01em; }
.connection { display: flex; align-items: center; gap: 6px; margin-top: 3px; overflow: hidden; color: var(--muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.connection-dot { width: 8px; height: 8px; flex: 0 0 auto; border-radius: 50%; background: #35a566; }
.chat-size-control {
  display: flex; align-items: center; flex: 0 0 auto; overflow: hidden;
  border: 1px solid var(--line); border-radius: 12px; background: var(--surface-soft);
}
.chat-size-control button { height: 38px; border: 0; border-radius: 0; padding: 0; background: transparent; color: var(--brand); line-height: 1; box-shadow: none; }
.chat-size-control button:not(.chat-size-value) { width: 36px; font-size: 19px; }
.chat-size-control .chat-size-value {
  width: 48px; border-right: 1px solid var(--line); border-left: 1px solid var(--line);
  color: #58615d; font-size: 10px; font-weight: 700; font-variant-numeric: tabular-nums;
}
.chat-size-control button:hover:not(:disabled) { background: var(--brand-soft); }
.chat-size-control button:disabled { color: #bbc2be; cursor: default; }

.messages {
  overflow-y: auto; padding: 24px clamp(18px, 5vw, 72px); scroll-behavior: smooth;
  background-color: var(--chat-canvas);
  background-image: radial-gradient(circle at 16px 16px, rgba(47,107,80,.035) 1px, transparent 1.2px);
  background-size: 48px 48px;
}
.message { display: flex; align-items: flex-end; margin-bottom: 12px; animation: rise .18s ease both; }
@keyframes rise { from { opacity: 0; transform: translateY(4px); } }
.message.history-message { animation: none; }
.bubble {
  position: relative; max-width: min(720px, 80%); padding: 13px 17px 10px; color: #171a18;
  font-size: var(--chat-text-size); line-height: 1.48; white-space: pre-wrap; box-shadow: 0 1px 2px rgba(31, 38, 34, .09);
}
.bubble p { margin: 0 0 8px; }
.message-time { float: right; margin: .75em 0 0 .9em; color: #7c837f; font-size: 9px; line-height: 1; white-space: nowrap; font-variant-numeric: tabular-nums; }
.user-message { justify-content: flex-end; }
.user-message .bubble { border-radius: 22px 22px 6px 22px; background: var(--mint); color: #17231b; }
.user-message .message-time { color: #65806d; }
.guide-message .bubble { border-radius: 22px 22px 22px 6px; background: var(--surface); white-space: normal; }
.user-message .bubble::after, .guide-message .bubble::before { display: none; }
.guide-message .bubble > :first-child { margin-top: 0; }
.guide-message .bubble > :nth-last-child(2) { margin-bottom: 0; }
.guide-message .bubble > :last-child:not(.message-time) { margin-bottom: 0; }
.guide-message .bubble h1, .guide-message .bubble h2, .guide-message .bubble h3, .guide-message .bubble h4 { margin: 14px 0 7px; color: #111412; font-family: inherit; line-height: 1.24; }
.guide-message .bubble h1 { font-size: 1.28em; }
.guide-message .bubble h2 { font-size: 1.19em; }
.guide-message .bubble h3 { font-size: 1.1em; }
.guide-message .bubble ul, .guide-message .bubble ol { margin: 7px 0 9px; padding-left: 1.45em; }
.guide-message .bubble li { margin: 3px 0; }
.guide-message .bubble blockquote { margin: 9px 0; padding: 7px 12px; border-left: 3px solid var(--brand); background: #f2f6f3; color: #4e5752; }
.guide-message .bubble blockquote p { margin: 0; }
.guide-message .bubble a { color: var(--brand); text-decoration-thickness: 1px; text-underline-offset: 2px; }
.guide-message .bubble code { padding: 2px 5px; border-radius: 5px; background: #edf0ee; font-size: .88em; }
.guide-message .bubble pre { overflow-x: auto; padding: 10px 12px; border-radius: 10px; background: #202723; color: #f5f7f6; }
.guide-message .bubble pre code { padding: 0; background: transparent; color: inherit; }
.guide-message .bubble hr { border: 0; border-top: 1px solid var(--line); margin: 13px 0; }
.guide-message .bubble table { width: 100%; margin: 9px 0; border-collapse: collapse; font-size: .92em; }
.guide-message .bubble th, .guide-message .bubble td { padding: 6px 8px; border: 1px solid var(--line); text-align: left; }
.guide-message .bubble th { background: #f2f5f3; }
.typing .bubble { color: var(--muted); font-style: italic; }
.error-message .bubble { border: 1px solid #efc8c3; background: #fff4f2; color: #8e392f; }

.quick-prompts { display: flex; gap: 7px; padding: 8px clamp(16px, 4vw, 54px); overflow-x: auto; background: var(--chat-canvas); }
.quick-prompts button { flex: 0 0 auto; border: 1px solid #dfe3e1; border-radius: 999px; padding: 8px 12px; background: rgba(255,255,255,.92); color: var(--brand-dark); font-size: 10px; font-weight: 700; }
.quick-prompts button:hover { border-color: #abc5b7; background: var(--brand-soft); }
.composer { display: flex; align-items: flex-end; gap: 9px; padding: 10px 16px 8px; border-top: 1px solid var(--line); background: var(--surface); }
.composer textarea {
  width: 100%; min-height: 46px; max-height: 150px; resize: none; border: 1px solid #eceeee; outline: 0;
  padding: 12px 16px; border-radius: 23px; background: var(--surface-soft); color: var(--ink);
  font-size: var(--chat-text-size); line-height: 1.42;
}
.composer textarea:focus, .composer textarea:focus-visible {
  border-color: #b5cbbf; background: var(--surface); outline: 0; box-shadow: none;
}
.composer textarea::placeholder { color: #a2a7a5; }
.composer button {
  width: 46px; height: 46px; min-height: 46px; flex: 0 0 46px; display: grid; place-items: center;
  border: 0; border-radius: 50%; padding: 0; background: var(--brand); color: white; font-size: 16px; font-weight: 800;
  box-shadow: 0 3px 8px rgba(47,107,80,.2);
}
.composer button span:first-child { display: none; }
.composer button:hover { background: var(--brand-dark); }
.composer button:disabled { opacity: .5; cursor: wait; }
.disclaimer { margin: 0; padding: 0 8px 7px; text-align: center; background: var(--surface); color: #9a9f9c; font-size: 9px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; margin: -1px; padding: 0; border: 0; }

@media (min-width: 801px) {
  .sidebar-toggle { display: none; }
  .shell.sidebar-collapsed .sidebar-toggle { display: grid; }
  .sidebar-toggle-expand { display: inline; }
  .sidebar-toggle-menu { display: none; }
  .shell { transition: grid-template-columns .18s ease; }
  .sidebar { transition: transform .18s ease, opacity .18s ease; }
  .shell.sidebar-resizing, .shell.sidebar-resizing .sidebar { transition: none; }
  .shell.sidebar-collapsed { grid-template-columns: 0 minmax(0, 1fr); }
  .shell.sidebar-collapsed .sidebar { transform: translateX(-100%); opacity: 0; visibility: hidden; }
  .shell.sidebar-collapsed .sidebar-resizer { display: none; }
}

@media (max-width: 800px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar {
    position: fixed; inset: 0 auto 0 0; width: min(330px, 88vw); z-index: 50;
    padding: 20px 18px; transform: translateX(-104%); transition: transform .22s ease; box-shadow: 12px 0 36px rgba(20,28,24,.16);
  }
  .shell.sidebar-open .sidebar { transform: translateX(0); }
  .sidebar-resizer { display: none; }
  .sidebar-scrim {
    display: block; position: fixed; inset: 0; z-index: 40; border: 0; padding: 0;
    background: rgba(12,18,15,.32); opacity: 0; pointer-events: none; transition: opacity .2s ease;
  }
  .shell.sidebar-open .sidebar-scrim { opacity: 1; pointer-events: auto; }
  .thread-list { max-height: none; }
  .chat-panel { height: 100vh; height: 100dvh; }
  .chat-header { min-height: 70px; padding: 9px 12px; gap: 8px; }
  .chat-identity { gap: 8px; }
  .chat-avatar { width: 38px; height: 38px; }
  .chat-header h2 { font-size: 15px; }
  .connection { max-width: 138px; font-size: 9px; }
  .chat-size-control { border-radius: 10px; }
  .chat-size-control button { height: 36px; }
  .chat-size-control button:not(.chat-size-value) { width: 30px; }
  .chat-size-control .chat-size-value { width: 38px; font-size: 9px; }
  .messages { padding: 15px 12px; }
  .message { margin-bottom: 9px; }
  .bubble { max-width: 92%; padding: 11px 14px 9px; }
  .quick-prompts { padding: 7px 10px; }
  .composer { padding: 8px 10px 7px; }
  .composer textarea { min-height: 44px; padding: 11px 14px; }
  .composer button { width: 44px; height: 44px; min-height: 44px; flex-basis: 44px; }
}

@media (max-width: 360px) {
  .chat-avatar { display: none; }
  .connection { max-width: 108px; }
  .chat-size-control .chat-size-value { width: 34px; }
}

/* Application-owned Claim Your Power journey */
.workspace {
  min-width: 0; height: 100vh; height: 100dvh; display: grid;
  grid-template-rows: auto minmax(0, 1fr); overflow: hidden; background: #f4f5f2;
}
.view-nav { display: grid; gap: 7px; }
.view-nav-button {
  width: 100%; min-width: 0; display: grid; grid-template-columns: 34px minmax(0, 1fr); align-items: center; gap: 10px;
  border: 1px solid transparent; border-radius: 13px; padding: 9px 10px; background: transparent; color: #464e49; text-align: left;
}
.view-nav-button > span:first-child {
  width: 32px; height: 32px; display: grid; place-items: center; border-radius: 10px;
  background: var(--surface-soft); color: var(--brand); font-size: 11px; font-weight: 850;
}
.view-nav-button > span:last-child { min-width: 0; display: grid; gap: 2px; }
.view-nav-button strong { font-size: 12px; }
.view-nav-button small { color: var(--muted); font-size: 9px; }
.view-nav-button:hover { border-color: #d9e3dd; background: #f7faf8; }
.view-nav-button.active { border-color: #c9ddd1; background: var(--brand-soft); color: var(--brand-dark); }
.view-nav-button.active > span:first-child { background: var(--brand); color: white; }
.journey-card { padding: 15px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface-soft); }
.status-pill { border-radius: 999px; padding: 5px 8px; background: var(--brand-soft); color: var(--brand-dark); font-size: 8px; font-weight: 800; letter-spacing: .035em; text-transform: uppercase; }
.journey-summary-row { display: flex; justify-content: space-between; margin-top: 14px; color: var(--muted); font-size: 11px; }
.progress-track { height: 7px; overflow: hidden; margin-top: 8px; border-radius: 999px; background: #dde4e0; }
.progress-fill { width: 0; height: 100%; border-radius: inherit; background: var(--brand); transition: width .25s ease; }
.resume-button { width: 100%; margin-top: 12px; border: 0; border-radius: 10px; padding: 9px 11px; background: var(--brand); color: white; font-size: 10px; font-weight: 750; }
.resume-button:hover { background: var(--brand-dark); }

.journey-view { min-height: 0; overflow-y: auto; padding: 0; background: white; scrollbar-gutter: stable; }
.primary-button, .secondary-button { min-height: 40px; border-radius: 11px; padding: 9px 14px; font-size: 11px; font-weight: 780; }
.primary-button { border: 1px solid var(--brand); background: var(--brand); color: white; }
.primary-button:hover { border-color: var(--brand-dark); background: var(--brand-dark); }
.secondary-button { border: 1px solid #c9d8d0; background: white; color: var(--brand-dark); }
.secondary-button:hover { border-color: #a9c1b4; background: var(--brand-soft); }
.storage-notice { margin: 0 var(--day-gutter) 16px; padding: 9px 12px; border: 1px solid #d9e5dd; border-radius: 11px; background: #f3f8f5; color: #53635a; font-size: 10px; }
.storage-notice.warning { border-color: #e5cfb3; background: #fff9f0; color: #74552f; }
.journey-layout { width: 100%; min-height: 100%; margin: 0; display: grid; grid-template-columns: minmax(0, 1fr); align-items: stretch; }
.sidebar-journey-picker { display: grid; gap: 9px; padding: 13px; border: 1px solid var(--line); border-radius: 16px; background: #fafbf9; }
.sidebar-journey-picker .section-heading > span { color: #536159; font-size: 10px; font-weight: 780; }
.part-selector { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 5px; }
.part-button { min-width: 0; border: 1px solid #d6dfda; border-radius: 8px; padding: 8px 3px; background: white; color: #45534b; font-size: 10.5px; font-weight: 800; }
.part-button:hover { border-color: #abc1b5; background: var(--brand-soft); color: var(--brand-dark); }
.part-button.selected { border-color: var(--brand); background: var(--brand); color: white; }
.sidebar-day-list { display: grid; gap: 4px; }
.sidebar-day-button { width: 100%; min-width: 0; min-height: 44px; display: grid; grid-template-columns: 31px minmax(0, 1fr) 8px; align-items: center; gap: 9px; border: 1px solid transparent; border-radius: 10px; padding: 7px 8px; background: transparent; color: #243129; text-align: left; }
.sidebar-day-button:hover { border-color: #b8cec1; background: #edf6f0; color: #183d2a; }
.sidebar-day-button.selected { border-color: #8eb69f; background: #dfeee5; color: #123923; }
.sidebar-day-number { width: 31px; height: 31px; display: grid; place-items: center; border-radius: 9px; background: #e9eeeb; color: #314239; font-size: 10px; font-weight: 850; }
.sidebar-day-button.complete .sidebar-day-number { background: var(--brand); color: white; }
.sidebar-day-button.in-progress .sidebar-day-number { background: #dcece3; color: var(--brand-dark); }
.sidebar-day-title { min-width: 0; overflow: hidden; display: -webkit-box; color: inherit; font-family: Inter, ui-sans-serif, system-ui, sans-serif; font-size: 12px; font-weight: 680; line-height: 1.3; -webkit-box-orient: vertical; -webkit-line-clamp: 2; white-space: normal; }
.sidebar-day-status { width: 7px; height: 7px; border-radius: 50%; background: #aebbb4; }
.sidebar-day-button.in-progress .sidebar-day-status { background: #78a18b; }
.sidebar-day-button.complete .sidebar-day-status { background: var(--brand); }
.day-card { --day-gutter: clamp(22px, 4vw, 52px); min-height: 100%; overflow: visible; border: 0; border-radius: 0; background: white; box-shadow: none; }
.day-fixed-header {
  position: sticky; top: 0; z-index: 4; display: grid;
  grid-template-columns: minmax(170px, .48fr) minmax(300px, 1.65fr) auto;
  grid-template-areas: "identity quote actions"; align-items: center; gap: clamp(16px, 2vw, 32px);
  padding: 14px var(--day-gutter) 15px; border-bottom: 1px solid var(--line); background: white;
  box-shadow: 0 8px 18px rgba(24,31,27,.05);
}
.day-card-header { display: contents; }
.day-card-header > div:first-child { grid-area: identity; min-width: 0; }
.day-card-header h2 { display: inline; margin-right: 9px; color: #172019; font-size: 23px; letter-spacing: -.035em; }
.day-status { display: inline-block; vertical-align: 4px; border-radius: 999px; padding: 5px 8px; font-size: 8px; font-weight: 820; letter-spacing: .035em; text-transform: uppercase; }
.day-status.not-started { background: #f0f2f1; color: #6f7773; }
.day-status.in-progress { background: var(--brand-soft); color: var(--brand-dark); }
.day-status.complete { background: var(--brand); color: white; }
.day-step-actions { grid-area: actions; justify-self: end; display: flex; gap: 6px; }
.day-step-actions button { min-height: 36px; border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; background: var(--surface-soft); color: #5b645f; font-size: 10px; font-weight: 700; }
.day-step-actions button:hover:not(:disabled) { border-color: #b8cbc0; background: var(--brand-soft); color: var(--brand-dark); }
.day-step-actions button:disabled { opacity: .42; cursor: default; }
.day-overview-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin: 18px var(--day-gutter) 0; }
.source-card, .theme-card { min-width: 0; height: 100%; border: 1px solid #dde3df; border-radius: 14px; padding: 15px 17px; background: #fafbf9; }
.field-label { margin: 0; color: var(--brand); font-size: 8px; font-weight: 830; letter-spacing: .09em; text-transform: uppercase; }
.source-card h3, .theme-card h3 { margin: 6px 0 8px; color: #222a25; font-family: var(--reading-font); font-size: 18px; font-weight: 650; line-height: 1.42; letter-spacing: -.01em; }
.source-card > p:last-child, .theme-card > p:last-child { margin: 0; color: #68716c; font-size: 10px; line-height: 1.45; }
.source-card .field-label { margin-right: 5px; }
.day-practices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: stretch; gap: 14px; margin: 12px var(--day-gutter) 0; }
.practice-card { min-width: 0; border: 1px solid #dce5df; border-radius: 13px; padding: 11px 14px 12px; background: #f4f8f5; }
.practice-card-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.practice-audio { min-height: 27px; display: inline-flex; align-items: center; gap: 5px; border: 1px solid #bad0c3; border-radius: 999px; padding: 4px 9px; background: #fff; color: var(--brand-dark); font-size: 8px; white-space: nowrap; }
.practice-audio > span { width: 8px; color: var(--brand); font-size: 8px; text-align: center; }
.practice-audio > strong { font-size: 8px; font-weight: 820; }
.practice-audio:hover:not(:disabled) { border-color: #7ba78e; background: var(--brand-soft); }
.practice-audio:disabled { cursor: wait; opacity: .58; }
.practice-audio.loading { cursor: wait; }
.practice-audio.playing { border-color: #2f7756; background: #e3f1e9; }
.practice-audio.error { border-color: #c98b7e; color: #8f4137; }
.affirmation-card { background: #f0f7f3; }
.practice-card blockquote { margin: 6px 0 0; color: #2d3a32; font-family: var(--reading-font); font-size: clamp(11px, 1vw, 13px); line-height: 1.48; white-space: pre-line; }
.day-practices[aria-busy="true"] .practice-card blockquote { color: #7a847e; font-style: italic; }
.day-practices.error .practice-card { border-color: #eadbd4; background: #fff8f5; }
.day-practices.error .practice-card blockquote { color: #794432; }
.opening-quote-card { grid-area: quote; min-width: 0; margin: 0; padding: 0; border: 0; border-radius: 0; background: white; }
.opening-quote-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.quote-audio { min-height: 23px; padding: 3px 8px; }
.opening-quote-card blockquote { max-width: none; margin: 3px 0 4px; color: #243129; font-family: var(--reading-font); font-size: clamp(14px, 1.25vw, 17px); font-style: italic; line-height: 1.42; }
.opening-quote-card > p { margin: 0; color: #59675f; font-size: 8px; font-weight: 750; letter-spacing: .055em; text-transform: uppercase; }
.reflection-fields {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: auto minmax(105px, 1fr); gap: 8px 14px;
  padding: 12px var(--day-gutter) 7px;
}
.reflection-field-heading { min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 8px 12px; }
.reflection-field-heading[data-voice-field="reflection"] { grid-column: 1; grid-row: 1; }
.reflection-fields #reflection-input { grid-column: 1; grid-row: 2; }
.reflection-field-heading[data-voice-field="commitment"] { grid-column: 2; grid-row: 1; }
.reflection-fields #commitment-input { grid-column: 2; grid-row: 2; }
.reflection-fields label { min-width: 0; display: grid; gap: 3px; }
.reflection-fields label span { color: #29312c; font-size: 12px; font-weight: 800; }
.reflection-fields label small { color: #59635d; font-family: var(--reading-font); font-size: 14px; line-height: 1.55; }
.reflection-fields textarea { width: 100%; min-height: 105px; height: clamp(105px, 14vh, 150px); resize: vertical; border: 1px solid #dfe5e1; border-radius: 13px; padding: 12px 14px; background: #fbfcfb; color: var(--ink); font-family: var(--reading-font); font-size: 15px; line-height: 1.55; }
.reflection-fields textarea:focus { border-color: #a9c1b4; outline: 0; box-shadow: 0 0 0 3px rgba(47,107,80,.1); background: white; }
.voice-controls { display: grid; grid-template-columns: auto minmax(74px, auto); align-items: center; justify-content: end; gap: 3px 7px; }
.voice-mic { min-height: 31px; display: inline-flex; align-items: center; gap: 6px; border: 1px solid #b9cdc1; border-radius: 999px; padding: 6px 10px; background: #f5faf7; color: var(--brand-dark); font-size: 9px; }
.voice-mic > span { width: 8px; height: 8px; color: #6f9882; font-size: 8px; line-height: 1; }
.voice-mic > strong { font-size: 9px; font-weight: 800; }
.voice-mic:hover:not(:disabled) { border-color: #84aa95; background: var(--brand-soft); }
.voice-mic.recording { border-color: #b5554d; background: #fff4f2; color: #8c342d; }
.voice-mic.recording > span { color: #c74940; animation: voice-pulse 1.15s ease-in-out infinite; }
.voice-mic.processing { cursor: wait; opacity: .78; }
.voice-status { grid-column: 2; max-width: min(150px, 34vw); overflow: hidden; color: #76817b; font-size: 8px; line-height: 1.25; text-align: left; text-overflow: ellipsis; white-space: nowrap; }
.voice-status.error { color: #93483f; }
.voice-undo { grid-column: 1 / -1; justify-self: end; border: 0; padding: 1px 2px; background: transparent; color: var(--brand-dark); font-size: 8px; text-decoration: underline; text-underline-offset: 2px; }
@keyframes voice-pulse { 0%, 100% { opacity: .45; transform: scale(.82); } 50% { opacity: 1; transform: scale(1.16); } }
@media (prefers-reduced-motion: reduce) { .voice-mic.recording > span { animation: none; } }
.local-privacy { margin: 4px var(--day-gutter) 7px; color: #77807b; font-size: 9px; line-height: 1.45; }
.journey-sync-status { margin: 0 var(--day-gutter) 14px; color: #587064; font-size: 9px; font-weight: 700; }
.journey-sync-status.syncing::before, .journey-sync-status.synced::before, .journey-sync-status.offline::before, .journey-sync-status.conflict::before { content: ""; width: 7px; height: 7px; display: inline-block; margin-right: 6px; border-radius: 50%; background: #91a89b; }
.journey-sync-status.synced::before { background: var(--brand); }
.journey-sync-status.offline::before { background: #bd8a49; }
.journey-sync-status.conflict::before { background: #b3534b; }
.sync-conflict { margin: 0 var(--day-gutter) 14px; padding: 13px; border: 1px solid #e4c5bf; border-radius: 13px; background: #fff8f6; }
.sync-conflict[hidden] { display: none; }
.sync-conflict h3 { margin: 0; color: #6f302b; font-size: 12px; }
.sync-conflict > p { margin: 5px 0 10px; color: #76544f; font-size: 9px; }
.sync-conflict-values { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.sync-conflict-values article { min-width: 0; padding: 9px; border: 1px solid #ead9d5; border-radius: 9px; background: white; }
.sync-conflict-values strong { color: #5e3d38; font-size: 8px; text-transform: uppercase; }
.sync-conflict-values pre { max-height: 120px; overflow: auto; margin: 5px 0 0; color: #352f2d; font-family: var(--reading-font); font-size: 11px; line-height: 1.4; white-space: pre-wrap; overflow-wrap: anywhere; }
.sync-conflict-actions { display: flex; justify-content: flex-end; gap: 7px; margin-top: 9px; }
.sync-conflict-actions button { min-height: 34px; padding: 6px 10px; font-size: 9px; }
.day-card-footer { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; padding: 17px var(--day-gutter) 24px; border-top: 1px solid var(--line); }
.day-card-footer > div:first-child { display: grid; justify-items: start; gap: 5px; }
.day-reference-actions { grid-template-columns: auto auto auto; }
.day-reference-actions small { grid-column: 1 / -1; }
.link-button { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
.day-card-footer small { color: var(--muted); font-size: 8px; }
.completion-actions { display: flex; flex: 0 0 auto; gap: 7px; }

.takeaways-view { min-height: 0; overflow-y: auto; padding: clamp(12px, 2vw, 24px); background: #f4f5f2; scrollbar-gutter: stable; }
.takeaways-view[hidden] { display: none; }
.takeaways-page { width: 100%; min-height: 100%; margin: 0; padding: clamp(20px, 2.6vw, 34px); border: 1px solid #dce3df; border-radius: 20px; background: white; box-shadow: var(--shadow); }
.back-link { display: inline-block; margin-bottom: 16px; color: var(--brand-dark); font-size: 11px; font-weight: 750; text-decoration: none; }
.back-link:hover { text-decoration: underline; text-underline-offset: 3px; }
.takeaways-page > h2 { color: #18221b; font-family: var(--reading-font); font-size: clamp(24px, 3.2vw, 33px); font-weight: 650; letter-spacing: -.025em; }
.takeaways-source-note { display: grid; gap: 6px; margin-top: 13px; padding: 14px 16px; border: 1px solid #dfe5e1; border-radius: 13px; background: #fafbf9; }
.takeaways-source-note strong { font-family: var(--reading-font); font-size: 16px; line-height: 1.4; }
.takeaways-source-note > span:last-child { color: var(--muted); font-size: 10px; }
.takeaways-intro { margin: 13px 0 7px; color: #647069; font-size: 11px; line-height: 1.55; }
.takeaways-overview { margin-top: 13px; padding: 15px 18px; border-left: 3px solid var(--brand); border-radius: 12px; background: #f1f7f3; }
.takeaways-overview > p:last-child { margin: 7px 0 0; color: #3c4941; font-family: var(--reading-font); font-size: 15px; line-height: 1.55; }
.takeaways-list {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  grid-auto-flow: row; align-items: stretch; gap: 12px;
  margin: 14px 0 20px; padding: 0; list-style: none; counter-reset: takeaway;
}
.takeaways-list li { position: relative; height: 100%; counter-increment: takeaway; padding: 15px 16px 15px 49px; border: 1px solid #e0e6e2; border-radius: 14px; background: #fbfcfb; color: #2e3832; font-family: var(--reading-font); font-size: 15px; line-height: 1.5; }
.takeaways-list li::before { content: counter(takeaway); position: absolute; top: 15px; left: 16px; width: 23px; height: 23px; display: grid; place-items: center; border-radius: 50%; background: var(--brand-soft); color: var(--brand-dark); font-family: Inter, ui-sans-serif, system-ui, sans-serif; font-size: 9px; font-weight: 850; }
.takeaways-toggle { width: 100%; margin: -8px 0 24px; }
.takeaways-actions { display: grid; grid-template-columns: auto 1fr auto; gap: 8px; }
.takeaways-actions #takeaways-ask { justify-self: center; }

.reader-view { min-height: 0; height: 100%; overflow: hidden; padding: clamp(12px, 2vw, 24px); background: #f4f5f2; }
.reader-view[hidden] { display: none; }
.reader-page { height: 100%; min-height: 0; display: grid; grid-template-rows: auto minmax(0, 1fr); overflow: hidden; border: 1px solid #dce3df; border-radius: 20px; background: white; box-shadow: var(--shadow); }
.reader-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; padding: 18px clamp(20px, 2.6vw, 34px); border-bottom: 1px solid var(--line); }
.reader-heading { min-width: 0; }
.reader-heading .back-link { margin-bottom: 9px; }
.reader-heading h2 { margin: 2px 0 3px; color: #18221b; font-family: var(--reading-font); font-size: clamp(22px, 2.5vw, 30px); font-weight: 650; letter-spacing: -.025em; }
.reader-source { margin: 0; overflow: hidden; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.reader-scope { flex: 0 0 auto; display: grid; gap: 2px; margin: 0; padding: 10px 12px; border: 1px solid #d9e5dd; border-radius: 11px; background: #f3f8f5; color: #53635a; font-size: 9px; }
.reader-scope strong { color: var(--brand-dark); font-size: 10px; }
.reader-stage { position: relative; min-height: 0; overflow: hidden; background: #f7f8f5; }
.reader-status { position: absolute; z-index: 2; inset: 50% auto auto 50%; margin: 0; padding: 10px 13px; transform: translate(-50%, -50%); border: 1px solid #d9e5dd; border-radius: 11px; background: white; color: #53635a; font-size: 11px; box-shadow: 0 7px 22px rgba(22, 35, 27, .08); }
.reader-status.error { width: min(440px, calc(100% - 32px)); color: #794432; text-align: center; }
.reader-status[hidden] { display: none; }
.epub-reader { width: min(920px, 100%); height: 100%; min-height: 0; margin: 0 auto; border-inline: 1px solid #e5e9e6; background: white; }
.epub-reader iframe { border: 0 !important; background: white; }

.chat-view { min-height: 0; display: grid; grid-template-rows: minmax(0, 1fr) auto auto auto; background: var(--chat-canvas); }
.chat-view[hidden] { display: none; }
.privacy-copy { flex: 0 0 auto; }

@media (max-width: 980px) {
  .journey-layout { grid-template-columns: 1fr; }
  .day-fixed-header {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "identity actions" "quote quote";
    gap: 8px 14px;
  }
}

@media (min-width: 801px) and (max-height: 800px) {
  .reflection-fields { padding-top: 9px; }
  .reflection-fields label small { font-size: 12px; line-height: 1.35; }
  .reflection-fields textarea { min-height: 88px; height: 88px; padding-block: 10px; }
  .local-privacy { margin-bottom: 8px; }
  .day-card-footer { padding-top: 10px; padding-bottom: 8px; }
}

@media (max-width: 800px) {
  .workspace { height: 100vh; height: 100dvh; }
  .journey-view { padding: 0; }
  .day-card { --day-gutter: 16px; border-radius: 0; }
  .day-fixed-header { padding: 12px var(--day-gutter) 13px; }
  .day-step-actions { grid-area: actions; flex: 0 0 auto; justify-self: end; }
  .day-step-actions button { flex: 0 0 auto; padding: 8px; }
  .opening-quote-card { margin: 0; padding: 0; }
  .day-overview-cards { grid-template-columns: minmax(0, 1fr); gap: 10px; margin: 14px var(--day-gutter) 0; }
  .source-card, .theme-card { padding: 13px 14px; }
  .day-practices { grid-template-columns: minmax(0, 1fr); gap: 10px; margin-top: 10px; }
  .practice-card { padding: 11px 13px 12px; }
  .practice-card blockquote { font-size: 13px; }
  .reflection-fields { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto auto auto; padding: 18px var(--day-gutter) 7px; }
  .reflection-field-heading[data-voice-field="reflection"], .reflection-fields #reflection-input,
  .reflection-field-heading[data-voice-field="commitment"], .reflection-fields #commitment-input { grid-column: 1; grid-row: auto; }
  .reflection-field-heading { grid-template-columns: minmax(0, 1fr) auto; }
  .reflection-fields textarea { height: auto; min-height: 132px; }
  .local-privacy { margin: 4px var(--day-gutter) 7px; }
  .journey-sync-status { margin-bottom: 12px; }
  .sync-conflict-values { grid-template-columns: minmax(0, 1fr); }
  .sync-conflict-actions { flex-direction: column; }
  .sync-conflict-actions button { width: 100%; }
  .day-card-footer { align-items: stretch; flex-direction: column; padding: 14px var(--day-gutter) 18px; }
  .day-card-footer > div:first-child, .day-card-footer button { width: 100%; }
  .day-reference-actions { grid-template-columns: 1fr; }
  .day-reference-actions small { grid-column: 1; }
  .completion-actions { width: 100%; }
  .completion-actions button { flex: 1; }
  .takeaways-view { padding: 10px; }
  .takeaways-page { min-height: 100%; padding: 20px 16px; border-radius: 17px; }
  .takeaways-list { grid-template-columns: minmax(0, 1fr); }
  .takeaways-list li { padding: 14px 14px 14px 46px; font-size: 15px; }
  .takeaways-actions { grid-template-columns: 1fr 1fr; }
  .takeaways-actions #takeaways-ask { grid-column: 1 / -1; grid-row: 2; width: 100%; }
  .reader-view { padding: 0; }
  .reader-page { border: 0; border-radius: 0; box-shadow: none; }
  .reader-header { align-items: stretch; flex-direction: column; gap: 9px; padding: 12px 16px; }
  .reader-heading .back-link { margin-bottom: 7px; }
  .reader-heading h2 { font-size: 21px; }
  .reader-scope { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 7px 10px; }
}

@media (max-width: 480px) {
  .chat-header { min-height: 66px; }
  .day-card-header h2 { font-size: 22px; }
  .connection { max-width: 145px; }
}

/* Orphic Hymns application-owned views */
.library-view, .hymn-view { min-height: 0; overflow-y: auto; padding: 22px; background: var(--chat-canvas); scrollbar-gutter: stable; }
.library-page, .hymn-page { width: 100%; min-height: 100%; margin: 0; }
.hymn-page .eyebrow { color: var(--brand); }
.library-tools { display: flex; align-items: center; gap: 18px; margin: 0 0 18px; }
.hymn-search { position: relative; display: block; flex: 1; }
.hymn-search input { width: 100%; min-height: 48px; padding: 0 48px 0 17px; border: 1px solid #d8e0db; border-radius: 14px; outline: none; background: rgba(255, 255, 255, .92); color: #2e3832; font: inherit; font-size: 14px; box-shadow: 0 5px 18px rgba(27, 40, 34, .04); }
.hymn-search input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand-soft) 78%, transparent); }
.hymn-search > span:last-child { position: absolute; top: 50%; right: 17px; color: var(--muted); font-size: 22px; transform: translateY(-53%); }
#hymn-result-count { min-width: 82px; margin: 0; color: var(--muted); font-size: 13px; font-weight: 800; text-align: right; }
.hymn-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 11px; padding-bottom: 24px; }
.hymn-card { display: grid; grid-template-columns: 38px minmax(0, 1fr) auto; align-items: center; gap: 12px; min-height: 86px; padding: 14px 15px; border: 1px solid #e0e6e2; border-radius: 16px; background: rgba(255, 255, 255, .9); color: inherit; text-decoration: none; box-shadow: 0 7px 18px rgba(27, 40, 34, .04); transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease; }
.hymn-card:hover { border-color: #9bbba8; box-shadow: 0 12px 26px rgba(27, 40, 34, .09); transform: translateY(-2px); }
.hymn-card:focus-visible { outline: 3px solid var(--brand-soft); outline-offset: 2px; }
.hymn-card-number { display: grid; width: 38px; height: 38px; place-items: center; border: 1px solid #cfe1d5; border-radius: 50%; background: var(--brand-soft); color: var(--brand-dark); font-family: Georgia, "Times New Roman", serif; font-size: 13px; }
.hymn-card-copy { display: flex; min-width: 0; flex-direction: column; gap: 5px; }
.hymn-card-copy strong { overflow: hidden; color: #2e3832; font-family: Georgia, "Times New Roman", serif; font-size: 16px; font-weight: 600; line-height: 1.18; text-overflow: ellipsis; }
.hymn-card-copy small { overflow: hidden; color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: .025em; text-overflow: ellipsis; text-transform: uppercase; white-space: nowrap; }
.hymn-card-arrow { color: var(--brand); font-size: 17px; }
.hymn-empty { padding: 50px 20px; color: var(--muted); text-align: center; }

.hymn-page { min-height: 100%; padding: clamp(20px, 2.6vw, 34px); border: 1px solid #dce3df; border-radius: 20px; background: radial-gradient(circle at 92% 5%, rgba(47, 107, 80, .11), transparent 27%), #fbfdfb; box-shadow: var(--shadow); }
.hymn-topbar { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; margin-bottom: 18px; }
.hymn-heading-row { min-width: 0; max-width: min(680px, 70%); text-align: right; }
.hymn-heading-row .eyebrow { margin: 0 0 4px; }
.hymn-heading-row h2 { margin: 0; color: #18221b; font-family: Georgia, "Times New Roman", serif; font-size: clamp(28px, 3.5vw, 40px); font-weight: 600; letter-spacing: -.025em; line-height: 1.08; }
.hymn-audio { min-height: 29px; display: inline-flex; align-items: center; gap: 6px; margin-top: 10px; margin-left: auto; border: 1px solid #bad0c3; border-radius: 999px; padding: 5px 11px; background: #fff; color: var(--brand-dark); font-size: 9px; white-space: nowrap; }
.hymn-audio > span { width: 9px; color: var(--brand); font-size: 9px; text-align: center; }
.hymn-audio > strong { font-size: 9px; font-weight: 820; }
.hymn-audio:hover:not(:disabled) { border-color: #7ba78e; background: var(--brand-soft); }
.hymn-audio:disabled { cursor: wait; opacity: .58; }
.hymn-audio.loading { cursor: wait; }
.hymn-audio.playing { border-color: #2f7756; background: #e3f1e9; }
.hymn-audio.error { border-color: #c98b7e; color: #8f4137; }
.hymn-text-card { padding: 24px 28px 28px; border: 1px solid #dfe5e1; border-radius: 17px; background: #fafbf9; }
.hymn-text-status { margin: 26px auto; color: #647069; font-family: Georgia, "Times New Roman", serif; font-size: 16px; font-style: italic; text-align: center; }
.hymn-reading-text { width: min(70ch, 100%); margin: 0 auto; color: #2e3832; font-family: Georgia, "Times New Roman", serif; font-size: clamp(16px, 1.45vw, 18px); line-height: 1.62; }
.hymn-stanza { margin: 0 0 1.55em; }
.hymn-stanza:last-child { margin-bottom: 0; }
.hymn-stanza p { margin: 0; }
.hymn-actions, .hymn-step-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 18px; }
.hymn-actions { justify-content: flex-end; }
.hymn-actions button { min-width: 190px; }
.hymn-step-actions { margin-top: 44px; padding-top: 18px; border-top: 1px solid #dfe5e1; }
.hymn-step-actions button { max-width: 46%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

@media (max-width: 1040px) {
  .hymn-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 800px) {
  .library-view, .hymn-view { padding: 10px; }
  .library-page, .hymn-page { min-height: 100%; }
  .hymn-grid { grid-template-columns: minmax(0, 1fr); }
  .hymn-page { padding: 20px 16px; border-radius: 17px; }
  .hymn-topbar { gap: 14px; margin-bottom: 16px; }
  .hymn-heading-row { max-width: 62%; }
  .hymn-heading-row h2 { font-size: 30px; }
  .hymn-text-card { padding: 19px 16px 22px; }
  .hymn-reading-text { font-size: 17px; }
}

@media (max-width: 480px) {
  .library-tools { align-items: stretch; flex-direction: column; gap: 8px; }
  #hymn-result-count { text-align: left; }
  .hymn-card { min-height: 78px; }
  .hymn-actions, .hymn-step-actions { align-items: stretch; flex-direction: column; }
  .hymn-actions button, .hymn-step-actions button { width: 100%; max-width: none; }
}
