/* Hallmark · app screen · signature: open-to-annotate PDF flow · home, Drive sources, recents, responsive editor · theme: Cobalt */
:root {
  --editor-paper-edge: var(--color-rule-2);
  --editor-paper-shadow: var(--shadow-page);
}
html, body { overflow-x: clip; }
[hidden] { display: none !important; }
.home-screen { min-height: 100dvh; overflow-y: auto; background: var(--color-paper); }
.home-topbar { display: flex; min-height: 76px; align-items: center; justify-content: space-between; padding: 0 max(var(--space-lg), calc((100vw - 1220px) / 2)); border-bottom: 1px solid var(--color-rule); background: var(--color-paper); }
.home-brand { display: inline-flex; align-items: center; gap: 10px; color: var(--color-ink); font-family: var(--font-display); font-size: var(--text-lg); font-weight: 600; text-decoration: none; }
.brand-mark { display: grid; width: 34px; height: 38px; place-items: center; color: var(--color-accent); }
.brand-mark svg { width: 28px; height: 28px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.7; }
.home-account-tools { display: flex; align-items: center; gap: var(--space-sm); }
.home-account-label { max-width: 230px; overflow: hidden; color: var(--color-muted); font-size: var(--text-xs); text-overflow: ellipsis; white-space: nowrap; }
.home-content { width: min(100% - 48px, 1220px); margin: 0 auto; }
.home-intro { display: grid; min-height: 330px; grid-template-columns: minmax(0, 1.25fr) minmax(280px, .75fr); align-items: center; padding: 44px 0 38px; gap: 56px; }
.home-intro-copy { max-width: 670px; }
.home-kicker { margin-bottom: var(--space-sm); color: var(--color-accent-deep); font-size: var(--text-sm); font-weight: 600; }
.home-intro h1 { max-width: 15ch; overflow-wrap: break-word; font-family: var(--font-body); font-size: clamp(2rem, 3.8vw, 3rem); font-weight: 600; letter-spacing: -.035em; line-height: 1.2; }
.home-lead { max-width: 52ch; margin-top: 14px; color: var(--color-ink-2); font-size: var(--text-md); line-height: 1.7; }
.home-actions { display: flex; flex-wrap: wrap; margin-top: var(--space-lg); gap: var(--space-sm); }
.home-actions button { min-height: 48px; }
.home-page-mark { position: relative; display: flex; min-height: 250px; align-items: center; justify-content: center; overflow: hidden; background: var(--color-paper-2); }
.home-page-sheet { position: relative; display: flex; width: 160px; height: 205px; flex-direction: column; padding: 29px 22px; gap: var(--space-sm); border: 1px solid var(--color-rule-2); background: var(--color-paper); box-shadow: var(--shadow-page); transform: rotate(-3deg); }
.home-page-sheet span { display: block; height: 2px; background: var(--color-page-line); }
.home-page-sheet .sheet-heading { width: 62%; height: 5px; margin-bottom: 6px; background: var(--color-rule-2); }
.home-page-sheet .sheet-note { width: 74%; height: 4px; margin-top: var(--space-sm); background: var(--color-accent-2); transform: rotate(-7deg); }
.sheet-pen { position: absolute; right: calc(50% - 118px); bottom: 43px; display: grid; width: 46px; height: 46px; place-items: center; border: 1px solid var(--color-accent-edge); background: var(--color-accent); color: var(--color-accent-ink); transform: rotate(8deg); }
.sheet-pen svg { width: 25px; height: 25px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
.home-drive-section { padding: 27px 0 30px; border-top: 1px solid var(--color-rule); }
.section-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--space-md); gap: var(--space-lg); }
.section-heading h2 { font-family: var(--font-body); font-size: var(--text-lg); font-weight: 600; }
.section-heading p { margin-top: 3px; color: var(--color-muted); font-size: var(--text-xs); }
.drive-account-summary { color: var(--color-muted); font-size: var(--text-xs); }
.drive-source-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border: 1px solid var(--color-rule); background: var(--color-paper); }
.drive-source { display: flex; min-width: 0; min-height: 85px; align-items: center; padding: 13px 15px; gap: var(--space-sm); border: 0; background: transparent; color: var(--color-ink); text-align: left; white-space: nowrap; }
.drive-source + .drive-source { border-left: 1px solid var(--color-rule); }
.drive-source:hover { background: var(--color-paper-2); }
.source-icon { display: grid; width: 38px; height: 38px; flex: none; place-items: center; color: var(--color-accent); }
.source-icon svg { width: 25px; height: 25px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.7; }
.drive-source > span:nth-child(2) { display: grid; min-width: 0; gap: var(--space-2xs); }
.drive-source strong { font-size: var(--text-sm); font-weight: 600; }
.drive-source small { color: var(--color-muted); font-size: var(--text-xs); line-height: 1.4; white-space: normal; }
.source-chevron { width: 17px; height: 17px; flex: none; margin-left: auto; fill: none; stroke: var(--color-muted); stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
.home-recent-section { min-height: 190px; padding: 27px 0 34px; border-top: 1px solid var(--color-rule); }
.recent-files { border-top: 1px solid var(--color-rule); }
.recent-empty { display: flex; min-height: 82px; align-items: center; justify-content: space-between; padding: 13px var(--space-3xs); gap: 18px; color: var(--color-muted); font-size: var(--text-sm); }
.recent-file { display: flex; width: 100%; min-height: 62px; align-items: center; padding: var(--space-xs) var(--space-2xs); gap: 13px; border: 0; border-bottom: 1px solid var(--color-rule); background: transparent; color: var(--color-ink); text-align: left; }
.recent-file:hover { background: var(--color-paper-2); }
.recent-file-icon { display: grid; width: 34px; height: 38px; flex: none; place-items: center; border: 1px solid var(--color-rule); color: var(--color-error); font-family: var(--font-display); font-size: 9px; font-weight: 600; }
.recent-file-info { display: grid; min-width: 0; flex: 1; gap: var(--space-2xs); }
.recent-file-info strong { overflow: hidden; font-size: var(--text-sm); font-weight: 500; text-overflow: ellipsis; white-space: nowrap; }
.recent-file-info small { color: var(--color-muted); font-size: var(--text-xs); }
.home-footer { display: flex; min-height: 52px; justify-content: center; padding: var(--space-sm) 20px; gap: 26px; border-top: 1px solid var(--color-rule); color: var(--color-muted); font-size: 11px; }
.drive-source:focus-visible, .recent-file:focus-visible, .home-brand:focus-visible { outline: 3px solid var(--color-focus); outline-offset: 3px; }
.editor-screen { height: 100%; }
.paper-stage { align-items: flex-start; }
.empty-state { width: min(100%, 520px); margin: auto; padding: var(--space-2xl) var(--space-lg); text-align: center; }
.empty-state h2 { font-family: var(--font-body); font-size: var(--text-xl); font-weight: 600; }
.empty-state p { margin-top: var(--space-xs); color: var(--color-muted); }
.empty-actions { display: flex; justify-content: center; flex-wrap: wrap; margin-top: 22px; gap: 10px; }
.btn-quiet { min-height: 42px; padding: 0 14px; border: 1px solid var(--color-rule-2); border-radius: var(--radius-input); background: var(--color-paper); font-size: var(--text-sm); }
.btn-quiet:hover { background: var(--color-paper-2); }
.pdf-page { width: auto; min-height: 0; padding: 0; border: 1px solid var(--editor-paper-edge); box-shadow: var(--editor-paper-shadow); line-height: 0; touch-action: none; }
.pdf-page canvas { display: block; max-width: none; }
#inkCanvas { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; }
#pdfCanvas { position: relative; z-index: 0; }
.pdf-page[data-tool="pen"] #inkCanvas, .pdf-page[data-tool="highlight"] #inkCanvas { cursor: crosshair; }
.pdf-page[data-tool="eraser"] #inkCanvas { cursor: cell; }
.thumbnail-list { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.page-thumb { padding: var(--space-2xs); }
.page-thumb canvas { display: block; width: 72px; height: auto; border: 1px solid var(--color-rule); background: var(--color-paper); }
.page-thumb.selected { border-color: var(--color-accent); }
.page-thumb span { color: var(--color-ink-2); font-size: var(--text-xs); }
.connected-accounts, .pending-drafts { padding: var(--space-sm) var(--space-lg); color: var(--color-ink-2); font-size: var(--text-sm); }
.google-setup-notice { margin: var(--space-xs) var(--space-lg) 0; color: var(--color-muted); font-size: var(--text-sm); line-height: 1.55; }
.google-setup-notice:empty { display: none; }
.setup-details { margin: var(--space-sm) var(--space-lg); padding: var(--space-sm); border: 1px solid var(--color-rule); border-radius: var(--radius-card); }
.setup-details summary { cursor: pointer; font-size: var(--text-sm); font-weight: 500; }
.setup-details p, .setup-hint { margin: 10px 0; color: var(--color-muted); font-size: var(--text-xs); line-height: 1.6; }
.setup-details label { display: block; margin-top: 10px; font-size: var(--text-xs); }
.setup-details input { display: block; width: 100%; min-height: 40px; margin-top: var(--space-2xs); padding: 0 var(--space-xs); border: 1px solid var(--color-rule-2); border-radius: var(--radius-input); background: var(--color-paper); color: var(--color-ink); }
.setup-details button { margin-top: var(--space-sm); }
.source-actions { display: flex; flex-wrap: wrap; padding: var(--space-lg) var(--space-lg) var(--space-xs); gap: var(--space-xs); }
.save-state.is-error { color: var(--color-error); }
.save-state.is-dirty { color: var(--color-muted); }
.drive-dialog[open] { display: block; overflow-y: auto; }
button:focus-visible, input:focus-visible, summary:focus-visible { outline: 3px solid var(--color-focus); outline-offset: 2px; }
@media (max-width: 640px) {
  .home-topbar { min-height: 62px; padding-inline: var(--space-sm); }
  .home-brand { font-size: var(--text-md); }
  .home-account-label { display: none; }
  .home-content { width: calc(100% - 28px); }
  .home-intro { min-height: 0; grid-template-columns: minmax(0, 1fr); padding: 34px 0 28px; gap: var(--space-lg); }
  .home-intro h1 { max-width: 14ch; font-size: 2rem; }
  .home-lead { margin-top: 10px; font-size: var(--text-sm); }
  .home-actions { margin-top: 18px; }
  .home-actions button { flex: 1 1 150px; }
  .home-page-mark { min-height: 150px; }
  .home-page-sheet { width: 112px; height: 140px; padding: 19px var(--space-md); gap: var(--space-xs); }
  .sheet-pen { right: calc(50% - 87px); bottom: 22px; width: 38px; height: 38px; }
  .home-drive-section, .home-recent-section { padding-block: 20px; }
  .section-heading { align-items: flex-start; }
  .drive-account-summary { display: none; }
  .drive-source-list { grid-template-columns: minmax(0, 1fr); }
  .drive-source { min-height: 70px; padding-inline: 10px; gap: var(--space-xs); }
  .drive-source + .drive-source { border-top: 1px solid var(--color-rule); border-left: 0; }
  .home-footer { flex-direction: column; align-items: center; gap: 5px; font-size: 10px; }
  .paper-stage { align-items: flex-start; justify-content: center; }
  .pdf-page { flex: none; }
  .setup-details { margin-inline: var(--space-sm); }
  .google-setup-notice { margin-inline: var(--space-sm); }
  .source-actions { padding-inline: var(--space-sm); }
}
@media (min-width: 641px) and (max-width: 900px) {
  .home-content { width: calc(100% - 40px); }
  .home-intro { grid-template-columns: minmax(0, 1fr) 280px; gap: 28px; }
  .drive-source { padding-inline: 10px; gap: var(--space-xs); }
  .drive-source small { display: none; }
}
