/* The page shell for sign-in, account, classes and messages: a paper sheet on the field ground.
   Colours, type, space and radii come from tokens.css (the overshoot design system, built from type-editor/src/tokens.css). */
* { box-sizing: border-box; }
html { background: var(--field); }
body { margin: 0; min-height: 100vh; background: var(--field); color: var(--ink); font: 400 13px/20px var(--font-sans); -webkit-font-smoothing: antialiased; }
:root { color-scheme: light dark; }
b, strong { font-weight: 600; }
/* the lock-up above the sheet, 14px tall, back to the editor */
.pagehead { max-width: 760px; margin: 0 auto; padding: 24px 0 16px; display: flex; align-items: center; height: 72px; }
.pagehead a { display: inline-flex; padding: 4px; margin-left: -4px; border-radius: var(--radius-sm); }
.pagehead img { display: block; height: 18px; width: auto; }
.lockup { display: block; height: 28px; width: auto; margin: 0 0 24px; }
main.card { background: var(--paper); border-radius: var(--radius-lg); box-shadow: inset 0 0 0 1px var(--line); margin: 0 auto 48px; padding: 32px; max-width: 760px; }
main.card.narrow { max-width: 416px; margin-top: 12vh; }
@media (max-width: 792px) { .pagehead { padding: 16px 16px 8px; height: auto; } main.card { margin: 0 16px 32px; padding: 24px; } main.card.narrow { margin-top: 24px; } }
h1 { font-size: 22px; line-height: 28px; font-weight: 600; margin: 0 0 8px; letter-spacing: -0.01em; }
h2 { font-size: 15px; line-height: 20px; font-weight: 600; margin: 32px 0 12px; }
h3 { font-size: 13px; line-height: 20px; font-weight: 600; margin: 16px 0 8px; }
h4 { font-size: 15px; line-height: 20px; font-weight: 600; }
p { margin: 0 0 12px; }
.lede { color: var(--quiet); margin: 0 0 24px; }
label { display: block; font-weight: 600; font-size: 13px; margin: 0 0 8px; }
/* fields: filled, borderless, rounded; the focus ring identifies them */
input, select, textarea { width: 100%; font: inherit; font-size: 13px; font-variant-numeric: tabular-nums; height: 32px; padding: 0 8px; border: 0; border-radius: var(--radius-md); background: var(--field); color: var(--ink); outline: none; }
input::placeholder, textarea::placeholder { color: var(--quiet); }
select { appearance: none; -webkit-appearance: none; padding-right: 28px; cursor: pointer; background: var(--field) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%238e8e93' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 10px center; }
textarea { height: auto; min-height: 80px; padding: 8px; line-height: 20px; resize: vertical; }
input:focus, select:focus, textarea:focus { box-shadow: 0 0 0 2px var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: none; }
/* buttons: filled, rounded, semibold. One primary per view */
button { font: inherit; font-size: 12px; font-weight: 600; height: 32px; padding: 0 16px; border-radius: var(--radius-md); cursor: pointer; border: 0; background: var(--field); color: var(--ink); display: inline-flex; align-items: center; justify-content: center; gap: 8px; white-space: nowrap; }
button:hover { background: var(--hover); }
button.primary { background: var(--accent); color: var(--paper); width: 100%; margin-top: 8px; height: 40px; font-size: 13px; border-radius: var(--radius-lg); }
button.primary:hover { filter: brightness(1.08); }
button.secondary { width: 100%; height: 40px; font-size: 13px; border-radius: var(--radius-lg); }
button.danger { color: var(--bad-text); }
button:disabled { opacity: var(--opacity-disabled); cursor: default; filter: none; }
button.link { background: none; border: 0; height: auto; padding: 0; color: var(--accent); font-size: inherit; font-weight: 400; border-radius: 0; }
button.link:hover { text-decoration: underline; background: none; }
.or { display: flex; align-items: center; gap: 16px; color: var(--quiet); font-size: 12px; margin: 16px 0; }
.or::before, .or::after { content: ""; flex: 1; border-top: 1px solid var(--line); }
.hidden { display: none !important; }
/* messages: say what happened and what to do next */
.msg { min-height: 20px; margin: 16px 0 0; }
.msg.good, .msg.bad { padding: 8px 12px; border-radius: var(--radius-md); font-size: 12px; line-height: 16px; }
.msg.good { background: color-mix(in srgb, var(--good) 12%, transparent); color: var(--good-text); }
.msg.bad { background: color-mix(in srgb, var(--bad) 10%, transparent); color: var(--bad-text); }
.msg:empty { padding: 0; background: none; }
.fine { color: var(--quiet); font-size: 11px; line-height: 16px; margin-top: 16px; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row > * { flex: 0 0 auto; }
.spread { justify-content: space-between; }
.row a { font-size: 13px; }
/* plans: rounded outlined cards; the current one gets an accent ring and a solid tag */
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(176px, 1fr)); gap: 16px; }
.plan { border-radius: var(--radius-lg); box-shadow: inset 0 0 0 1px var(--line); padding: 16px; display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.plan > button, .plan > .row { align-self: stretch; }
.plan > .row > button { flex: 1; }
.plan .price { font-size: 22px; line-height: 28px; font-weight: 600; font-variant-numeric: tabular-nums; }
.plan .price .muted { display: block; font-size: 11px !important; line-height: 16px; font-weight: 400; }
.plan .note { color: var(--ink); font-size: 12.5px; flex: 1; }
.plan.current { box-shadow: inset 0 0 0 2px var(--accent); }
.plan.current .tag { background: var(--ink); color: var(--paper); }
/* tags: small semibold pills, tinted by meaning */
.tag { display: inline-flex; align-items: center; height: 16px; padding: 0 8px; font-size: 10.5px; line-height: 16px; font-weight: 600; border-radius: var(--radius-full); background: var(--field); color: var(--ink); white-space: nowrap; }
.tag.good { background: color-mix(in srgb, var(--good) 12%, transparent); color: var(--good-text); }
.tag.bad { background: color-mix(in srgb, var(--bad) 12%, transparent); color: var(--bad-text); }
.tag.warn { background: color-mix(in srgb, var(--warn) 30%, transparent); color: var(--ink); }
.tag.accent { background: var(--accent-soft); color: var(--accent); }
/* tables: semibold head over a hairline, 32px rows */
table { width: 100%; border-collapse: collapse; font-size: 12.5px; font-variant-numeric: tabular-nums; }
td, th { text-align: left; height: 32px; padding: 4px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { color: var(--ink); font-weight: 600; }
tbody tr:hover td { background: var(--hover); }
td select, td input { height: 24px; font-size: 12px; width: auto; }
td button { height: 24px; padding: 0 12px; font-size: 11.5px; }
.muted { color: var(--quiet); }
.small { font-size: 11px; line-height: 16px; }
/* organisations: rows that open, a hairline between them */
details.org { box-shadow: inset 0 1px 0 var(--line); margin: 0; }
details.org:last-of-type { box-shadow: inset 0 1px 0 var(--line), inset 0 -1px 0 var(--line); }
details.org > summary { cursor: pointer; min-height: 48px; padding: 8px 0; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; list-style: none; }
details.org > summary::-webkit-details-marker { display: none; }
details.org > summary::before { content: ""; width: 12px; height: 12px; flex: none; background: var(--quiet); -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M4 2.5L7.5 6 4 9.5' fill='none' stroke='black' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 12px no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M4 2.5L7.5 6 4 9.5' fill='none' stroke='black' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 12px no-repeat; transition: transform .15s; }
details.org[open] > summary::before { transform: rotate(90deg); }
details.org > summary .tag { margin-left: 4px; }
.orgbody { padding: 0 0 16px 20px; }
.orgbody p { margin: 4px 0 12px; }
table.sub td, table.sub th { padding: 4px; }
label.inl { display: inline; margin: 0; }
/* checkbox: 18px, 5px corners; checked fills accent */
label.ck { display: inline-flex; gap: 8px; align-items: center; font-weight: 400; margin: 0; cursor: pointer; }
label.ck input { appearance: none; -webkit-appearance: none; width: 18px; height: 18px; flex: none; margin: 0; padding: 0; border: 1.5px solid var(--quiet); border-radius: 5px; background: none; display: grid; place-content: center; cursor: pointer; }
label.ck input:checked { background: var(--accent); border-color: var(--accent); }
label.ck input:checked::after { content: ""; width: 8px; height: 4px; border-left: 2px solid var(--paper); border-bottom: 2px solid var(--paper); transform: translateY(-1px) rotate(-45deg); }
label.ck input:focus { box-shadow: none; } label.ck input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.row select, .row input[type=number], .row input[type=datetime-local] { width: auto; }
/* briefs: a row under a hairline; title, a due tag (yellow when soon, red when overdue), the text, then counts */
.brief { box-shadow: inset 0 1px 0 var(--line); padding: 12px 0 16px; margin: 0; }
.brief h4 { margin: 0 0 4px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.brief .body { white-space: pre-wrap; margin: 4px 0 8px; color: var(--ink); }
.due { display: inline-flex; align-items: center; height: 16px; padding: 0 8px; border-radius: var(--radius-full); font-size: 10.5px; line-height: 16px; font-weight: 600; background: color-mix(in srgb, var(--warn) 30%, transparent); color: var(--ink); }
.due.late { background: color-mix(in srgb, var(--bad) 12%, transparent); color: var(--bad-text); }
.bform { display: flex; flex-direction: column; gap: 8px; padding: 12px 0; }
details.addbrief { margin: 4px 0 8px; }
details.addbrief > summary { list-style: none; cursor: pointer; color: var(--accent); display: inline-flex; min-height: 32px; align-items: center; }
details.addbrief > summary::-webkit-details-marker { display: none; }
details.addbrief > summary:hover { text-decoration: underline; }
details.addbrief[open] > summary { color: var(--ink); font-weight: 600; text-decoration: none; }
