/* RYVO feature stories. Paper artifacts and diagrams, composed per subject.
   Shared brand tokens live in the page; every illustration is semantic HTML. */
.feature-story { padding-block: clamp(64px, 8vw, 108px); border-top: 1px solid var(--line); }
.feature-story .story-heading { font-size: clamp(32px, 4vw, 49px); line-height: 1.06; max-width: 22ch; }
.story-lead { font-size: var(--t-lead); color: var(--ink2); line-height: 1.65; max-width: 48ch; margin-top: 22px; }
.story-copy > .story-notes { margin-top: 32px; }
.story-notes { display: grid; gap: 24px; }
.story-note h3 { font-family: var(--font-ui); font-size: 14px; line-height: 1.5; font-weight: 600; margin-bottom: 7px; }
.story-note p { font-size: var(--t-small); line-height: 1.75; color: var(--ink2); max-width: 52ch; }
.story-split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(40px, 7vw, 96px); align-items: center; }
.story-headline { display: flex; justify-content: space-between; align-items: end; gap: 48px; margin-bottom: 44px; }
.story-headline .story-heading { max-width: 19ch; }
.story-headline .story-lead { max-width: 43ch; margin-top: 0; }
.story-caption { font-size: 12px; line-height: 1.6; color: var(--muted); margin-top: 18px; }
.story-label { font-size: 11px; font-family: var(--font-mono); letter-spacing: .08em; text-transform: uppercase; line-height: 1.6; }
.story-divider { width: 36px; height: 2px; background: var(--accent); margin: 20px 0; }
.story-note-row { display: grid; grid-template-columns: 1fr 1fr; gap: 36px; margin-top: 38px; }
.story-mark { display: inline-flex; align-items: center; gap: 7px; color: var(--accent-ink); font-size: 12px; }
.story-mark::before { content: ''; width: 6px; height: 6px; border: 1px solid currentColor; border-radius: 50%; }
.paper-lines { display: grid; gap: 11px; margin: 22px 0; }
.paper-lines i { display: block; height: 1px; background: var(--line2); }
.paper-lines i:last-child { width: 60%; }
.story-arrow { font-size: 26px; color: var(--accent); font-family: var(--font-ui); }
/* Payment: a receipt and its invoice, offset like papers on a desk. */
.story-payments { background: var(--surface); }
.receipt-scene { position: relative; padding: 16px 0 0; }
.invoice-paper { margin-right: 36px; background: var(--paper); border: 1px solid var(--line2); padding: 32px; min-height: 350px; }
.invoice-paper header { display: flex; justify-content: space-between; align-items: baseline; gap: 15px; padding-bottom: 24px; border-bottom: 1px solid var(--ink); }
.invoice-paper header b { font-family: var(--font-display); font-size: 25px; font-weight: 400; }
.invoice-paper .invoice-title { font-family: var(--font-display); font-size: 33px; margin-top: 25px; }
.invoice-entry { display: flex; justify-content: space-between; gap: 16px; padding: 15px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.invoice-entry b { font-weight: 500; }
.payment-stamp { position: relative; margin: -48px 0 0 auto; width: 68%; background: var(--surface); border: 1px solid var(--accent); padding: 22px 24px; }
.payment-stamp strong { display: block; color: var(--accent-ink); font-family: var(--font-display); font-size: 29px; font-weight: 400; margin: 8px 0; }
.payment-stamp p { font-size: 12px; color: var(--ink2); }
/* Calendar: calendar spread comes first, copy follows it. */
.story-calendar { background: var(--sunk); }
.calendar-sheet { background: var(--surface); border: 1px solid var(--line2); }
.calendar-heading { display: flex; justify-content: space-between; align-items: center; padding: 22px; background: var(--accent-ink); color: var(--on-accent); }
.calendar-heading strong { font-family: var(--font-display); font-size: 26px; font-weight: 400; }
.calendar-days { display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); }
.calendar-days > div { min-width: 0; min-height: 148px; border-right: 1px solid var(--line); padding: 12px 7px; background: var(--rule-fine); }
.calendar-days > div:last-child { border: 0; }
.calendar-days b { display: block; text-align: center; font-size: 12px; font-weight: 400; color: var(--muted); margin-bottom: 35px; }
.calendar-days span { display: block; border-left: 2px solid var(--accent); padding: 5px; background: var(--accent-soft); font-size: 11px; line-height: 1.5; overflow-wrap: anywhere; }
.calendar-days > div:nth-child(3) span { margin-top: 60px; }
.calendar-days > div:nth-child(5) span { margin-top: 20px; }
.calendar-connections { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px 22px; padding: 22px 8px 0; font-size: 13px; }
.calendar-connections span { border-bottom: 1px solid var(--accent); padding-bottom: 6px; }
/* Mail: a horizontal filing tray, with one message joining the matter. */
.story-mailbox { background: var(--surface); }
.filing-desk { display: grid; grid-template-columns: 1.1fr 60px 1fr; align-items: center; gap: 24px; background: var(--rule-wide),var(--paper); padding: clamp(20px,4vw,46px); }
.mail-stack { background: var(--surface); border: 1px solid var(--line2); }
.mail-stack header { padding: 16px 20px; border-bottom: 1px solid var(--ink); }
.mail-row { padding: 16px 20px; border-bottom: 1px solid var(--line); }
.mail-row:last-child { border: 0; }
.mail-row strong { display: block; font-size: 13px; font-weight: 500; }
.mail-row span { display: block; color: var(--muted); font-size: 12px; margin-top: 4px; }
.mail-row.is-filed { border-left: 3px solid var(--accent); background: var(--accent-soft); }
.filing-desk > .story-arrow { text-align: center; }
.matter-folder { position: relative; border: 1px solid var(--accent); border-top: 3px solid var(--accent); background: var(--paper); padding: 28px; }
.matter-folder::before { content: ''; position: absolute; height: 14px; width: 90px; border: 1px solid var(--accent); border-bottom: 0; top: -17px; left: -1px; background: var(--paper); }
.matter-folder h3 { font-size: 28px; margin: 12px 0 25px; }
.folder-tabs { display: flex; flex-wrap: wrap; gap: 14px; font-size: 12px; border-bottom: 1px solid var(--line2); padding-bottom: 12px; }
.folder-tabs b { color: var(--accent-ink); font-weight: 500; }
/* SMS: a deliberate dark pause, one outbound reminder rather than a fake chat. */
.story-sms { background: var(--accent-ink); color: var(--on-accent); }
.story-sms .story-lead, .story-sms .story-note p { color: var(--on-accent); opacity: .85; }
.story-sms .story-caption { color: var(--on-accent); opacity: .75; }
.message-thread { border-left: 1px solid oklch(99% 0 0 / .35); padding: 8px 0 8px 32px; }
.message-thread > .story-label { color: var(--on-accent); opacity: .8; }
.message-bubble { position: relative; background: var(--paper); color: var(--ink); padding: 28px; border-radius: 4px 4px 4px 0; margin-top: 22px; max-width: 360px; }
.message-bubble::before { content: ''; position: absolute; left: -12px; bottom: 0; width: 12px; height: 16px; background: var(--paper); clip-path: polygon(100% 0,100% 100%,0 100%); }
.message-bubble p { font-family: var(--font-display); font-size: 26px; line-height: 1.4; }
.message-bubble span { display: block; font-size: 11px; color: var(--muted); margin-top: 20px; }
.message-outcome { margin-top: 25px; display: flex; flex-wrap: wrap; gap: 10px 20px; font-size: 12px; }
.message-outcome span { border-bottom: 1px solid oklch(99% 0 0 / .4); padding-bottom: 7px; }
/* Intake: a full-width process, with form lines becoming a matter folder. */
.story-intake { background: var(--paper); }
.intake-journey { display: grid; grid-template-columns: 1fr 40px 1fr 40px 1fr; align-items: center; gap: 18px; margin-top: 46px; }
.intake-stage { align-self: stretch; border-top: 2px solid var(--ink); padding-top: 20px; }
.intake-stage:last-child { border-color: var(--accent); }
.intake-stage h3 { font-family: var(--font-display); font-size: 30px; margin: 16px 0; }
.intake-stage p { font-size: 13px; color: var(--ink2); line-height: 1.7; }
.intake-lines { padding: 18px 20px; border: 1px solid var(--line2); background: var(--surface); margin-top: 18px; }
.intake-lines span { font-size: 11px; color: var(--muted); }
.intake-lines i { display: block; height: 1px; margin: 12px 0; background: var(--line); }
.intake-review { margin-top: 18px; display: grid; gap: 12px; padding: 20px; background: var(--sunk); font-size: 12px; }
.intake-file { margin-top: 18px; background: var(--accent-soft); border-left: 3px solid var(--accent); padding: 24px 20px; font-size: 14px; }
/* LEDES: four format sheets, each with a restrained offset. */
.story-ledes { background: var(--surface); text-align: center; }
.story-ledes .story-heading, .story-ledes .story-lead { margin-inline: auto; }
.export-sheets { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 18px; max-width: 940px; margin: 52px auto 32px; padding: 8px; }
.export-sheet { text-align: left; border: 1px solid var(--line2); border-top: 5px solid var(--accent); background: var(--paper); padding: 24px; min-height: 208px; }
.export-sheet:nth-child(1) { transform: rotate(-3deg) translateY(10px); }
.export-sheet:nth-child(2) { transform: translateY(-8px); }
.export-sheet:nth-child(3) { transform: rotate(2deg); }
.export-sheet:nth-child(4) { transform: rotate(4deg) translateY(13px); }
.export-sheet strong { display: block; font-family: var(--font-display); font-size: 32px; font-weight: 400; margin-top: 12px; }
.story-ledes .story-note-row { text-align: left; max-width: 850px; margin-inline: auto; border-top: 1px solid var(--line2); padding-top: 28px; margin-top: 44px; }
/* Late fees: marginal annotation beside an unchanged billing record. */
.story-late-fees { background: var(--sunk); }
.charge-ledger { border-left: 3px double var(--ink); padding-left: 25px; }
.charge-record { padding: 25px; background: var(--surface); border: 1px solid var(--line2); }
.charge-record + .charge-record { margin: 20px 0 0 42px; border-left: 3px solid var(--accent); }
.charge-record h3 { font-family: var(--font-display); font-size: 27px; margin: 15px 0; }
.charge-record p { font-size: 13px; color: var(--ink2); }
.charge-record .story-mark { margin-top: 18px; }
/* Reports: a large count, category index and a saved view worksheet. */
.story-reports { background: var(--surface); }
.report-composition { display: grid; grid-template-columns: .75fr 1.25fr; gap: 60px; align-items: start; margin-top: 46px; }
.report-count { display: flex; align-items: center; gap: 22px; border-top: 1px solid var(--ink); padding-top: 15px; }
.report-count strong { font-family: var(--font-display); color: var(--accent-ink); font-size: clamp(80px,10vw,132px); font-weight: 400; line-height: 1; }
.report-count span { font-size: 14px; line-height: 1.7; max-width: 14ch; }
.report-categories { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 22px; font-size: 13px; }
.report-categories span { border-bottom: 1px solid var(--line2); padding-bottom: 12px; }
.report-view { border: 1px solid var(--line2); background: var(--paper); }
.report-view header { display: flex; justify-content: space-between; gap: 15px; flex-wrap: wrap; padding: 20px 24px; border-bottom: 1px solid var(--line2); }
.report-view header strong { font-size: 15px; font-weight: 500; }
.report-columns { padding: 24px; }
.report-columns .column-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.column-tags span { background: var(--surface); border: 1px solid var(--line2); padding: 8px 12px; font-size: 12px; }
.report-grid { margin: 0 24px; border-block: 1px solid var(--line2); }
.report-grid div { height: 28px; border-bottom: 1px solid var(--line); background: repeating-linear-gradient(to right,transparent 0 32%,var(--line) 32% calc(32% + 1px)); }
.report-view footer { display: flex; justify-content: space-between; padding: 20px 24px; gap: 14px; flex-wrap: wrap; font-size: 12px; }
/* Identity: two dossiers, different subjects, one explicit result record. */
.story-identity { background: var(--rule-wide),var(--paper); }
.identity-dossiers { display: grid; grid-template-columns: 1fr 1fr; gap: 0; margin-top: 44px; border-block: 1px solid var(--ink); }
.identity-dossier { padding: 32px 38px 32px 0; }
.identity-dossier + .identity-dossier { padding: 32px 0 32px 38px; border-left: 1px solid var(--line2); }
.identity-dossier header { display: flex; gap: 20px; align-items: center; margin-bottom: 25px; }
.identity-dossier svg { width: 48px; height: 48px; color: var(--accent); flex: none; }
.identity-dossier h3 { font-size: 29px; }
.identity-dossier p { font-size: 14px; line-height: 1.7; color: var(--ink2); }
.identity-provider { margin-top: 22px; font-family: var(--font-mono); font-size: 12px; }
/* General ledger: a balanced book, not two disconnected feature cards. */
.story-books { background: var(--surface); }
.journal-spread { border: 1px solid var(--ink); background: var(--rule-fine),var(--paper); margin-top: 42px; }
.journal-caption { padding: 18px 26px; border-bottom: 3px double var(--ink); display: flex; justify-content: space-between; gap: 20px; }
.journal-caption strong { font-family: var(--font-display); font-size: 23px; font-weight: 400; }
.journal-columns { display: grid; grid-template-columns: 1fr 1fr; }
.journal-column { padding: 25px 30px 20px; }
.journal-column + .journal-column { border-left: 1px solid var(--ink); }
.journal-column h3 { font-size: 27px; margin-bottom: 20px; }
.journal-line { display: flex; justify-content: space-between; gap: 14px; border-bottom: 1px solid var(--line2); padding: 14px 0; font-size: 13px; }
.journal-line b { font-family: var(--font-mono); font-weight: 400; }
.journal-total { display: flex; justify-content: center; gap: 24px; padding: 19px; border-top: 3px double var(--ink); color: var(--accent-ink); font-size: 13px; }
/* Deposits: receipt-to-deposit timeline, using the actual trust treatment. */
.story-deposits { background: var(--paper); }
.deposit-track { padding: 36px; background: var(--surface); border: 1px solid var(--line2); border-left: var(--trust-rule); }
.deposit-track > .story-label { background: var(--trust-hatch); padding: 10px; display: block; }
.deposit-days { list-style: none; margin: 28px 0 0; padding: 0; }
.deposit-days li { position: relative; padding: 0 0 30px 30px; border-left: 1px solid var(--line2); margin-left: 5px; }
.deposit-days li:last-child { padding-bottom: 0; border-color: transparent; }
.deposit-days li::before { content: ''; position: absolute; top: 2px; left: -5px; width: 9px; height: 9px; background: var(--surface); border: 1px solid var(--accent); border-radius: 50%; }
.deposit-days li:last-child::before { background: var(--accent); }
.deposit-days strong { display: block; font-size: 15px; font-weight: 500; }
.deposit-days span { font-size: 13px; display: block; color: var(--ink2); margin-top: 8px; }
/* API: a permission boundary drawn as a frame. */
.story-api { background: var(--accent-ink); color: var(--on-accent); }
.story-api .story-lead, .story-api .story-note p { color: var(--on-accent); opacity: .85; }
.story-api .story-caption { color: var(--on-accent); opacity: .75; }
.permission-frame { padding: 32px; border: 1px solid oklch(99% 0 0 / .45); }
.permission-frame header { display: flex; justify-content: space-between; gap: 20px; padding-bottom: 22px; border-bottom: 1px solid oklch(99% 0 0 / .3); }
.permission-frame header b { font-family: var(--font-display); font-size: 32px; font-weight: 400; }
.permission-scope { padding: 25px 0 10px; }
.permission-scope p { margin-bottom: 15px; font-size: 15px; }
.permission-boundary { padding: 18px 0 0; margin-top: 15px; border-top: 1px dashed oklch(99% 0 0 / .5); font-size: 12px; line-height: 1.7; }
/* Webhooks: a delivery route and its paper trail. */
.story-webhooks { background: var(--rule-wide),var(--paper); }
.delivery-route { display: grid; grid-template-columns: 1fr 35px 1fr 35px 1fr; align-items: center; gap: 14px; margin: 44px 0 34px; }
.delivery-stop { border-block: 1px solid var(--ink); padding: 24px 18px; text-align: center; background: var(--paper); }
.delivery-stop strong { font-family: var(--font-display); font-size: 27px; font-weight: 400; display: block; }
.delivery-stop span { display: block; margin-top: 10px; color: var(--ink2); font-size: 12px; }
.delivery-log { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 15px 26px; border-left: 3px solid var(--accent); background: var(--surface); padding: 22px 26px; font-size: 13px; }
/* Keep all stories readable and in a deliberate order on small screens. */
.feature-story *, .story-split > *, .story-headline > *, .report-composition > * { min-width: 0; }
@media (max-width: 900px) {
 .story-split, .report-composition { grid-template-columns: 1fr; gap: 38px; }
 .story-headline { display: block; }
 .story-headline .story-lead { margin-top: 22px; }
 .story-copy { order: -1; }
 .receipt-scene, .calendar-scene, .message-thread, .charge-ledger, .deposit-track, .permission-frame { width: 100%; max-width: 560px; margin-inline: auto; }
 .filing-desk { gap: 14px; grid-template-columns: 1fr 30px 1fr; }
 .export-sheets { gap: 12px; }
 .export-sheet { padding: 18px; }
 .export-sheet strong { font-size: 26px; }
 .intake-journey { gap: 10px; grid-template-columns: 1fr 20px 1fr 20px 1fr; }
}
@media (max-width: 620px) {
 .feature-story figure { margin: 0; }
 .calendar-days span { padding: 4px 3px; font-size: 10px; }
 .story-headline { margin-bottom: 30px; }
 .story-note-row { grid-template-columns: 1fr; gap: 24px; }
 .filing-desk { grid-template-columns: 1fr; gap: 22px; }
 .filing-desk > .story-arrow { transform: rotate(90deg); }
 .matter-folder { margin-top: 12px; }
 .intake-journey { grid-template-columns: 1fr; gap: 24px; }
 .intake-journey > .story-arrow { transform: rotate(90deg); text-align: center; }
 .intake-stage { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 20px; }
 .intake-stage > .story-label { grid-column: 1 / -1; }
 .intake-stage h3 { margin-top: 8px; font-size: 25px; }
 .intake-stage > p { grid-column: 1; }
 .intake-lines, .intake-review, .intake-file { grid-column: 2; grid-row: 2 / 4; margin-top: 8px; }
 .export-sheets { grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 36px; }
 .export-sheet { min-height: 175px; }
 .export-sheet:nth-child(n) { transform: none; }
 .export-sheet:nth-child(even) { transform: translateY(10px); }
 .identity-dossiers { grid-template-columns: 1fr; }
 .identity-dossier, .identity-dossier + .identity-dossier { padding: 26px 0; border-left: 0; }
 .identity-dossier + .identity-dossier { border-top: 1px solid var(--line2); }
 .journal-column { padding: 18px 12px; }
 .journal-line { display: block; line-height: 1.6; }
 .journal-line b { display: block; margin-top: 5px; }
 .journal-caption { flex-direction: column; gap: 8px; padding: 18px; }
 .delivery-route { grid-template-columns: 1fr; }
 .delivery-route > .story-arrow { transform: rotate(90deg); text-align: center; }
 .delivery-stop { padding: 20px; }
 .payment-stamp { width: 78%; }
 .receipt-scene { padding-right: 0; }
 .invoice-paper { padding: 24px; }
 .deposit-track, .permission-frame { padding: 24px; }
 .charge-record + .charge-record { margin-left: 20px; }
 .message-thread { padding-left: 24px; }
}
@media (forced-colors: active) {
 .feature-story { border: 1px solid CanvasText; }
 .story-sms, .story-api { background: Canvas; color: CanvasText; }
 .story-sms .story-lead, .story-sms .story-note p, .story-api .story-lead, .story-api .story-note p { color: CanvasText; }
 .payment-stamp, .permission-frame, .message-bubble, .calendar-days span { border: 1px solid CanvasText; }
}
