:root {
  color-scheme: light;
  --ink: #171915;
  --muted: #6e7168;
  --paper: #f4f2ec;
  --surface: #fffef9;
  --line: #dcd9cf;
  --accent: #ff5c35;
  --accent-dark: #d83b18;
  --acid: #d9f45b;
  --green: #316d52;
  --shadow: 0 16px 40px rgb(39 35 25 / 9%);
  --radius: 22px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html { min-height: 100%; background: #dedbd3; }

body {
  min-height: 100%;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 15% 4%, rgb(217 244 91 / 22%), transparent 27rem),
    #dedbd3;
}

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

.app-shell {
  position: relative;
  width: min(100%, 680px);
  min-height: 100dvh;
  margin: 0 auto;
  overflow: hidden;
  background: var(--paper);
  box-shadow: 0 0 60px rgb(30 27 19 / 12%);
}

.screen {
  display: none;
  min-height: 100dvh;
  padding: max(22px, env(safe-area-inset-top)) 20px max(28px, env(safe-area-inset-bottom));
  animation: enter .22s ease both;
}

.screen--active { display: block; }

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

h1, h2, p { margin-top: 0; }
h1 { letter-spacing: -.055em; }
h2 { letter-spacing: -.035em; }

.eyebrow {
  margin-bottom: 9px;
  color: var(--muted);
  font-size: .73rem;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.lead { max-width: 26rem; color: var(--muted); font-size: 1.05rem; line-height: 1.5; }

#login-screen {
  display: none;
  padding-top: max(52px, calc(env(safe-area-inset-top) + 30px));
}

#login-screen.screen--active { display: flex; flex-direction: column; }

.login-mark {
  display: grid;
  width: 64px;
  height: 64px;
  margin-bottom: 52px;
  place-items: center;
  border: 2px solid var(--ink);
  border-radius: 18px;
  background: var(--acid);
  box-shadow: 5px 5px 0 var(--ink);
  font-size: 1.7rem;
  font-weight: 900;
  transform: rotate(-4deg);
}

#login-screen h1 { margin-bottom: 18px; font-size: clamp(3rem, 14vw, 4.9rem); line-height: .89; }
.login-form { margin-top: auto; }
.prototype-note { margin: 24px 0 0; color: var(--muted); font-size: .76rem; text-align: center; }

.stack { display: grid; gap: 15px; }

.field { display: grid; gap: 8px; }
.field > span { padding-left: 4px; font-size: .82rem; font-weight: 750; }
.field small { color: var(--muted); font-weight: 500; }
.field b { color: var(--accent); }

.field input,
.field textarea,
.search-box input {
  width: 100%;
  min-height: 54px;
  border: 1px solid var(--line);
  border-radius: 16px;
  outline: none;
  background: var(--surface);
  color: var(--ink);
  font-size: 16px;
  line-height: 1.45;
}

.field input { padding: 0 16px; }
.field textarea { display: block; min-height: 54px; padding: 15px 16px; resize: none; overflow: hidden; }
.field input:focus, .field textarea:focus, .search-box:focus-within { border-color: var(--ink); box-shadow: 0 0 0 3px rgb(23 25 21 / 8%); }

.button {
  width: 100%;
  min-height: 54px;
  padding: 13px 18px;
  border: 0;
  border-radius: 16px;
  font-weight: 800;
  cursor: pointer;
  transition: transform .12s ease, background .12s ease;
}

.button:active { transform: scale(.985); }
.button:disabled { cursor: default; opacity: .42; }
.button--primary { background: var(--ink); color: white; box-shadow: 0 7px 18px rgb(23 25 21 / 15%); }
.button--secondary { border: 1px solid var(--line); background: var(--surface); }
.button--ghost { background: transparent; color: var(--muted); }

.topbar {
  position: relative;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 56px;
  gap: 12px;
}

.topbar h1 { margin: 0; font-size: 1.32rem; }
.topbar .eyebrow { margin: 0 0 2px; font-size: .62rem; }
.topbar--compact { margin-bottom: 34px; }
.topbar-title { flex: 1; margin: 0; font-size: .93rem; font-weight: 800; text-align: center; }
.topbar-spacer { width: 48px; }

.icon-button, .back-button {
  display: grid;
  width: 48px;
  height: 48px;
  flex: 0 0 48px;
  place-content: center;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--surface);
  cursor: pointer;
}

.icon-button span { display: block; width: 20px; height: 2px; margin: 2px 0; border-radius: 9px; background: var(--ink); }
.back-button svg { width: 23px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 2; }

