:root {
  --ink: #0d1117;
  --paper: #f4f6f5;
  --cream: #e6ece9;
  --rust: #1a7a5e;
  --gold: #2a9d8f;
  --sage: #1a7a5e;
  --slate: #264653;
  --border: #b8ccc6;
  --muted: #6b7e79;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: 'DM Sans', sans-serif;
  min-height: 100vh;
}

/* ---- HEADER ---- */
header {
  border-bottom: 2px solid var(--ink);
  padding: 18px 40px;
  display: flex;
  align-items: baseline;
  gap: 16px;
  background: linear-gradient(135deg, #0d1117 60%, #0d2b24);
  color: var(--paper);
}

.logo {
  font-family: 'Playfair Display', serif;
  font-size: 28px;
  font-weight: 900;
  letter-spacing: -1px;
  color: var(--paper);
}

.logo span { color: #7ec8a4; }

.tagline {
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  color: #888;
  letter-spacing: 2px;
  text-transform: uppercase;
}

.user-controls {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
}

#user-name {
  font-family: 'DM Mono', monospace;
  font-size: 12px;
  color: #a8d5c2;
}

.role-badge {
  font-family: 'DM Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 2px;
}

.role-badge-admin {
  background: #2a4a3a;
  color: #7ec8a4;
  border: 1px solid #7ec8a4;
}

.role-badge-user {
  background: #1a2a4a;
  color: #a8c2d5;
  border: 1px solid #a8c2d5;
}

.btn-forget {
  padding: 5px 10px;
  background: transparent;
  color: #e07b54;
  border: 1px solid #e07b54;
  font-family: 'DM Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  border-radius: 2px;
  cursor: pointer;
}

/* ---- LOGIN OVERLAY ---- */
.login-overlay {
  position: fixed;
  inset: 0;
  background: rgba(13, 17, 23, 0.88);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  backdrop-filter: blur(4px);
}

.login-card {
  background: var(--paper);
  border: 2px solid var(--ink);
  padding: 48px 40px;
  width: 100%;
  max-width: 380px;
  border-radius: 2px;
}

.login-logo {
  font-family: 'Playfair Display', serif;
  font-size: 32px;
  font-weight: 900;
  letter-spacing: -1px;
  color: var(--ink);
  margin-bottom: 4px;
}

.login-logo span { color: var(--rust); }

.login-sub {
  font-family: 'DM Mono', monospace;
  font-size: 10px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 32px;
}

.login-card .form-group { margin-bottom: 16px; }

.login-card input[type="text"],
.login-card input[type="password"] {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid var(--border);
  background: #fff;
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  color: var(--ink);
  border-radius: 2px;
  outline: none;
  transition: border-color 0.2s;
}

.login-card input:focus { border-color: var(--ink); }

.login-error {
  font-family: 'DM Mono', monospace;
  font-size: 12px;
  color: #c0392b;
  min-height: 18px;
  margin-bottom: 12px;
}

/* ---- LAYOUT ---- */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 40px 24px;
}

/* ---- TABS ---- */
.tabs {
  display: flex;
  border-bottom: 2px solid var(--ink);
  margin-bottom: 36px;
  gap: 0;
  overflow-x: auto;
  overflow-y: hidden;
  flex-wrap: nowrap;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

.tabs::-webkit-scrollbar { height: 4px; }
.tabs::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

.tab {
  font-family: 'DM Mono', monospace;
  font-size: 12px;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  padding: 12px 20px;
  cursor: pointer;
  border: none;
  background: none;
  color: var(--muted);
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  transition: all 0.2s;
  position: relative;
  white-space: nowrap;
  flex-shrink: 0;
}

.tab:hover { color: var(--ink); }

.tab.active {
  color: var(--ink);
  border-bottom: 3px solid var(--rust);
  font-weight: 500;
}

/* ---- PANELS ---- */
.panel { display: none; }
.panel.active { display: block; }

/* ---- EDITOR AREA ---- */
.editor-wrap {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 28px;
  align-items: start;
}

.text-area-label {
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.word-count {
  color: var(--muted);
  font-size: 11px;
}

textarea {
  width: 100%;
  height: 320px;
  border: 1.5px solid var(--border);
  background: #fff;
  padding: 20px;
  font-family: 'DM Sans', sans-serif;
  font-size: 15px;
  line-height: 1.7;
  color: var(--ink);
  resize: vertical;
  outline: none;
  transition: border-color 0.2s;
  border-radius: 2px;
}

textarea:focus { border-color: var(--ink); }
textarea::placeholder { color: #bbb; }

/* ---- FORM INPUTS ---- */
input[type="text"], input[type="url"], select {
  padding: 11px 14px;
  border: 1.5px solid var(--border);
  background: #fff;
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  color: var(--ink);
  border-radius: 2px;
  outline: none;
  transition: border-color 0.2s;
}

input:focus, select:focus { border-color: var(--ink); }

input[type="range"] {
  flex: 1;
  accent-color: var(--ink);
}

/* ---- SECTION HEADER ---- */
.section-header {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin-bottom: 24px;
}

.section-title {
  font-family: 'Playfair Display', serif;
  font-size: 24px;
  font-weight: 700;
}

.section-sub {
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 1px;
}

/* ---- ANALYSIS PROSE ---- */
.analysis-prose {
  background: #fff;
  border: 1.5px solid var(--border);
  padding: 20px;
  border-radius: 2px;
  font-size: 14px;
  line-height: 1.8;
  color: var(--ink);
  margin-top: 16px;
  white-space: pre-wrap;
}

/* ---- SENSITIVITY SLIDER ---- */
.slider-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 10px;
}

.slider-label {
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
}

/* ---- NOTICE BANNERS ---- */
.notice {
  padding: 12px 16px;
  border-radius: 2px;
  margin-bottom: 24px;
  font-size: 13px;
  line-height: 1.6;
  border-left-width: 4px;
  border-left-style: solid;
  border-top: 1px solid;
  border-right: 1px solid;
  border-bottom: 1px solid;
}

.notice-warning {
  background: #fff8e1;
  border-color: rgba(212, 172, 13, 0.25);
  border-left-color: #d4ac0d;
  color: #5a4a0a;
}

.notice-info {
  background: #e6f0ed;
  border-color: rgba(26, 122, 94, 0.25);
  border-left-color: #1a7a5e;
  color: #1a7a5e;
  font-size: 12px;
}

.notice-teal {
  background: #e8f4f8;
  border-color: rgba(42, 157, 143, 0.25);
  border-left-color: #2a9d8f;
  color: #1a4a4a;
}

/* ---- RESPONSIVE ---- */
@media (max-width: 760px) {
  .editor-wrap { grid-template-columns: 1fr; }
  header { padding: 16px 20px; }
  .container { padding: 24px 16px; }
  .tabs { overflow-x: auto; }
  .tab { padding: 10px 18px; font-size: 11px; }
}
