/* Typecho Go — admin UI */
:root {
  color-scheme: light;
  --a-bg: #f4f5f2;
  --a-surface: #ffffff;
  --a-surface-soft: #f7f8f5;
  --a-text: #1e232b;
  --a-text-soft: #4b5563;
  --a-muted: #7a8492;
  --a-border: #e3e5df;
  --a-border-strong: #d2d5ce;
  --a-primary: #275ecb;
  --a-primary-soft: #e9f0ff;
  --a-primary-strong: #19469f;
  --a-danger: #bd3434;
  --a-danger-soft: #fbeaea;
  --a-success: #21734c;
  --a-success-soft: #e8f5ee;
  --a-warning: #98610d;
  --a-warning-soft: #fdf1dc;
  --a-sidebar: #151b24;
  --a-sidebar-soft: #1e2632;
  --a-sidebar-text: #d8dee8;
  --a-sidebar-muted: #8491a4;
  --a-shadow: 0 18px 48px rgba(24, 29, 37, 0.09);
  --a-shadow-sm: 0 3px 12px rgba(24, 29, 37, 0.06);
  --a-radius: 14px;
  --a-radius-sm: 9px;
  --a-font: Inter, "SF Pro Text", "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --a-mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --a-bg: #0e1116;
    --a-surface: #171c24;
    --a-surface-soft: #1d232d;
    --a-text: #e8edf4;
    --a-text-soft: #bcc5d2;
    --a-muted: #8994a3;
    --a-border: #29313d;
    --a-border-strong: #3a4453;
    --a-primary: #7da7ff;
    --a-primary-soft: #192844;
    --a-primary-strong: #a9c6ff;
    --a-danger: #ff8f8f;
    --a-danger-soft: #3a1d20;
    --a-success: #79d6a7;
    --a-success-soft: #173225;
    --a-warning: #f0bd6e;
    --a-warning-soft: #332713;
    --a-sidebar: #090c11;
    --a-sidebar-soft: #141a23;
    --a-shadow: 0 18px 48px rgba(0, 0, 0, 0.35);
    --a-shadow-sm: 0 3px 12px rgba(0, 0, 0, 0.22);
  }
}

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

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

body {
  margin: 0;
  font-family: var(--a-font);
  line-height: 1.55;
  text-rendering: optimizeLegibility;
}

button,
input,
textarea,
select {
  font: inherit;
}

a {
  color: var(--a-primary);
  text-underline-offset: 0.16em;
}

:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--a-primary) 40%, transparent);
  outline-offset: 2px;
}

[hidden] {
  display: none !important;
}

/* Login */
.login-body {
  min-height: 100vh;
  background:
    radial-gradient(circle at 15% 10%, color-mix(in srgb, var(--a-primary) 14%, transparent), transparent 30rem),
    var(--a-bg);
  color: var(--a-text);
}

.login-shell {
  display: grid;
  grid-template-columns: minmax(340px, 480px) minmax(380px, 1fr);
  min-height: 100vh;
}

.login-card {
  align-self: center;
  justify-self: center;
  width: min(100% - 48px, 400px);
  padding-block: 48px;
}

.login-brand {
  display: inline-block;
  margin-bottom: 50px;
  color: var(--a-text);
  font-family: Georgia, "Songti SC", serif;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.03em;
  text-decoration: none;
}

.login-eyebrow {
  margin: 0 0 9px;
  color: var(--a-primary);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.login-card h1 {
  margin: 0;
  font-size: clamp(32px, 4vw, 43px);
  letter-spacing: -0.045em;
  line-height: 1.15;
}

.login-subtitle {
  margin: 11px 0 28px;
  color: var(--a-muted);
  font-size: 14px;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 17px;
}

.login-form label,
.form-field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  color: var(--a-text-soft);
  font-size: 12px;
  font-weight: 650;
}

.login-form input,
.form-field input,
.form-field textarea,
.form-field select,
.inline-form input,
.inline-form select,
.inline-form textarea {
  width: 100%;
  border: 1px solid var(--a-border-strong);
  border-radius: 9px;
  background: var(--a-surface);
  color: var(--a-text);
  padding: 10px 12px;
  font-size: 14px;
  font-weight: 400;
  outline: 0;
  transition: border-color 140ms ease, box-shadow 140ms ease;
}

