/* ===== Skill Saver — Juicy Orange Theme v3 ===== */

:root {
  /* Core palette — vibrant, juicy */
  --bg: #fff8f2;
  --bg-card: #ffffff;
  --bg-hover: #fff0e0;
  --bg-input: #fffaf5;
  --border: #f5c89a;
  --border-focus: #ff6b1a;
  --text: #1a0e06;
  --text-secondary: #7a5a3e;
  --text-muted: #b8956e;

  /* Accent — juicy tangerine */
  --accent: #ff6b1a;
  --accent-hover: #e85d10;
  --accent-light: #ff8c4a;
  --accent-glow: rgba(255, 107, 26, 0.4);
  --accent-subtle: rgba(255, 107, 26, 0.06);

  /* Semantic */
  --danger: #dc2626;
  --danger-hover: #b91c1c;
  --danger-glow: rgba(220, 38, 38, 0.3);
  --success: #16a34a;
  --success-glow: rgba(22, 163, 74, 0.25);
  --warning: #ea580c;

  /* Layout */
  --radius: 12px;
  --radius-lg: 16px;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --mono: 'JetBrains Mono', 'Fira Code', monospace;

  /* Shadows & Glow */
  --shadow: 0 2px 16px rgba(120, 80, 40, 0.07);
  --shadow-lg: 0 12px 40px rgba(120, 80, 40, 0.12);
  --glow: 0 0 24px var(--accent-glow), 0 0 60px rgba(255, 107, 26, 0.12);
  --glow-sm: 0 0 12px var(--accent-glow);
}

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

html { font-size: 15px; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

.hidden { display: none !important; }

/* ===== Scrollbar ===== */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--bg); border-radius: 4px; }
::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--accent), var(--accent-hover));
  border-radius: 4px;
  border: 2px solid var(--bg);
}
::-webkit-scrollbar-thumb:hover { background: var(--accent-hover); }
* { scrollbar-width: thin; scrollbar-color: var(--accent) var(--bg); }

/* ===== Header ===== */
header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(20px) saturate(1.5);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 16px rgba(255, 107, 26, 0.06);
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  height: 60px;
  display: flex;
  align-items: center;
  gap: 20px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  text-decoration: none;
  font-weight: 800;
  font-size: 1.15rem;
  white-space: nowrap;
}
.logo svg { color: var(--accent); filter: drop-shadow(0 0 8px var(--accent-glow)); }

/* ===== Search ===== */
.header-search {
  flex: 1;
  max-width: 480px;
  position: relative;
}

.header-search input {
  width: 100%;
  height: 42px;
  background: var(--bg-input);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  padding: 0 40px 0 16px;
  font-size: 0.92rem;
  font-family: var(--font);
  outline: none;
  transition: all 0.2s ease;
}
.header-search input:focus {
  border-color: var(--accent);
  box-shadow: var(--glow-sm);
  background: #fff;
}
.header-search input::placeholder { color: var(--text-muted); }

.search-clear {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
  padding: 0;
}
.search-clear:hover { background: var(--accent-subtle); color: var(--accent); }
.search-clear.visible { display: flex; }

.search-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin-top: 6px;
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  max-height: 400px;
  overflow-y: auto;
  z-index: 200;
}

.search-item {
  display: block;
  padding: 12px 16px;
  text-decoration: none;
  color: var(--text);
  border-bottom: 1px solid rgba(245, 200, 154, 0.4);
  transition: background 0.15s;
}
.search-item:last-child { border-bottom: none; }
.search-item:hover { background: var(--accent-subtle); }
.search-item .si-title { font-weight: 700; font-size: 0.92rem; }
.search-item .si-path { font-size: 0.78rem; color: var(--text-secondary); }
.search-item .si-snippet { font-size: 0.78rem; color: var(--text-muted); margin-top: 2px; }
.search-item mark { background: rgba(255, 107, 26, 0.15); color: var(--accent); border-radius: 2px; font-weight: 700; }

