/* Ratably — the shared components: the app pages and the public pages reuse these; page-specific
   layout is app-pages.css (app) and site-pages.css / site-tools.css (public). Moved verbatim from
   app.css so that the public pages can load them too; nothing about them changed. */

/* page head: eyebrow, h1, one lede */
.page-head { margin-bottom: 32px }
.page-head h1 { font-size: var(--h1-app); line-height: 1.08; margin-top: 8px }
.page-head .lede { margin-top: 12px; max-width: 44em; color: var(--ink2); font-size: 1.06rem }

/* card, with an optional header row (title and an action) and a footer */
.card { background: var(--sheet); border: 1px solid var(--rule); border-radius: 6px; padding: clamp(18px, 3vw, 28px); margin-bottom: 20px }
.card-danger { border-left: 4px solid var(--red) }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px }
.card-title { font-size: 1.15rem; line-height: 1.2; letter-spacing: 0 }
.card > .card-title { margin-bottom: 12px }
.card-text { color: var(--ink2); margin-bottom: 16px }
.card-note { margin-top: 8px; font-size: .85rem; color: var(--ink2) }
.card-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px }
.card-foot { display: flex; justify-content: flex-end; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--rule) }
.card a:not(.btn) { color: var(--green); font-weight: 600 }

/* stat: a number over a mono label */
.stat { display: grid; gap: 6px; margin-bottom: 8px }
.stat-n { font: 800 2.2rem/1 var(--display); letter-spacing: -.03em }
.stat-l { font: 500 .78rem var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--ink2) }

/* buttons: btn-primary is the page's one main action; btn-danger is quiet until hover */
.btn-danger { border-color: var(--rule); color: var(--ink2) }
.btn-danger:hover:not(:disabled) { background: transparent; border-color: var(--red); color: var(--red) }

/* row list: a title, a mono meta line, actions on the right (stacked below 600 px) */
.row-list { list-style: none; margin: 0; padding: 0 }
.row-list > li { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; padding: 14px 0; border-top: 1px solid var(--rule) }
.row-list > li:first-child { border-top: 0; padding-top: 0 }
.row-main { display: grid; gap: 2px; min-width: 0; flex: 1 1 260px }
.row-title { font-weight: 600; font-size: 1.1rem; line-height: 1.3; overflow-wrap: anywhere }
.row-meta { font: 400 .8rem/1.45 var(--mono); color: var(--ink2); overflow-wrap: anywhere }
.row-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px }
.btn-quiet { border-color: transparent; background: transparent; color: var(--ink2); text-decoration: underline; text-underline-offset: 3px }
.btn-quiet:hover:not(:disabled) { background: transparent; border-color: transparent; color: var(--ink); text-decoration-thickness: 2px }
.btn-quiet-danger:hover:not(:disabled) { color: var(--red) }
.row-list .kept-fields { flex-basis: 100%; display: grid; grid-template-columns: max-content 1fr; gap: 4px 14px; margin: 4px 0 0; font-size: .85rem }
.row-list .kept-fields dt { color: var(--ink2) }
.row-list .kept-fields dd { margin: 0; overflow-wrap: anywhere }
@media (max-width: 600px) {
  .row-list > li { flex-direction: column; align-items: stretch }
  .row-main { flex: none }
  .row-actions .btn { flex: 1 }
  .row-actions .btn-primary { flex-basis: 100% }
  .row-actions .btn-quiet { flex: 1 1 auto; white-space: nowrap; padding-inline: .4em }
}

/* empty state: what will appear here, and the link that fills it */
.empty { display: grid; justify-items: center; gap: 10px; padding: 20px 8px; text-align: center }
.empty p { max-width: 34em; color: var(--ink2) }
.empty a { color: var(--green); font-weight: 600 }

/* notice: a left-bordered line; the status lines the page scripts write (.upload-status) look the same */
.notice, .upload-status { margin-top: 16px; padding: 12px; border: 0; border-left: 3px solid var(--ink2); border-radius: 0 4px 4px 0;
  background: color-mix(in srgb, var(--ink2) 7%, var(--sheet)); color: var(--ink); font-size: .92rem }
.notice.ok, .upload-status.ok { border-left-color: var(--green); background: var(--green-soft) }
.notice.error, .upload-status.error, .notice.bad, .upload-status.bad { border-left-color: var(--red); background: color-mix(in srgb, var(--red) 8%, var(--sheet)); color: var(--red) }

