:root {
    color-scheme: light;
    font-family: "Segoe UI", system-ui, sans-serif;
    line-height: 1.55;
    color: #14332f;
    background: #f2f6f3;
    --ink: #14332f;
    --muted: #506762;
    --line: #d8e5dd;
    --paper: #fff;
    --deep: #123d36;
    --green: #14674e;
    --pale: #e6f4eb;
    --focus: #00875f;
    --radius: 16px;
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; }
h1, h2, p, dl, dd { margin: 0; }
a { color: #0c6049; text-underline-offset: .18em; }
button, input, select, textarea { font: inherit; }
button, summary { cursor: pointer; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }

.layout { display: grid; grid-template-columns: 16.5rem minmax(0, 1fr); min-height: 100vh; }
.sidebar {
    background: var(--deep);
    color: #eaf8f1;
    padding: 2rem 1.25rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
    align-self: start;
    position: sticky;
    top: 0;
    min-height: 100vh;
    max-height: 100dvh;
    overflow-y: auto;
}
.brand {
    display: inline-flex;
    align-items: center;
    gap: .65rem;
    color: inherit;
    font-weight: 750;
    font-size: 1.15rem;
    letter-spacing: -.02em;
    text-decoration: none;
}
.brand-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .2rem;
    width: 2.2rem;
    height: 2.2rem;
    flex: 0 0 auto;
    background: #a8e6c1;
    color: #174f42;
    border-radius: .65rem;
}
.brand-mark i { display: block; width: .19rem; height: .7rem; border-radius: 1rem; background: currentColor; }
.brand-mark i:nth-child(2) { height: 1.15rem; }

