:root {
  color-scheme: dark;
  --bg: #0f0f12;
  --card: #1a1a20;
  --accent: #2d6cdf;
  --text: #f0f0f2;
  --muted: #9a9aa4;
  --danger: #d23b3b;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  min-height: 100vh;
  padding-bottom: env(safe-area-inset-bottom);
}
.app {
  max-width: 480px;
  margin: 0 auto;
  padding: 20px 16px 60px;
}
header.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
header.top h1 { font-size: 18px; margin: 0; }
header.top button {
  background: none; border: none; color: var(--muted); font-size: 20px;
}
.url-form { display: flex; gap: 8px; margin-bottom: 12px; }
.url-form input {
  flex: 1;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid #2a2a32;
  background: var(--card);
  color: var(--text);
  font-size: 16px;
}
.url-form button {
  padding: 12px 18px;
  border-radius: 10px;
  border: none;
  background: var(--accent);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
}
.resume-btn {
  display: block;
  width: 100%;
  padding: 12px;
  margin-bottom: 20px;
  border-radius: 10px;
  border: 1px dashed #34343e;
  background: transparent;
  color: var(--text);
  font-size: 14px;
  text-align: left;
}
.resume-btn .url { color: var(--muted); display: block; font-size: 12px; margin-top: 2px; }

section { margin-bottom: 24px; }
section h2 {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin: 0 0 8px;
}
.history-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.history-list li {
  display: flex; align-items: center; gap: 8px;
  background: var(--card);
  border-radius: 10px;
  padding: 10px 12px;
}
.history-list li .open-btn {
  flex: 1; text-align: left; background: none; border: none; color: var(--text);
  font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.history-list li .del-btn { background: none; border: none; color: var(--muted); font-size: 16px; padding: 4px 6px; }
.history-empty { color: var(--muted); font-size: 13px; }
.clear-history {
  margin-top: 10px; background: none; border: none; color: var(--danger); font-size: 13px;
}

.settings-panel {
  background: var(--card);
  border-radius: 12px;
  padding: 16px;
  display: none;
}
.settings-panel.open { display: block; }
.settings-panel .row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 0; border-bottom: 1px solid #25252d;
}
.settings-panel .row:last-of-type { border-bottom: none; }
.settings-panel label { font-size: 14px; }
.settings-panel .hint { font-size: 12px; color: var(--muted); display: block; margin-top: 2px; }
.settings-panel textarea {
  width: 100%; min-height: 70px; margin-top: 6px; border-radius: 8px;
  border: 1px solid #2a2a32; background: #111115; color: var(--text); padding: 8px; font-size: 13px;
}
.settings-panel .save-btn {
  width: 100%; margin-top: 14px; padding: 12px; border-radius: 10px; border: none;
  background: var(--accent); color: #fff; font-weight: 600;
}
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: #232330; color: #fff; padding: 10px 16px; border-radius: 10px;
  font-size: 13px; opacity: 0; transition: opacity .2s; pointer-events: none;
}
.toast.show { opacity: 1; }

input[type="checkbox"] { width: 20px; height: 20px; accent-color: var(--accent); }

.login-wrap {
  display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 16px;
}
.login-card {
  background: var(--card); border-radius: 14px; padding: 28px; width: 100%; max-width: 360px;
}
.login-card h1 { font-size: 18px; margin-top: 0; }
.login-card input {
  width: 100%; padding: 12px; border-radius: 10px; border: 1px solid #2a2a32;
  background: #111115; color: var(--text); font-size: 16px; margin: 10px 0;
}
.login-card button {
  width: 100%; padding: 12px; border-radius: 10px; border: none;
  background: var(--accent); color: #fff; font-weight: 600;
}
.login-card .error { color: var(--danger); font-size: 13px; min-height: 18px; }
