:root {
    color-scheme: light;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: #f4f3ef;
    color: #1b2420;
    --ink: #1b2420;
    --muted: #66716b;
    --line: #dfe2dc;
    --paper: #fffefa;
    --green: #1d5b45;
    --green-soft: #e5f0e9;
    --amber: #9b631f;
    --amber-soft: #f7ecd9;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: clamp(1rem, 2.5vw, 2rem);
    background:
        radial-gradient(circle at 8% 5%, rgba(29, 91, 69, 0.08), transparent 30rem),
        #f4f3ef;
}

main {
    width: min(44rem, 100%);
    background: #ffffff;
    border: 1px solid #d9e0e7;
    border-radius: 0.75rem;
    box-shadow: 0 1rem 3rem rgba(23, 32, 42, 0.08);
    padding: clamp(1.5rem, 4vw, 3rem);
}

.status-shell {
    width: min(44rem, 100%);
}

h1 {
    margin-top: 0;
}

.status-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
    gap: 1rem;
    margin: 1.5rem 0;
}

.status-card {
    border: 1px solid #d9e0e7;
    border-radius: 0.5rem;
    padding: 1rem;
}

.status-label {
    display: block;
    color: #586573;
    font-size: 0.85rem;
    margin-bottom: 0.35rem;
}

.status-value {
    font-weight: 700;
}

.ok {
    color: #167447;
}

.warning {
    color: #9a5d00;
}

.error {
    color: #a12a2a;
}

.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

a.button {
    background: #17202a;
    border-radius: 0.4rem;
    color: #ffffff;
    display: inline-block;
    padding: 0.7rem 1rem;
    text-decoration: none;
}

.text-link {
    align-self: center;
    color: #4f5d55;
    font-size: 0.85rem;
}

.job-browser {
    width: min(86rem, 100%);
    padding: 0;
    overflow: hidden;
    border-radius: 1.1rem;
    background: var(--paper);
    border-color: #d8dbd4;
    box-shadow: 0 1.25rem 4rem rgba(27, 36, 32, 0.1);
}

.app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.1rem 1.5rem;
    border-bottom: 1px solid var(--line);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 0.8rem;
    color: var(--ink);
    text-decoration: none;
}

.brand-mark {
    display: grid;
    place-items: center;
    width: 2.35rem;
    height: 2.35rem;
    border-radius: 0.65rem;
    background: var(--ink);
    color: #fff;
    font-weight: 800;
    letter-spacing: -0.04em;
}

.brand strong,
.brand small {
    display: block;
}

.brand small {
    margin-top: 0.08rem;
    color: var(--muted);
    font-size: 0.72rem;
}

.header-state {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--green);
    font-size: 0.85rem;
    font-weight: 700;
}

.pulse {
    width: 0.55rem;
    height: 0.55rem;
    border-radius: 50%;
    background: #2d8a65;
    box-shadow: 0 0 0 0.25rem var(--green-soft);
}

.read-only {
    margin-left: 0.4rem;
    padding: 0.32rem 0.55rem;
    border-radius: 999px;
    background: #eef0ec;
    color: #59635d;
    font-size: 0.67rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.browser-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 2rem;
    padding: clamp(1.8rem, 4vw, 3.4rem) clamp(1.5rem, 4vw, 3.5rem) 1.5rem;
}

.eyebrow {
    margin: 0 0 0.45rem;
    color: var(--green);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.browser-heading h1 {
    margin: 0;
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(2.4rem, 6vw, 4.7rem);
    font-weight: 500;
    letter-spacing: -0.055em;
    line-height: 0.95;
}

.lede {
    max-width: 42rem;
    margin: 1rem 0 0;
    color: var(--muted);
    font-size: 1rem;
    line-height: 1.6;
}

.page-stat {
    min-width: 8rem;
    padding-left: 1.25rem;
    border-left: 1px solid var(--line);
}

.page-stat strong,
.page-stat span {
    display: block;
}

.page-stat strong {
    font-family: Georgia, serif;
    font-size: 2.6rem;
    font-weight: 500;
}

.page-stat span {
    color: var(--muted);
    font-size: 0.78rem;
}

.filter-bar {
    display: grid;
    grid-template-columns: minmax(14rem, 1.7fr) minmax(10rem, 0.8fr) auto auto;
    align-items: end;
    gap: 0.8rem;
    margin: 0 clamp(1.5rem, 4vw, 3.5rem) 2rem;
    padding: 1rem;
    border: 1px solid var(--line);
    border-radius: 0.8rem;
    background: #f8f8f4;
}

.filter-bar label > span {
    display: block;
    margin: 0 0 0.4rem 0.15rem;
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 700;
}

.filter-bar input,
.filter-bar select,
.filter-bar button {
    width: 100%;
    min-height: 2.7rem;
    border: 1px solid #cfd4cc;
    border-radius: 0.5rem;
    background: #fff;
    color: var(--ink);
    font: inherit;
}

.filter-bar input,
.filter-bar select {
    padding: 0.65rem 0.75rem;
}

.filter-bar button {
    padding: 0.65rem 1rem;
    border-color: var(--green);
    background: var(--green);
    color: #fff;
    cursor: pointer;
    font-weight: 750;
}

.reset-link {
    min-height: 2.7rem;
    display: grid;
    place-items: center;
    padding: 0 0.5rem;
    color: var(--muted);
    font-size: 0.85rem;
}

.results-panel {
    padding: 0 clamp(1.5rem, 4vw, 3.5rem) 2rem;
}

.results-header {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.8rem;
}

.results-header h2 {
    margin: 0;
    font-size: 1.15rem;
}

.results-header > p {
    margin: 0;
    color: var(--muted);
    font-size: 0.78rem;
}

.job-list {
    border-top: 1px solid var(--ink);
}

.job-card {
    border-bottom: 1px solid var(--line);
}

.job-card summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.05rem 0.75rem;
    cursor: pointer;
    list-style: none;
}

