:root {
  --ink: #14232b; --muted: #5a6b74; --faint: #8b9aa1;
  --line: #dce5e8; --line-strong: #c3d1d6; --page: #eef4f5;
  --cyan: #3eb1c8; --teal: #236b7a; --deep: #174751; --wash: #e8f5f8;
  --error: #c0392b; --amber: #a86a0c;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { background: var(--page); color: var(--ink); font: 16px/1.5 Figtree, system-ui, sans-serif; -webkit-font-smoothing: antialiased; }
[hidden] { display: none !important; }
b { font-weight: 600; }
.muted { color: var(--muted); font-weight: 400; }
.code { font-weight: 600; letter-spacing: 0.02em; font-variant-numeric: tabular-nums; }

.swooshes { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.wrap { position: relative; max-width: 720px; margin: 0 auto; padding: 48px 24px; }
.card { background: #fff; border-radius: 16px; overflow: hidden; box-shadow: 0 1px 2px rgba(20,35,43,.06), 0 8px 28px rgba(20,35,43,.07); }
.band { height: 8px; background: var(--cyan); }

.head { display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; padding: 36px 40px 24px; }
h1 { margin: 0; font-size: 32px; line-height: 1.15; font-weight: 600; letter-spacing: -0.01em; }
.lede { margin: 10px 0 0; max-width: 50ch; color: var(--muted); line-height: 1.65; }
.logo { width: 132px; height: auto; margin-top: 6px; flex-shrink: 0; }

.q { border-top: 1px solid var(--line); padding: 24px 40px; }
.q h2 { margin: 0; font-size: 17px; font-weight: 600; line-height: 1.35; }
.n { color: var(--muted); margin-right: 6px; }
.req { color: var(--error); margin-left: 4px; }
.hint { margin: 4px 0 0; font-size: 15px; color: var(--muted); line-height: 1.4; }
.q > .field, .q > select { margin-top: 12px; }
.sub { font-size: 15px; font-weight: 500; }

.field { width: 100%; border: 1px solid var(--line-strong); border-radius: 8px; background: #fff; color: var(--ink); font: inherit; padding: 11px 14px; transition: border-color .15s, box-shadow .15s; }
.field::placeholder { color: var(--faint); }
.field:hover { border-color: var(--faint); }
.field:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px rgba(62,177,200,.25); }
.field.bad { border-color: var(--error); }
textarea.field { resize: vertical; line-height: 1.6; }
select.field { appearance: none; background: #fff url(chevron.svg) no-repeat right 14px center; padding-right: 40px; cursor: pointer; }
input[type=date].field { padding-top: 8px; padding-bottom: 8px; margin-top: 6px; }

.msg { margin: 8px 0 0; font-size: 14px; }
.msg.bad { color: var(--error); }
.msg.warn { color: var(--amber); }
.err { margin: 8px 0 0; font-size: 14px; font-weight: 500; color: var(--error); }
.does { margin: 8px 0 0; display: flex; align-items: center; gap: 8px; font-size: 15px; color: var(--teal); }
.does::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex-shrink: 0; }
.does.crm { color: var(--amber); }

.extras { margin-top: 16px; display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.seg { display: flex; margin-top: 6px; border: 1px solid var(--line-strong); border-radius: 8px; padding: 2px; }
.seg button { flex: 1; border: 0; background: transparent; border-radius: 6px; padding: 8px 12px; font: 500 15px Figtree, sans-serif; color: var(--muted); cursor: pointer; }
.seg button[aria-checked=true] { background: var(--deep); color: #fff; font-weight: 600; }
.seg button[aria-checked=true][data-v=Critical] { background: var(--error); }

.actions { border-top: 1px solid var(--line); padding: 24px 40px; display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; }
.btn { min-width: 172px; border: 0; border-radius: 8px; padding: 12px 24px; background: var(--deep); color: #fff; font: 600 16px Figtree, sans-serif; cursor: pointer; transition: filter .15s, transform .05s; }
.btn:hover { filter: brightness(1.1); }
.btn:active { transform: translateY(1px); }
.btn.dark { background: var(--ink); }
.btn.ghost { background: #fff; color: var(--ink); border: 1px solid var(--line-strong); }
.btn[disabled] { opacity: .7; cursor: progress; }

/* task card */
.task { margin-top: 16px; border: 1px solid var(--line); border-radius: 12px; background: #fbfdfd; overflow: hidden; }
.task-top { padding: 16px 20px 0; }
.board, dt, .bar-head span { font-size: 14px; color: var(--muted); }
.title { margin-top: 2px; font-size: 19px; font-weight: 600; line-height: 1.25; }
.customer { margin-top: 2px; font-size: 15px; color: var(--muted); }
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 24px; padding: 16px 20px; margin: 0; }
dd { margin: 2px 0 0; font-size: 15px; font-weight: 500; line-height: 1.35; overflow-wrap: anywhere; }
.notset { color: var(--muted); font-weight: 400; }
.pill { white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 2px 10px; font-size: 14px; font-weight: 600; text-transform: capitalize; background: #eef1f2; color: #55656d; }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.people { display: flex; align-items: center; gap: 8px; }
.avatars { display: flex; }
.av { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; color: #fff; font-size: 12px; font-weight: 600; box-shadow: 0 0 0 2px #fff; }
.av + .av { margin-left: -6px; }
.bars { border-top: 1px solid var(--line); }
.bar-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; font-size: 14px; }
.bar-head b .muted { font-weight: 400; }
.bar { margin-top: 6px; height: 6px; border-radius: 999px; background: var(--line); overflow: hidden; }
.fill { height: 100%; border-radius: 999px; transform-origin: left; animation: fill .7s cubic-bezier(.2,.7,.2,1) both; }
.fill-progress { background: var(--cyan); }
.fill-time { background: var(--deep); }
.fill-time.over { background: var(--error); }
.over-text { color: var(--error); }

.pick { display: grid; gap: 8px; margin-top: 8px; }
.pick button { display: flex; justify-content: space-between; align-items: center; gap: 12px; text-align: left; border: 1px solid var(--line); background: #fff; border-radius: 8px; padding: 12px 16px; font: inherit; color: inherit; cursor: pointer; }
.pick button[aria-pressed=true] { border-color: var(--teal); background: var(--wash); }
.pick .t { display: block; font-weight: 600; }
.pick .b { display: block; font-size: 14px; color: var(--muted); }

/* done */
.done { border-top: 1px solid var(--line); padding: 32px 40px; }
.done-head { display: flex; gap: 16px; align-items: flex-start; }
.badge { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; color: #fff; background: var(--cyan); flex-shrink: 0; }
.badge.crm { background: var(--ink); }
.done h2 { margin: 0; font-size: 22px; font-weight: 600; line-height: 1.2; }
.done .meta { margin: 4px 0 0; color: var(--muted); font-size: 15px; }
.done ul { list-style: none; padding: 0; margin: 20px 0 0; display: grid; gap: 8px; font-size: 15px; }
.done li { display: flex; gap: 8px; align-items: flex-start; }
.done li svg { color: var(--teal); margin-top: 3px; flex-shrink: 0; }
.done a { color: var(--teal); font-weight: 600; }
.preview { margin-top: 20px; border: 1px solid var(--line); border-radius: 12px; background: #fbfdfd; }
.preview-head { display: flex; justify-content: space-between; align-items: center; padding: 10px 16px; border-bottom: 1px solid var(--line); font-size: 14px; font-weight: 500; color: var(--muted); }
.preview pre { margin: 0; padding: 14px 16px; white-space: pre-wrap; overflow-wrap: anywhere; font: 15px/1.6 Figtree, sans-serif; color: var(--ink); }
.copy { border: 0; border-radius: 6px; padding: 4px 12px; background: var(--ink); color: #fff; font: 600 14px Figtree, sans-serif; cursor: pointer; }
.done-actions { margin-top: 24px; display: flex; flex-wrap: wrap; gap: 12px; }
.done-actions .btn { min-width: 0; padding: 10px 20px; font-size: 15px; }

.dots span { animation: blink 1s infinite both; }
.dots span:nth-child(2) { animation-delay: .15s; }
.dots span:nth-child(3) { animation-delay: .3s; }
.reveal { animation: reveal .32s cubic-bezier(.2,.7,.2,1) both; }
.drift { animation: drift 26s ease-in-out infinite alternate; }
.drift-2 { animation: drift 34s ease-in-out infinite alternate-reverse; }
@keyframes reveal { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
@keyframes fill { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes blink { 0%, 80%, 100% { opacity: .2; } 40% { opacity: 1; } }
@keyframes drift { from { transform: translate(0,0) rotate(0); } to { transform: translate(-40px,18px) rotate(4deg); } }
@media (prefers-reduced-motion: reduce) { .reveal, .fill, .drift, .drift-2, .dots span { animation: none; } }

@media (max-width: 640px) {
  .wrap { padding: 24px 12px; }
  .head { flex-direction: column-reverse; gap: 16px; padding: 24px 24px 24px; }
  .logo { width: 104px; align-self: flex-end; margin: 0; }
  h1 { font-size: 27px; }
  .q, .actions, .done { padding-left: 24px; padding-right: 24px; }
  .grid, .extras { grid-template-columns: 1fr; }
}
