/* DAYO News Admin — corporate navy on white */

:root {
  --navy-950: #071a30;
  --navy-900: #0b2340;
  --navy-800: #0f2b52;
  --navy-700: #16406f;
  --navy-600: #1f548c;
  --navy-100: #e7eef8;
  --navy-50: #f2f6fc;
  --gold: #a98532;
  --ink: #15202e;
  --ink-2: #3c4a5c;
  --muted: #5d6b7d;
  --line: #dde5ef;
  --line-2: #eef2f8;
  --bg: #f6f8fc;
  --white: #fff;
  --ok: #0b6b45;
  --ok-bg: #e6f4ec;
  --warn: #8a5a00;
  --warn-bg: #fdf1db;
  --danger: #a3241c;
  --danger-bg: #fbeae8;
  --info-bg: #eaf1fb;
  --radius: 10px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 2px rgba(11, 35, 64, .06), 0 1px 3px rgba(11, 35, 64, .05);
  --shadow: 0 8px 24px rgba(11, 35, 64, .08);
  --shadow-lg: 0 24px 60px rgba(11, 35, 64, .18);
  --font: "Noto Sans JP", "Hiragino Kaku Gothic ProN", "Yu Gothic", Meiryo, system-ui, -apple-system, "Segoe UI", sans-serif;
  --serif: "Noto Serif JP", "Hiragino Mincho ProN", Yu Mincho, serif;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

img { max-width: 100%; height: auto; }
a { color: var(--navy-700); text-underline-offset: .18em; }
a:hover { color: var(--navy-600); }
h1, h2, h3, h4 { line-height: 1.25; letter-spacing: .005em; margin: 0 0 .5em; font-weight: 700; }
h1 { font-size: 1.75rem; }
h2 { font-size: 1.375rem; }
h3 { font-size: 1.125rem; }
p { margin: 0 0 1em; }
hr { border: 0; border-top: 1px solid var(--line); margin: 1.5rem 0; }

:focus-visible {
  outline: 3px solid var(--navy-600);
  outline-offset: 2px;
  border-radius: 4px;
}

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  top: 8px; left: 8px;
  z-index: 200;
  transform: translateY(-200%);
  background: var(--navy-800);
  color: #fff;
  border: 0;
  padding: .6rem 1rem;
  border-radius: var(--radius);
  font: inherit;
  cursor: pointer;
}
.skip-link:focus { transform: none; }

/* ---------- header ---------- */

.site-header {
  background: var(--white);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 60;
}
.header-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: .65rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  text-decoration: none;
  color: var(--navy-900);
  font-weight: 700;
  letter-spacing: .02em;
}
.brand-mark {
  width: 34px; height: 34px;
  border-radius: 8px;
  background: var(--navy-800);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: .95rem;
  font-weight: 700;
  letter-spacing: 0;
  flex: none;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-name { font-size: .98rem; }
.brand-sub { font-size: .7rem; font-weight: 500; color: var(--muted); letter-spacing: .08em; text-transform: uppercase; }

.main-nav {
  display: flex;
  align-items: center;
  gap: .25rem;
  margin-inline-start: .5rem;
  flex-wrap: wrap;
}
.main-nav a {
  display: inline-block;
  padding: .4rem .7rem;
  border-radius: 8px;
  font-size: .9rem;
  font-weight: 500;
  color: var(--ink-2);
  text-decoration: none;
}
.main-nav a:hover { background: var(--navy-50); color: var(--navy-800); }
.main-nav a[aria-current="page"] { background: var(--navy-100); color: var(--navy-900); font-weight: 700; }

.header-right {
  margin-inline-start: auto;
  display: flex;
  align-items: center;
  gap: .6rem;
  flex-wrap: wrap;
}
.user-chip {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  font-size: .8rem;
  color: var(--ink-2);
  background: var(--navy-50);
  border: 1px solid var(--line);
  padding: .25rem .6rem;
  border-radius: 999px;
  max-width: 220px;
}
.user-chip .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); flex: none; }
.user-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.lang-switch {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: var(--white);
}
.lang-switch button {
  border: 0;
  background: transparent;
  font: inherit;
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .04em;
  color: var(--muted);
  padding: .32rem .5rem;
  cursor: pointer;
}
.lang-switch button + button { border-left: 1px solid var(--line); }
.lang-switch button[aria-pressed="true"] { background: var(--navy-800); color: #fff; }
.lang-switch button:hover:not([aria-pressed="true"]) { background: var(--navy-50); color: var(--navy-800); }

/* ---------- layout ---------- */

#view { flex: 1 0 auto; }
.page { max-width: 1180px; margin: 0 auto; padding: 1.75rem 1.25rem 3.5rem; }
.page.narrow { max-width: 860px; }
.page-head {
  display: flex;
  align-items: flex-end;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
}
.page-head h1 { margin: 0; font-size: 1.5rem; }
.page-head .sub { color: var(--muted); font-size: .875rem; margin: .2rem 0 0; }
.page-head .actions { margin-inline-start: auto; display: flex; gap: .5rem; flex-wrap: wrap; }

.section-title {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--navy-800);
  padding-bottom: .4rem;
  border-bottom: 2px solid var(--navy-800);
  display: inline-block;
  margin-bottom: 1.25rem;
}