.login-form input:focus,
.form-field input:focus,
.form-field textarea:focus,
.form-field select:focus,
.inline-form input:focus,
.inline-form select:focus,
.inline-form textarea:focus {
  border-color: var(--a-primary);
  box-shadow: 0 0 0 3px var(--a-primary-soft);
}

.login-foot {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  margin: 28px 0 0;
  color: var(--a-muted);
  font-size: 12px;
}

.login-foot a {
  color: var(--a-muted);
  text-decoration: none;
}

.login-foot a:hover {
  color: var(--a-primary);
}

.login-aside {
  display: flex;
  align-items: flex-end;
  position: relative;
  overflow: hidden;
  margin: 20px;
  border-radius: 24px;
  background:
    radial-gradient(circle at 25% 15%, rgba(93, 138, 255, 0.33), transparent 45%),
    radial-gradient(circle at 80% 80%, rgba(80, 201, 182, 0.2), transparent 40%),
    #111821;
  color: #e7edf7;
}

.login-aside::before,
.login-aside::after {
  content: "";
  position: absolute;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 50%;
}

.login-aside::before {
  width: 520px;
  height: 520px;
  right: -170px;
  top: -190px;
}

.login-aside::after {
  width: 300px;
  height: 300px;
  right: -80px;
  top: -80px;
}

.login-aside-inner {
  position: relative;
  z-index: 1;
  width: min(560px, 80%);
  padding: 0 0 72px 64px;
}

.login-aside-kicker {
  margin: 0 0 18px;
  color: #85a9ff;
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.17em;
  text-transform: uppercase;
}

.login-aside-title {
  margin: 0;
  font-family: Georgia, "Songti SC", serif;
  font-size: clamp(34px, 4vw, 54px);
  letter-spacing: -0.045em;
  line-height: 1.2;
}

.login-aside-copy {
  max-width: 430px;
  margin: 24px 0 0;
  color: #9ba9bc;
  font-size: 14px;
  line-height: 1.8;
}

/* Shell */
.admin-body {
  min-height: 100vh;
  background: var(--a-bg);
  color: var(--a-text);
}

.admin-shell {
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  min-height: 100vh;
}

.admin-sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  height: 100vh;
  background: var(--a-sidebar);
  color: var(--a-sidebar-text);
  border-right: 1px solid rgba(255, 255, 255, 0.04);
  z-index: 30;
}

.admin-brand-wrap {
  padding: 25px 20px 22px;
}

.admin-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  color: #f2f5fa;
  text-decoration: none;
}

