:root {
  --bg: #f3f6fb;
  --panel: #ffffff;
  --text: #0f172a;
  --muted: #475569;
  --accent: #0ea5a6;
  --border: #dbe3ef;
  --nav-bg: rgba(255,255,255,.9);
  --nav-text: #0f172a;
  --footer-bg: rgba(255,255,255,.78);
  --drawer-bg: rgba(255,255,255,.96);
  --drawer-text: #0f172a;
}
html[data-theme='dark'] {
  --bg: #0f1f32;
  --panel: #162a42;
  --text: #eef6ff;
  --muted: #c1d3ea;
  --accent: #14b8a6;
  --border: #3a5675;
  --nav-bg: rgba(11,18,32,.86);
  --nav-text: #eef6ff;
  --footer-bg: rgba(11,18,32,.74);
  --drawer-bg: rgba(11,18,32,.96);
  --drawer-text: #eef6ff;
}
* { box-sizing: border-box; }
html, body { min-height: 100%; }
body { margin: 0; font-family: "Trebuchet MS", "Segoe UI", system-ui, sans-serif; background: var(--bg); color: var(--text); display: flex; flex-direction: column; }
.container { width: min(1100px, 92%); margin: 0 auto; }
.row { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.site-header {
  border-bottom: 1px solid rgba(20,184,166,.35);
  background: linear-gradient(90deg, rgba(12,27,48,.92) 0%, rgba(18,64,84,.88) 52%, rgba(28,40,78,.9) 100%);
  position: sticky;
  top: 0;
  backdrop-filter: blur(8px);
}
.brand { font-weight: 800; color: #f8fafc; text-decoration: none; }
.top-nav { display: flex; gap: 10px; align-items: center; margin-left: auto; }
.header-tools { display: flex; align-items: center; gap: 8px; margin-left: 10px; }
.site-header .row { justify-content: flex-start; }
.top-nav { order: 2; }
.header-tools { order: 3; }
.top-nav a { color: var(--nav-text); text-decoration: none; padding: 8px 10px; border-radius: 8px; font-weight: 600; }
.top-nav a:hover { background: rgba(20,184,166,.14); }
.site-header .top-nav a { color: #e8f1ff; }
.site-header .top-nav a:hover { color: #ffffff; background: rgba(255,255,255,.12); }
.theme-toggle-btn {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.theme-toggle-btn svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}
.nav-toggle {
  display: none;
  background: var(--accent);
  color: #fff;
  border: 0;
  border-radius: 8px;
  width: 40px;
  height: 36px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 4px;
  padding: 0;
}
.nav-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  background: #fff;
  border-radius: 2px;
}
button,.btn { background: var(--accent); color: #fff; border: 0; padding: 9px 12px; border-radius: 10px; text-decoration: none; cursor: pointer; }
main { padding: 24px 0 96px; flex: 1 0 auto; position: relative; z-index: 1; }
.hero,.card,.dashboard { background: var(--panel); border: 1px solid var(--border); border-radius: 14px; padding: 20px; }
.launch-soon { text-align: center; padding: 42px 20px; }
.launch-soon h1 { margin: 0 0 10px; font-size: clamp(2rem, 4vw, 3rem); }
.launch-soon p { margin: 0 0 16px; color: var(--muted); }
.launch-badges { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-bottom: 14px; }
.launch-badges span { border: 1px solid var(--border); border-radius: 999px; padding: 6px 10px; font-size: .85rem; background: rgba(20,184,166,.12); }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px,1fr)); gap: 12px; }
label { display: block; margin: 10px 0; }
input { width: 100%; padding: 9px; margin-top: 5px; border-radius: 9px; border: 1px solid var(--border); background: var(--bg); color: var(--text); }
select, textarea {
  width: 100%;
  padding: 9px;
  margin-top: 5px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
}
select option {
  background: var(--panel);
  color: var(--text);
}
.error { color: #dc2626; }
.auth-wrap {
  width: min(560px, 94vw);
  margin: 18px auto 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  align-items: start;
}
.auth-showcase {
  border: 1px solid rgba(20,184,166,.36);
  border-radius: 12px;
  padding: 12px 14px;
  background: linear-gradient(135deg, rgba(20,184,166,.2), rgba(30,41,59,.34));
  box-shadow: 0 8px 22px rgba(2,10,26,.2);
}
.auth-showcase h1 { margin: 0; font-size: clamp(1.2rem, 2.5vw, 1.6rem); }
.auth-showcase p { margin: 2px 0 0; color: var(--text); opacity: .85; font-size: .9rem; }
.auth.auth-fancy {
  border-radius: 14px;
  border: 1px solid rgba(148,163,184,.38);
  box-shadow: 0 14px 30px rgba(2, 10, 26, .28);
  background: linear-gradient(180deg, rgba(255,255,255,.9), rgba(241,245,249,.88));
  padding: 14px;
}
.auth.auth-fancy h2 { margin-top: 0; margin-bottom: 6px; font-size: 1.65rem; }
.auth-form { display: grid; gap: 8px; }
.auth-form label { margin: 6px 0; font-weight: 600; }
.auth-form input { margin-top: 4px; }
.auth-form button { margin-top: 4px; }
.hp-field {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
.site-footer {
  color: var(--text);
  background: var(--footer-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 14px;
  margin: 10px auto 12px;
  position: relative;
  z-index: 1;
}
.reader-drawer {
  position: fixed !important;
  left: 0;
  right: 0;
  bottom: 0 !important;
  transform: none !important;
  z-index: 9999;
  background: var(--drawer-bg);
  backdrop-filter: blur(8px);
  border-top: 1px solid var(--border);
  display: grid;
  grid-template-columns: repeat(4,1fr);
  min-height: 58px;
}
.reader-drawer a {
  text-align: center;
  padding: 8px 6px;
  color: var(--drawer-text);
  text-decoration: none;
  font-weight: 700;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
}
.reader-drawer .rd-ic { font-size: 1.1rem; line-height: 1; }
.reader-drawer .rd-ic { width: 18px; height: 18px; display: inline-flex; }
.reader-drawer .rd-ic svg { width: 100%; height: 100%; fill: #d4af37; }
.reader-drawer .rd-tx { font-size: .84rem; line-height: 1; }
.reader-drawer a:hover { background: rgba(20,184,166,.14); }
.has-reader-drawer main { padding-bottom: 122px; }
.has-reader-drawer .site-footer { margin-bottom: 64px; }
.inline { display: inline; }

.dash-body { background: #ecf0f5; }
html[data-theme='dark'] .dash-body { background: #0b1220; }
html[data-theme='dark'] .card,
html[data-theme='dark'] .dashboard,
html[data-theme='dark'] .hero {
  background: #1a314d;
  border-color: #45678b;
  color: #eef6ff;
}
html[data-theme='dark'] input,
html[data-theme='dark'] select,
html[data-theme='dark'] textarea {
  background: #13263d;
  border-color: #4a6d92;
  color: #eef6ff;
}
html[data-theme='dark'] ::placeholder {
  color: #bdd2ea;
  opacity: .85;
}
html[data-theme='dark'] .auth.auth-fancy {
  background: linear-gradient(180deg, rgba(10,18,34,.86), rgba(12,22,42,.9));
  border-color: #28405d;
}
html[data-theme='dark'] .auth-showcase {
  border-color: rgba(20,184,166,.46);
}
html[data-theme='light'] .auth-showcase h1,
html[data-theme='light'] .auth-showcase p {
  color: #f8fafc;
  text-shadow: 0 1px 6px rgba(0,0,0,.28);
}
html[data-theme='light'] .auth.auth-fancy {
  background: linear-gradient(180deg, rgba(255,255,255,.98), rgba(246,249,252,.98));
  border-color: #c9d6e6;
}
.dash-shell { display: grid; grid-template-columns: 260px 1fr; min-height: 100vh; }
.dash-sidebar {
  background: linear-gradient(180deg, #1f2937 0%, #111827 100%);
  color: #e5e7eb;
  padding: 20px 14px;
  border-right: 1px solid #0f172a;
  position: relative;
  transition: width .2s ease;
}
.dash-brand { font-size: 1.2rem; font-weight: 800; margin-bottom: 18px; }
.collapse-btn {
  width: 42px;
  height: 38px;
  background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.collapse-btn.top {
  background: #0ea5a6;
  border-color: #0ea5a6;
  color: #fff;
}
.dash-user { background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.14); padding: 10px; border-radius: 10px; margin-bottom: 14px; }
.dash-user span { display: block; color: #9ca3af; font-size: .8rem; margin-top: 4px; }
.dash-menu { display: grid; gap: 8px; }
.dash-menu .item, .submenu a {
  color: #d1d5db;
  text-decoration: none;
  padding: 10px 12px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 10px;
  position: relative;
}
.dash-menu button.item {
  width: 100%;
  border: 0;
  cursor: default;
  font: inherit;
  background: transparent;
}
.dash-menu .item:hover, .dash-menu .item.active, .submenu a:hover {
  background: rgba(14,165,166,.2);
  color: #fff;
}
.dash-menu .ic { width: 18px; height: 18px; display: inline-flex; }
.dash-menu .ic svg { width: 100%; height: 100%; fill: currentColor; }
.menu-group { position: relative; }
.submenu {
  position: absolute;
  top: 0;
  left: calc(100% + 8px);
  min-width: 190px;
  background: #111827;
  border: 1px solid #334155;
  border-radius: 10px;
  padding: 8px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  z-index: 20;
  transition: opacity .12s ease;
}
.menu-group:hover .submenu,
.menu-group.open .submenu {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  display: grid;
  gap: 6px;
}
.tip {
  display: none;
  position: absolute;
  left: calc(100% + 12px);
  top: 50%;
  transform: translateY(-50%);
  background: #0f172a;
  border: 1px solid #334155;
  border-radius: 8px;
  color: #e5e7eb;
  padding: 6px 8px;
  font-size: .8rem;
  white-space: nowrap;
  z-index: 30;
}
.dash-main { padding: 18px; }
.dash-topbar {
  background: #fff;
  border: 1px solid #d9e0ea;
  border-radius: 12px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.dash-title-wrap { display: flex; align-items: center; gap: 12px; }
.dash-title-wrap h1 { margin: 0; }
html[data-theme='dark'] .dash-topbar,
html[data-theme='dark'] .panel,
html[data-theme='dark'] .stat {
  background: #111827;
  border-color: #243244;
  color: #e5e7eb;
}
.dash-actions { display: flex; gap: 8px; align-items: center; }
.btn.ghost { background: transparent; color: var(--text); border: 1px solid var(--border); }
.dash-grid { display: grid; gap: 12px; grid-template-columns: repeat(4,minmax(0,1fr)); margin-bottom: 14px; }
.stat {
  border: 1px solid #d9e0ea;
  border-radius: 12px;
  background: #fff;
  padding: 14px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, .06);
}
.stat h3 { margin: 0 0 8px; color: #64748b; font-size: .9rem; text-transform: uppercase; letter-spacing: .04em; }
.stat p { margin: 0; font-size: 1.6rem; font-weight: 800; }
.role-admin .stat { border-top: 4px solid #3b82f6; }
.role-editor .stat { border-top: 4px solid #f59e0b; }
.role-author .stat { border-top: 4px solid #10b981; }
.panel-row { display: grid; grid-template-columns: 1fr 1.4fr; gap: 12px; }
.panel {
  border: 1px solid #d9e0ea;
  border-radius: 12px;
  background: #fff;
  padding: 14px;
}
.panel header { border-bottom: 1px solid #e5eaf1; margin-bottom: 10px; }
.panel h2 { margin: 0 0 8px; font-size: 1.02rem; }
.panel ul { margin: 0; padding-left: 18px; color: #475569; }
.panel table { width: 100%; border-collapse: collapse; }
.panel th, .panel td { border-bottom: 1px solid #e6edf7; padding: 8px; text-align: left; font-size: .92rem; }
html[data-theme='dark'] .panel th,
html[data-theme='dark'] .panel td { border-bottom-color: #1f2b3d; }

@media (max-width: 980px) {
  .auth-wrap { grid-template-columns: 1fr; }
  .dash-shell { grid-template-columns: 1fr; }
  .dash-sidebar { position: static; }
  .dash-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .panel-row { grid-template-columns: 1fr; }
}

.dash-shell.is-collapsed { grid-template-columns: 84px 1fr; }
.dash-shell.is-collapsed .dash-brand,
.dash-shell.is-collapsed .dash-user,
.dash-shell.is-collapsed .dash-menu .txt { display: none; }
.dash-shell.is-collapsed .dash-menu .item { justify-content: center; }
.dash-shell.is-collapsed .dash-menu .item:hover .tip { display: block; }
.dash-shell.is-collapsed .menu-group .submenu { left: calc(100% + 12px); }

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #f8fafc;
  text-decoration: none;
  padding: 4px 8px;
  border-radius: 12px;
}
.brand-text { display: grid; line-height: 1.05; }
.brand-text strong {
  font-family: "Arial Black", "Segoe UI", sans-serif;
  font-size: 1.6rem;
  letter-spacing: .02em;
  color: #f8fafc;
  text-shadow: 0 2px 10px rgba(0,0,0,.22);
}
.brand-text small {
  color: #d7e9e6;
  font-size: .82rem;
  font-weight: 700;
  margin-top: 3px;
  letter-spacing: .02em;
  justify-self: end;
  text-align: right;
}
.brand-logo {
  width: 68px;
  height: 68px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid rgba(212,175,55,.55);
  box-shadow: 0 0 0 2px rgba(7,15,29,.42), 0 6px 16px rgba(0,0,0,.3);
}
.app-logo { width: 30px; height: 30px; object-fit: contain; border-radius: 6px; }
.dash-brand { display: flex; align-items: center; gap: 8px; }

.front-bg.front-bg-animated {
  background: radial-gradient(circle at 20% 20%, var(--morph-a, #16385f) 0%, transparent 35%),
              radial-gradient(circle at 80% 10%, var(--morph-b, #3a1c5a) 0%, transparent 30%),
              radial-gradient(circle at 50% 90%, var(--morph-c, #0f766e) 0%, transparent 35%),
              #0b1324;
  background-size: 160% 160%;
  animation: morphbg var(--morph-speed, 16s) ease-in-out infinite;
}
.front-bg::before {
  content: '';
  position: fixed;
  inset: 0;
  background: linear-gradient(180deg, rgba(8,15,32,.16) 0%, rgba(8,15,32,.24) 100%);
  pointer-events: none;
  z-index: 0;
}
html[data-theme='light'] .front-bg::before {
  background: linear-gradient(180deg, rgba(255,255,255,.06) 0%, rgba(255,255,255,.12) 100%);
}
.site-header { position: relative; z-index: 2; }
html[data-theme='light'] .site-header {
  background: linear-gradient(90deg, rgba(15,45,72,.92) 0%, rgba(23,96,104,.9) 55%, rgba(35,49,95,.9) 100%);
}
.front-bg.front-bg-image {
  background-size: cover;
  background-repeat: no-repeat;
  background-position: center;
}
.front-bg.front-bg-solid {
  background-image: none;
}
.front-bg.front-bg-animated.morph-wave {
  background:
    linear-gradient(130deg, var(--morph-a, #16385f), transparent 55%),
    linear-gradient(230deg, var(--morph-b, #3a1c5a), transparent 50%),
    linear-gradient(45deg, var(--morph-c, #0f766e), transparent 50%),
    #0b1324;
  background-size: 220% 220%;
  animation: wavebg var(--morph-speed, 16s) ease-in-out infinite;
}
.front-bg.front-bg-animated.morph-nebula {
  background-image:
    radial-gradient(circle at 30% 15%, var(--morph-c, #0f766e) 0%, transparent 33%),
    radial-gradient(circle at 75% 25%, var(--morph-a, #16385f) 0%, transparent 38%),
    radial-gradient(circle at 40% 80%, var(--morph-b, #3a1c5a) 0%, transparent 35%),
    radial-gradient(circle at 60% 60%, rgba(255,255,255,.12), transparent 45%);
  background-size: 180% 180%;
  animation: nebulabg var(--morph-speed, 16s) ease-in-out infinite;
}
.front-bg.front-bg-animated.intensity-low { background-size: 130% 130%; opacity: .96; }
.front-bg.front-bg-animated.intensity-medium { background-size: 160% 160%; opacity: 1; }
.front-bg.front-bg-animated.intensity-high { background-size: 190% 190%; opacity: 1; }
@keyframes morphbg {
  0% { background-position: 0% 0%, 100% 0%, 50% 100%; }
  50% { background-position: 25% 20%, 80% 30%, 60% 85%; }
  100% { background-position: 0% 0%, 100% 0%, 50% 100%; }
}
@keyframes wavebg {
  0% { background-position: 0% 50%, 100% 40%, 20% 60%; }
  50% { background-position: 100% 50%, 0% 60%, 80% 40%; }
  100% { background-position: 0% 50%, 100% 40%, 20% 60%; }
}
@keyframes nebulabg {
  0% { background-position: 10% 20%, 80% 20%, 40% 80%, 50% 50%; }
  50% { background-position: 30% 10%, 70% 40%, 55% 70%, 40% 60%; }
  100% { background-position: 10% 20%, 80% 20%, 40% 80%, 50% 50%; }
}

.ui-header-sticky-off .site-header,
.ui-header-sticky-off .dash-topbar { position: static; }
.ui-header-sticky-on .site-header,
.ui-header-sticky-on .dash-topbar { position: sticky; top: 0; z-index: 30; }
.ui-header-trans-on .site-header,
.ui-header-trans-on .dash-topbar {
  background: var(--nav-bg);
  backdrop-filter: blur(8px);
  border-color: rgba(148,163,184,.3);
}
.ui-footer-sticky-on .site-footer { position: sticky; bottom: 0; z-index: 20; }
.ui-footer-trans-on .site-footer {
  background: var(--footer-bg);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(148,163,184,.3);
  border-radius: 12px 12px 0 0;
  padding-top: 10px;
}

.card-radius-sm .hero, .card-radius-sm .card, .card-radius-sm .dashboard, .card-radius-sm .panel, .card-radius-sm .stat { border-radius: 8px; }
.card-radius-md .hero, .card-radius-md .card, .card-radius-md .dashboard, .card-radius-md .panel, .card-radius-md .stat { border-radius: 14px; }
.card-radius-lg .hero, .card-radius-lg .card, .card-radius-lg .dashboard, .card-radius-lg .panel, .card-radius-lg .stat { border-radius: 20px; }

.card-surface-solid .hero, .card-surface-solid .card, .card-surface-solid .dashboard, .card-surface-solid .panel, .card-surface-solid .stat { backdrop-filter: none; }
.card-surface-soft .hero, .card-surface-soft .card, .card-surface-soft .dashboard, .card-surface-soft .panel, .card-surface-soft .stat { background: rgba(255,255,255,.92); }
.card-surface-glass .hero, .card-surface-glass .card, .card-surface-glass .dashboard, .card-surface-glass .panel, .card-surface-glass .stat {
  background: rgba(255,255,255,.68);
  backdrop-filter: blur(8px);
}
html[data-theme='dark'] .card-surface-soft .hero,
html[data-theme='dark'] .card-surface-soft .card,
html[data-theme='dark'] .card-surface-soft .dashboard,
html[data-theme='dark'] .card-surface-soft .panel,
html[data-theme='dark'] .card-surface-soft .stat { background: rgba(17,24,39,.9); }
html[data-theme='dark'] .card-surface-glass .hero,
html[data-theme='dark'] .card-surface-glass .card,
html[data-theme='dark'] .card-surface-glass .dashboard,
html[data-theme='dark'] .card-surface-glass .panel,
html[data-theme='dark'] .card-surface-glass .stat { background: rgba(17,24,39,.62); }
html[data-theme='light'] .card-surface-soft .hero,
html[data-theme='light'] .card-surface-soft .card,
html[data-theme='light'] .card-surface-soft .dashboard,
html[data-theme='light'] .card-surface-soft .panel,
html[data-theme='light'] .card-surface-soft .stat { background: rgba(255,255,255,.95); }
html[data-theme='light'] .card-surface-glass .hero,
html[data-theme='light'] .card-surface-glass .card,
html[data-theme='light'] .card-surface-glass .dashboard,
html[data-theme='light'] .card-surface-glass .panel,
html[data-theme='light'] .card-surface-glass .stat { background: rgba(255,255,255,.78); }

.card-shadow-none .hero, .card-shadow-none .card, .card-shadow-none .dashboard, .card-shadow-none .panel, .card-shadow-none .stat { box-shadow: none; }
.card-shadow-sm .hero, .card-shadow-sm .card, .card-shadow-sm .dashboard, .card-shadow-sm .panel, .card-shadow-sm .stat { box-shadow: 0 1px 3px rgba(15,23,42,.08); }
.card-shadow-md .hero, .card-shadow-md .card, .card-shadow-md .dashboard, .card-shadow-md .panel, .card-shadow-md .stat { box-shadow: 0 4px 14px rgba(15,23,42,.12); }
.card-shadow-lg .hero, .card-shadow-lg .card, .card-shadow-lg .dashboard, .card-shadow-lg .panel, .card-shadow-lg .stat { box-shadow: 0 10px 26px rgba(15,23,42,.18); }

.branding-wrap { padding: 16px; }
.branding-wrap > header p { color: #64748b; margin-top: 6px; }
.tabs { display: flex; gap: 8px; margin: 10px 0 16px; border-bottom: 1px solid #e5eaf1; padding-bottom: 10px; }
.tab { background: #e2e8f0; color: #0f172a; }
.tab.active { background: #0ea5a6; color: #fff; }
.tab-panel { display: none; }
.tab-panel.active { display: block; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 12px; }
.form-grid .full { grid-column: 1 / -1; }
.form-grid label { background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 10px; padding: 10px; margin: 0; }
.form-grid input[type='file'], .form-grid select { width: 100%; margin-top: 6px; }
.form-grid fieldset { border: 1px solid #e2e8f0; border-radius: 10px; padding: 10px; }
.form-grid legend { font-weight: 700; padding: 0 4px; }
.form-grid .options { display: flex; gap: 14px; flex-wrap: wrap; }
.hint { display: block; margin-top: 6px; color: #64748b; font-size: .8rem; word-break: break-all; }
.notice.success { border-left: 4px solid #10b981; background: #ecfdf5; }
.coins-table-wrap { overflow-x: auto; }
.coins-table { width: 100%; border-collapse: collapse; min-width: 760px; margin: 0 auto; }
.coins-table th, .coins-table td { border-bottom: 1px solid #e2e8f0; padding: 7px 8px; text-align: center; vertical-align: middle; }
.coins-table th { font-size: .82rem; text-transform: uppercase; letter-spacing: .04em; color: #64748b; }
.coin-thumb { width: 28px; height: 28px; object-fit: contain; }
.coin-actions { display: flex; gap: 6px; align-items: center; justify-content: center; }
.sm { padding: 6px 8px; border-radius: 8px; font-size: .82rem; }
.danger { background: #dc2626; color: #fff; }
.lock-pill {
  color: #f8fafc;
  border: 1px solid #475569;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 30px;
  padding: 0;
}
.lock-pill svg { width: 15px; height: 15px; fill: currentColor; }
.lock-pill.locked { background: #d4af37; border-color: #b38f1d; color: #1f2937; }
.lock-pill.unlocked { background: #475569; border-color: #64748b; color: #e5e7eb; }
.coin-form-compact {
  grid-template-columns: repeat(3, minmax(220px, 1fr));
  gap: 8px;
  max-width: 1120px;
  margin: 0 auto;
}
.coin-form-compact label { padding: 7px 8px; }
.coin-form-compact input, .coin-form-compact select, .coin-form-compact textarea { margin-top: 4px; }
.coin-form-compact input,
.coin-form-compact select {
  padding: 7px 9px;
}
.coin-advanced {
  border: 1px dashed var(--border);
  border-radius: 10px;
  padding: 8px 10px;
  background: rgba(148,163,184,.06);
}
.coin-advanced summary { cursor: pointer; font-weight: 700; margin-bottom: 8px; }
textarea {
  width: 100%;
  padding: 9px;
  margin-top: 5px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
}
html[data-theme='dark'] .form-grid label,
html[data-theme='dark'] .form-grid fieldset,
html[data-theme='dark'] .tab {
  background: #111827;
  color: #e5e7eb;
  border-color: #243244;
}
html[data-theme='dark'] .coins-table th,
html[data-theme='dark'] .coins-table td { border-bottom-color: #243244; }
html[data-theme='dark'] .lock-pill.unlocked { background: #374151; border-color: #4b5563; color: #f3f4f6; }
html[data-theme='dark'] .lock-pill.locked { background: #d4af37; border-color: #b38f1d; color: #111827; }
.role-author .panel table td, .role-author .panel table th { font-size: .88rem; }
.income-topbar { display: flex; align-items: center; justify-content: space-between; }
.income-actions { display: flex; gap: 8px; }
.panel.full-width { grid-column: 1 / -1; }

.modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(2, 6, 23, .55);
  z-index: 1200;
  padding: 14px;
}
.modal.open { display: flex; }
.modal-card {
  width: min(700px, 96vw);
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
}
.modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }

@media (max-width: 860px) {
  .form-grid { grid-template-columns: 1fr; }
  .coin-form-compact { grid-template-columns: 1fr; max-width: 100%; }
}

@media (max-width: 720px) {
  .container { width: min(100%, 96%); }
  .site-header .row {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "brand tools"
      "nav nav";
    gap: 8px;
    padding: 6px 0;
    align-items: center;
  }
  .brand { grid-area: brand; }
  .header-tools { grid-area: tools; justify-self: end; }
  .site-header { overflow: visible; }
  .nav-toggle { display: inline-flex; }
  .brand { gap: 8px; min-width: 0; }
  .brand-logo { width: 44px; height: 44px; flex: 0 0 auto; }
  .brand-text { min-width: 0; }
  .brand-text strong {
    font-size: clamp(1.15rem, 6.8vw, 1.45rem);
    line-height: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .brand-text small {
    font-size: .7rem;
    color: #d7e9e6;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .top-nav {
    grid-area: nav;
    display: none;
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    padding: 10px;
    background: var(--nav-bg);
    border: 1px solid var(--border);
    border-radius: 10px;
  }
  .site-header.nav-open .top-nav {
    display: flex;
  }
  .top-nav a,
  .top-nav form,
  .top-nav .inline,
  .top-nav button {
    width: 100%;
  }
  .top-nav a {
    display: block;
    padding: 10px 12px;
    font-size: .95rem;
    border: 1px solid var(--border);
    background: rgba(255,255,255,.35);
  }
  .top-nav form { margin: 0; }
  .top-nav button {
    display: block;
    padding: 10px 12px;
    border-radius: 8px;
    font-size: .95rem;
  }
  main { padding: 14px 0 96px; }
  .hero, .card, .dashboard { padding: 14px; border-radius: 14px; }
  .grid { grid-template-columns: 1fr; gap: 10px; }
  .reader-drawer { box-shadow: 0 -8px 20px rgba(0,0,0,.12); }
  .reader-drawer {
    min-height: 56px;
    grid-template-columns: repeat(4, minmax(0,1fr));
  }
  .reader-drawer a {
    padding: 7px 2px;
  }
  .reader-drawer .rd-ic { font-size: 1rem; }
  .reader-drawer .rd-tx { font-size: .75rem; }
  .has-reader-drawer main { padding-bottom: 112px; }
}
