@font-face {
  font-family: Poppins;
  src: url('./fonts/poppins-regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: Poppins;
  src: url('./fonts/poppins-semibold.woff2') format('woff2');
  font-weight: 500 900;
  font-style: normal;
  font-display: swap;
}
@layer reset,base,layout,components;
@layer reset {
  * {
    box-sizing: border-box;
  }
  body,
  h1,
  h2,
  h3,
  p {
    margin: 0;
  }
  button,
  input,
  select,
  textarea {
    font: inherit;
  }
  button,
  a,
  input,
  select,
  textarea {
    -webkit-tap-highlight-color: transparent;
  }
  button {
    cursor: pointer;
  }
  a {
    color: inherit;
  }
  button:disabled {
    cursor: wait;
    opacity: 0.55;
  }
  svg {
    vertical-align: middle;
  }
}
@layer base {
  :root {
    font-family: Poppins, 'Segoe UI', Arial, sans-serif;
    color: #202020;
    background: #fafafa;
    font-size: 14px;
    --accent: #f65801;
    --ink: #202020;
    --muted: #696969;
    --line: #ededed;
    --surface: #fff;
    --orange: #b87536;
    --red: #b65a51;
  }
  body {
    min-width: 340px;
  }
  button,
  input,
  select,
  textarea {
    outline-offset: 3px;
  }
  button:focus-visible,
  a:focus-visible {
    outline: 3px solid #b3b3b3;
  }
  input,
  select,
  textarea {
    border: 1px solid #ededed;
    border-radius: 8px;
    background: white;
    padding: 10px 12px;
    color: var(--ink);
    min-width: 0;
  }
  input:focus,
  select:focus,
  textarea:focus {
    border-color: #737373;
    outline: 2px solid #dddddd;
  }
  input[type='checkbox'] {
    accent-color: var(--accent);
    width: 16px;
    height: 16px;
  }
  label {
    display: grid;
    gap: 6px;
    font-size: 12px;
    font-weight: 600;
    color: #484848;
  }
  h1 {
    font-size: 30px;
    font-weight: 600;
    letter-spacing: -1px;
  }
  h2 {
    font-size: 16px;
    font-weight: 600;
    letter-spacing: -0.3px;
  }
  h3 {
    font-size: 14px;
    font-weight: 600;
  }
  p {
    line-height: 1.7;
  }
  .muted {
    color: var(--muted);
  }
  .small {
    font-size: 12px;
  }
  .mono {
    font-family: Consolas, monospace;
    font-size: 12px;
  }
  .negative {
    color: var(--red);
  }
  .positive {
    color: var(--accent);
  }
  .initial {
    padding: 12vh;
    text-align: center;
    color: var(--muted);
  }
  .skip {
    position: fixed;
    top: -70px;
    z-index: 99;
    background: white;
    padding: 15px;
  }
  .skip:focus {
    top: 8px;
  }
  .sr {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
  }
}
@layer layout {
  .shell {
    display: grid;
    grid-template-columns: 234px minmax(0, 1fr);
    min-height: 100vh;
  }
  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: 234px;
    background: #202020;
    color: #b3b3b3;
    padding: 29px 18px;
    display: flex;
    flex-direction: column;
    z-index: 20;
  }
  .brand {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 0 10px 30px;
    text-decoration: none;
    color: white;
  }
  .brand img {
    width: 38px;
    height: 38px;
  }
  .brand strong {
    display: block;
    font-size: 22px;
    letter-spacing: -0.8px;
    font-weight: 600;
  }
  .brand small {
    font-size: 9px;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: #b3b3b3;
  }
  .nav-label {
    font-size: 10px;
    letter-spacing: 1.7px;
    padding: 20px 14px 10px;
    color: #737373;
  }
  .nav {
    display: grid;
    gap: 5px;
  }
  .nav a {
    display: flex;
    gap: 12px;
    align-items: center;
    text-decoration: none;
    padding: 12px 14px;
    border-radius: 8px;
    font-size: 13px;
  }
  .nav a:hover {
    background: #202020;
    color: white;
  }
  .nav a.active {
    background: #484848;
    color: #ededed;
  }
  .nav a.active:after {
    content: '';
    margin-left: auto;
    width: 5px;
    height: 5px;
    background: #dddddd;
    border-radius: 50%;
  }
  .nav svg {
    width: 18px;
    height: 18px;
    opacity: 0.85;
  }
  .sidebar-bottom {
    margin-top: auto;
    padding: 28px 10px 0;
  }
  .workspace-label {
    display: flex;
    gap: 8px;
    align-items: center;
    font-size: 11px;
    color: #b3b3b3;
    margin-bottom: 18px;
  }
  .dot {
    width: 6px;
    height: 6px;
    display: inline-block;
    border-radius: 50%;
    background: #b3b3b3;
  }
  .profile {
    display: flex;
    gap: 10px;
    align-items: center;
    border-top: 1px solid #484848;
    padding-top: 20px;
  }
  .avatar {
    width: 33px;
    height: 33px;
    background: #484848;
    border-radius: 50%;
    display: grid;
    place-items: center;
    color: #ededed;
    font-weight: 600;
  }
  .profile strong {
    font-size: 12px;
    color: #ededed;
    display: block;
  }
  .profile small {
    font-size: 10px;
    color: #b3b3b3;
  }
  .profile button {
    margin-left: auto;
    background: transparent;
    border: 0;
    color: #b3b3b3;
    padding: 4px;
  }
  .workspace {
    grid-column: 2;
    min-width: 0;
  }
  .topbar {
    height: 73px;
    border-bottom: 1px solid var(--line);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 36px;
    background: #fafafa;
  }
  .breadcrumb {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 12px;
    color: #b3b3b3;
  }
  .breadcrumb b {
    color: #484848;
    font-weight: 500;
  }
  .topbar-right {
    display: flex;
    align-items: center;
    gap: 18px;
    color: var(--muted);
    font-size: 11px;
  }
  .private-badge {
    padding: 6px 9px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: white;
  }
  .mobile-menu {
    display: none;
  }
  .main {
    padding: 32px 36px 40px;
    max-width: 1880px;
    margin: auto;
  }
  .page-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 27px;
  }
  .eyebrow {
    font-size: 10px;
    letter-spacing: 1.7px;
    text-transform: uppercase;
    color: #737373;
    margin-bottom: 7px;
  }
  .page-title p {
    font-size: 12px;
    color: #737373;
    margin-top: 7px;
  }
  .actions {
    display: flex;
    gap: 9px;
    align-items: center;
  }
  .grid {
    display: grid;
    gap: 20px;
  }
  .stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 17px;
    margin: 23px 0;
  }
  .two-col {
    display: grid;
    grid-template-columns: minmax(0, 1.85fr) minmax(280px, 1fr);
    gap: 20px;
  }
  .bottom-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 20px;
  }
  .stack {
    display: grid;
    gap: 20px;
  }
  .page-footer {
    display: flex;
    justify-content: space-between;
    font-size: 10px;
    color: #737373;
    margin-top: 30px;
    border-top: 1px solid var(--line);
    padding-top: 15px;
    gap: 12px;
  }
}
@layer components {
  .icon {
    width: 17px;
    height: 17px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.65;
    stroke-linecap: round;
    stroke-linejoin: round;
    flex-shrink: 0;
  }
  .btn {
    border: 1px solid #ededed;
    background: white;
    color: #484848;
    border-radius: 7px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 14px;
    font-size: 12px;
    font-weight: 550;
    text-decoration: none;
    white-space: nowrap;
  }
  .btn:hover {
    background: #fafafa;
  }
  .btn.primary {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
  }
  .btn.primary:hover {
    background: #484848;
  }
  .btn.quiet {
    border: 0;
    background: transparent;
    padding: 7px;
    color: #737373;
  }
  .btn.danger {
    color: var(--red);
    border-color: #e3bfb9;
  }
  .btn.small {
    padding: 6px 10px;
    font-size: 11px;
  }
  .panel {
    background: white;
    border: 1px solid var(--line);
    border-radius: 11px;
    min-width: 0;
    box-shadow: 0 2px 3px #20202002;
  }
  .panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 21px 23px 16px;
    gap: 15px;
  }
  .panel-header p {
    font-size: 11px;
    color: #737373;
    margin-top: 5px;
  }
  .panel-body {
    padding: 0 23px 22px;
  }
  .filters {
    padding: 15px 18px;
  }
  .filter-row {
    display: flex;
    gap: 13px;
    align-items: end;
    flex-wrap: wrap;
  }
  .filter-row label {
    min-width: 125px;
    flex: 1;
  }
  .filter-row .period-select {
    flex: 1.4;
    min-width: 230px;
  }
  .filter-row [data-filter='filterMode'] {
    min-width: 145px;
  }
  .filter-row input,
  .filter-row select {
    font-size: 12px;
    padding: 9px 10px;
    width: 100%;
    background: #fafafa;
  }
  .filter-row .filter-action {
    align-self: end;
    flex: 0;
    min-width: auto;
  }
  .filter-extras {
    border-top: 1px solid var(--line);
    margin-top: 15px;
    padding-top: 15px;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
  }
  .filter-extras[hidden] {
    display: none;
  }
  .checkbox-row {
    display: flex;
    gap: 19px;
    flex-wrap: wrap;
    align-items: center;
    margin-top: 17px;
  }
  .checkbox-row label {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 11px;
    font-weight: 400;
  }
  .filter-note {
    font-size: 10px;
    color: #737373;
    margin-left: auto;
  }
  .stat {
    padding: 19px 20px 16px;
    background: white;
    border: 1px solid var(--line);
    border-radius: 10px;
    min-width: 0;
    position: relative;
    overflow: hidden;
  }
  .stat.primary-stat {
    background: #ededed;
    border-color: #dddddd;
  }
  .stat-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11px;
    color: #737373;
    gap: 10px;
  }
  .stat-top .icon-box {
    width: 27px;
    height: 27px;
    background: #fafafa;
    border-radius: 7px;
    display: grid;
    place-items: center;
    color: #737373;
  }
  .stat.primary-stat .icon-box {
    background: #dddddd;
    color: #484848;
  }
  .stat-value {
    font-size: 29px;
    font-weight: 620;
    letter-spacing: -1px;
    margin-top: 12px;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
  }
  .stat-note {
    font-size: 10px;
    color: #737373;
    margin-top: 10px;
    display: flex;
    gap: 6px;
    align-items: center;
  }
  .stat-note .positive {
    font-weight: 550;
  }
  .sparkline {
    position: absolute;
    right: 15px;
    bottom: 14px;
    width: 61px;
    height: 25px;
    opacity: 0.5;
  }
  .chart-wrap {
    padding: 7px 18px 7px 8px;
    height: 260px;
  }
  .chart-wrap svg {
    display: block;
    width: 100%;
    height: 100%;
    overflow: visible;
  }
  .legend {
    display: flex;
    gap: 16px;
    font-size: 10px;
    color: #737373;
  }
  .legend span {
    display: flex;
    align-items: center;
    gap: 6px;
  }
  .legend i {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #737373;
  }
  .legend i.orange {
    background: #d1a169;
  }
  .segment {
    display: inline-flex;
    padding: 3px;
    background: #fafafa;
    border: 1px solid #ededed;
    border-radius: 7px;
    gap: 3px;
    flex-wrap: wrap;
  }
  .segment button {
    border: 0;
    background: transparent;
    padding: 7px 11px;
    font-size: 11px;
    color: #737373;
    border-radius: 5px;
  }
  .segment button.active {
    background: white;
    color: #484848;
    box-shadow: 0 1px 3px #20202010;
  }
  .chart-summary {
    border-top: 1px solid var(--line);
    display: flex;
    padding: 15px 23px;
    gap: 30px;
    flex-wrap: wrap;
  }
  .chart-summary strong {
    font-size: 13px;
    display: block;
    margin-top: 3px;
  }
  .chart-summary span {
    font-size: 10px;
    color: #737373;
  }
  .channel-list {
    padding: 3px 23px 15px;
    display: grid;
    gap: 19px;
  }
  .channel-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11px;
    gap: 8px;
  }
  .channel-head strong {
    font-variant-numeric: tabular-nums;
    font-size: 12px;
    font-weight: 550;
  }
  .channel-name {
    display: flex;
    align-items: center;
    gap: 9px;
  }
  .channel-avatar {
    width: 26px;
    height: 26px;
    display: grid;
    place-items: center;
    background: #ededed;
    color: #737373;
    border-radius: 6px;
    font-size: 10px;
    font-weight: 600;
  }
  .bar-track {
    height: 5px;
    background: #fafafa;
    border-radius: 4px;
    margin-top: 9px;
    overflow: hidden;
  }
  .bar-fill {
    height: 100%;
    border-radius: 4px;
    background: #737373;
  }
  .panel-link {
    display: flex;
    justify-content: space-between;
    border-top: 1px solid var(--line);
    padding: 14px 23px;
    color: #737373;
    text-decoration: none;
    font-size: 11px;
  }
  .panel-link:hover {
    background: #fafafa;
  }
  .notice {
    display: flex;
    align-items: start;
    gap: 11px;
    background: #faf5e9;
    border: 1px solid #ede5cd;
    border-radius: 8px;
    padding: 13px 15px;
    font-size: 11px;
    color: #967f4e;
    margin-top: 19px;
    line-height: 1.7;
  }
  .notice .icon {
    margin-top: 2px;
    width: 15px;
    height: 15px;
  }
  .notice.info {
    background: #fafafa;
    color: #737373;
    border-color: #ededed;
  }
  .notice p + p {
    margin-top: 3px;
  }
  .source-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 13px 0;
    border-top: 1px solid #ededed;
    gap: 15px;
  }
  .source-row:first-child {
    border-top: 0;
  }
  .source-row strong {
    display: block;
    font-size: 12px;
    font-weight: 550;
  }
  .source-row small {
    font-size: 10px;
    color: #737373;
    display: block;
    margin-top: 5px;
  }
  .pill {
    display: inline-flex;
    padding: 4px 7px;
    border-radius: 5px;
    background: #ededed;
    color: #737373;
    font-size: 10px;
    white-space: nowrap;
  }
  .pill.warning {
    background: #faf1df;
    color: #b6904f;
  }
  .pill.error {
    background: #fbebe8;
    color: #b5665c;
  }
  .pill.neutral {
    background: #fafafa;
    color: #737373;
  }
  .quality-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 13px 0;
    border-top: 1px solid #ededed;
  }
  .quality-row:first-child {
    border-top: 0;
  }
  .quality-row .count {
    min-width: 29px;
    height: 28px;
    display: grid;
    place-items: center;
    background: #f5f1e5;
    border-radius: 7px;
    color: #b09863;
    font-size: 11px;
  }
  .quality-row strong {
    font-size: 11px;
    font-weight: 500;
  }
  .quality-row small {
    font-size: 10px;
    display: block;
    color: #737373;
    margin-top: 4px;
  }
  .quality-row a {
    margin-left: auto;
    color: #b3b3b3;
  }
  .toolbar {
    display: flex;
    justify-content: space-between;
    gap: 15px;
    align-items: center;
    margin: 23px 0 15px;
    flex-wrap: wrap;
  }
  .toolbar .actions {
    flex-wrap: wrap;
  }
  .table-scroll {
    overflow: auto;
    border-radius: 0 0 10px 10px;
    max-height: 65vh;
    scrollbar-width: thin;
    scrollbar-color: #dddddd #fafafa;
  }
  .data-table {
    border-collapse: separate;
    border-spacing: 0;
    width: 100%;
    font-size: 11px;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
  }
  .data-table th {
    color: #737373;
    font-weight: 500;
    background: #fafafa;
  }
  .data-table th,
  .data-table td {
    padding: 13px 16px;
    border-bottom: 1px solid #ededed;
    text-align: right;
    max-width: 330px;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .data-table th:first-child,
  .data-table td:first-child {
    text-align: left;
    position: sticky;
    left: 0;
    z-index: 2;
    background: white;
    min-width: 150px;
    border-right: 1px solid #ededed;
  }
  .data-table thead th {
    position: sticky;
    top: 0;
    z-index: 3;
    background: #fafafa;
  }
  .data-table thead th:first-child {
    z-index: 4;
    background: #fafafa;
  }
  .data-table tbody tr:hover td {
    background: #fafafa;
  }
  .data-table td button {
    border: 0;
    background: transparent;
    color: inherit;
    padding: 0;
    white-space: nowrap;
    font: inherit;
  }
  .data-table td button:hover {
    color: var(--accent);
    text-decoration: underline;
  }
  .data-table .total-row td {
    background: #ededed;
    font-weight: 600;
    position: sticky;
    bottom: 0;
    z-index: 3;
  }
  .data-table .total-row td:first-child {
    z-index: 4;
  }
  .data-table td.total {
    background: #fafafa;
    font-weight: 600;
  }
  .data-table th.summer {
    color: #b7aa85;
  }
  .rank {
    font-size: 10px;
    color: #b3b3b3;
    margin-right: 9px;
  }
  .table-note {
    padding: 13px 19px;
    color: #737373;
    font-size: 10px;
    border-top: 1px solid var(--line);
    line-height: 1.7;
  }
  .empty {
    padding: 60px 30px;
    text-align: center;
    color: #b3b3b3;
  }
  .empty h3 {
    color: #737373;
    margin-bottom: 10px;
  }
  .empty p {
    font-size: 12px;
    max-width: 550px;
    margin: 0 auto 18px;
  }
  .form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 17px;
  }
  .form-grid .full {
    grid-column: 1/-1;
  }
  .form-grid textarea {
    min-height: 76px;
    resize: vertical;
  }
  .form-actions {
    display: flex;
    justify-content: end;
    gap: 9px;
    margin-top: 23px;
  }
  .upload-zone {
    display: block;
    border: 1px dashed #b3b3b3;
    background: #fafafa;
    border-radius: 9px;
    text-align: center;
    padding: 35px;
    color: #737373;
    cursor: pointer;
  }
  .upload-zone strong {
    display: block;
    font-size: 15px;
    margin: 14px 0 8px;
  }
  .upload-zone small {
    font-size: 11px;
  }
  .upload-zone input {
    display: block;
    max-width: 100%;
    font-size: 11px;
    margin: 18px auto 0;
  }
  .profile-fields {
    display: flex;
    gap: 15px;
    margin-top: 20px;
    align-items: end;
    flex-wrap: wrap;
  }
  .profile-fields label {
    flex: 1;
    min-width: 160px;
  }
  .batch {
    padding: 20px 23px;
  }
  .batch + .batch {
    border-top: 1px solid var(--line);
  }
  .batch-header {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: center;
  }
  .batch-header strong {
    font-size: 12px;
  }
  .batch small {
    display: block;
    margin-top: 6px;
    font-size: 10px;
    color: #737373;
  }
  .batch-metrics {
    display: flex;
    gap: 24px;
    margin-top: 17px;
    flex-wrap: wrap;
  }
  .batch-metrics strong {
    font-size: 18px;
    display: block;
    font-weight: 600;
  }
  .batch-metrics span {
    font-size: 10px;
    color: #737373;
  }
  .batch .actions {
    margin-top: 18px;
    flex-wrap: wrap;
  }
  .batch summary {
    cursor: pointer;
    font-size: 11px;
    color: #737373;
    margin-top: 15px;
  }
  .batch details pre {
    max-height: 230px;
    overflow: auto;
    white-space: pre-wrap;
    font-size: 10px;
  }
  .progress {
    height: 5px;
    background: #ededed;
    border-radius: 4px;
    overflow: hidden;
    margin: 15px 0;
  }
  .progress:after {
    content: '';
    display: block;
    height: 100%;
    width: 40%;
    background: #737373;
    animation: loading 1.2s ease-in-out infinite alternate;
  }
  @keyframes loading {
    to {
      transform: translateX(150%);
    }
  }
  .settings-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
  }
  .settings-grid .wide {
    grid-column: 1/-1;
  }
  .key-value {
    display: grid;
    grid-template-columns: 140px 1fr;
    gap: 14px;
    font-size: 12px;
    margin-top: 16px;
    line-height: 1.7;
  }
  .key-value dt {
    color: #737373;
  }
  .key-value dd {
    margin: 0;
  }
  .login {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1fr 1.15fr;
  }
  .login-art {
    background: #202020;
    position: relative;
    padding: 55px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    color: #dddddd;
  }
  .login-art:after {
    content: '';
    position: absolute;
    bottom: -80px;
    left: 5%;
    width: 80%;
    aspect-ratio: 1;
    transform: rotate(45deg);
    border: 1px solid #73737355;
    box-shadow:
      35px 35px 0 0 #73737322,
      70px 70px 0 0 #73737322,
      105px 105px 0 0 #73737322;
    pointer-events: none;
  }
  .login-art .brand {
    padding: 0;
  }
  .login-art h2 {
    font-size: 40px;
    font-weight: 400;
    line-height: 1.2;
    letter-spacing: -1.7px;
    max-width: 390px;
    position: relative;
    z-index: 1;
  }
  .login-art p {
    margin-top: 20px;
    max-width: 330px;
    color: #b3b3b3;
    font-size: 13px;
  }
  .login-art .login-caption {
    font-size: 11px;
    margin-bottom: 60px;
    letter-spacing: 1px;
    color: #737373;
  }
  .login-form-wrap {
    display: grid;
    align-items: center;
    justify-content: center;
    padding: 35px;
  }
  .login-form {
    width: 350px;
    max-width: 100%;
  }
  .login-form h1 {
    font-size: 27px;
    margin-bottom: 10px;
  }
  .login-form > p {
    font-size: 12px;
    color: #737373;
    margin-bottom: 30px;
  }
  .login-form label {
    margin-top: 18px;
  }
  .login-form input {
    padding: 13px;
  }
  .login-form .btn {
    width: 100%;
    margin-top: 24px;
    padding: 13px;
  }
  .login-form .error {
    font-size: 12px;
    color: #b56a58;
    margin-top: 15px;
  }
  .login-foot {
    font-size: 10px;
    color: #b3b3b3;
    margin-top: 30px;
    text-align: center;
  }
  #toast {
    position: fixed;
    bottom: 25px;
    right: 25px;
    z-index: 100;
    background: #202020;
    color: #fafafa;
    border-radius: 9px;
    padding: 13px 18px;
    font-size: 12px;
    box-shadow: 0 4px 25px #20202033;
    display: none;
    max-width: 430px;
  }
  #toast.visible {
    display: block;
  }
  #toast.error {
    background: #8f5147;
  }
  dialog {
    border: 1px solid #dddddd;
    border-radius: 14px;
    max-width: min(1080px, 94vw);
    width: 850px;
    max-height: 87vh;
    padding: 0;
    color: var(--ink);
    box-shadow: 0 20px 80px #172a3333;
  }
  dialog::backdrop {
    background: #20202055;
    backdrop-filter: blur(3px);
  }
  .dialog-head {
    padding: 23px 26px 18px;
    border-bottom: 1px solid var(--line);
    display: flex;
    justify-content: space-between;
    align-items: center;
  }
  .dialog-body {
    padding: 24px 26px;
  }
  .dialog-body pre {
    font-size: 11px;
    overflow: auto;
    max-height: 50vh;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
  }
  .dialog-body .data-table th:first-child,
  .dialog-body .data-table td:first-child {
    min-width: 70px;
  }
  .pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    font-size: 11px;
    color: #737373;
  }
  .notice button {
    margin-left: auto;
  }
  .rule-note {
    font-size: 11px;
    line-height: 1.8;
    color: #737373;
  }
  .badge-line {
    display: flex;
    gap: 10px;
    align-items: center;
  }
  .danger-text {
    color: var(--red);
  }
}
@media (min-width: 1600px) {
  .main {
    padding: 38px 48px;
  }
  .topbar {
    padding: 0 48px;
  }
  .chart-wrap {
    height: 310px;
  }
  .stat-value {
    font-size: 34px;
  }
}
@media (max-width: 1150px) {
  .shell {
    grid-template-columns: 200px minmax(0, 1fr);
  }
  .sidebar {
    width: 200px;
    padding-left: 12px;
    padding-right: 12px;
  }
  .main {
    padding: 27px 23px;
  }
  .topbar {
    padding: 0 23px;
  }
  .stats {
    gap: 11px;
  }
  .stat {
    padding: 17px 14px;
  }
  .stat-value {
    font-size: 24px;
  }
  .two-col {
    grid-template-columns: minmax(0, 1.5fr) minmax(250px, 1fr);
  }
  .filter-row label {
    min-width: 110px;
  }
  .filter-row .period-select {
    min-width: 250px;
  }
  .topbar-right .date {
    display: none;
  }
}
@media (max-width: 900px) {
  .stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .two-col,
  .bottom-grid,
  .settings-grid {
    grid-template-columns: 1fr;
  }
  .filter-extras {
    grid-template-columns: 1fr 1fr;
  }
  .page-title {
    align-items: start;
  }
  .page-title .actions {
    flex-direction: column;
    align-items: end;
  }
  .settings-grid .wide {
    grid-column: auto;
  }
  .chart-wrap {
    height: 250px;
  }
  .login {
    grid-template-columns: 1fr 1fr;
  }
  .login-art {
    padding: 30px;
  }
  .login-art h2 {
    font-size: 30px;
  }
}
@media (max-width: 680px) {
  .shell {
    grid-template-columns: 1fr;
  }
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.2s;
  }
  .sidebar.open {
    transform: translateX(0);
    width: 234px;
    box-shadow: 0 0 0 100vw #20202055;
  }
  .workspace {
    grid-column: 1;
  }
  .topbar {
    height: 58px;
    padding: 0 18px;
  }
  .mobile-menu {
    display: block;
    border: 0;
    background: transparent;
    color: #737373;
    padding: 4px;
  }
  .breadcrumb {
    gap: 8px;
  }
  .topbar-right {
    gap: 8px;
  }
  .main {
    padding: 24px 16px;
  }
  .page-title {
    margin-bottom: 20px;
    gap: 12px;
  }
  h1 {
    font-size: 26px;
  }
  .page-title p {
    font-size: 11px;
    max-width: 250px;
  }
  .page-title .actions .btn {
    font-size: 10px;
    padding: 8px;
  }
  .stats {
    gap: 10px;
    margin: 16px 0;
  }
  .stat-value {
    font-size: 24px;
  }
  .stat-top {
    font-size: 10px;
  }
  .stat-note {
    font-size: 9px;
  }
  .stat-top .icon-box {
    display: none;
  }
  .sparkline {
    width: 38px;
  }
  .filter-row {
    gap: 10px;
  }
  .filter-row label {
    min-width: calc(50% - 10px);
  }
  .filter-row .period-select {
    min-width: 100%;
  }
  .filter-note {
    width: 100%;
    margin-left: 0;
  }
  .filters {
    padding: 12px;
  }
  .checkbox-row {
    gap: 10px;
  }
  .checkbox-row label {
    font-size: 10px;
  }
  .panel-header {
    padding: 17px 18px;
  }
  .panel-body {
    padding: 0 18px 18px;
  }
  .chart-summary {
    gap: 20px;
  }
  .legend {
    gap: 9px;
  }
  .data-table td,
  .data-table th {
    padding: 12px;
  }
  .page-footer {
    font-size: 9px;
  }
  .login {
    display: block;
  }
  .login-art {
    min-height: 200px;
    padding: 23px;
  }
  .login-art h2 {
    font-size: 25px;
    margin-top: 30px;
    max-width: 350px;
  }
  .login-art p,
  .login-caption {
    display: none;
  }
  .login-art:after {
    left: 40%;
    bottom: -170px;
    width: 70%;
  }
  .login-form-wrap {
    padding: 38px 24px;
  }
  .login-form {
    width: 100%;
  }
  .form-grid {
    grid-template-columns: 1fr;
  }
  .form-grid .full {
    grid-column: auto;
  }
  .filter-extras {
    grid-template-columns: 1fr 1fr;
  }
  .toolbar {
    gap: 11px;
  }
  .segment button {
    padding: 7px 8px;
    font-size: 10px;
  }
  .profile-fields label {
    min-width: 130px;
  }
  .private-badge {
    font-size: 9px;
  }
  .dialog-body {
    padding: 18px;
  }
  .key-value {
    grid-template-columns: 100px 1fr;
  }
}
@media (max-width: 390px) {
  body {
    min-width: 300px;
  }
  .stats {
    grid-template-columns: 1fr;
  }
  .page-title {
    flex-wrap: wrap;
  }
  .page-title .actions {
    flex-direction: row;
  }
  .panel-header {
    flex-wrap: wrap;
  }
  .two-col {
    grid-template-columns: minmax(0, 1fr);
  }
  .topbar-right .private-badge svg {
    display: none;
  }
  .chart-summary {
    gap: 15px;
  }
  .filter-extras {
    grid-template-columns: 1fr;
  }
  .profile-fields label {
    min-width: 100%;
  }
  .login-form {
    width: 100%;
  }
  .login-art h2 {
    font-size: 25px;
  }
}

