:root {
  color-scheme: light;
  --bg-top: #dcfff8;
  --bg-mid: #f3f8ff;
  --bg-bottom: #eef1f7;
  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --text: #0f172a;
  --muted: #5b6474;
  --border: #dbe4ee;
  --accent: #0f766e;
  --accent-pressed: #115e59;
  --danger: #be123c;
  --radius-lg: 18px;
  --radius-md: 12px;
  --shadow: 0 14px 34px rgba(15, 23, 42, 0.08);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family: "Avenir Next", "Trebuchet MS", sans-serif;
  color: var(--text);
  background:
    radial-gradient(1300px 500px at 12% -10%, #c8fff5 0%, transparent 65%),
    radial-gradient(1000px 460px at 88% -20%, #e4f2ff 0%, transparent 62%),
    linear-gradient(180deg, var(--bg-top) 0%, var(--bg-mid) 36%, var(--bg-bottom) 100%);
}

.app {
  width: min(1120px, 100% - 24px);
  margin-inline: auto;
  padding: clamp(14px, 2.6vw, 28px) 0 clamp(22px, 3vw, 34px);
  display: grid;
  gap: clamp(10px, 1.8vw, 16px);
}

.app__header {
  padding: clamp(6px, 1vw, 10px) clamp(2px, 0.6vw, 6px);
}

.header-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.app__header h1 {
  margin: 0;
  font-size: clamp(1.5rem, 1.2rem + 1.2vw, 2rem);
  line-height: 1.15;
  letter-spacing: 0.01em;
}

.app__header p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: clamp(0.92rem, 0.85rem + 0.3vw, 1rem);
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: clamp(12px, 1.8vw, 18px);
  box-shadow: var(--shadow);
  margin: 0;
  backdrop-filter: blur(3px);
}

h2 {
  margin: 0 0 12px;
  font-size: clamp(1rem, 0.95rem + 0.35vw, 1.14rem);
}

.field {
  display: block;
  margin-bottom: 11px;
}

.field span {
  display: block;
  margin-bottom: 6px;
  font-size: 0.88rem;
  color: var(--muted);
}

input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  font: inherit;
  color: var(--text);
  background: var(--surface-soft);
}

.input-combo {
  position: relative;
}

.input-combo input {
  padding-right: 42px;
}

.combo-toggle {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 30px;
  height: 30px;
  min-height: 30px;
  padding: 0;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #ffffff;
  color: var(--muted);
  font-size: 0.9rem;
}

.combo-menu {
  margin: 6px 0 0;
  padding: 6px;
  list-style: none;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #ffffff;
  max-height: 126px;
  overflow-y: auto;
}

.combo-menu__item {
  margin: 0;
}

.combo-menu__btn {
  width: 100%;
  border: 0;
  background: transparent;
  text-align: left;
  padding: 8px 10px;
  border-radius: 8px;
  font: inherit;
  color: var(--text);
}

.combo-menu__btn:hover {
  background: #f1f7ff;
}

.combo-menu__item--empty {
  color: var(--muted);
  font-size: 0.9rem;
  padding: 8px 10px;
}

.icon-btn {
  width: 36px;
  height: 36px;
  min-height: 36px;
  border: 1px solid #b8d8d3;
  border-radius: 999px;
  background: #ebfffa;
  color: #0b615a;
  font-weight: 700;
  cursor: pointer;
}

.info-dialog {
  border: 0;
  border-radius: 14px;
  padding: 0;
  width: min(560px, calc(100% - 24px));
  box-shadow: 0 24px 56px rgba(2, 8, 23, 0.32);
}

.info-dialog::backdrop {
  background: rgba(2, 8, 23, 0.5);
}

.info-dialog__content {
  margin: 0;
  padding: 16px;
}

.info-dialog__content p {
  margin: 0 0 9px;
  color: #243247;
  line-height: 1.4;
}

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

.info-dialog__header h2 {
  margin: 0;
}

input:focus {
  border-color: var(--accent);
  outline: 2px solid #7ce8d7;
  outline-offset: 1px;
  background: #faffff;
}

input[type="month"] {
  max-width: 170px;
}

.timer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.timer {
  font-size: clamp(1.75rem, 1.3rem + 1.6vw, 2.35rem);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}

.btn {
  appearance: none;
  border: 1px solid transparent;
  border-radius: 12px;
  background: #dfe8f2;
  color: var(--text);
  min-height: 40px;
  padding: 8px 12px;
  font: inherit;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
}

.btn:hover {
  filter: brightness(0.98);
}

.btn:active {
  transform: translateY(1px);
}

.btn:focus-visible {
  outline: 2px solid #7ce8d7;
  outline-offset: 2px;
}

.btn--primary {
  background: var(--accent);
  color: #ffffff;
}

.btn--primary:hover {
  background: var(--accent-pressed);
}

.btn--danger {
  background: #ffe6eb;
  color: var(--danger);
  border-color: #ffd0da;
}

.btn--ghost {
  background: #ffffff;
  border-color: var(--border);
  color: var(--muted);
}

.quick-form {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2px;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 10px;
}

.muted {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.summary-value {
  margin: 4px 0 0;
  font-size: clamp(1.2rem, 1.06rem + 0.8vw, 1.55rem);
  font-weight: 700;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.month-action {
  width: 100%;
}

.backup-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.file-btn {
  display: inline-flex;
  align-items: center;
}

.entries {
  list-style: none;
  padding: 0;
  margin: 8px 0 0;
}

.entry {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-top: 1px solid var(--border);
}

.entry:first-child {
  border-top: 0;
}

.entry__task {
  margin: 0;
  font-weight: 650;
}

.entry__meta {
  margin: 4px 0 0;
  font-size: 0.84rem;
  color: var(--muted);
}

@media (min-width: 700px) {
  .quick-form {
    grid-template-columns: 1fr 1fr;
    column-gap: 10px;
  }

  .quick-form .field:nth-of-type(3),
  .quick-form .field:nth-of-type(4),
  .quick-form .btn {
    grid-column: 1 / -1;
  }
}

@media (min-width: 920px) {
  .app {
    grid-template-columns: 1.2fr 0.8fr;
    align-items: start;
  }

  .app__header {
    grid-column: 1 / -1;
  }

  .card--timer,
  .card--quick,
  .card--entries {
    grid-column: 1;
  }

  .card--summary,
  .card--backup {
    grid-column: 2;
  }

  .card--entries {
    min-height: 420px;
  }

  .month-action {
    width: auto;
    min-width: 130px;
  }
}
