* { box-sizing: border-box; }

:root {
    color-scheme: light;
    --ink: #1c3025;
    --muted: #56675e;
    --line: #dbe3dc;
    --paper: #fff;
    --surface: #f1f5ee;
    --green: #126747;
    --green-soft: #dff0e5;
    --accent: #c6ee90;
}

body {
    margin: 0;
    background: var(--surface);
    color: var(--ink);
    font: 16px/1.5 system-ui, sans-serif;
}

a { color: var(--green); }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .52; }
:focus-visible { outline: 3px solid #3a8d5f; outline-offset: 3px; }

h1, h2, h3, p { margin: 0; }
h1 { font-size: clamp(2rem, 5vw, 3.4rem); line-height: 1.08; letter-spacing: -.04em; }
h2 { font-size: 1.24rem; line-height: 1.3; }
h3 { font-size: 1rem; }
p, li, strong { overflow-wrap: anywhere; }
.muted { color: var(--muted); }
.error { color: #a63232; }
.eyebrow { color: var(--green); font-size: .74rem; font-weight: 750; letter-spacing: .1em; }
.description { margin-top: .75rem; max-width: 58ch; }
.skip, .sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.skip:focus { width: auto; height: auto; clip-path: none; z-index: 5; padding: .75rem; background: var(--paper); }

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: .75rem clamp(1rem, 5vw, 4rem);
    color: #f5fff2;
    background: #19221d;
}

.topbar a { color: inherit; }
.brand { display: inline-flex; align-items: center; gap: .65rem; text-decoration: none; font-weight: 750; }
.brand-icon {
    display: inline-grid;
    place-items: center;
    width: 2rem;
    height: 2rem;
    border-radius: .55rem;
    background: var(--accent);
    color: #19221d;
}

main, .format-page {
    width: min(100%, 1190px);
    margin: 0 auto;
    padding: clamp(1.25rem, 4vw, 3.25rem);
}
.page-heading {
    display: flex;
    justify-content: space-between;
    align-items: end;
    flex-wrap: wrap;
    gap: 1.25rem;
    margin-bottom: 1.5rem;
}
.page-heading .eyebrow { margin-bottom: .5rem; }
.actions { display: flex; align-items: center; gap: .65rem; flex-wrap: wrap; }
.subtle-link { font-size: .9rem; font-weight: 650; text-underline-offset: .2em; }

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2.65rem;
    padding: .5rem .9rem;
    border: 1px solid var(--line);
    border-radius: .55rem;
    background: var(--paper);
    color: var(--ink);
    font-weight: 650;
    text-decoration: none;
}
.button:hover { border-color: #93aa9b; }
.primary { background: var(--green); border-color: var(--green); color: white; }
.primary:hover { background: #0a5337; }
.compact { min-height: 2.25rem; font-size: .88rem; padding: .35rem .65rem; }

.card, .poll, .stat, .board-column {
    padding: 1.25rem;
    border: 1px solid var(--line);
    border-radius: .85rem;
    background: var(--paper);
}
.project-list, .stats, .board { display: grid; gap: .9rem; }
.project-list { grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr)); }
.project-card { display: grid; gap: .6rem; color: inherit; text-decoration: none; }
.project-card:hover { border-color: #7ca18d; }
.access-form { max-width: 420px; display: grid; gap: .7rem; }
.template-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr);
    gap: 1.25rem;
    margin-bottom: 1rem;
}
.template-intro, .template-editor { display: grid; align-content: start; gap: .65rem; }
.template-editor textarea { font: .87rem/1.55 ui-monospace, Consolas, monospace; }

input:not([type=radio]), select, textarea {
    width: 100%;
    min-height: 2.6rem;
    padding: .55rem .7rem;
    border: 1px solid #b6c6b9;
    border-radius: .48rem;
    color: var(--ink);
    background: var(--paper);
}
label, legend { font-weight: 650; }
textarea { resize: vertical; }
.stats { grid-template-columns: repeat(3, 1fr); margin-bottom: 1.25rem; }
.stat { display: grid; gap: .3rem; }
.stat strong { font-size: 1.25rem; }
.stat span { font-size: .88rem; }

.project-tabs {
    display: flex;
    gap: .25rem;
    border-bottom: 1px solid var(--line);
    margin-bottom: 1.2rem;
}
.tab {
    padding: .65rem .85rem;
    border: 0;
    border-bottom: 3px solid transparent;
    color: var(--muted);
    font-weight: 650;
    background: none;
}
.tab[aria-pressed=true] { color: var(--green); border-color: var(--green); }