.brand-mark {
  display: inline-flex;
  width: 36px;
  height: 36px;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: linear-gradient(145deg, #5f8fff, #2f60d2);
  color: #fff;
  font-family: Georgia, serif;
  font-size: 20px;
  font-weight: 700;
  box-shadow: 0 8px 18px rgba(38, 91, 210, 0.35);
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}

.brand-text strong {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.brand-text small {
  margin-top: 2px;
  color: var(--a-sidebar-muted);
  font-size: 10px;
  letter-spacing: 0.1em;
}

.admin-nav {
  display: flex;
  flex: 1;
  min-height: 0;
  flex-direction: column;
  overflow-y: auto;
  padding: 0 12px 20px;
}

.nav-label {
  margin: 22px 10px 7px;
  color: #647186;
  font-size: 9px;
  font-weight: 750;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.admin-nav a {
  display: flex;
  align-items: center;
  gap: 11px;
  border-radius: 8px;
  padding: 9px 11px;
  color: var(--a-sidebar-muted);
  font-size: 13px;
  font-weight: 550;
  text-decoration: none;
  transition: background 130ms ease, color 130ms ease;
}

.admin-nav a + a {
  margin-top: 2px;
}

.admin-nav a:hover {
  background: rgba(255, 255, 255, 0.055);
  color: #eef2f8;
}

.admin-nav a.active {
  background: rgba(91, 137, 255, 0.16);
  color: #e9efff;
}

.nav-icon {
  display: inline-flex;
  width: 20px;
  justify-content: center;
  color: #6e7d93;
  font-size: 15px;
  font-weight: 400;
}

.admin-nav a.active .nav-icon,
.admin-nav a:hover .nav-icon {
  color: #8daeff;
}

.sidebar-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  padding: 17px 20px;
  color: #617084;
  font-size: 10px;
}

.sidebar-foot a {
  color: #92a2b8;
  font-size: 11px;
  text-decoration: none;
}

.sidebar-foot a:hover {
  color: #fff;
}

.admin-main {
  min-width: 0;
}

.admin-topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 82px;
  border-bottom: 1px solid var(--a-border);
  background: color-mix(in srgb, var(--a-bg) 90%, transparent);
  padding: 14px clamp(22px, 4vw, 46px);
  backdrop-filter: blur(16px);
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.topbar-kicker {
  margin: 0 0 1px;
  color: var(--a-muted);
  font-size: 9px;
  font-weight: 750;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.admin-topbar h1 {
  margin: 0;
  font-size: 21px;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.25;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 15px;
}

.mobile-menu {
  display: none;
  border: 1px solid var(--a-border);
  border-radius: 8px;
  background: var(--a-surface);
  color: var(--a-text);
  width: 38px;
  height: 38px;
  align-items: center;
  justify-content: center;
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 9px;
}

.user-avatar {
  display: inline-flex;
  width: 34px;
  height: 34px;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--a-primary-soft);
  color: var(--a-primary);
  font-size: 13px;
  font-weight: 750;
}

.user-meta {
  display: flex;
  flex-direction: column;
  line-height: 1.3;
}

.user-meta strong {
  font-size: 12px;
  font-weight: 650;
}

.user-meta small {
  color: var(--a-muted);
  font-size: 9px;
  text-transform: uppercase;
}

.admin-view {
  max-width: 1420px;
  margin-inline: auto;
  padding: clamp(24px, 4vw, 46px);
  outline: none;
}

/* Generic components */
.page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin: 0 0 27px;
}

.page-header h2 {
  margin: 0;
  font-size: clamp(26px, 3vw, 34px);
  font-weight: 720;
  letter-spacing: -0.045em;
  line-height: 1.15;
}

.page-header p {
  margin: 7px 0 0;
  color: var(--a-muted);
  font-size: 13px;
}

.header-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.card {
  border: 1px solid var(--a-border);
  border-radius: var(--a-radius);
  background: var(--a-surface);
  box-shadow: var(--a-shadow-sm);
}

.card-pad {
  padding: 22px;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--a-border);
  padding: 18px 22px;
}

.card-header h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 680;
  letter-spacing: -0.015em;
}

.card-header p {
  margin: 3px 0 0;
  color: var(--a-muted);
  font-size: 11px;
}

.card-body {
  padding: 22px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 37px;
  border: 1px solid var(--a-border-strong);
  border-radius: 8px;
  background: var(--a-surface);
  color: var(--a-text);
  padding: 8px 13px;
  font-size: 12px;
  font-weight: 650;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  transition: border-color 130ms ease, background 130ms ease, color 130ms ease, transform 100ms ease;
}

.button:hover {
  border-color: var(--a-primary);
  color: var(--a-primary);
  text-decoration: none;
}

.button.primary {
  border-color: var(--a-primary);
  background: var(--a-primary);
  color: #fff;
}

.button.primary:hover {
  border-color: var(--a-primary-strong);
  background: var(--a-primary-strong);
  color: #fff;
}

.button.ghost {
  border-color: transparent;
  background: transparent;
}

.button.ghost:hover {
  background: var(--a-surface-soft);
  color: var(--a-text);
}

.button.small {
  min-height: 31px;
  padding: 5px 10px;
  font-size: 11px;
}

.button.danger {
  border-color: color-mix(in srgb, var(--a-danger) 35%, var(--a-border));
  color: var(--a-danger);
}

.button.danger:hover {
  border-color: var(--a-danger);
  background: var(--a-danger-soft);
  color: var(--a-danger);
}

.button.wide {
  width: 100%;
}

.button:active {
  transform: translateY(1px);
}

.button:disabled {
  cursor: wait;
  opacity: 0.55;
  transform: none;
}

.alert {
  margin-bottom: 18px;
  border-radius: 9px;
  padding: 11px 13px;
  font-size: 12px;
  line-height: 1.6;
}

