:root {
    color-scheme: light;
    --ink: #17211b;
    --muted: #69756f;
    --line: #dce3df;
    --soft: #f4f6f4;
    --paper: #ffffff;
    --green: #164b35;
    --green-2: #246849;
    --mint: #dcece3;
    --red: #a62b2b;
    --gold: #d5a74a;
    --sidebar: 294px;
    font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-synthesis: none;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--soft); }
body { margin: 0; color: var(--ink); background: var(--soft); }
a { color: inherit; }
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid #e3b95f; outline-offset: 2px; }

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.app-shell { min-height: 100vh; }
.topbar {
    position: sticky;
    top: 0;
    z-index: 40;
    height: 76px;
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 0 28px;
    color: white;
    background: var(--green);
    box-shadow: 0 2px 12px rgb(10 35 24 / 18%);
}

.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; }
.brand-mark {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border: 1px solid rgb(255 255 255 / 38%);
    border-radius: 50%;
    color: #fff7e6;
    font-family: Georgia, serif;
    font-size: 15px;
    letter-spacing: .08em;
}
.brand strong, .brand small { display: block; }
.brand strong { font-family: Georgia, serif; font-size: 18px; font-weight: 500; letter-spacing: .01em; }
.brand small { margin-top: 2px; color: #c9ddd2; font-size: 11px; letter-spacing: .04em; }
.api-link { margin-left: auto; color: #e5f1ea; font-size: 13px; font-weight: 650; text-decoration: none; }
.api-link:hover { color: white; }
.menu-button { display: none; width: 40px; height: 40px; padding: 9px; border: 0; background: transparent; }
.menu-button span { display: block; height: 2px; margin: 5px 0; border-radius: 2px; background: white; }

.shell-body { display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); min-height: calc(100vh - 76px); }
.sidebar {
    position: sticky;
    top: 76px;
    height: calc(100vh - 76px);
    overflow-y: auto;
    padding: 24px 18px 40px;
    border-right: 1px solid var(--line);
    background: #fafbfa;
}
.sidebar-heading { display: flex; align-items: center; justify-content: space-between; padding: 0 8px 13px; font-size: 12px; font-weight: 750; letter-spacing: .1em; text-transform: uppercase; }
.count-badge { min-width: 27px; padding: 3px 7px; border-radius: 999px; color: var(--green); background: var(--mint); text-align: center; }
.model-filter { position: relative; display: block; margin-bottom: 24px; }
.model-filter svg { position: absolute; top: 11px; left: 12px; width: 17px; fill: none; stroke: #78827d; stroke-linecap: round; stroke-width: 1.8; }
.model-filter input { width: 100%; height: 40px; padding: 0 12px 0 37px; border: 1px solid var(--line); border-radius: 9px; color: var(--ink); background: white; }
.model-filter input::placeholder { color: #8c9691; }
.nav-group { margin: 0 0 23px; }
.nav-group h2 { margin: 0 8px 7px; color: #818b86; font-size: 10px; font-weight: 750; letter-spacing: .1em; text-transform: uppercase; }
.nav-group nav { display: grid; gap: 2px; }
.nav-group a { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; padding: 8px; border-radius: 7px; color: #3b4741; font-size: 13px; text-decoration: none; }
.nav-group a small { color: #9aa29e; font-family: ui-monospace, monospace; font-size: 9px; }
.nav-group a:hover { background: #edf2ef; }
.nav-group a.active { color: var(--green); background: var(--mint); font-weight: 700; }
.nav-group a.active small { color: var(--green-2); }
.nav-loading, .nav-error { padding: 12px 8px; color: var(--muted); font-size: 13px; }
.nav-loading { display: flex; align-items: center; gap: 10px; }
.nav-error p { margin: 0 0 8px; }
.text-button { padding: 0; border: 0; color: var(--green); background: transparent; font-weight: 700; text-decoration: underline; cursor: pointer; }
.sidebar-scrim { display: none; }

.main-content { min-width: 0; }
.page { width: min(1420px, 100%); margin: 0 auto; padding: 44px clamp(24px, 4vw, 68px) 80px; }
.eyebrow { margin-bottom: 8px; color: var(--green-2); font-size: 11px; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
.page h1, .page h2 { font-family: Georgia, "Times New Roman", serif; }

.hero { position: relative; overflow: hidden; margin-bottom: 50px; padding: clamp(34px, 6vw, 72px); border-radius: 4px 4px 28px 4px; color: white; background: var(--green); }
.hero::after { content: ""; position: absolute; right: -70px; bottom: -150px; width: 410px; height: 410px; border: 1px solid rgb(255 255 255 / 13%); border-radius: 50%; box-shadow: 0 0 0 60px rgb(255 255 255 / 4%), 0 0 0 120px rgb(255 255 255 / 3%); }
.hero .eyebrow { color: #b9d6c7; }
.hero h1 { position: relative; z-index: 1; max-width: 740px; margin: 0; font-size: clamp(38px, 6vw, 70px); font-weight: 400; line-height: .98; letter-spacing: -.035em; }
.hero p { position: relative; z-index: 1; max-width: 690px; margin: 24px 0 30px; color: #d9e8e0; font-size: 17px; line-height: 1.65; }
.hero-meta { position: relative; z-index: 1; display: flex; gap: 28px; color: #c3d8cd; font-size: 12px; }
.hero-meta strong { color: white; font-size: 17px; }

.directory { display: grid; gap: 44px; }
.section-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 20px; margin-bottom: 16px; }
.section-heading h2 { margin: 0; font-size: 25px; font-weight: 500; }
.section-heading > span { color: var(--muted); font-size: 12px; }
.model-card-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.model-card { display: flex; align-items: center; gap: 13px; min-height: 76px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); text-decoration: none; transition: border-color .15s, box-shadow .15s, transform .15s; }
.model-card:hover { border-color: #a8c3b5; box-shadow: 0 8px 24px rgb(31 60 46 / 8%); transform: translateY(-1px); }
.model-card-icon { display: grid; flex: 0 0 auto; place-items: center; width: 42px; height: 42px; border-radius: 8px; color: var(--green); background: var(--mint); font-family: Georgia, serif; font-size: 13px; }
.model-card-copy { min-width: 0; }
.model-card-copy strong, .model-card-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.model-card-copy strong { font-size: 14px; }
.model-card-copy small { margin-top: 4px; color: var(--muted); font-family: ui-monospace, monospace; font-size: 9px; }
.model-card .arrow { margin-left: auto; color: #789184; }

.page-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 40px; margin-bottom: 32px; padding-bottom: 30px; border-bottom: 1px solid var(--line); }
.breadcrumb, .back-link { display: inline-block; margin-bottom: 28px; color: var(--green-2); font-size: 12px; font-weight: 700; text-decoration: none; }
.page-header .breadcrumb { margin-bottom: 26px; }
.page-header h1 { margin: 0; font-size: clamp(38px, 5vw, 58px); font-weight: 400; letter-spacing: -.025em; }
.page-header p { margin: 12px 0 0; color: var(--muted); }
.record-total { flex: 0 0 auto; padding: 18px 22px; border-left: 3px solid var(--gold); background: white; }
.record-total strong, .record-total span { display: block; }
.record-total strong { font-family: Georgia, serif; font-size: 27px; font-weight: 500; }
.record-total span { color: var(--muted); font-size: 11px; }
.table-toolbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; color: var(--muted); font-size: 12px; }
.page-size { display: flex; align-items: center; gap: 8px; }
.page-size select { padding: 7px 28px 7px 9px; border: 1px solid var(--line); border-radius: 7px; color: var(--ink); background: white; }
.data-table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; background: white; }
.data-table { width: 100%; border-collapse: collapse; text-align: left; }
.data-table th { padding: 13px 17px; border-bottom: 1px solid var(--line); color: #7b8580; background: #f8faf8; font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.data-table td { padding: 16px 17px; border-bottom: 1px solid #e9edea; vertical-align: middle; font-size: 13px; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover { background: #fbfcfb; }
.primary-cell { min-width: 300px; max-width: 590px; }
.primary-cell > a { display: -webkit-box; overflow: hidden; color: var(--ink); font-family: Georgia, serif; font-size: 16px; line-height: 1.35; text-decoration: none; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.primary-cell > a:hover { color: var(--green-2); text-decoration: underline; }
.primary-cell small { display: block; margin-top: 5px; color: var(--muted); font-size: 10px; }
code { padding: 2px 5px; border-radius: 4px; color: #4d5a53; background: #edf1ee; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .8em; }
.date-cell { min-width: 180px; color: var(--muted); white-space: nowrap; }
.arrow-cell { width: 42px; text-align: right; }
.arrow-cell a { color: var(--green-2); font-size: 18px; text-decoration: none; }
.reference-chips { display: flex; flex-wrap: wrap; gap: 5px; min-width: 180px; }
.reference-chips a, .more-chip { display: inline-block; max-width: 190px; overflow: hidden; padding: 4px 8px; border-radius: 999px; color: var(--green); background: var(--mint); font-size: 10px; text-decoration: none; text-overflow: ellipsis; white-space: nowrap; }
.reference-chips a:hover { background: #cce2d6; text-decoration: underline; }
.more-chip { color: var(--muted); background: #edf0ee; }
.muted { color: #929b96; }
.pagination { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-top: 18px; color: var(--muted); font-size: 12px; }
.pagination button { padding: 9px 13px; border: 1px solid var(--line); border-radius: 7px; color: var(--green); background: white; cursor: pointer; }
.pagination button:disabled { color: #aeb5b1; background: #f5f6f5; cursor: default; }

.detail-page { max-width: 1180px; }
.detail-header { margin-bottom: 44px; padding: 34px clamp(24px, 5vw, 54px); border-radius: 4px 4px 20px 4px; color: white; background: var(--green); }
.detail-type { margin-bottom: 16px; color: #b9d6c7; font-size: 11px; font-weight: 750; letter-spacing: .1em; text-transform: uppercase; }
.detail-type span { margin-left: 10px; opacity: .7; font-family: ui-monospace, monospace; font-size: 9px; }
.detail-header h1 { max-width: 920px; margin: 0; font-size: clamp(30px, 5vw, 50px); font-weight: 400; line-height: 1.08; }
.detail-meta { display: flex; flex-wrap: wrap; gap: 24px; margin-top: 25px; color: #c9ddd2; font-size: 12px; }
.detail-meta code { color: white; background: rgb(255 255 255 / 12%); }
.detail-section { margin-bottom: 44px; }
.field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 0; }
.field-card { min-width: 0; padding: 17px 18px; border: 1px solid var(--line); border-radius: 8px; background: white; }
.field-card dt { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 10px; color: var(--muted); font-size: 11px; font-weight: 700; }
.field-card dt code { color: #919a95; background: transparent; font-size: 8px; font-weight: 400; }
.field-card dd { margin: 0; font-size: 14px; line-height: 1.55; overflow-wrap: anywhere; }
.reference-card { border-left: 3px solid #77a58c; }
.reference-value { display: flex; align-items: center; gap: 8px; color: var(--green); font-family: Georgia, serif; font-size: 16px; text-decoration: none; }
.reference-value code { flex: 0 0 auto; margin-left: auto; font-family: ui-monospace, monospace; }
.reference-value:hover > span:first-child { text-decoration: underline; }
.external-value { color: var(--green-2); overflow-wrap: anywhere; }
.long-value { display: block; white-space: pre-wrap; }

.loading-state, .error-state, .empty-state { display: grid; justify-items: center; place-content: center; min-height: 420px; padding: 50px; text-align: center; }
.loading-state p { color: var(--muted); }
.spinner { display: inline-block; width: 24px; height: 24px; border: 2px solid #c7d8cf; border-top-color: var(--green); border-radius: 50%; animation: spin .8s linear infinite; }
.nav-loading .spinner { width: 16px; height: 16px; }
@keyframes spin { to { transform: rotate(360deg); } }
.error-symbol, .empty-icon { display: grid; place-items: center; width: 54px; height: 54px; margin-bottom: 15px; border-radius: 50%; color: var(--red); background: #f6e1e1; font-family: Georgia, serif; font-size: 25px; }
.empty-icon { color: var(--muted); background: #e8ece9; }
.error-state h1, .empty-state h2 { margin: 0; font-size: 28px; font-weight: 500; }
.error-state p, .empty-state p { max-width: 500px; color: var(--muted); line-height: 1.6; }
.primary-button { display: inline-block; padding: 10px 16px; border: 0; border-radius: 7px; color: white; background: var(--green); font-weight: 700; text-decoration: none; cursor: pointer; }
.server-error { max-width: 700px; margin: 15vh auto; padding: 40px; font-family: sans-serif; }

@media (max-width: 1080px) {
    .model-card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .field-grid { grid-template-columns: 1fr; }
}

@media (max-width: 820px) {
    .topbar { height: 66px; padding: 0 16px; }
    .menu-button { display: block; }
    .brand small { display: none; }
    .shell-body { display: block; min-height: calc(100vh - 66px); }
    .sidebar { position: fixed; z-index: 50; top: 66px; bottom: 0; left: 0; width: min(88vw, 330px); height: auto; transform: translateX(-105%); box-shadow: 12px 0 35px rgb(12 34 24 / 18%); transition: transform .2s ease; }
    .sidebar.is-open { transform: translateX(0); }
    .sidebar-scrim { position: fixed; z-index: 45; inset: 66px 0 0; display: block; border: 0; background: rgb(10 28 19 / 35%); }
    .page { padding: 28px 18px 60px; }
    .hero { padding: 38px 24px; }
    .hero-meta { flex-direction: column; gap: 8px; }
    .page-header { align-items: flex-start; flex-direction: column; }
    .record-total { width: 100%; }
}

@media (max-width: 600px) {
    .brand strong { font-size: 16px; }
    .api-link { font-size: 11px; }
    .model-card-grid { grid-template-columns: 1fr; }
    .section-heading { align-items: flex-start; }
    .table-toolbar { align-items: flex-start; flex-direction: column; gap: 12px; }
    .data-table th:nth-child(2), .data-table td:nth-child(2), .data-table th:nth-child(4), .data-table td:nth-child(4) { display: none; }
    .primary-cell { min-width: 240px; }
    .pagination > span { display: none; }
    .field-card dt { align-items: flex-start; flex-direction: column; gap: 4px; }
    .detail-header { padding: 28px 20px; }
}
