:root {
  color-scheme: light;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Yu Gothic UI", sans-serif;
  color: #2a2a2a;
  background: #fff;
  --muted: #646464;
  --line: #dbdbdb;
  --accent: #565656;
  --mono: "IBM Plex Mono", ui-monospace, Menlo, monospace;
}
* { box-sizing: border-box }
body { margin: 0; line-height: 1.6 }
a { color: var(--accent); text-underline-offset: .22em }
a:hover { color: #353535 }
:focus-visible { outline: 2px solid #686868; outline-offset: 3px }
.topbar { background: #fff; border-bottom: 1px solid var(--line) }
.bar-inner, main { width: min(1040px, calc(100% - 64px)); margin-inline: auto }
.bar-inner, nav, .brand, .actions, .dates { display: flex; align-items: center }
.bar-inner { min-height: 46px; justify-content: space-between; gap: 18px }
.brand { gap: 5px; font-size: 22px; font-weight: 680; letter-spacing: -.06em; color: #2c2c2c; text-decoration: none }
nav { gap: clamp(12px, 3vw, 30px); font-size: .83rem }
nav a, .nav-action { color: var(--muted); text-decoration: none }
nav a[aria-current] { color: #2e2e2e; font-weight: 650; text-decoration: underline; text-underline-offset: 8px }
nav button + form { padding-left: clamp(10px, 2vw, 22px); border-left: 1px solid var(--line) }
.nav-action { padding: 5px 0; background: transparent; border: 0; font-weight: 450 }
.nav-action:hover { background: transparent; color: #292929 }
main { padding-block: 18px 36px; overflow-wrap: anywhere }
h1, h2, h3, p { margin: 0 }
h1 { font-size: clamp(23px, 2.5vw, 30px); letter-spacing: -.045em; font-weight: 630; line-height: 1.27; margin-bottom: 16px }
h2 { font-size: 18px; line-height: 1.45 }
.command { display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px 18px; font-size: 13px; color: var(--muted) }
code { padding: 4px 9px; border: 1px solid var(--line); border-radius: 4px; background: #f1f1f1; color: #444444 }
code, .mono, time { font-family: var(--mono); font-variant-numeric: tabular-nums }
.list { --action-width: 34px; --actions-width: calc(4 * var(--action-width) + 12px); --columns: 6rem minmax(0, 1fr) var(--actions-width); border-top: 1px solid var(--line) }
.tools, .meta { display: flex; align-items: center; gap: 8px }
.tools { margin-bottom: 12px }
.tools input, .tools select { font: inherit; font-size: 13px; padding: 6px 9px; border: 1px solid var(--line); border-radius: 4px; background: white; color: inherit; min-height: 34px }
.tools input { max-width: 350px; flex: 1; min-width: 0 }
.count { font-size: 12px; margin-left: auto; white-space: nowrap; color: var(--muted) }
.list-head, .report-row {
  display: grid;
  grid-template-columns: var(--columns);
  gap: 12px;
  align-items: center;
  padding: 7px 8px;
  border-bottom: 1px solid var(--line);
}
.list-head { background: #f0f0f0; color: var(--muted); font-size: 12px; font-weight: 600; padding-block: 6px }
.report-row:hover, .report-row:focus-within { background: #f2f2f2 }
.report-name { min-width: 0 }
.report-title { color: inherit; font-size: 16px; font-weight: 600; text-decoration: none }
.report-title:hover { text-decoration: underline }
.meta { flex-wrap: wrap; gap: 0 10px; font-size: 12px; color: var(--muted) }
.status { display: inline-flex; align-items: center; justify-self: start; width: fit-content; gap: 5px; padding: 2px 7px; border-radius: 4px; font-size: 12px; line-height: 1.5; font-weight: 600; white-space: nowrap; color: #444; background: #eee }
.status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor }
.status[data-state="公開中"] { color: #146342; background: #e0f5e9 }
.status[data-state="下書き"], .status[data-state="確認可能"] { color: #204f96; background: #e8f0fc }
.status[data-state="新版あり"], .status[data-state="変換待ち"], .status[data-state="変換中"] { color: #804400; background: #fff0cf }
.status[data-state="変換エラー"], [role="alert"] { color: #92282e; background: #fff0f0 }
.row-actions { display: grid; grid-template-columns: repeat(4,var(--action-width)); gap: 4px }
.row-actions a, .row-actions button {
  display: grid;
  place-items: center;
  justify-self: stretch;
  min-height: var(--action-width);
  padding: 0;
  border: 1px solid #d3d3d3;
  border-radius: 4px;
  font: inherit;
  font-size: 12px;
  color: var(--accent);
  background: #ffffff;
  text-align: center;
  text-decoration: none;
}
.row-actions a:hover, .row-actions button:hover { background: #ececec; border-color: #ababab }
[hidden] { display: none !important }
small, time, .dates, .empty { font-size: 13px; color: var(--muted) }
.empty { padding: 24px 0 }
.login { width: min(100%, 320px); margin: clamp(24px, 8vh, 110px) auto 0 }
.login h1 { font-size: 23px }
.panel { display: grid; gap: 12px; max-width: 580px }
.panel label { display: grid; gap: 6px; color: var(--muted); font-size: 14px; font-weight: 550 }
input { width: 100%; min-width: 0; font: inherit; font-size: 16px; color: #2a2a2a; background: white; border: 1px solid #c3c3c3; border-radius: 5px; padding: 7px 10px }
button { font: inherit; font-size: inherit; font-weight: 550; cursor: pointer; justify-self: start; border: 1px solid transparent; border-radius: 5px; background: #3a3a3a; color: white; padding: 9px 18px }
button:hover { background: #282828 }
.login button { width: 100%; margin-top: 6px }
.quiet { background: transparent; border-color: var(--line); color: #484848 }
.quiet:hover { background: #eeeeee }
.actions, .dates { flex-wrap: wrap; gap: 8px 16px; margin-bottom: 18px; font-size: 14px }
.back { display: inline-block; margin-bottom: 20px; color: var(--muted); font-size: 13px; text-decoration: none }
.version { margin-top: 32px; padding-top: 24px; border-top: 1px solid var(--line); scroll-margin-top: 20px }
.version h2 { margin: 4px 0 10px }
.version > a { font-size: 14px }
iframe { display: block; width: 100%; height: 68vh; margin: 18px 0 22px; border: 1px solid var(--line); border-radius: 6px; background: white }
pre { color: #804400; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14px }
@media (max-width: 600px) {
  .bar-inner, main { width: calc(100% - 32px) }
  .bar-inner { min-height: 46px; flex-wrap: wrap; padding-block: 10px; gap: 6px 12px }
  nav { flex-wrap: wrap; gap: 12px; font-size: 12px }
  .tools { flex-wrap: wrap }
  .tools input { flex-basis: 100%; max-width: none }
}

@media (max-width: 800px) {
  .list { --action-width: 44px; --columns: 5.1rem minmax(0,1fr) }
  .list-head span:last-child { display: none }
  .report-row { align-items: baseline; gap: 7px 12px }
  .row-actions { grid-column: 1 / -1; width: var(--actions-width) }

}

#cli-help { width: min(26rem, calc(100% - 32px)); max-height: 85vh; overflow: auto; padding: 24px; border: 1px solid var(--line); border-radius: 8px; color: inherit; background: #fff }
#cli-help::backdrop { background: rgb(0 0 0 / 28%) }
#cli-help p { margin: 16px 0 6px; font-size: 14px }
#cli-help .copy-command { width: 100% }
.copy-command { display: inline-flex; align-items: center; justify-content: space-between; gap: 12px; padding: 7px 10px; background: #f1f1f1; border: 1px solid var(--line); color: #444444; text-align: left }
.copy-command:hover { background: #ececec }
.copy-command code { padding: 0; border: 0; background: none; font-weight: 400 }
.copy-command img { flex: none }
#cli-help form { margin-top: 20px; text-align: right }

main:has(.review) { padding-block: 14px 28px }
.review-head, .review-bar, .review-meta, .review-tools, .publish-action, .dialog-actions { display: flex; align-items: center; gap: 8px }
.review-head h1 { flex: 1; min-width: 0; margin: 0; font-size: clamp(18px, 2vw, 24px) }
.review-bar { justify-content: space-between; flex-wrap: wrap; margin: 6px 0 }
.review-meta { flex-wrap: wrap; font-size: 13px; min-width: 0 }
.review-meta select { padding: 4px; font: inherit; border: 1px solid var(--line); border-radius: 4px; background: white }
.review-tools { gap: 4px; margin-left: auto }
.icon-action { display: inline-grid; place-items: center; padding: 0; width: 36px; height: 36px; flex: none; border: 1px solid var(--line); border-radius: 4px; background: white }
.icon-action:hover { background: #ececec }
.publish-action { flex: none; font-size: 13px; padding: 7px 12px }
.publish-action img { filter: invert(1); width: 15px; height: 15px }
.review iframe { margin: 0; height: clamp(280px, calc(100dvh - 245px), 900px) }
.publication { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; margin-top: 8px }
.publication label { font-size: 12px; color: var(--muted) }
.publication input { padding: 6px 8px }
#report-tools { width: min(25rem, calc(100% - 32px)); padding: 20px; border: 1px solid var(--line); border-radius: 8px; color: inherit }
#report-tools::backdrop { background: rgb(0 0 0 / 28%) }
#report-tools p { margin: 12px 0 4px; font-size: 13px }
#report-tools .dates { margin: 12px 0 0 }
.dialog-actions { justify-content: flex-end; margin-top: 16px }
@media (max-width: 600px) {
  .icon-action { width: 40px; height: 40px }
  .publication { grid-template-columns: 1fr }
}

.nav-action, .login button { display: inline-flex; gap: 7px; align-items: center; justify-content: center }
.nav-action img, .login button img { width: 16px; height: 16px }
.login button img { filter: invert(1) }
.login [role="alert"] { padding: 6px 9px; border-radius: 4px; font-size: 13px }
.tools input[type="search"] { padding-left: 31px; background: white url("lucide/search.svg") 9px center / 15px no-repeat }

.view-stats { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--line) }
.view-stats h3 { font-size: 15px }
#report-tools .view-stats p { margin: 4px 0 10px }
.view-stats table { width: 100%; text-align: center; border-collapse: collapse; font-variant-numeric: tabular-nums; font-size: 13px }
.view-stats caption { text-align: left; color: var(--muted); font-size: 12px }
.view-stats th { background: #f5f5f5; font-weight: normal }
.view-stats time { font-size: 11px }