/* ===== Nav ===== */
.header-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius);
  border: none;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
}
.nav-btn:hover {
  background: var(--accent-subtle);
  color: var(--accent);
  box-shadow: var(--glow-sm);
}

/* ===== Main ===== */
main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 24px;
}

/* ===== Page header ===== */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  gap: 16px;
  flex-wrap: wrap;
}
.page-header h1 { font-size: 1.6rem; font-weight: 800; }

.breadcrumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 8px;
}
.breadcrumb a,
.breadcrumb span {
  min-width: 0;
  overflow-wrap: anywhere;
}
.breadcrumb a { color: var(--accent); text-decoration: none; font-weight: 600; }
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb .sep { color: var(--text-muted); }

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  border-radius: var(--radius);
  border: 2px solid var(--border);
  background: var(--bg-card);
  color: var(--text);
  font-size: 0.92rem;
  font-family: var(--font);
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  text-decoration: none;
}
.btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: var(--glow-sm);
  transform: translateY(-1px);
}
.btn:active { transform: translateY(0); box-shadow: none; }

.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-hover));
  border-color: var(--accent);
  color: #fff;
  box-shadow: 0 4px 16px var(--accent-glow);
}
.btn-primary:hover {
  background: linear-gradient(135deg, var(--accent-light), var(--accent));
  border-color: var(--accent-light);
  color: #fff;
  box-shadow: var(--glow);
  transform: translateY(-2px);
}
.btn-primary:active { transform: translateY(0); box-shadow: 0 2px 6px var(--accent-glow); }

.btn-danger {
  background: transparent;
  border-color: var(--danger);
  color: var(--danger);
}
.btn-danger:hover {
  background: var(--danger);
  color: #fff;
  box-shadow: 0 0 14px var(--danger-glow);
  border-color: var(--danger);
}

.btn-sm { padding: 7px 14px; font-size: 0.84rem; }
.btn-icon {
  width: 32px;
  height: 32px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  border: 1.5px solid var(--border);
  background: var(--bg-card);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s;
  flex-shrink: 0;
}
.btn-icon:hover { color: var(--danger); border-color: var(--danger); background: rgba(220,38,38,0.05); }

.btn-group { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* ===== Cards ===== */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}

.card {
  background: var(--bg-card);
  border: 2px solid rgba(245, 200, 154, 0.4);
  border-radius: var(--radius-lg);
  padding: 20px 22px;
  transition: all 0.25s ease;
  text-decoration: none;
  color: var(--text);
  display: flex;
  flex-direction: column;
  position: relative;
}
.card:hover {
  border-color: var(--accent);
  transform: translateY(-3px);
  box-shadow: var(--glow), var(--shadow-lg);
}
.card-body { flex: 1; cursor: pointer; text-decoration: none; color: inherit; display: block; }
.card-body:hover { color: inherit; }
.card-title { font-weight: 800; font-size: 1.05rem; margin-bottom: 4px; }
.card-meta { font-size: 0.8rem; color: var(--text-secondary); }
.card-desc { font-size: 0.85rem; color: var(--text-muted); margin-top: 6px; }
.card-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(245, 200, 154, 0.3);
}

/* ===== Instruction cards ===== */
.inst-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--bg-card);
  border: 2px solid rgba(245, 200, 154, 0.4);
  border-radius: var(--radius);
  padding: 14px 18px;
  text-decoration: none;
  color: var(--text);
  transition: all 0.2s ease;
}
.inst-card:hover {
  border-color: var(--accent);
  background: var(--accent-subtle);
  box-shadow: var(--glow-sm);
}
.inst-card .inst-icon { color: var(--accent); flex-shrink: 0; text-decoration: none; }
.inst-card .inst-info { flex: 1; min-width: 0; text-decoration: none; color: inherit; }
.inst-card .inst-info:hover { color: inherit; }
.inst-card .inst-title { font-weight: 700; font-size: 0.96rem; }
.inst-card .inst-meta { font-size: 0.78rem; color: var(--text-secondary); }
.inst-card .inst-ro {
  font-size: 0.7rem;
  color: var(--warning);
  background: rgba(255, 107, 26, 0.08);
  padding: 2px 8px;
  border-radius: 6px;
  font-weight: 700;
}
.inst-card .inst-actions { display: flex; gap: 6px; flex-shrink: 0; }
.inst-list { display: flex; flex-direction: column; gap: 8px; }

