/* Application styles using Digital Agency Design System HTML tokens (v2). */
:root {
  --app-text: var(--color-neutral-solid-gray-900);
  --app-muted: var(--color-neutral-solid-gray-700);
  --app-line: var(--color-neutral-solid-gray-300);
  --app-soft: var(--color-neutral-solid-gray-50);
  --app-blue: var(--color-key-900);
  --app-blue-hover: var(--color-key-1000);
}
* { box-sizing: border-box; }
html { background: var(--color-neutral-white); }
body { margin: 0; color: var(--app-text); background: var(--color-neutral-white); font-size: 16px; line-height: 1.6; }
[hidden] { display: none !important; }
button, input, select { font: inherit; }
button { cursor: pointer; }
a { text-underline-offset: .18em; }
.skip-link { position: absolute; left: 16px; top: -100px; z-index: 100; padding: 9px 15px; background: var(--color-primitive-yellow-300); color: #000; font-weight: 700; }
.skip-link:focus { top: 12px; }
header { border-bottom: 1px solid var(--app-line); background: #fff; min-height: 86px; padding: 15px max(24px, calc((100vw - 1200px) / 2)); display: flex; align-items: center; justify-content: space-between; gap: 22px; }
.brand { font-size: 21px; font-weight: 700; line-height: 1.35; }
.brand a, .brand a:visited { color: var(--app-text); text-decoration: none; }
.brand a:hover { text-decoration: underline; }
.brand small { display: block; font-size: 14px; font-weight: 400; color: var(--app-muted); margin-top: 3px; }
.topnav { display: flex; align-items: center; gap: 22px; }
.topnav a { white-space: nowrap; font-weight: 700; }
.status { color: var(--app-muted); font-size: 14px; padding-left: 18px; border-left: 1px solid var(--app-line); }
.layout { max-width: 1248px; padding: 32px 24px 64px; margin: auto; }
.dashboard { margin-bottom: 48px; }
.dashboard-head { display: flex; justify-content: space-between; align-items: end; gap: 24px; border-bottom: 2px solid var(--app-text); padding-bottom: 24px; margin-bottom: 24px; }
.dashboard-eyebrow { margin: 0 0 4px; color: var(--app-muted); font-size: 14px; font-weight: 700; }
.dashboard-head h1 { margin: 0 0 8px; font-size: 36px; line-height: 1.35; }
.dashboard-head p:last-child { margin: 0; color: var(--app-muted); }
.dashboard-total { white-space: nowrap; border-left: 1px solid var(--app-line); padding-left: 24px; font-variant-numeric: tabular-nums; }
.dashboard-total small { display: block; color: var(--app-muted); }
.dashboard-total strong { font-size: 36px; line-height: 1.3; }
.dashboard-total span { margin-left: 4px; }
.dashboard-chart-section { border: 1px solid var(--app-line); padding: 24px; }
.dashboard-section-head { display: flex; justify-content: space-between; align-items: start; gap: 12px 24px; }
.dashboard-section-head h2 { font-size: 22px; line-height: 1.4; margin: 0 0 4px; }
.dashboard-section-head p { margin: 0; color: var(--app-muted); font-size: 14px; }
.dashboard-section-head > a { white-space: nowrap; font-weight: 700; }
.dashboard-legend { display: flex; flex-wrap: wrap; gap: 8px 16px; white-space: nowrap; font-size: 14px; }
.dashboard-legend span { display: inline-flex; align-items: center; gap: 6px; }
.dashboard-legend i { display: inline-block; width: 14px; height: 14px; }
.legend-border, .monthly-border { background: var(--color-key-800); }
.legend-domestic, .monthly-domestic { background: var(--color-neutral-solid-gray-500); }
.dashboard-chart-value { border-left: 4px solid var(--app-blue); background: var(--color-key-50); padding: 8px 12px; margin: 20px 0 12px; font-weight: 700; font-variant-numeric: tabular-nums; }
.monthly-scroll { overflow-x: auto; }
.monthly-chart { display: flex; align-items: end; gap: 5px; min-width: 840px; height: 220px; border-bottom: 1px solid var(--app-line); }
.monthly-col { display: flex; align-items: end; flex: 1; height: 100%; padding: 0; border: 0; background: transparent; cursor: pointer; }
.monthly-col:hover .monthly-stack { filter: brightness(.84); }
.monthly-col.active { outline: 2px solid var(--color-primitive-blue-1000); outline-offset: 2px; }
.monthly-col:focus-visible { outline: 3px solid var(--color-primitive-yellow-300); outline-offset: 2px; }
.monthly-stack { display: flex; flex-direction: column-reverse; width: 100%; min-height: 0; }
.monthly-stack i { display: block; width: 100%; }
.monthly-axis { display: grid; grid-template-columns: repeat(24, minmax(0, 1fr)); gap: 5px; min-width: 840px; color: var(--app-muted); font-size: 12px; margin-top: 8px; white-space: nowrap; }
.monthly-table { width: min(590px, 100%); }
.monthly-table th:not(:first-child), .monthly-table td { text-align: right; }
.dashboard-note { color: var(--app-muted); font-size: 14px; margin: 18px 0 0; }
.dashboard-rankings { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; margin-top: 24px; }
.dashboard-ranking { border: 1px solid var(--app-line); padding: 22px 24px; min-width: 0; }
.dashboard-rank-list { list-style: none; padding: 0; margin: 14px 0 0; }
.dashboard-rank-list li { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; gap: 4px 10px; align-items: center; border-top: 1px solid var(--app-line); padding: 10px 0; }
.rank-order { color: var(--app-muted); font-weight: 700; font-variant-numeric: tabular-nums; }
.dashboard-rank-list a { display: inline-flex; gap: 8px; align-items: center; font-weight: 700; min-width: 0; }
.dashboard-rank-list strong { white-space: nowrap; font-variant-numeric: tabular-nums; }
.rank-track { grid-column: 2 / 4; height: 5px; background: var(--app-soft); }
.rank-track i { display: block; height: 100%; background: var(--color-key-800); }
.filters { border: 1px solid var(--app-line); padding: 22px; margin: 28px 0 18px; }
.filters h2 { font-size: 20px; line-height: 1.5; margin: 0 0 18px; }
.filter-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 18px; }
.field { margin-bottom: 0; }
.field label { display: block; font-weight: 700; margin-bottom: 8px; }
.field input, .field select, .search input, .profile-search-controls input, .country-index-toolbar input { width: 100%; min-height: 48px; background: #fff; border: 1px solid var(--color-neutral-solid-gray-600); border-radius: 4px; color: var(--app-text); padding: 9px 12px; }
.field input::placeholder, .search input::placeholder, .profile-search-controls input::placeholder { color: var(--app-muted); opacity: 1; }
.field select { appearance: none; padding-right: 48px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16' fill='none'%3E%3Cpath d='m3 6 5 5 5-5' stroke='%231a1a1a' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 20px center; background-size: 16px 16px; }
.linkbutton { background: none; border: 0; color: var(--color-primitive-blue-1000); text-decoration: underline; padding: 6px 0; font-weight: 700; text-align: left; }
.linkbutton:hover { color: var(--color-primitive-blue-900); text-decoration-thickness: 3px; }
.filters .hint { border-top: 1px solid var(--app-line); padding-top: 14px; margin: 12px 0 0; color: var(--app-muted); font-size: 14px; line-height: 1.65; }
.main-panel { min-width: 0; }
.searchbar { border-bottom: 2px solid var(--app-text); padding: 0 0 28px; }
.searchbar h2 { font-size: 30px; line-height: 1.5; margin: 0 0 10px; }
.sub { margin: 0 0 22px; color: var(--app-muted); }
.search-label, .country-index-field label { display: block; font-weight: 700; margin-bottom: 8px; }
.search, .profile-search-controls { display: flex; gap: 12px; }
.search input, .profile-search-controls input { flex: 1; min-width: 0; }
.search button, .profile-search-controls button { background: var(--app-blue); border: 2px solid var(--app-blue); color: #fff; border-radius: 4px; min-height: 48px; padding: 8px 24px; font-weight: 700; white-space: nowrap; }
.search button:hover, .profile-search-controls button:hover { background: var(--app-blue-hover); border-color: var(--app-blue-hover); }
.summary { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 8px 16px; padding: 22px 0 12px; color: var(--app-muted); }
.summary strong { font-size: 24px; color: var(--app-text); }
.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; min-width: 720px; border-top: 1px solid var(--app-line); }
th { text-align: left; background: var(--app-soft); padding: 14px 12px; border-bottom: 1px solid var(--app-line); color: var(--app-text); font-size: 14px; white-space: nowrap; }
td { padding: 16px 12px; border-bottom: 1px solid var(--app-line); vertical-align: top; line-height: 1.55; }
tbody tr:hover { background: var(--color-key-50); }
.product { font-weight: 700; min-width: 160px; }
.violation { min-width: 210px; }
.muted { color: var(--app-muted); }
.tag { display: inline-block; color: var(--app-text); border: 1px solid var(--app-line); background: #fff; padding: 1px 8px; white-space: nowrap; font-size: 14px; }
.tag.domestic { background: var(--app-soft); }
.country-link { font-weight: 700; }
.detail-button { background: #fff; color: var(--color-primitive-blue-1000); border: 1px solid var(--app-blue); border-radius: 4px; min-height: 40px; padding: 5px 10px; white-space: nowrap; text-decoration: underline; font-weight: 700; }
.detail-button:hover { background: var(--color-key-50); }
mark { background: var(--color-primitive-cyan-100); box-shadow: inset 0 -2px 0 var(--color-primitive-cyan-900); color: inherit; }
.empty { padding: 42px 16px; text-align: center; color: var(--app-muted); }
.pager { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 20px 0; }
.pager button { border: 1px solid var(--app-blue); background: #fff; color: var(--app-blue); border-radius: 4px; min-height: 44px; padding: 7px 18px; font-weight: 700; }
.pager button:hover:not(:disabled) { background: var(--color-key-50); }
.pager button:disabled { color: var(--app-muted); border-color: var(--app-line); cursor: default; }
.country-list, .country-page { max-width: 1248px; margin: auto; padding: 32px 24px 72px; }
.breadcrumb { margin: 0 0 26px; color: var(--app-muted); font-size: 14px; }
.page-head { border-bottom: 2px solid var(--app-text); padding-bottom: 24px; }
.page-head h1, .profile-hero h1 { font-size: 36px; line-height: 1.45; margin: 0 0 12px; }
.page-head p, .profile-hero p { margin: 0; color: var(--app-muted); }
.country-index-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin: 28px 0 18px; }
.country-index-field { width: min(350px, 100%); }
.country-index-toolbar input { max-width: 350px; }
.region-tabs { position: sticky; top: 0; z-index: 5; display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 28px; padding: 12px 0; border-bottom: 1px solid var(--app-line); background: #fff; }
.region-tabs button { min-height: 42px; border: 1px solid var(--app-blue); border-radius: 4px; padding: 6px 12px; background: #fff; color: var(--app-blue); font-weight: 700; }
.region-tabs button:hover { background: var(--color-key-50); }
.region-tabs button[aria-pressed="true"] { background: var(--app-blue); color: #fff; }
.region-tabs button span { margin-left: 4px; font-size: 13px; font-weight: 400; }
.region-section { margin-top: 34px; }
.region-heading { display: flex; align-items: baseline; gap: 16px; border-bottom: 2px solid var(--app-text); padding-bottom: 8px; margin-bottom: 12px; }
.region-heading h2 { font-size: 24px; margin: 0; }
.region-heading span { color: var(--app-muted); font-size: 14px; }
.country-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(255px, 1fr)); gap: 0; border-top: 1px solid var(--app-line); border-left: 1px solid var(--app-line); }
.country-card { border-right: 1px solid var(--app-line); border-bottom: 1px solid var(--app-line); padding: 18px; display: flex; justify-content: space-between; gap: 10px; align-items: center; background: #fff; font-weight: 700; }
.country-regions .country-card, .country-regions .country-card:visited, .country-regions .country-card:hover { color: var(--app-blue); text-decoration: none; }
.country-regions .country-card:focus-visible { outline: 3px solid var(--color-primitive-yellow-300); outline-offset: -3px; }
.country-card-name { display: inline-flex; align-items: center; gap: 9px; min-width: 0; }
.country-flag { font-size: 22px; line-height: 1; flex: none; }
.country-card:hover { background: var(--color-key-50); }
.country-card small { color: var(--app-muted); font-size: 14px; font-weight: 400; white-space: nowrap; }
.variant-note { color: var(--app-muted); margin: 28px 0; line-height: 1.7; }
.variant-note summary { color: var(--color-primitive-blue-1000); text-decoration: underline; font-weight: 700; cursor: pointer; }
.variant-note div { margin-top: 10px; }
.profile-hero { border-left: 8px solid var(--app-blue); border-bottom: 1px solid var(--app-line); padding: 8px 0 28px 24px; margin-bottom: 30px; }
.profile-hero .eyebrow { font-weight: 700; color: var(--app-muted); margin-bottom: 7px; }
.back-search, .paid-link { display: inline-block; margin-top: 20px; font-weight: 700; }
.paid-link { margin-left: 24px; }
.profile-stats { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--app-line); border-bottom: 1px solid var(--app-line); margin-bottom: 34px; }
.stat { padding: 22px 20px 24px; border-right: 1px solid var(--app-line); }
.stat:last-child { border-right: 0; }
.stat small { display: block; color: var(--app-muted); font-size: 14px; }
.stat strong { display: block; font-size: 36px; line-height: 1.3; margin-top: 4px; }
.profile-grid { display: grid; grid-template-columns: 1.25fr 1fr; gap: 34px; }
.profile-card h2, .profile-search-head h2, .paid-section h2 { font-size: 24px; line-height: 1.5; margin: 0 0 6px; }
.profile-card { min-width: 0; }
.section-desc { color: var(--app-muted); margin: 0 0 20px; }
.trend-value { margin: 0 0 12px; padding: 8px 12px; border-left: 4px solid var(--app-blue); background: var(--color-key-50); font-weight: 700; font-variant-numeric: tabular-nums; }
.trend-scroll { overflow-x: auto; }
.trend { height: 210px; min-width: 700px; display: flex; align-items: end; gap: 4px; padding: 0 2px; border-bottom: 1px solid var(--app-line); }
.trend-col { display: flex; align-items: end; flex: 1; min-width: 24px; height: 100%; padding: 0; border: 0; border-radius: 0; background: transparent; cursor: pointer; }
.trend-col span { display: block; width: 100%; min-height: 2px; background: var(--color-key-800); }
.trend-col.latest span { background: var(--color-key-300); }
.trend-col:hover span { background: var(--color-key-1000); }
.trend-col.active { outline: 2px solid var(--color-primitive-blue-1000); outline-offset: 2px; }
.trend-col:focus-visible { outline: 3px solid var(--color-primitive-yellow-300); outline-offset: 2px; }
.trend-axis { min-width: 700px; display: flex; justify-content: space-between; margin-top: 10px; color: var(--app-muted); font-size: 14px; }
.trend-details { margin-top: 14px; }
.trend-details summary { width: fit-content; color: var(--color-primitive-blue-1000); text-decoration: underline; font-weight: 700; cursor: pointer; }
.trend-table { min-width: 0; width: min(320px, 100%); margin-top: 12px; }
.trend-table th, .trend-table td { padding: 6px 12px; }
.trend-table td { text-align: right; }
.category-row { margin-bottom: 15px; }
.category-top { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 5px; }
.category-top a { font-weight: 700; }
.category-top span { white-space: nowrap; color: var(--app-muted); }
.category-track { height: 8px; background: var(--color-neutral-solid-gray-100); }
.category-track i { display: block; height: 100%; background: var(--color-key-800); }
.ranking-all { max-height: 340px; overflow-y: auto; margin-top: 12px; border-top: 1px solid var(--app-line); }
.ranking-list-row { display: flex; justify-content: space-between; gap: 16px; padding: 8px 4px; border-bottom: 1px solid var(--app-line); }
@media (prefers-reduced-motion: no-preference) {
  .monthly-chart.animate-in .monthly-stack { transform-origin: bottom; animation: grow-up 850ms cubic-bezier(.18,.72,.2,1) both; }
  .trend.animate-in .trend-col span { transform-origin: bottom; animation: grow-up 850ms cubic-bezier(.18,.72,.2,1) both; }
  #categories.animate-in .category-track i, #violationCountries.animate-in .category-track i { transform-origin: left; animation: grow-right 650ms cubic-bezier(.18,.72,.2,1) both; animation-delay: var(--grow-delay); }
  @keyframes grow-up { from { transform: scaleY(0); } to { transform: scaleY(1); } }
  @keyframes grow-right { from { transform: scaleX(0); } to { transform: scaleX(1); } }
}
.profile-search { border-top: 2px solid var(--app-text); padding-top: 22px; margin-top: 38px; }
.profile-search-head p { color: var(--app-muted); margin: 0 0 16px; }
.country-period { display: grid; grid-template-columns: repeat(2, minmax(0, 220px)); gap: 18px; margin-top: 18px; }
.violation-filters { display: grid; grid-template-columns: minmax(0, 1.5fr) repeat(2, minmax(0, 1fr)); gap: 18px; margin-top: 18px; }
.profile-search-head .period-hint { margin: 8px 0 0; font-size: 14px; }
.paid-section { border-top: 1px solid var(--app-line); padding-top: 30px; margin-top: 40px; }
.paid-section > p { color: var(--app-muted); margin: 0 0 20px; }
.paid-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.paid-card { border: 1px solid var(--app-line); border-top: 4px solid var(--app-blue); padding: 20px; }
.paid-card span { color: var(--app-muted); font-size: 14px; }
.paid-card h3 { font-size: 20px; margin: 8px 0; }
.paid-card p { margin: 0; }
.drawer { border: 0; border-left: 1px solid var(--app-line); border-radius: 0; padding: 0; margin: 0 0 0 auto; height: 100dvh; width: min(650px, 100vw); max-height: 100dvh; box-shadow: var(--elevation-2); overflow-y: auto; }
.drawer::backdrop { background: rgba(0,0,0,.58); }
.drawer-head { background: #fff; position: sticky; top: 0; z-index: 2; border-bottom: 1px solid var(--app-line); padding: 15px 24px; display: flex; justify-content: space-between; align-items: center; }
.drawer-head strong { font-size: 20px; }
.drawer-head button { background: #fff; border: 1px solid var(--app-line); border-radius: 4px; font-size: 24px; width: 44px; height: 44px; line-height: 1; }
.drawer-head button:hover { background: var(--app-soft); }
.drawer-body { padding: 26px 24px 48px; }
.drawer-body h2 { font-size: 24px; line-height: 1.5; margin: 0 0 20px; }
.lead { border-left: 4px solid var(--app-blue); background: var(--color-key-50); padding: 16px 18px; margin: 20px 0 28px; }
.detail-grid { display: grid; grid-template-columns: 145px 1fr; gap: 0; margin: 0; border-top: 1px solid var(--app-line); }
.detail-grid dt, .detail-grid dd { border-bottom: 1px solid var(--app-line); padding: 12px 6px; margin: 0; overflow-wrap: anywhere; }
.detail-grid dt { font-weight: 700; }
.detail-grid dd { white-space: pre-wrap; }
.source { margin-top: 30px; border-top: 1px solid var(--app-line); padding-top: 18px; color: var(--app-muted); }
.source a { display: inline-block; margin-top: 8px; font-weight: 700; }
.notice { border-left: 4px solid var(--color-semantic-warning-yellow-2); background: var(--color-primitive-yellow-50); padding: 12px 16px; margin-bottom: 18px; }
.site-footer { border-top: 1px solid var(--app-line); background: var(--app-soft); padding: 30px max(24px, calc((100vw - 1200px) / 2)); color: var(--app-muted); font-size: 14px; }
@media (max-width: 1050px) {
  header { display: block; }
  .topnav { margin-top: 14px; }
}
@media (max-width: 800px) {
  .dashboard-rankings { grid-template-columns: 1fr; }
  header { display: block; padding: 18px 20px; }
  .topnav { margin-top: 15px; }
  .status { margin-left: auto; }
  .layout { padding: 24px 20px 50px; }
  .filters { padding: 20px; }
  .filter-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 0 18px; }
  .field { margin-bottom: 18px; }
  .profile-grid { grid-template-columns: 1fr; }
  .violation-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .country-list, .country-page { padding: 24px 20px 60px; }
}
@media (max-width: 600px) {
  .dashboard-head { display: block; }
  .dashboard-head h1 { font-size: 28px; }
  .dashboard-total { border-left: 0; border-top: 1px solid var(--app-line); padding: 12px 0 0; margin-top: 18px; }
  .dashboard-total strong { font-size: 30px; }
  .dashboard-chart-section, .dashboard-ranking { padding: 18px; }
  .dashboard-section-head { display: block; }
  .dashboard-section-head > a { display: inline-block; margin-top: 6px; }
  .dashboard-legend { margin-top: 8px; }
  .brand { font-size: 18px; }
  .topnav { gap: 8px 18px; flex-wrap: wrap; }
  .status { display: none; }
  .filter-grid { grid-template-columns: 1fr; }
  .searchbar h2, .page-head h1, .profile-hero h1 { font-size: 28px; }
  .search, .profile-search-controls { flex-direction: column; }
  .search button, .profile-search-controls button { width: 100%; }
  .summary { display: block; }
  .summary > div + div { margin-top: 7px; }
  .country-index-toolbar { display: block; }
  .country-index-field { width: 100%; margin-top: 12px; }
  .country-index-toolbar input { max-width: none; }
  .profile-stats { grid-template-columns: 1fr 1fr 1fr; }
  .stat { padding: 15px 8px; }
  .stat strong { font-size: 24px; }
  .paid-grid { grid-template-columns: 1fr; }
  .detail-grid { grid-template-columns: 105px 1fr; }
  .paid-link { margin-left: 0; display: block; margin-top: 8px; }
  .country-period { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .violation-filters { grid-template-columns: 1fr; }
}
