:root {
  --ink: #18211f;
  --muted: #64716d;
  --paper: #f3efe4;
  --card: #fffaf0;
  --accent: #d86f45;
  --accent-strong: #a64224;
  --line: #ded3bd;
  --danger: #b42318;
  --ok: #25835f;
  --shadow: 0 24px 60px rgba(55, 39, 22, 0.16);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  background:
    radial-gradient(circle at 12% 12%, rgba(216, 111, 69, 0.22), transparent 28rem),
    radial-gradient(circle at 88% 18%, rgba(37, 131, 95, 0.12), transparent 20rem),
    linear-gradient(135deg, #fbf4df 0%, #edf1df 55%, #e7d4ba 100%);
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  border: 0;
  border-radius: 999px;
  padding: 0.8rem 1.1rem;
  color: #fff;
  background: var(--accent);
  cursor: pointer;
  transition: transform 160ms ease, background 160ms ease;
}

button:hover {
  background: var(--accent-strong);
  transform: translateY(-1px);
}

button.secondary {
  color: var(--ink);
  background: #efe4cc;
}

button.danger {
  background: var(--danger);
}

code {
  padding: 0.1rem 0.3rem;
  border-radius: 0.3rem;
  background: #efe4cc;
}

.shell {
  width: min(1280px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 3rem 0;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 2rem;
  align-items: end;
  margin-bottom: 2rem;
}

.hero h1 {
  max-width: 920px;
  margin: 0;
  font-size: clamp(2.4rem, 6vw, 5.4rem);
  line-height: 0.9;
  letter-spacing: -0.06em;
}

.hero-copy {
  max-width: 760px;
  color: var(--muted);
  font-size: 1.12rem;
}

.hero-panel,
.topbar,
.card {
  border: 1px solid rgba(122, 93, 55, 0.22);
  border-radius: 1.4rem;
  background: rgba(255, 250, 240, 0.82);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.hero-panel {
  display: flex;
  gap: 0.6rem;
  align-items: center;
  min-width: 230px;
  padding: 1rem 1.2rem;
}

.status-dot {
  width: 0.75rem;
  height: 0.75rem;
  border-radius: 50%;
  background: #d1a62f;
}

.status-dot.ready {
  background: var(--ok);
}

.status-dot.error {
  background: var(--danger);
}

.card {
  padding: 1.4rem;
}

.card h2,
.card h3 {
  margin: 0 0 1rem;
}

.card h2 {
  font-size: 1.55rem;
}

.card h3 {
  font-size: 1.05rem;
}

.eyebrow {
  margin: 0 0 0.4rem;
  color: var(--accent-strong);
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.muted {
  color: var(--muted);
}

.hidden {
  display: none !important;
}

.topbar,
.workspace-switch,
.topbar-actions,
.card-heading,
.entries-header {
  display: flex;
  gap: 1rem;
}

.topbar,
.card-heading,
.entries-header {
  justify-content: space-between;
  align-items: start;
}

.topbar {
  align-items: center;
  padding: 1rem 1.2rem;
  margin-bottom: 1.4rem;
}

.workspace-switch,
.topbar-actions {
  align-items: end;
  flex-wrap: wrap;
}

.workspace-switch label,
.topbar-actions label {
  min-width: 220px;
}

.management-grid,
.timer-grid,
.split-panel,
.lists-grid {
  display: grid;
  gap: 1.4rem;
}

.management-grid {
  grid-template-columns: minmax(0, 1.25fr) minmax(320px, 0.95fr);
  margin-bottom: 1.4rem;
}

.timer-grid {
  grid-template-columns: minmax(0, 1.3fr) minmax(320px, 0.9fr);
  margin-bottom: 1.4rem;
}

.lower-grid {
  align-items: start;
}

.split-panel,
.lists-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 1rem;
}

.primary-card {
  background: rgba(255, 247, 225, 0.9);
}

.elapsed {
  min-width: 150px;
  border-radius: 1rem;
  padding: 0.9rem 1rem;
  text-align: center;
  color: #fff;
  background: var(--ink);
  font-size: 1.5rem;
  font-variant-numeric: tabular-nums;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.form-grid.compact {
  gap: 0.85rem;
}

label {
  display: grid;
  gap: 0.35rem;
  color: var(--muted);
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-size: 0.85rem;
  font-weight: 700;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 0.8rem;
  padding: 0.75rem 0.85rem;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.72);
}

textarea {
  resize: vertical;
}

.wide,
.actions {
  grid-column: 1 / -1;
}

.toggle {
  display: flex;
  gap: 0.6rem;
  align-items: center;
  border: 1px dashed var(--line);
  border-radius: 0.8rem;
  padding: 0.75rem 0.85rem;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.45);
}

.toggle input {
  width: auto;
  margin: 0;
}

.actions,
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  align-items: end;
}

.filters label {
  min-width: 145px;
}

.entity-list {
  display: grid;
  gap: 0.8rem;
  padding: 0;
  margin: 0;
  list-style: none;
}

.entity-list li,
.favorite-card {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  border: 1px solid rgba(122, 93, 55, 0.18);
  border-radius: 1rem;
  padding: 0.9rem 1rem;
  background: rgba(255, 255, 255, 0.56);
}

.entity-list span,
.favorite-card p {
  margin: 0.2rem 0 0;
  color: var(--muted);
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-size: 0.85rem;
}

.favorites-list {
  display: grid;
  gap: 0.85rem;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 0.9rem 0.6rem;
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.entry-copy strong,
.entry-copy span {
  display: block;
}

.entry-copy span {
  margin-top: 0.3rem;
  color: var(--muted);
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-size: 0.85rem;
}

.toast {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  max-width: 360px;
  border-radius: 1rem;
  padding: 1rem 1.1rem;
  color: #fff;
  background: var(--ink);
  box-shadow: var(--shadow);
}

@media (max-width: 980px) {
  .management-grid,
  .timer-grid,
  .split-panel,
  .lists-grid,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .hero {
    grid-template-columns: 1fr;
  }

  .hero-panel {
    width: fit-content;
  }

  .card-heading,
  .entries-header,
  .topbar {
    flex-direction: column;
  }
}