/* ===== Controls & Select ===== */
.controls {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.controls select,
.controls .btn,
.controls input[type="text"] {
  height: 42px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.92rem;
  font-weight: 600;
  box-sizing: border-box;
}

.controls .btn {
  padding: 0 16px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.controls .btn-sm {
  padding: 0 14px;
  font-size: 0.88rem;
}

select {
  appearance: none;
  -webkit-appearance: none;
  background: var(--bg-card) url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%23ff6b1a' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 14px center;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  padding: 10px 40px 10px 16px;
  font-size: 0.92rem;
  font-family: var(--font);
  font-weight: 600;
  outline: none;
  cursor: pointer;
  transition: all 0.2s ease;
  height: 42px;
  min-width: 160px;
}
select:focus { border-color: var(--accent); box-shadow: var(--glow-sm); }
select:hover { border-color: var(--accent-light); }
select option {
  background: var(--bg-card);
  color: var(--text);
  padding: 10px 16px;
  font-family: var(--font);
  font-size: 0.92rem;
  font-weight: 500;
  border-bottom: 1px solid rgba(245, 200, 154, 0.3);
}
select option:checked {
  background: linear-gradient(135deg, var(--accent), var(--accent-hover));
  color: #fff;
  font-weight: 700;
}
select option:hover {
  background: var(--accent-subtle);
  color: var(--accent);
}

/* File input — styled */
input[type="file"] {
  display: block;
  width: 100%;
  padding: 12px 16px;
  background: var(--bg-card);
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 0.92rem;
  font-family: var(--font);
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}
input[type="file"]:hover {
  border-color: var(--accent);
  background: var(--accent-subtle);
}
input[type="file"]::file-selector-button {
  background: linear-gradient(135deg, var(--accent), var(--accent-hover));
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 8px 16px;
  font-size: 0.88rem;
  font-family: var(--font);
  font-weight: 700;
  cursor: pointer;
  margin-right: 12px;
  transition: all 0.2s;
}
input[type="file"]::file-selector-button:hover {
  background: linear-gradient(135deg, var(--accent-light), var(--accent));
  box-shadow: var(--glow-sm);
}

input[type="text"],
input[type="password"],
input[type="email"],
textarea {
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  padding: 12px 16px;
  font-size: 0.95rem;
  font-family: var(--font);
  outline: none;
  transition: all 0.2s ease;
  width: 100%;
}
input[type="text"]:focus,
input[type="password"]:focus,
input[type="email"]:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: var(--glow-sm);
  background: #fff;
}
input::placeholder, textarea::placeholder { color: var(--text-muted); }

textarea {
  font-family: var(--mono);
  font-size: 0.88rem;
  line-height: 1.6;
  resize: vertical;
  min-height: 300px;
}

label { font-size: 0.88rem; color: var(--text-secondary); display: block; margin-bottom: 6px; font-weight: 600; }

.form-group { margin-bottom: 20px; }

/* ===== Toggle ===== */
.toggle-wrap { display: flex; align-items: center; gap: 10px; }
.toggle { position: relative; width: 44px; height: 24px; }
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle .slider {
  position: absolute;
  inset: 0;
  background: var(--border);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.25s ease;
}
.toggle .slider::before {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  left: 3px;
  top: 3px;
  background: #fff;
  border-radius: 50%;
  transition: all 0.25s ease;
  box-shadow: 0 1px 4px rgba(0,0,0,0.15);
}
.toggle input:checked + .slider {
  background: linear-gradient(135deg, var(--accent), var(--accent-hover));
  box-shadow: var(--glow-sm);
}
.toggle input:checked + .slider::before { transform: translateX(20px); }

/* ===== Range slider ===== */
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  outline: none;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 22px;
  height: 22px;
  background: linear-gradient(135deg, var(--accent), var(--accent-hover));
  border-radius: 50%;
  cursor: pointer;
  box-shadow: var(--glow-sm);
  border: 2px solid #fff;
}
input[type="range"]::-moz-range-thumb {
  width: 22px;
  height: 22px;
  background: linear-gradient(135deg, var(--accent), var(--accent-hover));
  border-radius: 50%;
  cursor: pointer;
  box-shadow: var(--glow-sm);
  border: 2px solid #fff;
}