/* sub-nav (Your account): two tabs on a 2 px rule */
.subnav { display: flex; border-bottom: 2px solid var(--rule); margin-bottom: 24px }
.subnav a { padding: 10px 20px; margin-bottom: -2px; border-bottom: 2px solid transparent; color: var(--ink2); font-weight: 500; text-decoration: none }
.subnav a:hover { color: var(--ink) }
.subnav a[aria-current="page"] { color: var(--green); border-bottom-color: var(--green); font-weight: 600 }
@media (max-width: 600px) { .subnav a { flex: 1; text-align: center; padding-inline: 8px } }

/* ---- additions for the public pages (site phase 2) ---- */

/* page head, large: the public pages' h1 */
.page-head-lg h1 { font-size: var(--h1-page) }

/* grids of cards: 1 column, 2 from 600 px, 3 or 4 from 900 px */
.cards-3, .cards-4 { display: grid; gap: var(--gap); margin: 0 0 var(--gap); padding: 0; list-style: none }
.cards-3 .card, .cards-4 .card { margin-bottom: 0 }
@media (min-width: 600px) { .cards-3, .cards-4 { grid-template-columns: repeat(2, minmax(0, 1fr)) } }
@media (min-width: 900px) {
  .cards-3 { grid-template-columns: repeat(3, minmax(0, 1fr)) }
  .cards-4 { grid-template-columns: repeat(4, minmax(0, 1fr)) }
}

/* closing call to action: a tinted card, the sentence at the left and the one button at the right */
.card.cta { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 16px 24px; background: var(--green-soft) }
.card.cta h2 { font-size: var(--h2-section); max-width: 22em }
.lede sup { line-height: 0 }

/* the price grid on /pricing and /app/billing: the tier cards stand apart, and a last row of one or two
   is centred instead of leaving a hole: one column on a phone, two from 700 px, three from 1020 px
   (the starred tier stays dark). The same rules for both pages; only what the buttons do differs. */
#pricingGrid { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--gap); border: 0; background: none }
#pricingGrid .tier { flex: 1 1 100%; border: 1px solid var(--rule); border-radius: 6px; background: var(--sheet) }
#pricingGrid .tier-star { border-color: var(--ink); background: var(--ink) }
#pricingGrid .tier-custom { flex: 1 1 100%; padding: 4px 0 0; border: 0; text-align: center }
#pricingGrid .pricing-status { flex: 1 1 100% }
@media (min-width: 700px) {
  #pricingGrid .tier { flex-basis: calc(50% - var(--gap) / 2); max-width: calc(50% - var(--gap) / 2) }
}
@media (min-width: 1020px) {
  #pricingGrid .tier { flex-basis: calc((100% - 2 * var(--gap)) / 3); max-width: calc((100% - 2 * var(--gap)) / 3) }
}

/* short help on buttons (ratably-tips.js): the bubble, and on touch screens the "?" beside a button */
.r-tip { position: fixed; top: 0; left: 0; z-index: 80; width: max-content; max-width: min(280px, calc(100vw - 16px));
  padding: 8px 12px; border-radius: 4px; background: var(--ink); color: #fff; font: 500 .88rem/1.4 var(--body);
  pointer-events: none; box-shadow: 0 8px 20px -8px rgba(16, 32, 47, .5); overflow-wrap: anywhere }
.r-tip-hint { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; min-width: 24px;
  margin: 0 0 0 6px; padding: 0; vertical-align: middle; border: 1.5px solid var(--ink2); border-radius: 50%;
  background: var(--sheet); color: var(--ink2); font: 600 .8rem/1 var(--body); cursor: pointer }
.r-tip-hint:hover, .r-tip-hint:focus-visible { background: var(--green-soft); color: var(--ink); border-color: var(--ink) }
[data-tip][hidden] + .r-tip-hint { display: none }
/* tight rows: the top bar has no room for a "?" (it pushed the menu button off a 393 px screen), so a button directly in
   it gets none there and its twin inside the menu panel carries the "?"; a list row's actions get a smaller gap */
.nav-account > .r-tip-hint { display: none }
.nav-menu-panel button.r-tip-hint { width: 24px; min-width: 24px; height: 24px; min-height: 24px; padding: 0; margin: 6px auto 8px;
  justify-content: center; border: 1.5px solid var(--ink2); border-radius: 50% }
.row-actions .r-tip-hint { margin-left: 3px }