.nav { display: grid; gap: .3rem; }
.nav a {
    display: block;
    font-size: .96rem;
    padding: .7rem .8rem;
    color: #dceee4;
    text-decoration: none;
    border-radius: .6rem;
}
.nav a:hover, .nav a[aria-current="page"] { background: #2a5b50; color: #fff; }
.nav a[aria-current="page"] { font-weight: 700; }
.account { border-top: 1px solid #4d736a; margin-top: auto; padding: 1rem .25rem 0; }
.account p { overflow-wrap: anywhere; line-height: 1.35; }
.account small { display: block; margin: .25rem 0 .7rem; color: #c2dbcf; }
.account .button.secondary { background: #245449; color: #fff; border-color: #548177; }

.workspace {
    width: min(100%, 87rem);
    padding: clamp(1.25rem, 4vw, 3.25rem);
    margin: 0 auto;
}
.page-header { display: flex; justify-content: space-between; align-items: start; flex-wrap: wrap; gap: .75rem; margin-bottom: 1.65rem; }
h1 { font-size: clamp(1.9rem, 4vw, 2.8rem); line-height: 1.12; font-weight: 770; letter-spacing: -.045em; }
h2 { font-size: 1.15rem; line-height: 1.3; font-weight: 730; letter-spacing: -.018em; }
.page-header p, .section-description, .muted-text { color: var(--muted); }
.page-header p { margin-top: .5rem; }
.section-description { margin-bottom: 1.2rem; }

.tag {
    display: inline-flex;
    align-items: center;
    padding: .18rem .6rem;
    border-radius: 1rem;
    font-size: .86rem;
    font-weight: 670;
    line-height: 1.45;
    white-space: nowrap;
}
.tag.demo, .tag.info { background: #dcefea; color: #1a5447; }
.tag.ok { background: #e0f2e6; color: #226046; }
.tag.warn { background: #fff0ce; color: #71460d; }
.tag.danger { background: #fae8e1; color: #9c332b; }
.tag.muted { background: #edf1ef; color: #4a615b; }

.notice { margin-bottom: 1.2rem; border: 1px solid #b3dac4; background: #e8f6ed; color: #174e3c; padding: .75rem 1rem; border-radius: .7rem; }
.notice.error { background: #fff0ea; border-color: #efcabf; color: #8b362c; }
.demo-panel { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: .85rem; background: #e1efe7; border: 1px solid #c1dccd; border-radius: var(--radius); padding: 1rem 1.15rem; margin-bottom: 1.4rem; }
.demo-panel p { display: grid; gap: .15rem; }
.demo-panel span { color: #3e6157; }
.actions { display: flex; flex-wrap: wrap; gap: .55rem; }

.button {
    display: inline-flex;
    min-height: 2.6rem;
    align-items: center;
    justify-content: center;
    padding: .45rem .85rem;
    border: 1px solid transparent;
    border-radius: .55rem;
    line-height: 1.35;
    text-decoration: none;
    font-size: .94rem;
    font-weight: 700;
}
.button.primary { background: var(--green); color: #fff; }
.button.primary:hover { background: #105542; }
.button.secondary { background: var(--paper); border-color: #c7dbd0; color: var(--ink); }
.button.secondary:hover { background: #e9f4ed; }
.account .button.secondary:hover { background: #2a5b50; }
.align-start { justify-self: start; }

.filter-bar {
    display: grid;
    grid-template-columns: minmax(7rem, .8fr) minmax(10rem, 1.25fr) minmax(9rem, 1fr) minmax(8rem, .85fr) auto;
    align-items: end;
    gap: .75rem;
    max-width: 57rem;
    margin-bottom: 1.15rem;
}
.filter-bar label { min-width: 0; font-weight: 700; }
.metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .8rem; margin-bottom: 1.2rem; }
.metric, .card {
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: 0 3px 12px #16443a06;
}
.metric { min-width: 0; padding: .9rem 1rem; display: flex; flex-direction: column; gap: .1rem; }
.metric.highlight { background: #dff1e5; border-color: #c2e0cf; }
.metric dt { font-size: .92rem; color: #38554c; }
.metric dd { font-size: clamp(1.9rem, 4vw, 2.65rem); font-weight: 750; letter-spacing: -.04em; line-height: 1.25; }
.metric dd span { color: var(--muted); font-size: 1rem; font-weight: 680; letter-spacing: 0; }

.card { margin-bottom: 1rem; min-width: 0; }
.card-head, .card-body { padding: 1rem 1.2rem; }
.card-head { border-bottom: 1px solid var(--line); }
.results-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .65rem; }
.compact { max-width: 52rem; }
.empty { margin: 0; padding: 1.2rem; color: var(--muted); }
.table-wrap { overflow-x: auto; border-radius: 0 0 var(--radius) var(--radius); }
table { width: 100%; min-width: 44rem; border-collapse: collapse; font-size: .94rem; }
thead { background: #f4f8f6; text-align: left; }
thead th { font-size: .87rem; color: #436157; font-weight: 700; white-space: nowrap; }
th, td { padding: .72rem .72rem; border-bottom: 1px solid #e6efe9; vertical-align: top; text-align: left; }
th:first-child, td:first-child { padding-left: 1.15rem; }
th:last-child, td:last-child { padding-right: 1.15rem; }
tbody th { font-weight: 670; }
tbody tr:last-child > * { border-bottom: 0; }
.follow-action summary { color: #1c604d; font-weight: 680; }
.review { min-width: min(19rem, 60vw); max-width: 29rem; display: grid; gap: .85rem; padding: .65rem 0 .3rem; }
.review .tag { justify-self: start; }
.review form + form { border-top: 1px solid var(--line); padding-top: .85rem; }
.review .comment, .review .existing-reply { white-space: pre-wrap; overflow-wrap: anywhere; }
.review .existing-reply { background: #eff7f2; padding: .55rem .7rem; border-radius: .45rem; }
.contact { margin: 0; }
.contact dt { font-weight: 680; }
.contact dd { margin-bottom: .2rem; overflow-wrap: anywhere; }

.form-stack { display: grid; gap: .9rem; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .85rem; }
.form-grid .wide { grid-column: 1 / -1; }
label { display: grid; gap: .3rem; font-weight: 680; font-size: .92rem; }
input:not([type="checkbox"]):not([type="hidden"]):not([type="radio"]), select, textarea {
    width: 100%;
    min-width: 0;
    min-height: 2.6rem;
    padding: .48rem .62rem;
    color: var(--ink);
    background: #fcfefd;
    border: 1px solid #abc4b9;
    border-radius: .5rem;
}
textarea { resize: vertical; }
input::placeholder { color: #60766e; }
.checks { display: grid; gap: .4rem; margin: 0; }
fieldset.checks { border: 1px solid var(--line); border-radius: .65rem; padding: .65rem .8rem; }
.questionnaire-fields { min-width: 0; margin: .35rem 0 0; padding: .7rem .9rem .9rem; border: 1px solid var(--line); border-radius: .65rem; }
.questionnaire-fields legend { padding: 0 .4rem; font-weight: 700; }
.questionnaire-fields select { max-width: 17rem; }
.checks legend { font-weight: 700; padding: 0 .35rem; }
.checks label { display: flex; gap: .45rem; align-items: baseline; font-weight: 520; }
input[type="checkbox"] { margin: 0; width: 1rem; height: 1rem; flex: 0 0 1rem; accent-color: var(--green); }

.profile-list { max-width: 58rem; }
.profile > summary { list-style: none; display: flex; flex-wrap: wrap; gap: .65rem; padding: .95rem 1.2rem; align-items: center; }
.profile > summary::-webkit-details-marker { display: none; }
.profile > summary::after { content: "+"; margin-left: auto; color: var(--green); font-weight: 750; font-size: 1.35rem; line-height: 1; }
.profile[open] > summary::after { content: "−"; }
.profile[open] > summary { border-bottom: 1px solid var(--line); }
.profile > summary span { color: var(--muted); font-size: .9rem; }
.entry-list { list-style: none; margin: 0; padding: 0; }
.entry-list li { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .55rem; padding: .8rem 1.2rem; }
.entry-list li + li { border-top: 1px solid var(--line); }
.entry-list small { display: block; font-size: .8rem; color: var(--muted); }
.code-line { border-radius: .55rem; background: #eff7f2; padding: .65rem .8rem; overflow-wrap: anywhere; }
.code-line code { display: block; margin-top: .2rem; font-size: .9rem; }
.token-note { padding: .65rem .8rem; border: 1px solid #9fcdb3; border-radius: .55rem; background: #e8f6ed; }
.token-note input { margin-top: .3rem; font-family: ui-monospace, monospace; font-size: .9rem; }

.sign-in {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 1rem;
    background: linear-gradient(155deg, #d3e9dc, #f6faf7 67%);
}
.sign-in-panel { width: min(100%, 26rem); background: var(--paper); padding: clamp(1.25rem, 6vw, 2.25rem); border: 1px solid #cfdfd6; border-radius: 1.3rem; box-shadow: 0 1rem 3rem #153e331c; }
.sign-in-panel .brand { margin-bottom: 1.25rem; }
.sign-in-panel h1 { font-size: clamp(1.7rem, 6vw, 2.25rem); }
.sign-in-panel p { margin: .7rem 0 1rem; }
.sign-in-panel .tag { margin-top: 0; }
.sign-in-panel form { margin-top: 1.2rem; }
.sign-in-panel .button { margin-top: .25rem; }

@media (max-width: 980px) {
    .filter-bar { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .filter-bar .button { justify-self: start; }
}
@media (max-width: 900px) {
    .layout { grid-template-columns: 13rem minmax(0, 1fr); }
    .sidebar { padding-inline: 1rem; }
    .workspace { padding-inline: 1.25rem; }
    .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 650px) {
    .layout { display: block; }
    .sidebar { position: static; min-height: 0; max-height: none; padding: 1rem 1.15rem .75rem; gap: .75rem; }
    .nav { display: flex; flex-wrap: wrap; }
    .nav a { padding: .4rem .55rem; }
    .account { display: flex; align-items: center; flex-wrap: wrap; justify-content: space-between; gap: .5rem; padding: .55rem 0 0; }
    .account small { display: none; }
    .form-grid { grid-template-columns: 1fr; }
}
@media (max-width: 390px) {
    .filter-bar { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; }
}