/* ===== Markdown ===== */
.instruction-container {
  background: var(--bg-card);
  border: 2px solid rgba(245, 200, 154, 0.4);
  border-radius: var(--radius-lg);
  padding: 28px 32px;
  transition: all 0.2s;
  overflow: hidden;
}
.instruction-container:hover { box-shadow: var(--glow-sm); }
.instruction-container .page-header { margin-bottom: 20px; }
.instruction-container .md-body { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border); }
.instruction-title-block {
  flex: 1 1 320px;
  min-width: 0;
}
.instruction-title-block h1 {
  overflow-wrap: anywhere;
}
.instruction-meta {
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin-top: 4px;
  overflow-wrap: anywhere;
}

.md-body { font-size: 0.95rem; line-height: 1.75; }
.md-body h1 { font-size: 1.6rem; margin: 24px 0 12px; font-weight: 800; }
.md-body h2 { font-size: 1.3rem; margin: 20px 0 10px; font-weight: 700; border-bottom: 1px solid var(--border); padding-bottom: 6px; }
.md-body h3 { font-size: 1.1rem; margin: 16px 0 8px; font-weight: 700; }
.md-body p { margin: 8px 0; }
.md-body ul, .md-body ol { margin: 8px 0; padding-left: 24px; }
.md-body li { margin: 4px 0; }
.md-body code { font-family: var(--mono); font-size: 0.88em; background: var(--accent-subtle); padding: 2px 6px; border-radius: 4px; color: var(--accent); }
.md-body pre { background: #1a0e06; border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; overflow-x: auto; margin: 12px 0; }
.md-body pre code { background: none; padding: 0; color: #fde8d4; }
.md-body blockquote { border-left: 3px solid var(--accent); color: var(--text-secondary); margin: 12px 0; background: var(--accent-subtle); border-radius: 0 var(--radius) var(--radius) 0; padding: 12px 16px; }
.md-body table { width: 100%; border-collapse: collapse; margin: 12px 0; font-size: 0.9rem; }
.md-body th, .md-body td { border: 1px solid var(--border); padding: 8px 12px; text-align: left; }
.md-body th { background: var(--accent-subtle); font-weight: 700; }
.md-body a { color: var(--accent); text-decoration: none; font-weight: 600; }
.md-body a:hover { text-decoration: underline; }
.md-body img { max-width: 100%; border-radius: var(--radius); }
.md-body hr { border: none; border-top: 1px solid var(--border); margin: 20px 0; }
.md-body,
.md-body * {
  max-width: 100%;
  overflow-wrap: anywhere;
}

/* ===== Pagination ===== */
.pagination { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 24px; }
.pagination button {
  padding: 7px 14px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
  color: var(--text);
  cursor: pointer;
  font-size: 0.86rem;
  font-weight: 600;
  transition: all 0.2s;
}
.pagination button:hover { border-color: var(--accent); color: var(--accent); box-shadow: var(--glow-sm); }
.pagination button.active {
  background: linear-gradient(135deg, var(--accent), var(--accent-hover));
  border-color: var(--accent);
  color: #fff;
  box-shadow: var(--glow-sm);
}
.pagination button:disabled { opacity: 0.4; cursor: default; box-shadow: none; }
.pagination .page-info { font-size: 0.85rem; color: var(--text-secondary); }

/* ===== Empty ===== */
.empty { text-align: center; padding: 60px 20px; color: var(--text-muted); }
.empty svg { margin-bottom: 12px; opacity: 0.3; }
.empty p { font-size: 0.95rem; }

/* ===== Modal — large, spacious ===== */
#modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(26, 14, 6, 0.25);
  backdrop-filter: blur(12px);
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px;
}

#modal-content {
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: 20px;
  padding: 36px 40px;
  max-width: 600px;
  width: 100%;
  min-width: 480px;
  box-shadow: 0 20px 60px rgba(120, 80, 40, 0.15), 0 0 50px var(--accent-glow);
  animation: modalIn 0.25s ease-out;
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.92) translateY(12px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-title { font-size: 1.3rem; font-weight: 800; margin-bottom: 24px; color: var(--text); }
.modal-actions { display: flex; justify-content: flex-end; gap: 12px; margin-top: 28px; }

/* ===== Login ===== */
.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  position: fixed;
  inset: 0;
  width: 100vw;
  min-height: 100vh;
  padding: 24px;
  background: var(--bg);
  background-image: url('https://mrxodfhuudvvbwmuhaue.supabase.co/storage/v1/object/public/public-images/misc/ChatGPT_Image_18_____2026_____10_51_52_1779090728707.png');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-attachment: fixed;
  overflow: auto;
}
.login-page > * {
  position: relative;
}
.login-box {
  background: rgba(255, 255, 255, 0.68);
  border: 1px solid rgba(255, 255, 255, 0.58);
  border-radius: 20px;
  padding: 44px 40px;
  width: 100%;
  max-width: 440px;
  box-shadow: 0 24px 70px rgba(120, 80, 40, 0.24), 0 0 70px rgba(255, 140, 66, 0.22);
  backdrop-filter: blur(18px) saturate(1.15);
  -webkit-backdrop-filter: blur(18px) saturate(1.15);
}
.login-box h1 { font-size: 1.4rem; text-align: center; margin-bottom: 32px; }
.login-box .logo-center {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 32px;
  color: var(--text);
  font-size: 1.3rem;
  font-weight: 800;
}
.login-box .logo-center svg { color: var(--accent); filter: drop-shadow(0 0 10px var(--accent-glow)); }
.login-box .form-group { margin-bottom: 20px; }
.login-box input[type="text"],
.login-box input[type="password"] {
  height: 48px;
  font-size: 1rem;
  padding: 0 16px;
}
.password-field {
  position: relative;
}
.password-field input[type="password"],
.password-field input[type="text"] {
  width: 100%;
  padding-right: 52px;
}
.password-toggle {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
}
.password-toggle:hover {
  background: rgba(255, 140, 66, 0.12);
  color: var(--accent);
}
.login-box .btn-primary {
  width: 100%;
  justify-content: center;
  height: 48px;
  font-size: 1rem;
  margin-top: 4px;
}
.login-link {
  display: block;
  width: 100%;
  margin-top: 16px;
  border: 0;
  background: transparent;
  color: var(--accent);
  font: inherit;
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
  text-align: center;
}
.login-link:hover {
  color: var(--accent-dark);
}
.login-error {
  background: rgba(220, 38, 38, 0.06);
  border: 2px solid rgba(220, 38, 38, 0.2);
  color: var(--danger);
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: 0.88rem;
  margin-bottom: 16px;
}
.login-error.login-info {
  background: rgba(34, 197, 94, 0.08);
  border-color: rgba(34, 197, 94, 0.28);
  color: #15803d;
}