.alert-error {
  background: var(--a-danger-soft);
  color: var(--a-danger);
}

.alert-success {
  background: var(--a-success-soft);
  color: var(--a-success);
}

.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.45;
}

.badge-publish,
.badge-approved {
  background: var(--a-success-soft);
  color: var(--a-success);
}

.badge-draft,
.badge-waiting {
  background: var(--a-warning-soft);
  color: var(--a-warning);
}

.badge-private,
.badge-hidden,
.badge-spam {
  background: var(--a-danger-soft);
  color: var(--a-danger);
}

.badge-page,
.badge-comment {
  background: var(--a-primary-soft);
  color: var(--a-primary);
}

.muted {
  color: var(--a-muted);
}

.text-small {
  font-size: 11px;
}

.mono {
  font-family: var(--a-mono);
  font-size: 11px;
}

/* Dashboard */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}

.stat-card {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--a-border);
  border-radius: var(--a-radius);
  background: var(--a-surface);
  padding: 19px 20px;
  box-shadow: var(--a-shadow-sm);
}

.stat-card::after {
  content: "";
  position: absolute;
  width: 70px;
  height: 70px;
  right: -24px;
  top: -25px;
  border-radius: 50%;
  background: var(--a-primary-soft);
  opacity: 0.75;
}

.stat-label {
  margin: 0 0 9px;
  color: var(--a-muted);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.stat-value {
  margin: 0;
  font-size: 34px;
  font-weight: 710;
  letter-spacing: -0.05em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.stat-note {
  margin: 9px 0 0;
  color: var(--a-muted);
  font-size: 10px;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(280px, 0.8fr);
  gap: 18px;
}

.quick-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.quick-action {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-height: 92px;
  justify-content: center;
  border: 1px solid var(--a-border);
  border-radius: 10px;
  background: var(--a-surface-soft);
  color: var(--a-text);
  padding: 14px;
  text-decoration: none;
}

.quick-action:hover {
  border-color: var(--a-primary);
  color: var(--a-primary);
  text-decoration: none;
}

.quick-action strong {
  font-size: 12px;
  font-weight: 680;
}

.quick-action small {
  color: var(--a-muted);
  font-size: 10px;
}

/* Tables */
.table-wrap {
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.data-table th,
.data-table td {
  border-bottom: 1px solid var(--a-border);
  padding: 12px 15px;
  text-align: left;
  vertical-align: middle;
}

.data-table th {
  background: var(--a-surface-soft);
  color: var(--a-muted);
  font-size: 9px;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}

.data-table tbody tr:hover {
  background: color-mix(in srgb, var(--a-primary-soft) 28%, transparent);
}

.data-table tbody tr:last-child td {
  border-bottom: 0;
}

.data-table .title-cell {
  min-width: 220px;
}

.title-link {
  display: block;
  color: var(--a-text);
  font-size: 13px;
  font-weight: 620;
  line-height: 1.4;
  text-decoration: none;
}

.title-link:hover {
  color: var(--a-primary);
}

.cell-sub {
  margin-top: 3px;
  color: var(--a-muted);
  font-size: 10px;
}

.row-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  white-space: nowrap;
}

.row-actions .button {
  min-height: 28px;
  padding: 3px 8px;
  font-size: 10px;
}

.num-cell {
  color: var(--a-muted);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 9px;
  margin-bottom: 14px;
}

.toolbar-spacer {
  flex: 1;
}

.search-inline {
  position: relative;
  width: min(300px, 100%);
}

.search-inline input {
  width: 100%;
  border: 1px solid var(--a-border-strong);
  border-radius: 8px;
  background: var(--a-surface);
  color: var(--a-text);
  padding: 8px 12px;
  font-size: 12px;
}

.search-inline input:focus {
  border-color: var(--a-primary);
  outline: 0;
  box-shadow: 0 0 0 3px var(--a-primary-soft);
}

.toolbar select {
  border: 1px solid var(--a-border-strong);
  border-radius: 8px;
  background: var(--a-surface);
  color: var(--a-text);
  padding: 8px 28px 8px 10px;
  font-size: 12px;
}

.table-empty {
  padding: 48px 20px;
  color: var(--a-muted);
  text-align: center;
  font-size: 12px;
}

.pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-top: 1px solid var(--a-border);
  color: var(--a-muted);
  font-size: 11px;
}

.pager-actions {
  display: flex;
  gap: 6px;
}

/* Forms and editor */
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.form-grid .span-2 {
  grid-column: 1 / -1;
}

.form-field textarea {
  resize: vertical;
  min-height: 140px;
}

.form-field.small-input input,
.form-field.small-input select {
  max-width: 240px;
}

.checkbox-field {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  color: var(--a-text-soft);
  font-size: 12px;
}

.checkbox-field input {
  width: 16px;
  height: 16px;
  margin: 2px 0 0;
  accent-color: var(--a-primary);
}

.form-hint {
  margin: 5px 0 0;
  color: var(--a-muted);
  font-size: 10px;
  line-height: 1.55;
}

.form-actions {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 22px;
}

.editor-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 18px;
  align-items: start;
}

