.cw {
    --cw-ink: #14233f;
    --cw-muted: #51617a;
    --cw-blue: #244ec0;
    --cw-line: #dce5f0;
    color: var(--cw-ink);
    background: #f2f6fb;
    min-height: 68vh;
    padding: clamp(20px, 4vw, 54px) 16px 64px;
    font-family: "Inter", system-ui, sans-serif;
}
.cw [hidden] { display: none !important; }
.cw-wrap { max-width: 1120px; margin: auto; display: grid; gap: 18px; }
.cw-hero {
    background: linear-gradient(120deg, #12244a, #244b9e);
    color: #fff;
    padding: clamp(22px, 5vw, 54px);
    border-radius: 26px;
    position: relative;
}
.cw-hero a { color: #e3edff; text-decoration: underline; text-underline-offset: 3px; }
.cw-group { display: inline-block; margin-left: 14px; padding: 4px 11px; border-radius: 99px; background: #ffffff24; font-size: .82rem; }
.cw h1 { font-size: clamp(2rem, 6vw, 3.6rem); line-height: 1.08; margin: 18px 0 8px; color: inherit; letter-spacing: -.04em; }
.cw h2 { font-size: clamp(1.15rem, 3vw, 1.55rem); margin: 0 0 6px; color: inherit; }
.cw h3 { margin: 0 0 10px; color: inherit; }
.cw p { margin: 0; }
.cw-hero p { color: #e3edff; }
.cw-session { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.cw-panel { background: #fff; border: 1px solid var(--cw-line); border-radius: 18px; padding: clamp(16px, 3vw, 26px); min-width: 0; }
.cw-login { width: min(100%, 480px); }
.cw-stack { display: grid; gap: 14px; margin-top: 14px; }
.cw-stack > .cw-button { justify-self: start; }
.cw-tabs { display: flex; gap: 6px; margin-bottom: 18px; }
.cw-tabs a { padding: 8px 14px; border-radius: 9px; color: var(--cw-blue); font-weight: 650; }
.cw-tabs a[aria-current] { background: #eaf0ff; }
.cw label { display: grid; gap: 5px; font-size: .88rem; font-weight: 650; min-width: 0; }
.cw select, .cw input:not([type=hidden]), .cw textarea {
    border: 1px solid #b9c8dc;
    border-radius: 9px;
    padding: 9px 11px;
    color: var(--cw-ink);
    background: #fff;
    width: 100%;
    font: inherit;
    font-size: 1rem;
}
.cw textarea { resize: vertical; min-height: 110px; }
.cw :focus-visible { outline: 3px solid #6e95ff; outline-offset: 3px; }
.cw-button {
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--cw-blue); color: #fff; border: 1px solid transparent; border-radius: 10px;
    font: inherit; font-size: .9rem; font-weight: 650; padding: 9px 14px; min-height: 42px;
    cursor: pointer; text-decoration: none;
}
.cw-button:hover { filter: brightness(.92); }
.cw-secondary { background: #f2f6ff; color: #183c97; border-color: #cfdbf6; }
.cw-period, .cw-filters { display: flex; align-items: end; flex-wrap: wrap; gap: 12px; }
.cw-period label { flex: 0 1 230px; }
.cw-filters { margin: 16px 0; }
.cw-filters label { flex: 1 1 155px; }
.cw-metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 140px), 1fr)); gap: 12px; }
.cw-metrics span, .cw-muted { color: var(--cw-muted); font-size: .88rem; }
.cw-metrics strong { display: block; font-size: clamp(1.5rem, 4vw, 2.25rem); line-height: 1.25; font-variant-numeric: tabular-nums; }
.cw-metrics small { font-size: .85rem; color: var(--cw-muted); font-weight: 500; white-space: nowrap; }
.cw-heading, .cw-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.cw-heading { justify-content: space-between; margin-bottom: 14px; }
.cw-scroll { overflow: auto; }
.cw table { border-collapse: collapse; width: 100%; text-align: left; font-size: .92rem; }
.cw th, .cw td { padding: 10px 12px; border-bottom: 1px solid var(--cw-line); vertical-align: middle; }
.cw th { font-weight: 650; }
.cw thead { background: #f2f6fb; color: var(--cw-muted); }
.cw-id { white-space: nowrap; font-size: .85rem; }
.cw-grade, .cw-status { display: inline-block; background: #ecf2fa; padding: 4px 9px; border-radius: 8px; font-weight: 650; white-space: nowrap; }
.cw-status { font-size: .78rem; }
.cw-low { background: #fff0e7; color: #963a16; }
.cw-sent { background: #def6ec; color: #155943; }
.cw-link { background: transparent; border: 0; color: var(--cw-blue); font: inherit; font-weight: 650; padding: 7px 3px; cursor: pointer; text-align: left; text-decoration: underline; text-underline-offset: 3px; }
.cw dialog { width: min(560px, calc(100% - 28px)); max-height: 90vh; padding: 24px; border: 1px solid var(--cw-line); border-radius: 18px; color: var(--cw-ink); background: #fff; }
.cw dialog::backdrop { background: #0e1e3aa8; }
.cw dialog .cw-note-body { white-space: pre-wrap; overflow-wrap: anywhere; margin: 14px 0; }
.cw .cw-error { background: #fff0e7; color: #8f3015; border-radius: 10px; padding: 10px 14px; }
.cw [data-empty] { margin-top: 12px; }
@media (max-width: 640px) {
    .cw-table, .cw-table tbody { display: block; }
    .cw-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
    .cw-table tr { display: flex; flex-wrap: wrap; gap: 5px 12px; padding: 12px 0; border-bottom: 1px solid var(--cw-line); }
    .cw-table th, .cw-table td { border: 0; padding: 0; }
    .cw-table th, .cw-table .cw-note { flex: 1 0 100%; }
    .cw-table td[data-label]::before { content: attr(data-label) " "; color: var(--cw-muted); }
    .cw-table td[data-label] { align-self: center; }
    .cw-id { order: -1; }
}