/* ===== Settings ===== */
.settings-section {
  background: var(--bg-card);
  border: 2px solid rgba(245, 200, 154, 0.4);
  border-radius: var(--radius-lg);
  padding: 28px 32px;
  margin-bottom: 18px;
  transition: all 0.2s;
}
.settings-section:hover { box-shadow: var(--glow-sm); }
.settings-section h2 { font-size: 1.15rem; font-weight: 800; margin-bottom: 20px; color: var(--text); }
.api-key-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid rgba(245, 200, 154, 0.3);
}
.api-key-item:last-child { border-bottom: none; }
.api-key-item.revoked { opacity: 0.5; }
.api-key-item.revoked .api-key-label { text-decoration: line-through; color: var(--text-muted); }
.api-key-label { font-weight: 700; }
.api-key-date { font-size: 0.8rem; color: var(--text-secondary); }
.api-key-main {
  flex: 1;
  min-width: 0;
}
.api-key-actions {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-shrink: 0;
}
.token-display {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #1a0e06;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  font-family: var(--mono);
  font-size: 0.88rem;
  word-break: break-all;
  margin: 16px 0;
  color: #fde8d4;
  position: relative;
  overflow: hidden;
}
.token-value {
  flex: 1;
  min-width: 0;
  font-family: var(--mono);
  font-size: 0.82rem;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.token-copy-btn {
  position: static;
  flex-shrink: 0;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  color: #fde8d4;
  border-radius: 8px;
  padding: 6px 12px;
  cursor: pointer;
  font-size: 0.78rem;
  font-family: var(--font);
  font-weight: 600;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 4px;
}
.token-copy-btn:hover { background: rgba(255,255,255,0.2); }
.key-warning {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 107, 26, 0.08);
  border: 2px solid rgba(255, 107, 26, 0.25);
  border-radius: var(--radius);
  padding: 12px 16px;
  font-size: 0.88rem;
  color: var(--accent-hover);
  margin-bottom: 16px;
}
.key-warning svg { flex-shrink: 0; color: var(--accent); }
.s3-status { display: flex; align-items: center; gap: 8px; font-size: 0.92rem; }
.s3-dot { width: 10px; height: 10px; border-radius: 50%; }
.s3-dot.ok { background: var(--success); box-shadow: 0 0 8px var(--success-glow); }
.s3-dot.err { background: var(--danger); box-shadow: 0 0 8px var(--danger-glow); }