.editor-main,
.editor-side {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.editor-side {
  position: sticky;
  top: 104px;
}

.title-input {
  width: 100%;
  border: 0;
  border-bottom: 1px solid var(--a-border);
  border-radius: 0;
  background: transparent;
  color: var(--a-text);
  padding: 10px 2px 16px;
  font-size: clamp(25px, 3.4vw, 36px);
  font-weight: 700;
  letter-spacing: -0.05em;
  line-height: 1.25;
  outline: 0;
}

.title-input::placeholder {
  color: var(--a-border-strong);
}

.title-input:focus {
  border-bottom-color: var(--a-primary);
}

.editor-textarea {
  width: 100%;
  min-height: 460px;
  resize: vertical;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--a-text);
  padding: 20px 22px;
  font-family: var(--a-mono);
  font-size: 13px;
  line-height: 1.8;
  outline: 0;
  tab-size: 2;
}

.editor-tabs {
  display: flex;
  align-items: center;
  gap: 3px;
  border-bottom: 1px solid var(--a-border);
  padding: 8px 10px 0;
}

.editor-tab {
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 6px 6px 0 0;
  background: transparent;
  color: var(--a-muted);
  padding: 7px 11px;
  font-size: 11px;
  font-weight: 650;
}

.editor-tab:hover {
  color: var(--a-text);
}

.editor-tab.active {
  border-bottom-color: var(--a-primary);
  color: var(--a-primary);
}

.preview-pane {
  min-height: 460px;
  padding: 23px;
  color: var(--a-text-soft);
  font-family: Georgia, "Songti SC", serif;
  font-size: 15px;
  line-height: 1.85;
  overflow-wrap: break-word;
}

.preview-pane > :first-child {
  margin-top: 0;
}

.preview-pane h1,
.preview-pane h2,
.preview-pane h3 {
  color: var(--a-text);
  font-family: var(--a-font);
  letter-spacing: -0.025em;
}

.preview-pane pre {
  overflow-x: auto;
  border: 1px solid var(--a-border);
  border-radius: 8px;
  background: var(--a-surface-soft);
  padding: 14px;
  font-family: var(--a-mono);
  font-size: 12px;
}

.preview-pane code {
  border-radius: 4px;
  background: var(--a-surface-soft);
  padding: 1px 4px;
  font-family: var(--a-mono);
  font-size: 0.88em;
}

.preview-pane blockquote {
  margin-inline: 0;
  border-left: 3px solid var(--a-primary);
  padding-left: 15px;
  color: var(--a-muted);
}

.meta-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  max-height: 170px;
  overflow-y: auto;
  padding: 2px;
}

.meta-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--a-border);
  border-radius: 999px;
  background: var(--a-surface-soft);
  padding: 5px 9px;
  color: var(--a-text-soft);
  font-size: 10px;
}

.meta-check input {
  width: 13px;
  height: 13px;
  margin: 0;
  accent-color: var(--a-primary);
}

.editor-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 20px;
}

.word-count {
  margin-left: auto;
  color: var(--a-muted);
  font-size: 10px;
}

/* Inline meta forms */
.inline-form {
  display: grid;
  grid-template-columns: 1.1fr 1fr 1.4fr 80px auto;
  gap: 9px;
  align-items: end;
}

.inline-form .form-field {
  gap: 4px;
}

