:root {
  color-scheme: light;
  --page: #f4f7fb;
  --surface: #ffffff;
  --ink: #172033;
  --muted: #657086;
  --line: #dce3ee;
  --blue: #2358d5;
  --blue-dark: #183f9e;
  --blue-soft: #edf3ff;
  --green: #18734a;
  --green-soft: #eaf8f1;
  --amber: #8a5300;
  --amber-soft: #fff4d6;
  --red: #a2262d;
  --red-soft: #fff0f1;
  --gray-soft: #f0f2f6;
  --focus: #0b65d8;
  font-family: Inter, Pretendard, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; min-height: 100vh; background: var(--page); color: var(--ink); }
button, input, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .58; }
.is-hidden { display: none !important; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

.topbar { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between; min-height: 58px; padding: 0 24px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.96); }
.brand, .auth-status { display: flex; align-items: center; gap: 10px; font-weight: 700; }
.mark, .lock-mark { display: grid; place-items: center; color: white; background: var(--blue); font-weight: 850; }
.mark { width: 30px; height: 30px; border-radius: 9px; font-size: 12px; }
.auth-status { color: var(--green); font-size: 13px; }
.text-button { border: 0; padding: 8px; color: var(--blue); background: transparent; font-weight: 700; }

.page-shell { width: min(1240px, calc(100% - 32px)); margin: 0 auto; padding: 28px 0 48px; }
.intro { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 20px; }
.eyebrow { margin: 0 0 6px; color: var(--blue); font-size: 11px; font-weight: 800; letter-spacing: .11em; }
h1 { margin: 0; font-size: clamp(22px, 3vw, 31px); }
.retention-note { max-width: 600px; margin: 0; color: var(--muted); font-size: 13px; line-height: 1.55; }

.platform-tabs { display: flex; flex-wrap: wrap; gap: 6px; padding: 6px; border: 1px solid var(--line); border-radius: 14px 14px 0 0; background: #e9eef6; }
.platform-tabs button { min-width: 110px; min-height: 44px; border: 1px solid transparent; border-radius: 9px; color: var(--muted); background: transparent; font-weight: 750; }
.platform-tabs button[aria-selected="true"] { border-color: #b9c9ed; color: var(--blue-dark); background: var(--surface); box-shadow: 0 2px 8px rgba(34,59,103,.08); }
#build-panel { padding: 18px; border: 1px solid var(--line); border-top: 0; border-radius: 0 0 14px 14px; background: var(--surface); }

.filters { display: grid; grid-template-columns: minmax(220px, 1fr) minmax(150px, .35fr) minmax(150px, .35fr) auto; align-items: end; gap: 10px; }
.filters label { display: grid; gap: 5px; color: var(--muted); font-size: 12px; font-weight: 700; }
.filters input, .filters select { width: 100%; min-height: 42px; border: 1px solid var(--line); border-radius: 9px; padding: 0 11px; color: var(--ink); background: white; }
.primary-button, .secondary-button, .download-button, .missing-refresh { min-height: 42px; border-radius: 9px; padding: 0 14px; font-weight: 750; }
.primary-button, .download-button { border: 1px solid var(--blue); color: white; background: var(--blue); }
.primary-button:hover:not(:disabled), .download-button:hover:not(:disabled) { background: var(--blue-dark); }
.secondary-button, .missing-refresh { border: 1px solid var(--line); color: var(--ink); background: white; }

.expiry-summary { min-height: 34px; margin-top: 14px; padding: 8px 11px; border-radius: 8px; color: var(--muted); background: var(--gray-soft); font-size: 13px; }
.retry-banner { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 10px; padding: 10px 12px; border: 1px solid #e7bd70; border-radius: 9px; color: var(--amber); background: var(--amber-soft); font-weight: 650; }
.retry-banner button { min-height: 36px; border: 1px solid currentColor; border-radius: 7px; color: inherit; background: transparent; font-weight: 750; }
.panel-state { padding: 54px 16px; text-align: center; color: var(--muted); }

.list-scroll { max-width: 100%; margin-top: 12px; overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; }
table { width: 100%; min-width: 880px; border-collapse: collapse; font-size: 13px; }
th, td { padding: 13px 14px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
th { color: var(--muted); background: #f8fafd; font-size: 11px; letter-spacing: .04em; }
tbody tr:last-child td { border-bottom: 0; }
.version { font-weight: 800; }
.branch, .commit, .file-meta, .date-detail, .row-message { display: block; margin-top: 4px; color: var(--muted); font-size: 11px; }
.branch, .commit { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.status-badge { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 5px 9px; font-weight: 750; white-space: nowrap; }
.status-badge::before { content: "●"; font-size: 9px; }
.state-publishing { color: #555f72; background: var(--gray-soft); }
.state-available { color: var(--green); background: var(--green-soft); }
.state-expiring { color: var(--amber); background: var(--amber-soft); }
.state-expired { color: #555f72; background: var(--gray-soft); }
.state-missing { color: var(--red); background: var(--red-soft); }
.actions { display: flex; align-items: center; gap: 7px; }
.row-message { max-width: 190px; color: var(--red); }
.row-message:empty { display: none; }
.pagination { display: flex; align-items: center; justify-content: flex-end; gap: 12px; margin-top: 14px; color: var(--muted); font-size: 12px; }

.lock { position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; padding: 24px; background: var(--page); }
.lock-card { width: min(360px, 100%); padding: 28px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); box-shadow: 0 18px 55px rgba(29,48,82,.12); }
.lock-mark { width: 46px; height: 46px; margin-bottom: 18px; border-radius: 13px; }
.lock-card > p:not(.eyebrow):not(.lock-message) { margin: 8px 0 20px; color: var(--muted); font-size: 13px; }
.lock-card label { display: block; margin-bottom: 6px; color: var(--muted); font-size: 12px; font-weight: 700; }
.lock-card input { width: 100%; min-height: 44px; border: 1px solid var(--line); border-radius: 9px; padding: 0 11px; }
.masked-input { -webkit-text-security: disc; }
.lock-card .primary-button { width: 100%; min-height: 44px; margin-top: 12px; }
.lock-message { min-height: 18px; margin: 9px 0 0; color: var(--red); font-size: 12px; }

@media (max-width: 760px) {
  .topbar { padding: 0 14px; }
  .page-shell { width: min(100% - 20px, 1240px); padding-top: 18px; }
  .intro { align-items: start; flex-direction: column; gap: 10px; }
  .platform-tabs button { flex: 1 1 44%; min-width: 94px; min-height: 44px; }
  .filters { grid-template-columns: 1fr 1fr; }
  .search-field { grid-column: 1 / -1; }
  button, input, select, .primary-button, .secondary-button, .download-button, .missing-refresh { min-height: 44px; }
  .pagination { justify-content: space-between; }
}

@media (max-width: 470px) {
  .filters { grid-template-columns: 1fr; }
  .search-field { grid-column: auto; }
  .filters > button { width: 100%; }
  .auth-status > span:first-child { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}