/* ===== Responsive ===== */
@media (max-width: 640px) {
  html { font-size: 14px; }
  .header-inner { padding: 0 10px; gap: 10px; }
  .logo { font-size: 1rem; }
  .logo svg { width: 28px; height: 28px; }
  .header-search { max-width: 180px; flex: 1 1 120px; }
  .header-search input { height: 38px; padding-left: 12px; font-size: 0.86rem; }
  .nav-btn { width: 36px; height: 36px; }
  main { padding: 14px 10px; max-width: 100%; overflow-x: hidden; }
  .page-header { flex-direction: column; align-items: flex-start; }
  .page-header h1 { font-size: 1.35rem; line-height: 1.25; }
  .card-grid { grid-template-columns: 1fr; }
  #modal-content { min-width: unset; padding: 28px 24px; }
  .login-box { padding: 32px 24px; }
  .instruction-container,
  .settings-section {
    padding: 22px 18px;
    border-radius: 14px;
  }
  .instruction-container .page-header { gap: 18px; }
  .instruction-title-block { flex-basis: auto; width: 100%; }
  .instruction-meta { font-size: 0.9rem; }
  .btn-group { width: 100%; }
  .btn-group .btn { flex: 1 1 auto; justify-content: center; }
  textarea {
    min-height: 460px;
    font-size: 0.86rem;
    line-height: 1.7;
  }
  .api-key-item {
    flex-direction: column;
    align-items: stretch;
  }
  .api-key-actions {
    justify-content: flex-start;
    flex-wrap: wrap;
  }
  .token-display {
    flex-direction: column;
    align-items: stretch;
    padding: 14px;
  }
  .token-copy-btn {
    position: static;
    width: 100%;
    justify-content: center;
  }
  .md-body { font-size: 1rem; }
  .md-body h1 { font-size: 1.35rem; line-height: 1.25; }
  .md-body h2 { font-size: 1.18rem; line-height: 1.3; }
}