.inline-form input {
  padding: 8px 10px;
  font-size: 12px;
  font-weight: 400;
}

/* Comments */
.comment-admin-list {
  display: flex;
  flex-direction: column;
}

.comment-admin-item {
  padding: 18px 20px;
  border-bottom: 1px solid var(--a-border);
}

.comment-admin-item:last-child {
  border-bottom: 0;
}

.comment-admin-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 9px;
  color: var(--a-muted);
  font-size: 10px;
}

.comment-admin-head strong {
  color: var(--a-text);
  font-size: 12px;
}

.comment-admin-body {
  margin: 8px 0 0;
  color: var(--a-text-soft);
  font-size: 12px;
  line-height: 1.7;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.comment-admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 11px;
}

/* Media */
.media-drop {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border: 1px dashed var(--a-border-strong);
  border-radius: 10px;
  background: var(--a-surface-soft);
  padding: 17px;
  margin-bottom: 18px;
}

.media-drop strong {
  display: block;
  font-size: 12px;
}

.media-drop small {
  color: var(--a-muted);
  font-size: 10px;
}

.media-upload-form {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(175px, 1fr));
  gap: 14px;
}

.media-card {
  overflow: hidden;
  border: 1px solid var(--a-border);
  border-radius: 11px;
  background: var(--a-surface);
}

.media-preview {
  display: flex;
  aspect-ratio: 4 / 3;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background:
    linear-gradient(45deg, var(--a-surface-soft) 25%, transparent 25%) 0 0 / 16px 16px,
    linear-gradient(-45deg, var(--a-surface-soft) 25%, transparent 25%) 0 8px / 16px 16px,
    linear-gradient(45deg, transparent 75%, var(--a-surface-soft) 75%) 8px -8px / 16px 16px,
    linear-gradient(-45deg, transparent 75%, var(--a-surface-soft) 75%) -8px 0 / 16px 16px,
    var(--a-surface);
}

.media-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.file-mark {
  color: var(--a-muted);
  font-family: var(--a-mono);
  font-size: 12px;
  text-transform: uppercase;
}

.media-info {
  padding: 11px 12px;
}

.media-name {
  overflow: hidden;
  margin: 0;
  color: var(--a-text);
  font-size: 11px;
  font-weight: 620;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.media-meta {
  margin: 3px 0 0;
  color: var(--a-muted);
  font-size: 9px;
}

.media-actions {
  display: flex;
  gap: 5px;
  margin-top: 9px;
}

.media-actions .button {
  flex: 1;
  min-height: 27px;
  padding: 3px 6px;
  font-size: 9px;
}

/* Settings */
.settings-layout {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.settings-tabs {
  display: flex;
  flex-direction: column;
  gap: 2px;
  border: 1px solid var(--a-border);
  border-radius: var(--a-radius);
  background: var(--a-surface);
  padding: 7px;
  box-shadow: var(--a-shadow-sm);
}

.settings-tab {
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--a-muted);
  padding: 9px 11px;
  text-align: left;
  font-size: 11px;
  font-weight: 620;
}

.settings-tab:hover {
  background: var(--a-surface-soft);
  color: var(--a-text);
}

.settings-tab.active {
  background: var(--a-primary-soft);
  color: var(--a-primary);
}

.settings-panel {
  display: none;
}

.settings-panel.active {
  display: block;
}

.settings-section + .settings-section {
  border-top: 1px solid var(--a-border);
  margin-top: 22px;
  padding-top: 22px;
}

.settings-section h3 {
  margin: 0 0 4px;
  font-size: 14px;
  font-weight: 680;
}

.settings-section > p {
  margin: 0 0 17px;
  color: var(--a-muted);
  font-size: 11px;
}

.toggle-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 10px 0;
}

.toggle-row + .toggle-row {
  border-top: 1px solid var(--a-border);
}

.toggle-copy strong {
  display: block;
  color: var(--a-text);
  font-size: 12px;
}

.toggle-copy p {
  margin: 3px 0 0;
  color: var(--a-muted);
  font-size: 10px;
}

/* Dialog */
.admin-dialog {
  width: min(520px, calc(100% - 30px));
  border: 1px solid var(--a-border);
  border-radius: 15px;
  background: var(--a-surface);
  color: var(--a-text);
  padding: 0;
  box-shadow: var(--a-shadow);
}

