:root {
  color-scheme: light;
  --ink: #18302d;
  --muted: #6b7b78;
  --line: #d9e4df;
  --paper: #f8faf6;
  --panel: #ffffff;
  --brand: #214e48;
  --brand-strong: #163b36;
  --accent: #d86c47;
  --gold: #e5bd54;
  --done: #82918e;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--paper);
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(33, 78, 72, 0.12), rgba(248, 250, 246, 0) 260px),
    var(--paper);
}

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

button {
  border: 0;
  cursor: pointer;
}

.login-view {
  display: grid;
  min-height: 100vh;
  padding: 28px;
  place-items: center;
}

.login-panel {
  display: grid;
  width: min(100%, 420px);
  gap: 34px;
}

.app-shell {
  width: min(100%, 520px);
  min-height: 100vh;
  margin: 0 auto;
  padding: max(18px, env(safe-area-inset-top)) 16px calc(96px + env(safe-area-inset-bottom));
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 72px;
  gap: 16px;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(2rem, 12vw, 3.2rem);
  line-height: 0.95;
  letter-spacing: 0;
}

.icon-button,
.round-add {
  display: grid;
  width: 48px;
  height: 48px;
  flex: 0 0 48px;
  place-items: center;
  border-radius: 50%;
  color: white;
  background: var(--brand);
  font-size: 1.4rem;
  font-weight: 800;
  box-shadow: 0 12px 24px rgba(33, 78, 72, 0.22);
}

.icon-button {
  background: var(--accent);
}

.quick-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 12px 0 18px;
}

.quick-strip div {
  min-height: 72px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.74);
}

.quick-strip span {
  display: block;
  font-size: 1.55rem;
  font-weight: 850;
}

.quick-strip small {
  color: var(--muted);
  font-weight: 700;
}

.view {
  display: grid;
  gap: 14px;
}

.stack,
.composer {
  display: grid;
  gap: 10px;
}

.composer {
  grid-template-columns: 1fr auto;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 14px 36px rgba(24, 48, 45, 0.08);
}

.composer input:first-child,
.composer textarea,
.composer .two-col {
  grid-column: 1 / -1;
}

.composer select,
.composer input[type="date"],
.composer input[type="time"] {
  min-width: 0;
}

.composer.tall {
  grid-template-columns: 1fr;
}

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 800;
}

input,
select,
textarea {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  color: var(--ink);
  background: white;
  outline: none;
}

textarea {
  min-height: 92px;
  padding-top: 12px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(33, 78, 72, 0.14);
}

.primary {
  min-height: 48px;
  border-radius: 8px;
  padding: 0 16px;
  color: white;
  background: var(--brand);
  font-weight: 850;
}

.item-list {
  display: grid;
  gap: 10px;
}

.item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
  min-height: 70px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
}

.item.done {
  color: var(--done);
  background: rgba(255, 255, 255, 0.62);
}

.item.done .item-title {
  text-decoration: line-through;
}

.project-item {
  grid-template-columns: 1fr auto;
}

.event-item {
  grid-template-columns: auto 1fr auto;
}

.check {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 2px solid var(--brand);
  border-radius: 50%;
  color: var(--brand);
  background: transparent;
  font-weight: 900;
}

.item.done .check {
  color: white;
  background: var(--brand);
}

.item-main {
  min-width: 0;
}

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

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 5px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 650;
}

.pill {
  padding: 3px 7px;
  border-radius: 999px;
  background: #edf3ef;
}

.notes {
  margin: 9px 0 0;
  color: var(--muted);
  font-size: 0.94rem;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.date-badge {
  display: grid;
  width: 52px;
  min-height: 52px;
  place-items: center;
  border-radius: 8px;
  color: white;
  background: var(--brand);
}

.date-badge strong {
  font-size: 1.2rem;
  line-height: 1;
}

.date-badge span {
  font-size: 0.72rem;
  font-weight: 800;
}

.danger {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 50%;
  color: var(--accent);
  background: #fff2ed;
  font-size: 1.2rem;
  font-weight: 900;
}

.empty,
.error {
  min-height: 44px;
  color: var(--muted);
  font-weight: 750;
}

.error {
  color: #a33a2b;
}

.tabbar {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  width: min(100%, 520px);
  margin: 0 auto;
  padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(18px);
}

.tab {
  display: grid;
  min-width: 0;
  min-height: 58px;
  place-items: center;
  border-radius: 8px;
  color: var(--muted);
  background: transparent;
  font-size: 0.76rem;
  font-weight: 800;
}

.tab span {
  font-size: 1.15rem;
}

.tab.active {
  color: white;
  background: var(--brand);
}

[hidden] {
  display: none !important;
}

@media (max-width: 360px) {
  .app-shell {
    padding-right: 12px;
    padding-left: 12px;
  }

  .tab {
    font-size: 0.68rem;
  }

  .quick-strip div {
    padding: 10px 8px;
  }
}