.card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.card-pad { padding: 1.25rem; }

/* ---------- buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  font: inherit;
  font-size: .875rem;
  font-weight: 700;
  line-height: 1.2;
  padding: .62rem 1rem;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--white);
  color: var(--ink);
  cursor: pointer;
  text-decoration: none;
  transition: background .15s ease, border-color .15s ease, color .15s ease;
  white-space: nowrap;
}
.btn:hover { background: var(--navy-50); border-color: #c6d4e6; color: var(--navy-900); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--navy-800); border-color: var(--navy-800); color: #fff; }
.btn-primary:hover { background: var(--navy-700); border-color: var(--navy-700); color: #fff; }
.btn-subtle { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn-subtle:hover { background: var(--navy-50); }
.btn-danger { color: var(--danger); border-color: #eccfcc; background: #fff; }
.btn-danger:hover { background: var(--danger-bg); border-color: #dfb1ac; color: var(--danger); }
.btn-sm { font-size: .8rem; padding: .38rem .65rem; border-radius: 7px; }
.btn-block { width: 100%; }
.btn-icon { padding: .5rem; width: 34px; height: 34px; }

/* ---------- forms ---------- */

.field { margin-bottom: 1.1rem; }
.field > label, .label {
  display: block;
  font-size: .82rem;
  font-weight: 700;
  letter-spacing: .03em;
  color: var(--ink-2);
  margin-bottom: .35rem;
}
.field .hint { font-size: .78rem; color: var(--muted); margin: .3rem 0 0; }
.input, .select, .textarea {
  width: 100%;
  font: inherit;
  font-size: .95rem;
  color: var(--ink);
  background: var(--white);
  border: 1px solid #cbd6e4;
  border-radius: 8px;
  padding: .6rem .7rem;
  line-height: 1.45;
}
.input:hover, .select:hover, .textarea:hover { border-color: #a9bad0; }
.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: var(--navy-600);
  box-shadow: 0 0 0 3px rgba(31, 84, 140, .16);
}
.textarea { min-height: 84px; resize: vertical; }
.select { appearance: none; background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath fill='%235d6b7d' d='M1 1l5 5 5-5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right .7rem center; padding-right: 2rem; }
.form-row { display: grid; gap: 1rem; grid-template-columns: 1fr 1fr; }
.field-error { color: var(--danger); font-size: .8rem; margin: .3rem 0 0; font-weight: 600; }
.checkbox { display: flex; align-items: flex-start; gap: .55rem; font-size: .9rem; cursor: pointer; }
.checkbox input { width: 18px; height: 18px; margin: .15rem 0 0; accent-color: var(--navy-800); flex: none; }

/* ---------- alerts / badges ---------- */

.alert {
  display: flex;
  gap: .6rem;
  align-items: flex-start;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: .7rem .85rem;
  font-size: .875rem;
  margin-bottom: 1rem;
  background: var(--info-bg);
  color: var(--navy-900);
}
.alert-error { background: var(--danger-bg); border-color: #eccfcc; color: #7d1a14; }
.alert-warn { background: var(--warn-bg); border-color: #eddbae; color: #6d4700; }
.alert-ok { background: var(--ok-bg); border-color: #bfe2ce; color: #08543a; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .03em;
  padding: .18rem .5rem;
  border-radius: 999px;
  border: 1px solid transparent;
  white-space: nowrap;
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-published { color: var(--ok); background: var(--ok-bg); border-color: #bfe2ce; }
.badge-scheduled { color: var(--warn); background: var(--warn-bg); border-color: #eddbae; }
.badge-draft { color: var(--ink-2); background: #eef1f6; border-color: #dbe2ec; }
.chip {
  display: inline-block;
  font-size: .72rem;
  font-weight: 700;
  color: var(--navy-800);
  background: var(--navy-50);
  border: 1px solid var(--navy-100);
  border-radius: 4px;
  padding: .1rem .4rem;
  white-space: nowrap;
}
.pin-mark { color: var(--gold); font-size: .78rem; font-weight: 700; display: inline-flex; align-items: center; gap: .2rem; }

/* ---------- login / setup ---------- */

.auth-wrap {
  min-height: calc(100vh - 140px);
  display: grid;
  place-items: center;
  padding: 2.5rem 1.25rem;
  background:
    radial-gradient(700px 300px at 50% -10%, rgba(31, 84, 140, .10), transparent 70%),
    var(--bg);
}
.auth-card { width: 100%; max-width: 420px; padding: 2rem; }
.auth-card h1 { font-size: 1.35rem; margin-bottom: .25rem; }
.auth-card .lede { color: var(--muted); font-size: .875rem; margin-bottom: 1.5rem; }
.auth-links { display: flex; justify-content: space-between; align-items: center; gap: .75rem; flex-wrap: wrap; margin-top: 1.25rem; padding-top: 1rem; border-top: 1px solid var(--line-2); font-size: .8rem; }
.auth-links a, .auth-links button { color: var(--muted); }
.link-btn { background: none; border: 0; padding: 0; font: inherit; font-size: inherit; color: var(--muted); text-decoration: underline; cursor: pointer; }
.link-btn:hover { color: var(--navy-800); }

/* ---------- list ---------- */

.toolbar {
  display: flex;
  gap: .6rem;
  flex-wrap: wrap;
  align-items: center;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--line);
  background: var(--white);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}
.toolbar .search { flex: 1 1 240px; position: relative; min-width: 200px; }
.toolbar .search input { padding-left: 2rem; }
.toolbar .search svg { position: absolute; left: .6rem; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.toolbar select { width: auto; min-width: 140px; font-size: .85rem; padding-block: .5rem; }
.result-count { font-size: .8rem; color: var(--muted); padding: .55rem 1.25rem; border-bottom: 1px solid var(--line-2); background: var(--navy-50); }

.post-rows { list-style: none; margin: 0; padding: 0; }
.post-row {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr) auto auto;
  gap: 1rem;
  align-items: center;
  padding: .9rem 1.25rem;
  border-bottom: 1px solid var(--line-2);
}
.post-row:last-child { border-bottom: 0; }
.post-row:hover { background: #fbfcfe; }
.post-thumb {
  width: 92px; height: 62px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--navy-50);
  object-fit: cover;
  display: block;
  flex: none;
}
.post-thumb-empty {
  width: 92px; height: 62px;
  border-radius: 8px;
  border: 1px dashed #c9d5e4;
  background: repeating-linear-gradient(135deg, #f7f9fc, #f7f9fc 6px, #eef3fa 6px, #eef3fa 12px);
  display: grid;
  place-items: center;
  color: #9aa9bc;
  font-size: .65rem;
  font-weight: 700;
}
.post-main { min-width: 0; }
.post-title {
  font-size: .97rem;
  font-weight: 700;
  color: var(--navy-900);
  margin: 0 0 .15rem;
  display: flex;
  align-items: center;
  gap: .45rem;
  flex-wrap: wrap;
  line-height: 1.4;
}
.post-title a { color: inherit; text-decoration: none; }
.post-title a:hover { text-decoration: underline; }
.post-meta { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; font-size: .76rem; color: var(--muted); }
.post-status { display: flex; flex-direction: column; gap: .3rem; align-items: flex-start; }
.post-actions { display: flex; gap: .35rem; align-items: center; }
.post-actions .btn { font-size: .78rem; padding: .35rem .6rem; }

.empty-state { padding: 3rem 1.25rem; text-align: center; color: var(--muted); }
.empty-state h2 { color: var(--ink); font-size: 1.05rem; }
.empty-state p { font-size: .875rem; margin-bottom: 1.25rem; }

/* ---------- editor ---------- */

.editor-head {
  position: sticky;
  top: 61px;
  z-index: 40;
  background: rgba(246, 248, 252, .96);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--line);
  padding: .75rem 0;
  margin-bottom: 1.25rem;
}
.editor-head-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 1.25rem;
  display: flex;
  gap: .5rem;
  align-items: center;
  flex-wrap: wrap;
}
.editor-head h1 { font-size: 1.1rem; margin: 0; }
.editor-head .spacer { flex: 1 1 20px; }
.save-state { font-size: .78rem; color: var(--muted); display: inline-flex; align-items: center; gap: .35rem; min-height: 1.5rem; }
.save-state .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); }
.save-state[data-state="saved"] .dot { background: var(--ok); }
.save-state[data-state="saving"] .dot { background: var(--warn); animation: pulse 1s infinite; }
.save-state[data-state="dirty"] .dot { background: var(--danger); }
@keyframes pulse { 50% { opacity: .3; } }

.editor-grid {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 1.25rem 3.5rem;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 1.5rem;
  align-items: start;
}
.editor-main { min-width: 0; }
.editor-side { position: sticky; top: 132px; display: grid; gap: 1rem; }
.side-card { padding: 1rem 1.1rem; }
.side-card h2 { font-size: .8rem; letter-spacing: .08em; text-transform: uppercase; color: var(--navy-800); margin-bottom: .75rem; }
.side-row { display: flex; justify-content: space-between; gap: .75rem; font-size: .8rem; padding: .3rem 0; border-bottom: 1px dashed var(--line-2); }
.side-row:last-child { border-bottom: 0; }
.side-row dt { color: var(--muted); }
.side-row dd { margin: 0; text-align: right; font-weight: 600; color: var(--ink-2); }

.lang-tabs { display: flex; gap: .25rem; border-bottom: 1px solid var(--line); padding: 0 1.1rem; background: var(--white); border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
.lang-tabs button {
  font: inherit;
  font-size: .85rem;
  font-weight: 700;
  color: var(--muted);
  background: none;
  border: 0;
  border-bottom: 3px solid transparent;
  padding: .75rem .8rem;
  cursor: pointer;
}
.lang-tabs button[aria-selected="true"] { color: var(--navy-800); border-bottom-color: var(--navy-800); }
.lang-tabs button:hover { color: var(--navy-800); }
.lang-tabs .missing { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--gold); margin-left: .35rem; vertical-align: middle; }

.editor-fields { padding: 1.25rem; }
.title-input { font-size: 1.15rem; font-weight: 700; padding: .7rem .75rem; }
.counter { font-size: .72rem; color: var(--muted); text-align: right; margin-top: .2rem; }
.counter.over { color: var(--warn); }

/* rich text */
.rte { border: 1px solid #cbd6e4; border-radius: 8px; overflow: hidden; background: #fff; }
.rte-toolbar {
  display: flex;
  gap: 2px;
  flex-wrap: wrap;
  padding: .35rem;
  background: var(--navy-50);
  border-bottom: 1px solid var(--line);
}
.rte-toolbar button {
  display: inline-grid;
  place-items: center;
  width: 32px; height: 32px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--ink-2);
  cursor: pointer;
  font: inherit;
  font-size: .8rem;
  font-weight: 700;
}
.rte-toolbar button:hover { background: #fff; border-color: var(--line); color: var(--navy-800); }
.rte-toolbar button[aria-pressed="true"] { background: var(--navy-100); color: var(--navy-900); }
.rte-toolbar .sep { width: 1px; background: var(--line); margin: 4px 3px; }
.rte-editor {
  min-height: 340px;
  max-height: 65vh;
  overflow-y: auto;
  padding: 1rem;
  font-size: 1rem;
  line-height: 1.75;
  outline: none;
}
.rte-editor:focus { box-shadow: inset 0 0 0 2px rgba(31, 84, 140, .25); }
.rte-editor:empty::before { content: attr(data-placeholder); color: #94a3b5; pointer-events: none; }
.rte-editor h2 { font-size: 1.3rem; margin: 1.2em 0 .5em; }
.rte-editor h3 { font-size: 1.1rem; margin: 1.1em 0 .4em; }
.rte-editor p { margin: 0 0 .9em; }
.rte-editor ul, .rte-editor ol { padding-left: 1.4em; margin: 0 0 .9em; }
.rte-editor blockquote {
  margin: 1em 0;
  padding: .5em 1em;
  border-left: 4px solid var(--navy-100);
  background: var(--navy-50);
  color: var(--ink-2);
}
.rte-editor img { border-radius: 8px; margin: .5em 0; }
.rte-editor a { text-decoration: underline; }
.rte-editor figure { margin: 1em 0; }
.rte-editor figcaption { font-size: .8rem; color: var(--muted); text-align: center; }
.rte.is-dragover { box-shadow: 0 0 0 3px rgba(31, 84, 140, .25); }
.upload-status { font-size: .78rem; color: var(--navy-700); padding: .4rem .75rem; background: var(--navy-50); border-top: 1px solid var(--line); }
.upload-status:empty { display: none; }

/* markdown body editor */
.md-hint { margin-bottom: .45rem; }
.md-split { display: grid; grid-template-columns: minmax(0, 1fr); gap: .75rem; }
.md-split[data-mode="on"] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.md-input { min-height: 340px; font-size: .92rem; line-height: 1.75; }
.md-input.is-dragover { box-shadow: 0 0 0 3px rgba(31, 84, 140, .25); }
.md-preview {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: .85rem 1rem;
  background: #fff;
  min-height: 340px;
  max-height: 65vh;
  overflow-y: auto;
}
.md-preview[hidden] { display: none; }
.md-empty { color: var(--muted); font-size: .9rem; margin: 0; }
@media (max-width: 900px) {
  .md-split[data-mode="on"] { grid-template-columns: minmax(0, 1fr); }
}

/* administrator accounts */
.admin-form-title { font-size: .95rem; margin: 0 0 .25rem; }
.admin-form-lede { font-size: .85rem; color: var(--muted); margin: 0 0 1rem; }
.admin-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 1rem; }
.admin-rows { list-style: none; margin: 0; padding: 0; }
.admin-row { display: flex; align-items: center; gap: 1rem; padding: .85rem 1.1rem; border-top: 1px solid var(--line-2); }
.admin-row:first-child { border-top: 0; }
.admin-main { flex: 1 1 auto; min-width: 0; }
.admin-name { font-weight: 600; color: var(--ink); }
.admin-email { font-size: .8rem; color: var(--muted); overflow-wrap: anywhere; }
@media (max-width: 720px) {
  .admin-form-grid { grid-template-columns: minmax(0, 1fr); }
}

/* cover */
.cover-drop {
  border: 1px dashed #bfcede;
  border-radius: 10px;
  background: var(--navy-50);
  padding: 1rem;
  text-align: center;
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.cover-drop:hover, .cover-drop.is-dragover { border-color: var(--navy-600); background: var(--navy-100); }
.cover-drop p { font-size: .8rem; color: var(--muted); margin: .35rem 0 0; }
.cover-preview { position: relative; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); }
.cover-preview img { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; background: var(--navy-50); }
.cover-preview .cover-actions { display: flex; gap: .4rem; padding: .5rem; background: #fff; border-top: 1px solid var(--line-2); }

/* modal / dialog */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 120;
  background: rgba(7, 26, 48, .55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  overflow-y: auto;
}
.modal {
  background: #fff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 520px;
  margin: auto;
}
.modal.modal-wide { max-width: 900px; }
.modal-head { padding: 1.1rem 1.25rem .5rem; }
.modal-head h2 { font-size: 1.1rem; margin: 0; }
.modal-body { padding: .5rem 1.25rem 1rem; font-size: .9rem; color: var(--ink-2); }
.modal-foot { display: flex; justify-content: flex-end; gap: .5rem; padding: .9rem 1.25rem; border-top: 1px solid var(--line-2); background: #fbfcfe; border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
.modal-pre { margin: 0; padding: 1rem; background: var(--navy-950); color: #d8e6f7; border-radius: 0 0 var(--radius-lg) var(--radius-lg); max-height: 60vh; overflow: auto; font-size: .78rem; line-height: 1.5; }

/* toast */
.toast {
  position: fixed;
  left: 50%;
  bottom: 1.5rem;
  transform: translate(-50%, 150%);
  z-index: 200;
  background: var(--navy-900);
  color: #fff;
  font-size: .85rem;
  font-weight: 500;
  padding: .7rem 1.1rem;
  border-radius: 999px;
  box-shadow: var(--shadow);
  opacity: 0;
  transition: transform .25s ease, opacity .25s ease;
  max-width: calc(100vw - 2rem);
  pointer-events: none;
}
.toast.show { transform: translate(-50%, 0); opacity: 1; }
.toast[data-kind="error"] { background: #7d1a14; }

/* ---------- public ---------- */

.public-hero {
  background: linear-gradient(180deg, var(--navy-900), var(--navy-800));
  color: #fff;
  padding: 2.75rem 1.25rem 2.25rem;
}
.public-hero-inner { max-width: 1000px; margin: 0 auto; }
.public-hero .eyebrow { font-size: .72rem; letter-spacing: .22em; text-transform: uppercase; color: #a9c4e4; margin-bottom: .5rem; }
.public-hero h1 { font-size: 1.9rem; margin: 0; color: #fff; }
.public-hero .lede { color: #c6d8ee; font-size: .9rem; margin: .5rem 0 0; }

.public-wrap { max-width: 1000px; margin: 0 auto; padding: 2.25rem 1.25rem 3.5rem; }
.news-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 1rem; }
.news-item {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 1.25rem;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: box-shadow .15s ease, transform .15s ease;
}
.news-item:hover { box-shadow: var(--shadow); transform: translateY(-1px); }
.news-item .thumb { aspect-ratio: 16 / 10; background: var(--navy-50); overflow: hidden; }
.news-item .thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.news-item .thumb.placeholder { display: grid; place-items: center; color: #9aa9bc; font-size: .75rem; font-weight: 700; letter-spacing: .1em; }
.news-item .body { padding: 1.1rem 1.25rem 1.25rem .25rem; min-width: 0; }
.news-item .meta { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; font-size: .76rem; color: var(--muted); margin-bottom: .4rem; }
.news-item .date { font-variant-numeric: tabular-nums; letter-spacing: .02em; }
.news-item h2 { font-size: 1.1rem; margin: 0 0 .35rem; }
.news-item h2 a { color: var(--navy-900); text-decoration: none; }
.news-item h2 a:hover { text-decoration: underline; }
.news-item p { font-size: .875rem; color: var(--ink-2); margin: 0; }
.news-item .more { display: inline-block; margin-top: .65rem; font-size: .8rem; font-weight: 700; color: var(--navy-700); text-decoration: none; }
.news-item .more:hover { text-decoration: underline; }
.news-item.is-pinned { border-color: #d9c69a; }
.news-item.is-pinned .pin-flag { color: var(--gold); font-weight: 700; }

.article { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 2rem; }
.article .meta { display: flex; gap: .75rem; align-items: center; flex-wrap: wrap; font-size: .8rem; color: var(--muted); margin-bottom: .75rem; }
.article h1 { font-size: 1.7rem; margin-bottom: 1rem; color: var(--navy-900); }
.article .cover { margin: 0 0 1.5rem; border-radius: 10px; overflow: hidden; background: var(--navy-50); }
.article .cover img { display: block; width: 100%; }
.article-body { font-size: 1rem; line-height: 1.9; color: var(--ink); max-width: 68ch; }
.article-body h2 { font-size: 1.3rem; margin: 1.6em 0 .6em; padding-bottom: .3em; border-bottom: 1px solid var(--line); }
.article-body h3 { font-size: 1.1rem; margin: 1.4em 0 .5em; }
.article-body ul, .article-body ol { padding-left: 1.4em; margin-bottom: 1em; }
.article-body blockquote { margin: 1.2em 0; padding: .6em 1.1em; border-left: 4px solid var(--navy-100); background: var(--navy-50); color: var(--ink-2); }
.article-body img { border-radius: 8px; }
.article-body figure { margin: 1.2em 0; }
.article-body figcaption { font-size: .8rem; color: var(--muted); text-align: center; }

.breadcrumb { font-size: .8rem; margin-bottom: 1rem; display: flex; gap: .4rem; flex-wrap: wrap; align-items: center; color: var(--muted); }
.breadcrumb a { color: var(--navy-700); }
.article-foot { margin-top: 2rem; padding-top: 1.25rem; border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; align-items: center; }

.feed-actions { display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: 1rem; }
.feed-url { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .8rem; background: var(--navy-50); border: 1px solid var(--line); padding: .5rem .7rem; border-radius: 8px; overflow-x: auto; white-space: nowrap; }

/* footer */
.site-footer {
  border-top: 1px solid var(--line);
  background: #fff;
  padding: 1.25rem;
  font-size: .78rem;
  color: var(--muted);
}
.site-footer .inner { max-width: 1180px; margin: 0 auto; display: flex; gap: 1rem; flex-wrap: wrap; justify-content: space-between; align-items: center; }
.site-footer a { color: var(--muted); }

/* loading */
.boot, .loading-block {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .6rem;
  padding: 4rem 1rem;
  color: var(--muted);
  font-size: .9rem;
}
.spinner {
  width: 18px; height: 18px;
  border-radius: 50%;
  border: 2px solid var(--line);
  border-top-color: var(--navy-700);
  animation: spin .7s linear infinite;
  display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- responsive ---------- */

@media (max-width: 960px) {
  .editor-grid { grid-template-columns: minmax(0, 1fr); }
  .editor-side { position: static; grid-row: 1; grid-template-columns: repeat(2, minmax(0, 1fr)); display: grid; }
  .editor-side .side-card:last-child { grid-column: 1 / -1; }
  .header-inner { gap: .5rem .75rem; }
  .main-nav { margin-inline-start: 0; order: 3; width: 100%; border-top: 1px solid var(--line-2); padding-top: .35rem; }
  .editor-head { top: 108px; }
  .editor-side { top: auto; }
}

@media (max-width: 760px) {
  body { font-size: 15.5px; }
  .page { padding: 1.25rem .9rem 2.5rem; }
  .header-inner { padding: .6rem .9rem; }
  .post-row {
    grid-template-columns: 72px minmax(0, 1fr);
    grid-template-areas: "thumb main" "status actions";
    gap: .6rem .75rem;
    padding: .85rem .9rem;
  }
  .post-row .post-thumb, .post-row .post-thumb-empty { grid-area: thumb; width: 72px; height: 54px; }
  .post-main { grid-area: main; }
  .post-status { grid-area: status; flex-direction: row; align-items: center; }
  .post-actions { grid-area: actions; justify-content: flex-end; flex-wrap: wrap; }
  .toolbar { padding: .85rem .9rem; }
  .toolbar .search { flex-basis: 100%; }
  .toolbar select { flex: 1 1 40%; min-width: 0; }
  .news-item { grid-template-columns: 1fr; gap: 0; }
  .news-item .thumb { aspect-ratio: 16 / 9; }
  .news-item .body { padding: 1rem 1.1rem 1.2rem; }
  .article { padding: 1.25rem; }
  .article h1 { font-size: 1.35rem; }
  .public-hero { padding: 2rem 1rem 1.75rem; }
  .public-hero h1 { font-size: 1.55rem; }
  .public-wrap { padding: 1.5rem .9rem 2.5rem; }
  .editor-side { grid-template-columns: 1fr; }
  .editor-head-inner { padding: 0 .9rem; }
  .editor-grid { padding: 0 .9rem 2.5rem; }
  .editor-head { position: static; }
  .editor-head .btn { flex: 1 1 auto; }
  .form-row { grid-template-columns: 1fr; }
  .site-footer .inner { flex-direction: column; align-items: flex-start; gap: .4rem; }
  .auth-card { padding: 1.5rem; }
  .result-count { padding: .5rem .9rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
  .spinner { animation: none; border-top-color: var(--navy-700); }
}

@media print {
  .site-header, .site-footer, .site-note { display: none; }
}
