:root {
  --bg: #f8fbff;
  --surface: #ffffff;
  --ink: #17202a;
  --muted: #667085;
  --line: #d7dee8;
  --green: #1f8a5b;
  --blue: #2374ab;
  --red: #d64545;
  --yellow: #f4b942;
  --shadow: 0 12px 34px rgba(23, 32, 42, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(135deg, rgba(31, 138, 91, 0.12), transparent 34%),
    linear-gradient(225deg, rgba(35, 116, 171, 0.12), transparent 42%),
    var(--bg);
  color: var(--ink);
  font-family: "Liberation Sans", system-ui, sans-serif;
}

button,
input,
textarea {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

.app {
  width: min(100%, 540px);
  min-height: 100vh;
  margin: 0 auto;
  padding: calc(env(safe-area-inset-top) + 14px) 14px calc(env(safe-area-inset-bottom) + 92px);
}

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

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.brand img {
  width: 46px;
  height: 46px;
  border-radius: 8px;
  box-shadow: 0 8px 20px rgba(35, 116, 171, 0.22);
}

.brand strong,
.brand span {
  display: block;
}

.brand strong {
  font-size: 18px;
}

.brand span {
  color: var(--muted);
  font-size: 13px;
  margin-top: 2px;
}

.icon-button,
button {
  border: 0;
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
  min-height: 42px;
  padding: 0 14px;
  font-weight: 800;
}

main {
  display: grid;
}

.view {
  display: none;
  animation: enter 180ms ease both;
}

.view.active {
  display: block;
}

.hero-panel,
.focus-panel {
  color: #fff;
  border-radius: 8px;
  padding: 22px;
  background:
    linear-gradient(135deg, rgba(31, 138, 91, 0.92), rgba(35, 116, 171, 0.92)),
    #2374ab;
  box-shadow: var(--shadow);
}

.kicker {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 10px;
  font-size: 34px;
  line-height: 1.04;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0;
  font-size: 28px;
  line-height: 1.1;
  letter-spacing: 0;
}

.hero-panel p:last-child,
.focus-panel p {
  margin-bottom: 0;
  line-height: 1.55;
}

.quick-form,
.entry-form {
  margin: 14px 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.quick-form label {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.input-row,
.entry-form {
  display: flex;
  gap: 8px;
}

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

input {
  min-height: 46px;
  padding: 0 12px;
}

textarea {
  resize: vertical;
  padding: 12px;
}

.stacked {
  display: grid;
}

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

.stats-grid article {
  min-height: 94px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.stats-grid span {
  display: block;
  color: var(--blue);
  font-size: 30px;
  font-weight: 900;
}

.stats-grid p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.focus-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  background:
    linear-gradient(135deg, rgba(214, 69, 69, 0.92), rgba(244, 185, 66, 0.96)),
    #d64545;
}

.timer-actions {
  display: grid;
  gap: 8px;
}

.timer-actions button {
  background: rgba(23, 32, 42, 0.88);
}

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  margin: 8px 0 14px;
}

.section-head .kicker {
  color: var(--blue);
}

.section-head button {
  background: #e9eef5;
  color: var(--ink);
}

.list {
  display: grid;
  gap: 8px;
}

.item {
  display: grid;
  gap: 8px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.task-item {
  grid-template-columns: auto 1fr auto;
  align-items: center;
}

.task-item input {
  width: 22px;
  height: 22px;
  min-height: 22px;
}

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

.item-title {
  margin: 0;
  font-weight: 900;
  overflow-wrap: anywhere;
}

.item-body {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.delete-button {
  min-height: 34px;
  padding: 0 10px;
  background: #ffe8e8;
  color: var(--red);
}

.empty {
  padding: 24px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  text-align: center;
  background: rgba(255, 255, 255, 0.6);
}

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

.link-grid a {
  min-height: 88px;
  display: grid;
  place-items: center;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  text-decoration: none;
  font-weight: 900;
  box-shadow: var(--shadow);
}

.tabs {
  position: fixed;
  left: 50%;
  bottom: max(12px, env(safe-area-inset-bottom));
  width: min(calc(100% - 24px), 520px);
  transform: translateX(-50%);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow);
}

.tab {
  min-height: 44px;
  padding: 0 8px;
  background: transparent;
  color: var(--muted);
}

.tab.active {
  background: var(--ink);
  color: #fff;
}

@keyframes enter {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (min-width: 720px) {
  .app {
    padding-top: 28px;
  }

  h1 {
    font-size: 40px;
  }
}