.admin-dialog::backdrop {
  background: rgba(8, 12, 18, 0.6);
  backdrop-filter: blur(3px);
}

.dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--a-border);
  padding: 17px 20px;
}

.dialog-header h3 {
  margin: 0;
  font-size: 15px;
  letter-spacing: -0.02em;
}

.dialog-close {
  border: 0;
  background: transparent;
  color: var(--a-muted);
  padding: 2px 7px;
  font-size: 19px;
  line-height: 1;
}

.dialog-body {
  padding: 20px;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  border-top: 1px solid var(--a-border);
  padding: 14px 20px;
}

/* Toast and loading */
.toast-stack {
  position: fixed;
  z-index: 100;
  right: 20px;
  bottom: 20px;
  display: flex;
  width: min(360px, calc(100% - 40px));
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  border: 1px solid var(--a-border);
  border-left: 3px solid var(--a-primary);
  border-radius: 9px;
  background: var(--a-surface);
  color: var(--a-text);
  box-shadow: var(--a-shadow);
  padding: 11px 14px;
  font-size: 12px;
  line-height: 1.55;
  animation: toast-in 160ms ease both;
  pointer-events: auto;
}

.toast.error {
  border-left-color: var(--a-danger);
}

.toast.success {
  border-left-color: var(--a-success);
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.loading-panel,
.error-panel {
  display: flex;
  min-height: 300px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--a-border);
  border-radius: var(--a-radius);
  background: var(--a-surface);
  color: var(--a-muted);
  text-align: center;
  padding: 30px;
}

.loading-panel p {
  margin: 13px 0 0;
  font-size: 12px;
}

.spinner {
  width: 23px;
  height: 23px;
  border: 2px solid var(--a-border);
  border-top-color: var(--a-primary);
  border-radius: 50%;
  animation: spin 700ms linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.error-panel h2 {
  margin: 0;
  color: var(--a-text);
  font-size: 19px;
}

.error-panel p {
  margin: 8px 0 17px;
  max-width: 480px;
  font-size: 12px;
}

/* Responsive */
@media (max-width: 1120px) {
  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-grid,
  .editor-layout {
    grid-template-columns: 1fr;
  }

  .editor-side {
    position: static;
  }

  .inline-form {
    grid-template-columns: 1fr 1fr;
  }

  .inline-form .form-field:first-child {
    grid-column: 1 / -1;
  }
}

@media (max-width: 900px) {
  .login-shell {
    grid-template-columns: 1fr;
  }

  .login-aside {
    display: none;
  }

  .admin-shell {
    grid-template-columns: 1fr;
  }

  .admin-sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: 248px;
    transform: translateX(-105%);
    transition: transform 180ms ease;
    box-shadow: 20px 0 50px rgba(0, 0, 0, 0.25);
  }

  .admin-sidebar.open {
    transform: translateX(0);
  }

  .mobile-menu {
    display: inline-flex;
  }

  .admin-topbar {
    padding-inline: 18px;
  }

  .admin-view {
    padding: 22px 18px 40px;
  }

  .settings-layout {
    grid-template-columns: 1fr;
  }

  .settings-tabs {
    flex-direction: row;
    overflow-x: auto;
  }

  .page-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .form-grid .span-2 {
    grid-column: auto;
  }
}

@media (max-width: 620px) {
  .topbar-right .user-meta {
    display: none;
  }

  .admin-topbar {
    min-height: 70px;
  }

  .page-header h2 {
    font-size: 27px;
  }

  .stats-grid,
  .quick-actions {
    grid-template-columns: 1fr 1fr;
  }

  .stat-card {
    padding: 15px;
  }

  .stat-value {
    font-size: 28px;
  }

  .inline-form {
    grid-template-columns: 1fr;
  }

  .inline-form .form-field:first-child {
    grid-column: auto;
  }

  .media-drop {
    align-items: flex-start;
    flex-direction: column;
  }

  .media-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .toast-stack {
    right: 14px;
    bottom: 14px;
    width: calc(100% - 28px);
  }

  .comment-admin-item {
    padding: 16px;
  }

  .editor-textarea {
    min-height: 360px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
