:root {
  font-family: "Segoe UI", "Noto Sans JP", "Yu Gothic UI", sans-serif;
  font-size: 14px;
  color: #222;
  background: #fff;
  font-synthesis: none;
  --line: #ddd;
  --muted: #666;
}
* { box-sizing: border-box; }
body { margin: 0; }
button, input, textarea, select { font: inherit; }
a { color: #245da1; text-decoration: underline; text-underline-offset: 2px; }
a:hover { color: #153d6d; }
button { cursor: pointer; }
button:disabled { opacity: .6; cursor: wait; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid #467ab5; outline-offset: 3px; }
.site-header {
  max-width: 960px;
  min-height: 64px;
  margin: auto;
  padding: 16px 24px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.brand { color: #222; font-size: 22px; font-weight: 650; text-decoration: none; }
.site-header nav { display: flex; align-items: center; gap: 24px; font-size: 13px; }
.site-header nav a { color: #555; }
.site-header nav .nav-active { color: #222; }
main { max-width: 960px; margin: auto; padding: 24px 24px 40px; }
h1 { font-size: 22px; font-weight: 600; margin: 0 0 18px; overflow-wrap: anywhere; }
h2 { font-size: 17px; font-weight: 600; margin: 0 0 18px; }
h3 { font-size: 15px; font-weight: 600; }
.list-heading { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 16px; min-width: 0; }
.list-heading h1 { white-space: nowrap; }
.list-heading h1 { margin: 0; font-size: 18px; }
.result-count { color: var(--muted); font-size: 13px; font-weight: 400; }
.list-controls, .admin-actions { display: flex; gap: 8px; align-items: center; min-width: 0; }
.list-controls select { width: 165px; max-width: 100%; min-width: 0; padding: 7px 10px; border: 1px solid #ccc; border-radius: 3px; background: white; color: #222; }
.category-form { display: flex; gap: 12px; align-items: flex-end; max-width: 540px; }
.category-form label { flex: 1; min-width: 0; margin-bottom: 0; }
.category-form .button { flex-shrink: 0; }
.category-list { margin-top: 24px; border-top: 1px solid var(--line); }
.category-list .category-form { padding: 14px 0; border-bottom: 1px solid var(--line); }
.search-input { width: 180px; min-width: 0; max-width: 100%; padding: 7px 10px; border: 1px solid #ccc; border-radius: 3px; background: white; }
.mod-table { width: 100%; border-collapse: collapse; table-layout: fixed; font-size: 13px; }
.mod-table th, .mod-table td { text-align: left; padding: 10px; border: 1px solid var(--line); vertical-align: middle; }
.mod-table th { padding-top: 10px; padding-bottom: 10px; background: #f5f5f5; font-size: 12px; font-weight: 500; }
.mod-table th:nth-child(1) { width: 34%; }
.mod-table th:nth-child(2) { width: auto; }
.mod-table th:nth-child(3) { width: 132px; }
.mod-table th:nth-child(4) { width: 70px; }
.mod-table .updated-heading { width: 49px; }
.mod-table .updated-heading, .mod-table .mod-updated { text-align: center; padding-inline: 4px; }
.mod-table .mod-updated { color: var(--muted); white-space: nowrap; font-size: 10px; line-height: 1.2; font-variant-numeric: tabular-nums; }
.mod-table tbody tr:hover { background: #fafafa; }
.mod-title { overflow: hidden; }
.title-line { display: flex; align-items: center; gap: 8px; min-width: 0; }
.title-line a { font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.category-label { max-width: 85px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: 10px; flex-shrink: 1; }
.lock-label { color: var(--muted); font-size: 10px; flex-shrink: 0; }
.description-preview { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #555; text-decoration: none; }
.description-preview:hover { text-decoration: underline; }
.mod-description { overflow: hidden; }
.mod-link { white-space: nowrap; }
.file-size { display: inline-block; margin-left: 8px; color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.trash-row { display: flex; align-items: center; gap: 16px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.trash-row .row-main { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.trash-row .row-main small { white-space: normal; }
.trash-row .button { flex-shrink: 0; }
.trash-row .admin-actions { flex-wrap: wrap; justify-content: flex-end; }
.trash-select-all { display: inline-flex; align-items: center; gap: 8px; margin: 0; }
.trash-select-all input, .trash-row input[type="checkbox"] { width: 18px; height: 18px; flex: 0 0 18px; margin: 0; }
.button.danger { color: #a12121; border-color: #d5a2a2; background: #fff; }
.button.danger:not(:disabled):hover { background: #fff1f1; }
.confirmation-dialog code { display: block; margin: 8px 0; overflow-wrap: anywhere; }
.share-link { margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--line); }
.share-link input { font-size: 12px; }
.trash-actions { margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line); }
.version-row .admin-actions { flex-wrap: wrap; justify-content: flex-end; }
.version-trash { margin-top: 20px; }
.version-trash summary { cursor: pointer; }
.confirmation-dialog { width: min(440px,calc(100% - 32px)); padding: 24px; border: 1px solid var(--line); border-radius: 6px; }
.confirmation-dialog::backdrop { background: rgb(0 0 0 / 35%); }
.confirmation-dialog h2 { margin-top: 0; }
.confirmation-dialog p { line-height: 1.8; overflow-wrap: anywhere; }
.confirmation-dialog .admin-actions { justify-content: flex-end; flex-wrap: wrap; }
.mod-table .mod-downloads, .mod-table .downloads-heading { text-align: right; font-variant-numeric: tabular-nums; }
.mobile-label { display: none; }
.pagination { display: flex; align-items: center; justify-content: center; gap: 18px; margin-top: 20px; font-size: 12px; }
.pagination .button:disabled { cursor: default; }
.mod-table .table-empty { padding: 30px 14px; color: var(--muted); text-align: center; }
.loading { padding: 24px 0; color: var(--muted); }
.empty { padding: 25px 0; }
.empty p { line-height: 1.8; }
.back-link { display: inline-block; font-size: 13px; margin-bottom: 24px; }
.muted, .help { color: var(--muted); font-size: 12px; line-height: 1.8; }
.detail > .muted { margin: -8px 0 24px; }
.detail-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 32px; align-items: start; }
.description-section { min-width: 0; border-top: 1px solid var(--line); padding-top: 20px; }
.description-text { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.9; font-size: 13px; }
.download-panel { min-width: 0; border: 1px solid var(--line); padding: 20px; }
dl { margin: 0 0 24px; }
dl > div { display: grid; grid-template-columns: 105px minmax(0, 1fr); gap: 12px; margin: 14px 0; font-size: 12px; }
dt { color: var(--muted); }
dd { margin: 0; overflow-wrap: anywhere; }
.checksum { margin-top: 20px; font-size: 11px; color: var(--muted); }
.checksum summary { cursor: pointer; }
.checksum code { display: block; margin-top: 10px; overflow-wrap: anywhere; }
.button { display: inline-flex; align-items: center; justify-content: center; border: 1px solid #bbb; border-radius: 3px; padding: 9px 14px; background: #f6f6f6; color: #222; font-size: 13px; text-decoration: none; line-height: 1.5; }
.button:hover { background: #ececec; color: #222; }
.button.primary { background: #345d86; border-color: #345d86; color: white; }
.button.primary:hover { background: #294d70; }
.button.full { width: 100%; }
.button.small { font-size: 12px; padding: 6px 10px; }
.text-button { border: 0; background: transparent; color: #555; padding: 0; font-size: 13px; text-decoration: underline; text-underline-offset: 2px; }
label { display: block; font-size: 13px; }
form label { margin-bottom: 18px; }
form input, form textarea, form select { display: block; width: 100%; margin-top: 7px; border: 1px solid #bbb; border-radius: 3px; padding: 9px 10px; color: #222; background: white; }
form textarea { resize: vertical; min-height: 120px; }
input[type=file] { padding: 7px; font-size: 12px; }
.message { margin: 16px 0 0; padding: 10px 12px; font-size: 13px; line-height: 1.8; overflow-wrap: anywhere; }
.message.error { background: #fff0ed; color: #9c382a; }
.message.success { background: #eff6ed; color: #365f2e; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.section-heading h1, .section-heading h2 { margin-bottom: 0; }
.number-pill { margin-left: 10px; font-size: 13px; color: var(--muted); font-weight: 400; }
.login-panel { max-width: 360px; margin: 25px auto; }
.login-panel form { margin-top: 24px; }
.login-panel .back-link { margin-top: 22px; }
.admin-stats { display: flex; flex-wrap: wrap; gap: 12px 28px; margin: 24px 0; font-size: 12px; color: var(--muted); }
.admin-stats strong { margin-left: 10px; color: #222; font-weight: 600; }
.admin-list { border: 1px solid var(--line); }
.admin-row { display: flex; align-items: center; gap: 20px; width: 100%; padding: 16px; border: 0; border-bottom: 1px solid var(--line); background: white; text-align: left; font-size: 12px; color: #222; }
.admin-row:last-child { border-bottom: 0; }
.admin-row:hover { background: #f8f8f8; }
.row-main { flex: 1; min-width: 0; }
.row-main strong { display: block; font-size: 14px; font-weight: 600; overflow-wrap: anywhere; }
.row-main small, .version-row small { display: block; margin-top: 6px; font-size: 11px; color: var(--muted); overflow-wrap: anywhere; }
.row-count { min-width: 60px; color: var(--muted); font-variant-numeric: tabular-nums; }
.status-tag { display: inline-block; color: #555; font-size: 11px; border: 1px solid var(--line); padding: 3px 6px; white-space: nowrap; }
.status-tag.private { color: #888; }
.editor-panel { border: 1px solid var(--line); padding: 24px; margin: 24px 0; scroll-margin-top: 20px; }
.editor-panel form { margin-top: 24px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.help { overflow-wrap: anywhere; }
.upload-section, .history-section { border-top: 1px solid var(--line); margin-top: 28px; padding-top: 12px; }
.version-row { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.version-row > div { min-width: 0; }
.version-row strong { font-size: 13px; }
@media (max-width: 650px) {
  .site-header { min-height: 56px; padding: 14px 16px; }
  .site-header nav { gap: 18px; font-size: 12px; }
  .brand { font-size: 20px; }
  main { padding: 22px 16px 36px; }
  .list-heading { flex-wrap: wrap; gap: 14px; }
  .list-controls { width: 100%; }
  .list-controls { flex-wrap: wrap; }
  .list-controls select { width: 0; flex: 1; }
  .search-input { width: 100%; flex: 1 0 100%; }
  .admin-actions { flex-wrap: wrap; }
  .mod-table { font-size: 11px; }
  .mod-table th, .mod-table td { padding: 10px 6px; }
  .mod-table th { font-size: 10px; }
  .mod-table th:nth-child(1) { width: 29%; }
  .mod-table th:nth-child(3) { width: 65px; }
  .mod-table .file-size { display: block; margin-left: 0; }
  .file-size { margin-left: 4px; font-size: 9px; }
  .mod-table th:nth-child(4) { width: 44px; }
  .category-label { display: none; }
  .title-line { gap: 4px; }
  .mod-table .table-empty { padding: 24px 8px; white-space: normal; }
  .detail-grid { grid-template-columns: 1fr; gap: 24px; }
  .download-panel { padding: 18px; }
  h1 { font-size: 20px; }
  .section-heading { flex-wrap: wrap; gap: 16px; }
  .form-grid { grid-template-columns: 1fr; gap: 0; }
  .editor-panel { padding: 18px 14px; }
  .admin-row { flex-wrap: wrap; gap: 12px; padding: 14px; }
  .row-main { flex-basis: 100%; }
  .admin-row > :last-child { margin-left: auto; }
  .version-row { flex-wrap: wrap; }
  .version-row .button { margin-left: auto; }
}