.popover {
  position: absolute;
  top: 59px;
  right: 0;
  z-index: 10;
  width: min(270px, calc(100vw - 40px));
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.popover[hidden] { display: none; }
.popover button { width: 100%; min-height: 48px; padding: 10px 12px; border: 0; border-radius: 11px; background: transparent; text-align: left; font-weight: 700; cursor: pointer; }
.popover button:active { background: var(--paper); }

.hero-copy { padding: 58px 0 31px; }
.hero-copy p { margin-bottom: 4px; color: var(--muted); }
.hero-copy h2 { max-width: 330px; margin-bottom: 0; font-size: clamp(2.35rem, 11vw, 4rem); line-height: .99; }

.project-picker { min-height: 248px; }
.search-box {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 58px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
}
.search-box svg { width: 21px; flex: 0 0 21px; fill: none; stroke: var(--muted); stroke-linecap: round; stroke-width: 1.8; }
.search-box input { min-height: 0; padding: 0; border: 0; background: transparent; }
.search-box input:focus { box-shadow: none; }

.project-list { display: grid; gap: 7px; padding-top: 10px; }
.project-option {
  display: flex;
  min-height: 54px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 14px;
  border: 1px solid transparent;
  border-radius: 15px;
  background: transparent;
  cursor: pointer;
  text-align: left;
}
.project-option strong { display: block; font-size: .94rem; }
.project-option small { color: var(--muted); }
.project-option::after { content: ""; width: 11px; height: 11px; flex: 0 0 11px; border: 2px solid var(--line); border-radius: 50%; }
.project-option[aria-selected="true"] { border-color: var(--ink); background: var(--surface); }
.project-option[aria-selected="true"]::after { border: 4px solid var(--ink); }
.empty-list { padding: 28px 8px; color: var(--muted); text-align: center; }

.home-actions { display: grid; gap: 11px; margin-top: 24px; }

.page-heading { margin-bottom: 34px; }
.page-heading h1 { margin-bottom: 10px; font-size: clamp(2.55rem, 12vw, 4rem); line-height: .96; }
.page-heading > p:last-child { max-width: 30rem; color: var(--muted); line-height: 1.5; }
.form-message { min-height: 0; margin: 0; color: var(--accent-dark); font-size: .86rem; }
.form-message:empty { display: none; }

.project-heading { padding: 18px 0 30px; }
.status-pill { display: inline-flex; min-height: 30px; align-items: center; margin-bottom: 18px; padding: 5px 11px; border-radius: 999px; background: var(--acid); font-size: .72rem; font-weight: 850; text-transform: uppercase; }
.status-pill--completed { background: #e0ded6; color: var(--muted); }
.project-heading h1 { margin-bottom: 13px; font-size: clamp(2.65rem, 12vw, 4.5rem); line-height: .94; overflow-wrap: anywhere; }
.project-description { margin-bottom: 13px; color: var(--muted); font-size: 1rem; line-height: 1.5; white-space: pre-wrap; }
.editable { touch-action: manipulation; }
.editable:focus-visible { outline: 2px solid var(--accent); outline-offset: 5px; border-radius: 4px; }
.edit-hint { margin: 0; color: #989b91; font-size: .75rem; }
.inline-editor { display: grid; gap: 10px; margin-bottom: 12px; }
.inline-editor textarea { width: 100%; min-height: 58px; padding: 13px 14px; border: 1px solid var(--ink); border-radius: 14px; background: var(--surface); font-size: 16px; line-height: 1.45; resize: none; overflow: hidden; }
.inline-actions { display: flex; gap: 8px; }
.inline-actions button { min-height: 44px; padding: 8px 13px; border: 0; border-radius: 12px; background: var(--ink); color: white; font-weight: 750; }
.inline-actions button:last-child { border: 1px solid var(--line); background: var(--surface); color: var(--ink); }

.comment-composer { display: grid; gap: 12px; padding: 19px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.comment-composer label { font-size: .78rem; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
.comment-composer textarea { width: 100%; min-height: 86px; padding: 0; border: 0; outline: none; background: transparent; font-size: 16px; line-height: 1.5; resize: none; overflow: hidden; }
.comment-composer .button { min-height: 50px; }

.timeline-section { padding-top: 40px; }
.section-title-row { display: flex; align-items: baseline; justify-content: space-between; gap: 15px; }
.section-title-row h2 { margin-bottom: 23px; font-size: 1.45rem; }
.section-title-row span { color: var(--muted); font-size: .8rem; }
.timeline { position: relative; display: grid; gap: 18px; padding-left: 22px; }
.timeline::before { content: ""; position: absolute; top: 8px; bottom: 10px; left: 5px; width: 1px; background: var(--line); }
.timeline-item { position: relative; }
.timeline-item::before { content: ""; position: absolute; top: 6px; left: -22px; width: 11px; height: 11px; border: 3px solid var(--paper); border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.timeline-date { margin-bottom: 6px; color: var(--muted); font-size: .73rem; font-weight: 750; }
.timeline-text { margin: 0; font-size: .95rem; line-height: 1.52; white-space: pre-wrap; }
.timeline-author { display: block; margin-top: 8px; color: #989b91; font-size: .72rem; }

.quick-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.quick-actions button { display: grid; min-height: 86px; place-items: center; gap: 5px; padding: 10px; border: 1px solid var(--line); border-radius: 17px; background: var(--surface); font-weight: 800; cursor: pointer; }
.quick-actions button:active, .quick-actions button.is-active { border-color: var(--ink); background: var(--acid); }
.quick-actions svg { width: 25px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
.date-row { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, .85fr); gap: 10px; }
.timezone-note { margin: -2px 4px 5px; color: var(--muted); font-size: .78rem; }

.toast { position: fixed; left: 50%; bottom: max(24px, calc(env(safe-area-inset-bottom) + 14px)); z-index: 20; width: min(calc(100% - 40px), 520px); padding: 14px 17px; border-radius: 15px; background: var(--ink); color: white; box-shadow: var(--shadow); font-size: .88rem; font-weight: 700; text-align: center; transform: translateX(-50%); }

@media (min-width: 681px) {
  .screen { padding-right: 42px; padding-left: 42px; }
  .app-shell { min-height: calc(100dvh - 32px); margin: 16px auto; border-radius: 28px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