.job-card summary::-webkit-details-marker {
    display: none;
}

.job-card summary:hover {
    background: #f7f7f2;
}

.job-primary,
.job-meta {
    display: flex;
    align-items: center;
}

.job-primary {
    min-width: 0;
    gap: 1rem;
}

.job-number {
    width: 5.6rem;
    color: var(--green);
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.04em;
}

.job-primary strong,
.job-primary small,
.due-date small {
    display: block;
}

.job-primary strong {
    overflow: hidden;
    font-size: 1rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.job-primary small {
    margin-top: 0.2rem;
    color: var(--muted);
    font-size: 0.78rem;
}

.job-meta {
    gap: 1.35rem;
}

.status-pill {
    min-width: 6.5rem;
    padding: 0.38rem 0.65rem;
    border-radius: 999px;
    text-align: center;
    font-size: 0.7rem;
    font-weight: 800;
}

.status-active { background: var(--green-soft); color: var(--green); }
.status-pending { background: var(--amber-soft); color: var(--amber); }
.status-complete { background: #e9edf4; color: #475b78; }
.status-neutral { background: #eef0ec; color: #59635d; }

.due-date {
    min-width: 6rem;
    font-size: 0.8rem;
    font-weight: 700;
}

.due-date small {
    margin-bottom: 0.2rem;
    color: var(--muted);
    font-size: 0.63rem;
    font-weight: 600;
    text-transform: uppercase;
}

.disclosure {
    color: var(--muted);
    font-size: 1.25rem;
    transition: transform 150ms ease;
}

.job-card[open] .disclosure {
    transform: rotate(45deg);
}

.job-detail {
    padding: 0 0.75rem 1.25rem 7.35rem;
}

.detail-strip {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1px;
    overflow: hidden;
    border-radius: 0.6rem;
    background: var(--line);
}

.detail-strip > div {
    padding: 0.9rem;
    background: #f6f7f3;
}

.detail-strip span,
.detail-strip strong {
    display: block;
}

.detail-strip span {
    margin-bottom: 0.25rem;
    color: var(--muted);
    font-size: 0.65rem;
    text-transform: uppercase;
}

.detail-strip strong {
    font-size: 0.8rem;
}

.detail-columns {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.2rem;
    padding-top: 1.2rem;
}

.related-block h3 {
    margin: 0 0 0.6rem;
    font-size: 0.75rem;
    text-transform: uppercase;
}

.related-block ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.related-block li {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.48rem 0;
    border-bottom: 1px solid #eceee9;
    font-size: 0.78rem;
}

.related-block li small,
.related-block li.muted {
    color: var(--muted);
}

.empty-state {
    padding: 4rem 1rem;
    text-align: center;
}

.empty-state h2 {
    margin: 0.8rem 0 0.3rem;
}

.empty-state p {
    margin: 0;
    color: var(--muted);
}

.empty-mark {
    display: inline-grid;
    place-items: center;
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    background: #eef0ec;
    color: var(--muted);
    font-family: Georgia, serif;
    font-size: 1.4rem;
}

.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding-top: 1.5rem;
    color: var(--muted);
    font-size: 0.8rem;
}

.page-button {
    padding: 0.55rem 0.8rem;
    border: 1px solid var(--line);
    border-radius: 0.45rem;
    color: var(--ink);
    text-decoration: none;
}

.page-button.disabled {
    color: #a9afaa;
}

.browser-footer {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 0.7rem;
}

@media (max-width: 760px) {
    body { padding: 0; }
    .job-browser { border: 0; border-radius: 0; }
    .app-header, .browser-heading, .results-header, .browser-footer { align-items: flex-start; }
    .header-state { font-size: 0; }
    .header-state .read-only { font-size: 0.67rem; }
    .browser-heading, .results-header, .browser-footer { flex-direction: column; }
    .page-stat { padding: 0; border: 0; }
    .filter-bar { grid-template-columns: 1fr; }
    .job-card summary { align-items: flex-start; }
    .job-number { width: auto; }
    .job-primary { align-items: flex-start; flex-direction: column; gap: 0.35rem; }
    .job-meta { gap: 0.5rem; }
    .due-date { display: none; }
    .job-detail { padding-left: 0.75rem; }
    .detail-strip { grid-template-columns: repeat(2, 1fr); }
    .detail-columns { grid-template-columns: 1fr; }
}

.flash {
    background: #eef6ff;
    border-left: 0.25rem solid #2a6fbb;
    padding: 0.9rem 1rem;
}

code {
    background: #eef1f4;
    border-radius: 0.25rem;
    padding: 0.1rem 0.3rem;
}
