:root {
  color-scheme: dark;
  --bg: #070707;
  --surface: #101010;
  --surface-soft: #151515;
  --surface-hard: #0b0b0b;
  --line: #282828;
  --text: #f4f4f4;
  --muted: #a4a4a4;
  --red: #e12b2b;
  --red-soft: rgba(225, 43, 43, 0.15);
  --shadow: 0 18px 52px rgba(0, 0, 0, 0.3);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
textarea {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

.app-shell {
  width: min(1760px, calc(100% - 24px));
  margin: 0 auto;
  padding: 18px 0;
}

.topbar {
  display: grid;
  grid-template-columns: minmax(220px, 0.55fr) minmax(520px, 1fr);
  align-items: end;
  gap: 16px;
  margin-bottom: 14px;
}

.topbar-summary {
  display: grid;
  gap: 8px;
  justify-items: end;
  align-content: end;
}

.logout-button {
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  padding: 0 12px;
}

.logout-button:hover {
  border-color: var(--red);
  color: var(--text);
}

.eyebrow {
  margin: 0 0 5px;
  color: var(--red);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: clamp(2rem, 3.6vw, 3.55rem);
  line-height: 0.95;
}

.welcome-message {
  margin: 14px 0 0;
  color: var(--red);
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  line-height: 1;
}

h2 {
  font-size: 0.98rem;
}

.status-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(124px, 1fr));
  gap: 8px;
  width: min(100%, 660px);
}

.status-strip article,
.metric-grid article {
  min-height: 72px;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.status-strip span,
.metric-grid strong {
  display: block;
  color: var(--text);
  font-size: 1.25rem;
  font-weight: 800;
}

.status-strip small,
.metric-grid span {
  color: var(--muted);
  font-size: 0.78rem;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(330px, 0.95fr) minmax(390px, 1.2fr) minmax(320px, 0.85fr);
  gap: 12px;
  align-items: start;
}

.stack {
  display: grid;
  gap: 12px;
  align-content: start;
}

.panel {
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.panel-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.danger-button:hover {
  border-color: var(--red);
  background: var(--red-soft);
}

.field-label,
.priority-grid span {
  display: block;
  margin: 10px 0 6px;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 700;
}

.priority-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.task-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  margin-bottom: 10px;
}

input,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-hard);
  color: var(--text);
  outline: none;
}

input {
  min-height: 38px;
  padding: 0 11px;
}

textarea {
  min-height: 76px;
  padding: 10px 11px;
  resize: vertical;
}

input:focus,
textarea:focus {
  border-color: var(--red);
  box-shadow: 0 0 0 3px var(--red-soft);
}

.task-form button,
.timer-actions button:first-child {
  min-height: 38px;
  border-radius: 8px;
  background: var(--red);
  color: white;
  font-weight: 800;
  padding: 0 14px;
}

.ghost-button,
.icon-button {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 700;
  padding: 0 10px;
}

.icon-button {
  width: 34px;
  padding: 0;
}

.icon-button svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.compact-list {
  display: grid;
  gap: 7px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.task-item,
.capture-item {
  display: grid;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-hard);
}

.task-item {
  grid-template-columns: 24px 1fr 30px;
}

.capture-item {
  grid-template-columns: 1fr 30px;
}

.task-item input {
  width: 18px;
  min-height: 18px;
  accent-color: var(--red);
}

.task-item span,
.capture-item span {
  overflow-wrap: anywhere;
  font-size: 0.88rem;
}

.task-item.is-done span {
  color: var(--muted);
  text-decoration: line-through;
}

.remove-task,
.remove-capture {
  width: 30px;
  min-height: 30px;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
}

.remove-task:hover,
.remove-capture:hover,
.ghost-button:hover,
.icon-button:hover {
  border-color: var(--red);
  color: var(--text);
}

.preset-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-bottom: 10px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-hard);
}

.preset-button {
  min-height: 34px;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-weight: 800;
}

.preset-button.is-active {
  background: var(--red);
  color: white;
}

.timer-face {
  display: grid;
  place-items: center;
  min-height: 150px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: radial-gradient(circle, rgba(225, 43, 43, 0.16), transparent 62%), var(--surface-hard);
  text-align: center;
}

.timer-face p {
  margin: 0 0 6px;
  color: var(--red);
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
}

.timer-face strong {
  display: block;
  font-size: clamp(3rem, 6vw, 4.9rem);
  line-height: 1;
  letter-spacing: 0;
}

.timer-actions {
  display: grid;
  grid-template-columns: 1fr 96px;
  gap: 8px;
  margin-top: 10px;
}

.news-feed {
  display: grid;
  gap: 8px;
}

.news-item {
  display: block;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-hard);
  color: var(--text);
  text-decoration: none;
}

.news-item:hover {
  border-color: var(--red);
}

.news-item strong {
  display: block;
  margin-bottom: 6px;
  font-size: 0.88rem;
  line-height: 1.3;
}

.news-item small {
  color: var(--muted);
  font-size: 0.76rem;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.verse-panel {
  background:
    linear-gradient(135deg, rgba(225, 43, 43, 0.15), transparent 45%),
    var(--surface);
}

blockquote {
  margin: 0;
  color: #eeeeee;
  font-size: clamp(1.05rem, 1.7vw, 1.45rem);
  font-weight: 700;
  line-height: 1.3;
}

.quick-links {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.quick-links a {
  display: grid;
  min-height: 38px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-hard);
  color: var(--text);
  font-size: 0.84rem;
  font-weight: 800;
  text-decoration: none;
}

.quick-links a:hover {
  border-color: var(--red);
  background: var(--red-soft);
}

.status-message {
  min-height: 18px;
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.35;
}

.status-message.success {
  color: #79d98b;
}

.status-message.error {
  color: #ff7b7b;
}

.login-body {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 22% 18%, rgba(225, 43, 43, 0.18), transparent 28%),
    var(--bg);
}

.login-shell {
  display: grid;
  grid-template-columns: minmax(260px, 0.9fr) minmax(320px, 420px);
  gap: 18px;
  width: min(940px, 100%);
  align-items: stretch;
}

.login-brand,
.login-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.login-brand {
  display: grid;
  align-content: end;
  min-height: 420px;
  padding: 28px;
  background:
    linear-gradient(145deg, rgba(225, 43, 43, 0.18), transparent 42%),
    var(--surface);
}

.login-brand img {
  width: 88px;
  height: 88px;
  margin-bottom: 22px;
  border-radius: 22px;
}

.login-brand h1 {
  max-width: 420px;
}

.login-card {
  display: grid;
  align-content: center;
  padding: 28px;
}

.login-card button {
  min-height: 42px;
  margin-top: 16px;
  border-radius: 8px;
  background: var(--red);
  color: white;
  font-weight: 800;
}

.empty-state {
  padding: 12px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  font-size: 0.86rem;
  text-align: center;
}

@media (max-width: 1180px) {
  .topbar,
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 680px) {
  .app-shell {
    width: min(100% - 18px, 1760px);
    padding: 14px 0;
  }

  .status-strip,
  .login-shell,
  .priority-grid,
  .task-form,
  .timer-actions,
  .quick-links {
    grid-template-columns: 1fr;
  }
}
