:root {
  color-scheme: light;
  --bg: #f4f6f8;
  --panel: #ffffff;
  --text: #18202a;
  --muted: #687385;
  --line: #d9dee7;
  --accent: #1877f2;
  --accent-dark: #0f5fc8;
  --danger: #b42318;
}

* {
  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;
}

.app-shell {
  width: min(720px, 100%);
  margin: 0 auto;
  padding: 18px 14px 28px;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 28px;
  line-height: 1.1;
}

h2 {
  font-size: 18px;
}

#userHint {
  margin-top: 4px;
  color: var(--muted);
  font-size: 14px;
}

.quick-add,
.manual-add,
.tasks-section {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  margin-bottom: 12px;
}

textarea,
input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 12px;
  color: var(--text);
  background: #fff;
  outline: none;
}

textarea:focus,
input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(24, 119, 242, 0.12);
}

button {
  min-height: 42px;
  border: 0;
  border-radius: 8px;
  padding: 0 14px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
}

button:active {
  background: var(--accent-dark);
}

button:disabled {
  cursor: wait;
  opacity: 0.65;
}

.quick-add button,
.manual-add button {
  width: 100%;
  margin-top: 10px;
}

.time-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 10px;
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

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

.status {
  min-height: 20px;
  color: var(--muted);
  font-size: 14px;
  margin-bottom: 8px;
}

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

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

.task-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 11px;
  background: #fbfcfe;
}

.task-title {
  font-weight: 700;
}

.task-time {
  margin-top: 4px;
  color: var(--muted);
  font-size: 14px;
}

@media (max-width: 560px) {
  .topbar {
    display: grid;
  }

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