:root {
  --bg: #081122;
  --bg-soft: rgba(18, 28, 48, 0.84);
  --panel: rgba(11, 20, 35, 0.78);
  --panel-border: rgba(255, 255, 255, 0.08);
  --text: #f5f7fb;
  --muted: #a5b1c7;
  --primary: #7c9cff;
  --primary-strong: #5d83ff;
  --success: #32d296;
  --danger: #ff7a90;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
html {
  background:
    radial-gradient(circle at top left, rgba(124, 156, 255, 0.22), transparent 32%),
    radial-gradient(circle at right, rgba(50, 210, 150, 0.18), transparent 22%),
    linear-gradient(160deg, #07101d 0%, #0b1320 55%, #121f33 100%);
  background-color: #0b1320;
}
body {
  font-family: Inter, system-ui, sans-serif;
  color: var(--text);
  background: transparent;
  min-height: 100dvh;
  -webkit-overflow-scrolling: touch;
}

a { color: inherit; text-decoration: none; }
code { font-family: ui-monospace, monospace; }
.shell { width: min(1180px, calc(100% - 32px)); margin: 0 auto; padding: 28px 0 56px; }
.topbar {
  position: relative; z-index: 3000; isolation: isolate; overflow: visible;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  margin-bottom: 28px; padding: 18px 22px; border: 1px solid var(--panel-border);
  background: rgba(10, 18, 33, 0.72); backdrop-filter: blur(14px); border-radius: 24px;
  box-shadow: var(--shadow);
}
.brand { display: flex; align-items: center; gap: 12px; font-weight: 800; }
.brand-mark {
  display: inline-grid; place-items: center; width: 42px; height: 42px; border-radius: 14px;
  background: linear-gradient(135deg, var(--primary), #95a9ff);
}
.nav { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.nav-user, .pill, .badge { font-size: 0.9rem; }
.hero { padding: 32px 0 20px; }
.two-columns { display: grid; grid-template-columns: 1.3fr 0.9fr; gap: 24px; }
.card {
  background: var(--panel); border: 1px solid var(--panel-border); border-radius: 28px;
  box-shadow: var(--shadow); backdrop-filter: blur(12px); padding: 28px;
}
.feature-card { align-self: start; }
.lead, .muted { color: var(--muted); }
h1 { font-size: clamp(2.3rem, 5vw, 4.3rem); line-height: 1.02; margin: 16px 0; max-width: 12ch; }
h2 { margin-top: 0; font-size: 1.4rem; }
.cta-row, .result-row, .inline-fields { display: flex; gap: 12px; flex-wrap: wrap; }
.inline-fields { align-items: flex-end; }
.section-card { margin-top: 8px; }
.steps { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.detailed-steps .step { min-height: 112px; }
.step, .history-item {
  display: flex; gap: 12px; align-items: flex-start; padding: 16px; border-radius: 18px;
  background: rgba(255, 255, 255, 0.03); border: 1px solid rgba(255,255,255,0.05);
}
.primary-btn, .secondary-btn, .ghost-btn {
  border: 0; cursor: pointer; border-radius: 16px; padding: 14px 18px; font-weight: 700;
  transition: 180ms ease; font-size: 0.96rem;
}
.primary-btn { background: linear-gradient(135deg, var(--primary), var(--primary-strong)); color: white; }
.secondary-btn, .ghost-btn { background: rgba(255,255,255,0.06); color: var(--text); border: 1px solid rgba(255,255,255,0.08); }
.primary-btn:hover, .secondary-btn:hover, .ghost-btn:hover { transform: translateY(-1px); }
.field { display: grid; gap: 8px; margin: 18px 0; }
.field span { font-weight: 600; }
input, textarea, select {
  width: 100%; background: rgba(255, 255, 255, 0.05); color: var(--text);
  border: 1px solid rgba(255,255,255,0.08); border-radius: 16px; padding: 14px 16px;
  font: inherit; outline: none;
}
textarea { resize: vertical; min-height: 160px; }
input:focus, textarea:focus, select:focus { border-color: rgba(124, 156, 255, 0.8); box-shadow: 0 0 0 4px rgba(124, 156, 255, 0.12); }
.pill {
  display: inline-flex; align-items: center; gap: 8px; width: fit-content; padding: 8px 12px;
  border-radius: 999px; background: rgba(124, 156, 255, 0.14); color: #dbe4ff; border: 1px solid rgba(124,156,255,0.2);
}
.flash-stack { display: grid; gap: 10px; margin-bottom: 16px; }
.flash { padding: 14px 16px; border-radius: 16px; }
.flash-success { background: rgba(50, 210, 150, 0.12); border: 1px solid rgba(50,210,150,0.2); }
.flash-error { background: rgba(255, 122, 144, 0.12); border: 1px solid rgba(255,122,144,0.2); }
.centered { display: grid; place-items: center; min-height: calc(100vh - 160px); }
.auth-card, .reveal-card { width: min(100%, 520px); }
.auth-wrap, .reveal-wrap { padding: 20px 0; }
.full-width { width: 100%; }
.dashboard-grid { align-items: start; }
.section-heading { display: flex; justify-content: space-between; gap: 16px; align-items: center; }
.status-dot { width: 14px; height: 14px; border-radius: 999px; background: var(--success); box-shadow: 0 0 0 8px rgba(50, 210, 150, 0.13); }
.result-card, .secret-box {
  margin-top: 18px; border-radius: 20px; padding: 16px; background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.06);
}
.secret-box { font-family: ui-monospace, monospace; font-size: 1rem; white-space: pre-wrap; word-break: break-word; }
.secret-box.loading { color: var(--muted); }
.secret-box.success { border-color: rgba(50, 210, 150, 0.34); }
.secret-box.error { border-color: rgba(255, 122, 144, 0.34); }
.hidden { display: none; }
.notice, .small, .top-gap { margin-top: 14px; }
.history-list { display: grid; gap: 12px; }
.history-item { justify-content: space-between; }
.history-item > div:first-child { min-width: 0; }
.history-item strong { display: block; overflow-wrap: anywhere; word-break: break-word; }
.badge { display: inline-flex; padding: 8px 10px; border-radius: 999px; }
.badge-neutral { background: rgba(124, 156, 255, 0.12); color: #dbe4ff; }
.badge-danger { background: rgba(255, 122, 144, 0.12); color: #ffd8df; }
.align-end { align-self: end; }
.generate-btn { margin-bottom: 18px; }
.ttl-row { gap: 16px; }
.ttl-field { min-width: 180px; flex: 0 0 180px; }
.custom-ttl { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.custom-number-field { min-width: 120px; width: 120px; }
.custom-unit-field { min-width: 150px; width: 150px; }
@media (max-width: 900px) {
  .two-columns, .steps { grid-template-columns: 1fr; }
  h1 { max-width: none; }
  .topbar { padding: 16px; }
  .shell { width: min(100% - 20px, 1180px); }
}


.hero-centered {
  max-width: 1180px;
  margin: 0 auto 18px;
  text-align: center;
}
.hero-wide { padding-top: 42px; }
.hero-centered h1 {
  max-width: 19ch;
  margin-left: auto;
  margin-right: auto;
}
.hero-centered .lead {
  max-width: 900px;
  margin: 0 auto;
  font-size: 1.18rem;
}
.hero-centered .cta-row {
  justify-content: center;
  margin-top: 22px;
}
.feature-grid {
  margin-top: 28px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}
.feature-tile {
  padding: 18px;
  border-radius: 20px;
  background: rgba(255,255,255,0.035);
  border: 1px solid rgba(255,255,255,0.06);
  text-align: left;
}
.login-form label { display: grid; gap: 8px; margin-top: 16px; }
.login-form .primary-btn { margin-top: 24px; }
.reveal-card.wide { width: min(100%, 680px); }
.reveal-card h1.compact-title {
  font-size: clamp(2.6rem, 4.2vw, 4rem);
  max-width: none;
}
.center-note { text-align: center; }
@media (max-width: 900px) {
  .feature-grid { grid-template-columns: 1fr 1fr; }
  .hero-centered .lead { font-size: 1.05rem; }
}
@media (max-width: 640px) {
  .feature-grid { grid-template-columns: 1fr; }
  .reveal-card.wide { width: min(100%, 560px); }
}


.generate-btn-wrap {
  display: flex;
  align-items: flex-end;
}
.history-actions {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
  gap: 10px;
}
.icon-btn {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.05);
  color: var(--text);
  cursor: pointer;
  display: inline-grid;
  place-items: center;
  font-size: 1rem;
  transition: 180ms ease;
}
.icon-btn:hover {
  transform: translateY(-1px);
  background: rgba(255, 122, 144, 0.12);
  border-color: rgba(255, 122, 144, 0.28);
}
.custom-ttl.hidden {
  display: none;
}

.flash { transition: opacity 220ms ease, transform 220ms ease, max-height 220ms ease, margin 220ms ease, padding 220ms ease; }
.flash-out { opacity: 0; transform: translateY(-6px); max-height: 0; margin: 0; padding-top: 0; padding-bottom: 0; overflow: hidden; }
.notif-wrap { position: relative; z-index: 4000; overflow: visible; }
.nav { position: relative; z-index: 4000; overflow: visible; }
.shell { position: relative; overflow: visible; }
.notif-btn { position: relative; min-width: 52px; display: inline-flex; align-items: center; justify-content: center; }
.notif-icon { font-size: 1rem; }
.notif-count {
  position: absolute; top: -7px; right: -7px; min-width: 20px; height: 20px; padding: 0 6px;
  border-radius: 999px; background: var(--danger); color: white; display: inline-grid; place-items: center;
  font-size: 0.72rem; font-weight: 800; border: 2px solid rgba(10, 18, 33, 0.92);
}
.notif-panel {
  position: absolute; top: calc(100% + 12px); right: 0; width: min(420px, calc(100vw - 32px));
  max-height: 460px; overflow: auto; padding: 18px; border-radius: 22px; z-index: 9999;
  background: rgba(10, 18, 33, 0.98); border: 1px solid rgba(255,255,255,0.09);
  box-shadow: 0 24px 80px rgba(0,0,0,0.5); backdrop-filter: blur(18px);
}
.notif-panel-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.notif-panel-actions { display: flex; align-items: center; justify-content: flex-end; gap: 12px; flex-wrap: wrap; }
.notif-mark-read {
  border: 0; background: transparent; color: #dbe4ff; cursor: pointer; font: inherit; font-weight: 600; padding: 0;
}
.notif-delete-all { color: #ffd8df; }
.notif-list { display: grid; gap: 10px; }
.notif-item {
  padding: 14px; border-radius: 16px; background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.06);
}
.notif-item { position: relative; padding-right: 46px; }
.notif-delete-btn {
  position: absolute; top: 10px; right: 10px; width: 28px; height: 28px; border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.08); background: rgba(255,255,255,0.04); color: var(--muted);
  cursor: pointer; display: inline-grid; place-items: center; font-size: 1rem; line-height: 1;
}
.notif-delete-btn:hover {
  color: var(--text); background: rgba(255, 122, 144, 0.12); border-color: rgba(255, 122, 144, 0.24);
}
.notif-item.is-unread { border-color: rgba(124, 156, 255, 0.28); background: rgba(124, 156, 255, 0.08); }
.notif-item p { margin: 0 0 8px; line-height: 1.4; }

.badge-success-soft { background: rgba(50, 210, 150, 0.12); color: #cbffe8; }
.small-btn { padding: 10px 12px; border-radius: 12px; font-size: 0.88rem; }
.danger-btn:hover { background: rgba(255, 122, 144, 0.12); border-color: rgba(255, 122, 144, 0.28); }
.admin-layout { padding-top: 24px; }
.admin-title { max-width: none; font-size: clamp(2rem, 4vw, 3rem); margin-bottom: 10px; }
.admin-header-row { margin-bottom: 20px; }
.admin-grid { display: grid; grid-template-columns: 0.95fr 1.4fr; gap: 22px; align-items: start; }
.admin-create-card, .admin-list-card {
  border-radius: 24px; padding: 22px; background: rgba(255,255,255,0.025); border: 1px solid rgba(255,255,255,0.06);
}
.admin-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.field-span-2 { grid-column: span 2; }
.checkbox-field { align-self: end; }
.switch-row { display: inline-flex; align-items: center; gap: 10px; }
.switch-row input { width: auto; }
.accounts-table-wrap { overflow-x: auto; }
.accounts-table { width: 100%; border-collapse: collapse; }
.accounts-table th, .accounts-table td { text-align: left; vertical-align: top; padding: 14px 10px; border-bottom: 1px solid rgba(255,255,255,0.07); }
.accounts-table th { color: var(--muted); font-size: 0.84rem; font-weight: 700; }
.table-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.table-actions form { margin: 0; }
.table-password-input { width: 170px; padding: 10px 12px; border-radius: 12px; }
.admin-edit-wrap { min-height: auto; padding-top: 18px; }
.admin-edit-card { width: min(100%, 720px); }
.admin-inline-fields { gap: 16px; }
.admin-role-field, .admin-status-field { min-width: 180px; }
.admin-meta { display: grid; gap: 6px; margin-top: 8px; }
@media (max-width: 980px) {
  .admin-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .admin-form-grid { grid-template-columns: 1fr; }
  .field-span-2 { grid-column: auto; }
  .table-password-input { width: 100%; }
}

.badge-admin { background: rgba(255, 196, 94, 0.14); color: #ffe7b0; }
.account-create-note {
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.06);
  line-height: 1.5;
}
.reset-password-form {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.password-mode-select { width: 96px; min-width: 96px; }
.table-password-input { min-width: 200px; width: 220px; }
.table-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.accounts-table td { vertical-align: middle; }


.admin-header-actions { display:flex; align-items:flex-end; justify-content:space-between; gap:16px; }
.admin-list-only { padding-top: 18px; }
.account-list-simple { display:grid; gap:14px; margin-top:16px; }
.account-row-card {
  display:grid; grid-template-columns: minmax(0,1.3fr) auto auto; gap:16px; align-items:center;
  padding:18px; border-radius:20px; background: rgba(255,255,255,0.03); border:1px solid rgba(255,255,255,0.06);
}
.account-row-main { min-width:0; }
.account-name { font-size:1.2rem; font-weight:800; margin-bottom:6px; }
.account-row-meta { display:flex; align-items:center; gap:10px; flex-wrap:wrap; justify-content:flex-start; }
.password-inline { display:flex; gap:10px; align-items:center; }
.password-inline input { flex:1; }
.admin-edit-stack { width:min(100%, 760px); display:grid; gap:18px; }
.admin-subcard h2 { margin-bottom:8px; }
.admin-danger-zone { border-color: rgba(255,122,144,0.16); }
.danger-actions-grid { display:flex; gap:12px; flex-wrap:wrap; }
@media (max-width: 900px) {
  .admin-header-actions { align-items:flex-start; flex-direction:column; }
  .account-row-card { grid-template-columns: 1fr; }
}