/* Gareth & Lucas: original icon, Poppins, white/black and the shop's #f65801. */
@layer components {
  .brand {
    gap: 9px;
    padding-left: 4px;
    padding-right: 0;
  }
  .brand img {
    width: 43px;
    height: 43px;
    filter: invert(1);
    object-fit: contain;
  }
  .brand strong {
    font-size: 14px;
    letter-spacing: -0.4px;
    white-space: nowrap;
  }
  .brand small {
    font-size: 8px;
    color: #b3b3b3;
    letter-spacing: 0.8px;
  }
  .sidebar {
    background: #191919;
    border-top: 5px solid #f65801;
  }
  .nav a.active {
    background: #f65801;
    color: #171717;
    font-weight: 600;
  }
  .nav a.active:after {
    background: #171717;
  }
  .nav a:hover {
    background: #333;
  }
  .nav a.active:hover {
    background: #ff701f;
  }
  .eyebrow {
    color: #c54200;
  }
  .btn.primary {
    background: #f65801;
    color: #171717;
    border-color: #f65801;
    font-weight: 600;
  }
  .btn.primary:hover {
    background: #ff701f;
    border-color: #ff701f;
  }
  .btn:hover {
    background: #f6f6f6;
  }
  input:focus,
  select:focus,
  textarea:focus {
    border-color: #c54200;
    outline-color: #ffe3d3;
  }
  button:focus-visible,
  a:focus-visible {
    outline-color: #f65801;
  }
  .positive {
    color: #34734b;
  }
  .primary-stat {
    background: #fff5ed;
    border-color: #f9d3bd;
  }
  .primary-stat .icon-box {
    background: #ffe3d1;
    color: #c54200;
  }
  .legend i,
  .bar-fill {
    background: #f65801;
  }
  .legend i.orange {
    background: #626262;
  }
  .segment button.active {
    color: #b53b00;
    background: #fff;
    box-shadow: 0 1px 3px #20202016;
  }
  .matrix-total {
    color: #202020;
  }
  .login-art {
    background: #191919;
    color: white;
    border-top: 7px solid #f65801;
  }
  .login-art:after {
    border-color: #f6580160;
    box-shadow:
      35px 35px 0 0 #f6580118,
      70px 70px 0 0 #f6580110,
      105px 105px 0 0 #f6580108;
  }
  .login-art h2 {
    font-weight: 600;
    text-transform: uppercase;
    font-size: 38px;
  }
  .login-art .login-caption {
    color: #ff9458;
  }
  .login-art p {
    color: #bfbfbf;
  }
  .year-comparison {
    margin-top: 24px;
  }
  .year-comparison .panel-header {
    gap: 16px;
    flex-wrap: wrap;
  }
  .year-comparison .eyebrow {
    font-size: 9px;
    margin-bottom: 7px;
  }
  .year-chart-controls {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 16px;
  }
  .year-season-toggle {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 6px 0;
    border: 0;
    background: transparent;
    color: #484848;
    text-align: left;
    font-size: 11px;
    font-weight: 600;
  }
  .year-season-toggle small {
    display: block;
    color: #737373;
    font-size: 10px;
    font-weight: 400;
  }
  .year-switch-track {
    width: 34px;
    height: 20px;
    flex-shrink: 0;
    border-radius: 12px;
    background: #d5d5d5;
    padding: 3px;
  }
  .year-switch-track i {
    display: block;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #fff;
  }
  .year-season-toggle[aria-checked='true'] .year-switch-track {
    background: #f65801;
  }
  .year-season-toggle[aria-checked='true'] .year-switch-track i {
    transform: translateX(14px);
    background: #202020;
  }
  .year-season-note {
    margin-bottom: 10px;
    color: #b53b00;
    font-size: 11px;
  }
  .year-body {
    padding: 0 24px 20px;
  }
  .year-intro,
  .year-footnote {
    font-size: 11px;
    color: #696969;
    line-height: 1.8;
  }
  .year-legend {
    display: flex;
    gap: 12px;
    margin: 20px 0 10px;
    flex-wrap: wrap;
  }
  .year-key {
    flex: 1 1 170px;
    text-align: left;
    background: #fafafa;
    border: 1px solid #e5e5e5;
    border-radius: 7px;
    padding: 14px 16px;
    color: #202020;
  }
  .year-key:hover {
    border-color: #b6b6b6;
  }
  .year-key strong {
    display: block;
    font-size: 21px;
    margin: 7px 0 4px;
    font-weight: 600;
    letter-spacing: -0.7px;
  }
  .year-key > span:last-child {
    font-size: 10px;
    color: #696969;
  }
  .year-key-label {
    display: flex;
    align-items: center;
    gap: 9px;
    font-weight: 600;
    font-size: 13px;
  }
  .year-key-label i {
    display: inline-block;
    width: 23px;
    border-top: 3px solid #d94700;
  }
  .year-color-0 {
    background: #fff6ef;
    border-color: #f9c7a9;
  }
  .year-color-1 i {
    border-color: #202020;
    border-top-style: dashed;
  }
  .year-color-2 i {
    border-color: #6a7891;
    border-top-style: dotted;
  }
  .year-color-3 i {
    border-color: #9b633c;
    border-top-style: dotted;
  }
  .year-key-label small {
    margin-left: auto;
    font-size: 8px;
    letter-spacing: 1px;
    color: #b53b00;
  }
  .year-key.is-hidden {
    opacity: 0.55;
    background: #fff;
  }
  .year-key.is-hidden .year-key-label {
    text-decoration: line-through;
  }
  .year-plot {
    overflow-x: auto;
    margin: 20px -6px 4px;
  }
  .year-plot svg {
    width: 100%;
    min-width: 520px;
    display: block;
    font-family: inherit;
    font-size: 17px;
    fill: #737373;
  }
  .year-grid {
    stroke: #ededed;
    stroke-width: 1;
  }
  .year-zero {
    stroke: #bfbfbf;
    stroke-width: 1;
  }
  .year-empty {
    text-align: center;
    color: #737373;
    font-size: 12px;
    margin-bottom: 16px;
  }
  .year-footnote {
    margin-bottom: 15px;
  }
  .year-details {
    border-top: 1px solid #ededed;
    padding-top: 14px;
    font-size: 11px;
  }
  .year-details summary {
    cursor: pointer;
    color: #484848;
    font-weight: 600;
  }
  .year-details .table-scroll {
    margin-top: 12px;
  }
}
@media (max-width: 600px) {
  .year-body {
    padding-left: 16px;
    padding-right: 16px;
  }
  .year-key {
    flex-basis: 100%;
  }
}