.poll-grid { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); gap: 1rem; align-items: start; }
.poll-grid > .poll:only-child { grid-column: 1 / -1; max-width: 700px; width: 100%; }
.poll { display: grid; gap: 1rem; }
.poll-header { display: grid; gap: .4rem; }
.name-field { display: grid; gap: .3rem; }
.choices { margin: 0; padding: 0; border: 0; min-width: 0; display: grid; gap: .55rem; }
.poll-option {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: start;
    gap: .65rem;
    padding: .7rem;
    border: 1px solid var(--line);
    border-radius: .55rem;
    font-weight: 450;
    cursor: pointer;
}
.poll-option:has(input:checked) { background: var(--green-soft); border-color: #6ba38a; }
.poll-option.occupied { background: #f4f7f4; cursor: default; }
.poll-option input { margin-top: .23rem; accent-color: var(--green); }
.option-copy { display: grid; gap: .18rem; min-width: 0; }
.option-copy .muted { font-size: .85rem; }
.occupancy-bar { height: 4px; border-radius: 8px; background: #e2ebe5; margin-top: .3rem; }
.occupancy-bar .filled { display: block; width: 100%; height: 100%; background: #39a26b; border-radius: inherit; }
.badge { max-width: 16ch; border-radius: 999px; padding: .2rem .5rem; font-size: .75rem; overflow-wrap: anywhere; }
.free { color: var(--green); background: var(--green-soft); }
.taken { color: #344f40; background: #e4ebe5; }

.team { display: grid; gap: .8rem; }
.member-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: .45rem;
    padding-top: .6rem;
    border-top: 1px solid var(--line);
}
.member-row strong { grid-column: 1 / -1; }

.board { grid-template-columns: repeat(4, minmax(0, 1fr)); align-items: start; }
.board-column { background: #e9efe9; min-height: 9rem; padding: .8rem; }
.board-column h2 { margin-bottom: .65rem; font-size: .98rem; }
.task-card {
    display: grid;
    text-align: left;
    width: 100%;
    gap: .25rem;
    padding: .65rem;
    margin: 0 0 .55rem;
    border: 1px solid var(--line);
    border-radius: .55rem;
    background: var(--paper);
    color: var(--ink);
}
.task-card:hover { border-color: #7ca18d; }
.task-card span { font-size: .83rem; }
.bug-label { color: #9b3f26; }
.mine-actions { margin-bottom: .75rem; }
.empty, .column-empty { color: var(--muted); padding: .75rem; }

dialog {
    max-width: min(94vw, 660px);
    width: 100%;
    max-height: 91vh;
    padding: clamp(1rem, 4vw, 1.6rem);
    border: 1px solid var(--line);
    border-radius: .85rem;
    color: var(--ink);
}
dialog::backdrop { background: #17251e88; }
.dialog-header { display: flex; justify-content: space-between; align-items: start; gap: .8rem; margin-bottom: 1rem; }
.import-form { display: grid; gap: .65rem; }
.preview { padding: .8rem; border-radius: .55rem; background: var(--surface); overflow-wrap: anywhere; }
.preview ul { padding-left: 1.1rem; margin: .35rem 0; }
.task-description { white-space: pre-wrap; margin: .75rem 0; }
.task-actions { margin-top: 1rem; }
.task-actions select { width: auto; }
#notice:not(:empty) {
    position: fixed;
    z-index: 6;
    bottom: 1rem;
    right: 1rem;
    max-width: min(440px, calc(100vw - 2rem));
    padding: .8rem 1rem;
    border-radius: .6rem;
    color: white;
    background: #19221d;
}
.format-page { max-width: 800px; }
.format-page > * + * { margin-top: 1rem; }
.format-page pre { white-space: pre-wrap; overflow-wrap: anywhere; }

@media (max-width: 760px) {
    .poll-grid, .template-card { grid-template-columns: 1fr; }
    .board { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 440px) {
    .stats, .board { grid-template-columns: 1fr; }
    .stat { grid-template-columns: 1fr auto; align-items: center; }
    .stat strong { font-size: 1rem; }
    .poll-option { grid-template-columns: auto minmax(0, 1fr); }
    .poll-option .badge { grid-column: 2; justify-self: start; }
}
