:root {
  color-scheme: light;
  --bg: #f6f7f9;
  --ink: #172026;
  --muted: #65727d;
  --line: #dbe1e6;
  --panel: #ffffff;
  --accent: #1c6dd0;
  --good: #16855b;
  --bad: #b42318;
}

* {
  box-sizing: border-box;
}

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

.shell {
  width: min(1080px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 32px 0 56px;
}

.topbar,
.tasks-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: 30px;
}

h2 {
  font-size: 20px;
}

.topbar p {
  color: var(--muted);
  margin-top: 8px;
}

.health {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 10px 14px;
  color: var(--muted);
  white-space: nowrap;
}

.panel,
.task {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.panel {
  margin: 28px 0;
  padding: 18px;
}

.field-grid {
  display: grid;
  grid-template-columns: minmax(150px, 220px) minmax(110px, 140px) minmax(130px, 160px) 1fr auto;
  gap: 14px;
  align-items: end;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
}

input,
select {
  width: 100%;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 0 12px;
  color: var(--ink);
  background: #fff;
  font-size: 15px;
}

button,
.actions a,
a.button {
  height: 42px;
  border: 1px solid transparent;
  border-radius: 7px;
  padding: 0 15px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--accent);
  color: white;
  font-weight: 650;
  text-decoration: none;
  cursor: pointer;
}

button.secondary,
a.button.secondary,
#refresh {
  background: white;
  color: var(--ink);
  border-color: var(--line);
}

a.button.disabled {
  pointer-events: none;
  opacity: 0.5;
}

.head-actions {
  display: flex;
  gap: 8px;
}

button.danger {
  background: white;
  color: var(--bad);
  border-color: #f0c7c1;
}

.format-box {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 14px;
}

.hidden {
  display: none;
}

#duration {
  color: var(--muted);
  margin-left: 8px;
}

.submit-row {
  display: grid;
  grid-template-columns: minmax(130px, 170px) 1fr auto;
  gap: 12px;
}

.cookie-panel {
  margin-top: -10px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px;
  align-items: center;
}

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

.thunder-panel h2 {
  font-size: 18px;
}

.meta.good {
  color: var(--good);
}

.meta.bad {
  color: var(--bad);
}

.cookie-panel h2 {
  font-size: 18px;
}

.cookie-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.cookie-actions select {
  width: 150px;
}

.cookie-actions input {
  width: min(340px, 42vw);
}

#cookieStatus {
  grid-column: 1 / -1;
}

.tasks-head {
  margin: 26px 0 14px;
}

.tasks {
  display: grid;
  gap: 12px;
}

.task {
  padding: 14px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  align-items: center;
}

.task-main {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.thumb {
  width: 96px;
  aspect-ratio: 16 / 9;
  border-radius: 6px;
  background: #e8edf2;
  background-size: cover;
  background-position: center;
  flex: 0 0 auto;
}

.task-info {
  min-width: 0;
}

.task h3 {
  font-size: 16px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.meta,
.error {
  color: var(--muted);
  font-size: 13px;
  margin-top: 6px;
}

.error {
  color: var(--bad);
}

.progress {
  height: 8px;
  border-radius: 99px;
  background: #e8edf2;
  overflow: hidden;
  margin-top: 10px;
}

.progress span {
  display: block;
  width: 0%;
  height: 100%;
  background: var(--good);
}

.actions {
  display: flex;
  gap: 8px;
}

.actions a.disabled {
  pointer-events: none;
  opacity: 0.42;
}

.actions .delete {
  background: white;
  color: var(--bad);
  border-color: #f0c7c1;
}

@media (max-width: 760px) {
  .topbar,
  .tasks-head,
  .task {
    align-items: stretch;
    flex-direction: column;
    display: flex;
  }

  .field-grid,
  .submit-row,
  .cookie-panel,
  .thunder-panel {
    grid-template-columns: 1fr;
  }

  .thunder-panel {
    align-items: stretch;
    flex-direction: column;
  }

  .cookie-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .cookie-actions input {
    width: 100%;
  }

  .health {
    white-space: normal;
  }

  .actions {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
  }

  .head-actions {
    display: grid;
    grid-template-columns: 1fr;
  }
}
