:root {
  --bg: #f3efe6;
  --ink: #1c1915;
  --card: #fffdf8;
  --accent: #0f6b5c;
  --line: #d9d0c1;
  --danger: #9b1c1c;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  background:
    radial-gradient(1200px 600px at 10% -10%, #e7f2ee 0%, transparent 55%),
    linear-gradient(180deg, #f7f2e8, var(--bg));
  color: var(--ink);
  min-height: 100vh;
}
.top {
  display: flex; justify-content: space-between; align-items: center;
  padding: 1rem 1.5rem; border-bottom: 1px solid var(--line); background: rgba(255,253,248,.85);
  backdrop-filter: blur(6px);
}
.brand { font-weight: 700; letter-spacing: .02em; }
nav { display: flex; gap: 1rem; align-items: center; }
nav a { color: var(--accent); text-decoration: none; }
.wrap { max-width: 1100px; margin: 0 auto; padding: 2rem 1.25rem 4rem; }
.login-card { max-width: 420px; margin: 4rem auto; padding: 2rem; background: var(--card); border: 1px solid var(--line); border-radius: 16px; }
.stack { display: grid; gap: .9rem; }
label { display: grid; gap: .35rem; font-size: .95rem; }
input, textarea, select, button {
  font: inherit; padding: .65rem .75rem; border-radius: 10px; border: 1px solid var(--line); background: #fff;
}
button, .btn {
  background: var(--accent); color: #fff; border: none; cursor: pointer; text-decoration: none;
  display: inline-block; padding: .7rem 1rem; border-radius: 999px;
}
.inline { display: inline; }
.inline button { background: transparent; color: var(--accent); border: 1px solid var(--line); border-radius: 999px; padding: .35rem .8rem; }
.muted { color: #6b645a; }
.error { color: var(--danger); background: #fdecec; padding: .75rem 1rem; border-radius: 10px; }
.ok { color: #0f6b5c; background: #e7f5f1; padding: .75rem 1rem; border-radius: 10px; }
.quota { font-size: 1.05rem; }
.grid { display: grid; gap: 2rem; grid-template-columns: 1.2fr .8fr; }
@media (max-width: 860px) { .grid { grid-template-columns: 1fr; } }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 1.1rem; }
.list { list-style: none; padding: 0; margin: 0; display: grid; gap: .75rem; }
.list li { padding: .85rem 1rem; background: var(--card); border: 1px solid var(--line); border-radius: 12px; display: grid; gap: .25rem; }
.list a { color: var(--ink); font-weight: 700; text-decoration: none; }
.box {
  white-space: pre-wrap; background: #1c1915; color: #f4efe6; padding: 1rem; border-radius: 12px;
  overflow: auto; max-height: 420px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .82rem;
}
.btn.secondary, a.btn.secondary {
  background: transparent; color: var(--accent); border: 1px solid var(--line);
}
.quota-card { margin: 1rem 0 1.5rem; }
.hello-card { margin: 1rem 0 1.5rem; display: grid; gap: 1rem; }
.metric-row {
  display: grid; gap: .65rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
@media (max-width: 640px) {
  .metric-row { grid-template-columns: 1fr; }
}
.metric {
  display: flex; gap: .65rem; align-items: center;
  padding: .7rem .8rem; border: 1px solid var(--line); border-radius: 12px; background: #fff;
}
.metric-ico {
  display: inline-flex; align-items: center; justify-content: center;
  width: 2.2rem; height: 2.2rem; border-radius: 10px; background: #e7f2ee; color: var(--accent); flex-shrink: 0;
}
.metric-num { display: block; font-size: 1.15rem; line-height: 1.15; }
.metric-lab { display: block; font-size: .82rem; }
.guide-row { display: grid; gap: .55rem; grid-template-columns: 1fr 1fr; }
@media (max-width: 520px) { .guide-row { grid-template-columns: 1fr; } }
.guide-link {
  display: flex; align-items: center; gap: .55rem;
  padding: .75rem 1rem; border-radius: 12px; border: 1px solid var(--line);
  background: #fff; color: var(--accent); text-decoration: none; font-weight: 600;
}
.guide-link:hover { background: #e7f2ee; }
.guide-ico { display: inline-flex; color: var(--accent); }
.limits { margin: .5rem 0 0; padding-left: 1.2rem; line-height: 1.45; }
.box.tall { max-height: 70vh; }
code { background: #efe8db; padding: .1rem .35rem; border-radius: 4px; font-size: .9em; }
ol { line-height: 1.5; }
table { width: 100%; border-collapse: collapse; background: var(--card); }
th, td { border: 1px solid var(--line); padding: .55rem .6rem; text-align: left; vertical-align: top; font-size: .92rem; }
.row-actions { display: flex; gap: .4rem; flex-wrap: wrap; align-items: center; }
.related-block { display: grid; gap: .75rem; }
.related-head {
  display: flex; justify-content: space-between; gap: .75rem; align-items: flex-start; flex-wrap: wrap;
}
.related-hint { margin: .25rem 0 0; font-size: .88rem; line-height: 1.4; }
.related-add-row {
  display: grid; grid-template-columns: 1fr auto; gap: .5rem; align-items: stretch;
}
@media (max-width: 640px) {
  .related-add-row { grid-template-columns: 1fr; }
}
.related-urls-hidden { display: none; }
.error-inline { color: var(--danger) !important; }
.card-inset {
  background: #fff; border: 1px dashed var(--line); border-radius: 14px; padding: .85rem 1rem;
}
.related-selected-top {
  display: flex; justify-content: space-between; align-items: center; gap: .5rem; margin-bottom: .55rem;
}
.url-chips {
  list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .45rem;
}
.url-chip {
  display: inline-flex; align-items: center; gap: .35rem;
  max-width: 100%; padding: .35rem .35rem .35rem .65rem;
  background: #e7f2ee; border: 1px solid #c5ddd5; border-radius: 999px; font-size: .86rem;
}
.url-chip a {
  color: var(--accent); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 220px;
}
.chip-x {
  border: none; background: transparent; color: #5a6e68; cursor: pointer;
  width: 1.5rem; height: 1.5rem; border-radius: 999px; padding: 0; line-height: 1; font-size: 1.05rem;
}
.chip-x:hover { background: #d5e8e1; color: var(--ink); }
.empty-related { margin: 0; font-size: .9rem; }
.related-manual { margin-top: .7rem; }
.related-manual summary { cursor: pointer; color: var(--accent); font-size: .9rem; }
.related-manual textarea { margin-top: .45rem; width: 100%; }
.suggest-box {
  border: 1px solid var(--line); border-radius: 14px; background: #fffdf8; overflow: hidden;
}
.suggest-toolbar {
  display: flex; justify-content: space-between; gap: .75rem; align-items: flex-start; flex-wrap: wrap;
  padding: .75rem .9rem; border-bottom: 1px solid var(--line); background: #f7f3ea;
}
.suggest-toolbar .muted { display: block; margin-top: .15rem; font-size: .86rem; }
.btn.ghost, button.btn.ghost {
  background: transparent; color: var(--accent); border: 1px solid var(--line); border-radius: 999px; padding: .4rem .8rem;
}
.btn.ghost:hover { background: #fff; }
button.btn:disabled { opacity: .45; cursor: not-allowed; }
.linkish {
  background: none; border: none; color: var(--accent); cursor: pointer; padding: 0; font: inherit; text-decoration: underline;
}
.suggest-panel { display: grid; gap: 0; min-width: 0; }
.suggest-item {
  display: grid; grid-template-columns: auto 1fr; gap: .7rem; align-items: start;
  padding: .75rem .9rem; border-bottom: 1px solid #efe8db; font-size: .92rem; cursor: pointer;
}
.suggest-item:last-child { border-bottom: none; }
.suggest-item:hover { background: #faf7f0; }
.suggest-item.is-in-list { opacity: .55; background: #f3f1eb; }
.suggest-item input { margin-top: .2rem; width: 1.05rem; height: 1.05rem; }
.suggest-body { display: grid; gap: .2rem; min-width: 0; }
.suggest-meta {
  display: block; font-size: .8rem; overflow-wrap: anywhere; word-break: break-word; line-height: 1.35;
}
.improve-box { display: grid; gap: .55rem; min-width: 0; }
.improve-box[hidden] { display: none !important; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.mode-fieldset {
  border: none; padding: 0; margin: 0;
}
.mode-fieldset legend {
  padding: 0; margin-bottom: .45rem; font-weight: 700;
}
.mode-switch {
  display: grid; gap: .55rem; grid-template-columns: 1fr 1fr;
}
@media (max-width: 520px) {
  .mode-switch { grid-template-columns: 1fr; }
}
.mode-option {
  display: grid; grid-template-columns: auto 1fr; gap: .65rem; align-items: center;
  padding: .85rem .9rem; border: 1px solid var(--line); border-radius: 14px;
  cursor: pointer; background: #fff;
}
.mode-option:hover { background: #faf7f0; }
.mode-option:has(input:checked) {
  border-color: #8bb8ad; background: #e7f2ee;
}
.mode-option input { width: 1.05rem; height: 1.05rem; margin: 0; }
.mode-body { display: grid; gap: .15rem; }
.check-row {
  display: grid; grid-template-columns: auto 1fr; gap: .65rem; align-items: start;
  cursor: pointer;
}
.check-row input { margin-top: .3rem; width: 1.05rem; height: 1.05rem; }
.suggest-pick {
  display: grid; gap: .2rem; width: 100%; max-width: 100%; min-width: 0;
  text-align: left; background: #fff; color: var(--ink);
  border: none; border-radius: 0; border-bottom: 1px solid #efe8db;
  padding: .7rem .85rem; cursor: pointer; font: inherit; white-space: normal;
  line-height: 1.35;
}
.suggest-pick:hover { background: #faf7f0; }
.suggest-pick:last-child { border-bottom: none; }
.suggest-pick strong {
  font-size: .95rem; overflow-wrap: anywhere; word-break: break-word;
}
.suggest-pick .suggest-meta { margin: 0; }
.page-type-fieldset {
  border: 1px solid var(--line); border-radius: 14px; padding: .85rem 1rem 1rem; margin: 0;
  background: #fff;
}
.page-type-fieldset legend {
  padding: 0 .35rem; font-weight: 700;
}
.page-type-list { display: grid; gap: .45rem; margin-top: .35rem; }
.page-type-option {
  display: grid; grid-template-columns: auto 1fr; gap: .65rem; align-items: start;
  padding: .7rem .75rem; border: 1px solid var(--line); border-radius: 12px;
  cursor: pointer; background: #fffdf8;
}
.page-type-option:hover { background: #faf7f0; }
.page-type-option:has(input:checked) {
  border-color: #8bb8ad; background: #e7f2ee;
}
.page-type-option input {
  margin-top: .25rem; width: 1.1rem; height: 1.1rem; accent-color: var(--accent);
}
.page-type-body { display: grid; gap: .2rem; font-size: .92rem; line-height: 1.35; }
.page-type-legend { margin-top: .65rem; }
.page-type-legend summary {
  cursor: pointer; color: var(--accent); font-size: .9rem;
}
.page-type-legend .limits { margin: .45rem 0 0; }
.admin-head {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; flex-wrap: wrap;
  margin-bottom: 1.25rem;
}
.admin-head h1 { margin: 0 0 .2rem; }
.admin-section { margin: 1.75rem 0; }
.stat-grid {
  display: grid; gap: .75rem;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  margin-bottom: 1.25rem;
}
.stat-card {
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  padding: .9rem 1rem; display: grid; gap: .2rem;
}
.stat-label { font-size: .82rem; color: #6b645a; text-transform: uppercase; letter-spacing: .04em; }
.stat-value { font-size: 1.65rem; line-height: 1.1; }
.stat-of { font-size: 1rem; color: #6b645a; font-weight: 500; }
.hour-chart {
  display: grid; grid-template-columns: repeat(24, minmax(0, 1fr)); gap: .2rem;
  align-items: end; min-height: 140px; margin-top: .75rem;
  overflow-x: auto; padding-bottom: .25rem;
}
.hour-col { display: grid; gap: .15rem; justify-items: center; min-width: 0; }
.hour-bar-wrap {
  width: 100%; height: 90px; display: flex; align-items: flex-end;
  background: #f3efe6; border-radius: 6px 6px 2px 2px;
}
.hour-bar {
  width: 100%; min-height: 2px; background: var(--accent); border-radius: 6px 6px 2px 2px;
}
.hour-col.is-peak .hour-bar { background: #9b1c1c; }
.hour-val { font-size: .68rem; color: #6b645a; }
.hour-lab { font-size: .58rem; color: #9a9184; writing-mode: horizontal-tb; transform: none; }
.admin-two {
  display: grid; gap: 1.5rem; grid-template-columns: 1fr 1fr;
}
@media (max-width: 960px) {
  .admin-two { grid-template-columns: 1fr; }
  .hour-lab { display: none; }
  .hour-col:nth-child(3n) .hour-lab { display: block; }
}
.tag {
  display: inline-block; font-size: .75rem; padding: .15rem .4rem; border-radius: 999px;
  background: #efe8db; color: #6b645a;
}
.tag-live { background: #e7f2ee; color: var(--accent); }
.editor-next ol { margin: .35rem 0 1rem; line-height: 1.5; }
.editor-next .actions { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: .25rem; }
.admin-details {
  margin-top: 1.5rem; padding: 1rem 1.1rem; background: var(--card);
  border: 1px solid var(--line); border-radius: 16px;
}
.admin-details summary { cursor: pointer; font-weight: 700; }
.admin-details[open] summary { margin-bottom: .75rem; }
.admin-details h3 { margin: 1rem 0 .5rem; font-size: 1rem; }
.admin-details .actions { display: flex; gap: .5rem; flex-wrap: wrap; margin: .5rem 0 1rem; }
