/* ProjectHub — design system imported from Claude Design (ProjectHub.dc.html). */

:root {
  --bg:#FBFAF8; --surface:#FFFFFF; --raise:#F4F2EE;
  --ink:#18171B; --muted:#6C6975; --faint:#9C99A4; --line:#E7E3DD;
  --accent:#3A55C8; --accent-soft:#ECEFFC;
  --ok:#2C7A57; --bad:#B5382F; --idle:#A9A6AE;
  --stale1:#FAF1E4; --stale2:#F6E4C9; --stale-ink:#8A5A17;
  --sans:'IBM Plex Sans', system-ui, -apple-system, sans-serif;
  --mono:'IBM Plex Mono', ui-monospace, SFMono-Regular, monospace;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg:#121115; --surface:#1A191E; --raise:#232228;
    --ink:#ECEAE5; --muted:#9C98A2; --faint:#75717C; --line:#2B2930;
    --accent:#8FA2FF; --accent-soft:#22243A;
    --ok:#4FBF8B; --bad:#E4756A; --idle:#6E6B75;
    --stale1:#241C12; --stale2:#33260F; --stale-ink:#E0B270;
  }
}
[data-theme="dark"] {
  --bg:#121115; --surface:#1A191E; --raise:#232228;
  --ink:#ECEAE5; --muted:#9C98A2; --faint:#75717C; --line:#2B2930;
  --accent:#8FA2FF; --accent-soft:#22243A;
  --ok:#4FBF8B; --bad:#E4756A; --idle:#6E6B75;
  --stale1:#241C12; --stale2:#33260F; --stale-ink:#E0B270;
}

* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0;
  background: var(--bg); color: var(--ink);
  font-family: var(--sans); font-size: 15px; line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
input, textarea, select, button { font: inherit; color: inherit; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
::selection { background: var(--accent-soft); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

@keyframes ph-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes ph-flash { 0% { background: var(--accent-soft); } 100% { background: var(--surface); } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

/* ------------------------------------------------------------------ shells */

.wrap { max-width: 520px; margin: 0 auto; padding: 0 0 96px; }
.page { padding: 20px 18px 0; }
.micro {
  font-family: var(--mono); font-size: 10.5px; letter-spacing: .12em;
  text-transform: uppercase; color: var(--faint);
}
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.error { color: var(--bad); font-size: 13px; }
.saved { color: var(--ok); font-size: 12px; }
h1.title { font-size: 24px; font-weight: 600; letter-spacing: -.02em; margin: 0 0 4px; }

/* ------------------------------------------------------------------ topbar */

.topbar {
  position: sticky; top: 0; z-index: 20;
  background: var(--bg); border-bottom: 1px solid var(--line);
  padding: 14px 18px 12px;
}
.topbar .row { display: flex; align-items: center; gap: 12px; }
.wordmark {
  border: 0; background: none; padding: 0; cursor: pointer; color: var(--ink);
  font-family: var(--mono); font-size: 13px; letter-spacing: .12em; text-transform: uppercase;
}
.grow { flex: 1; }
.topnav { display: flex; align-items: center; gap: 14px; font-size: 13px; color: var(--muted); }
.topnav a, .topnav button {
  border: 0; background: none; padding: 4px 0; cursor: pointer; color: inherit;
}
.topnav a:hover { text-decoration: none; color: var(--ink); }
.btn-outline-pill {
  border: 1px solid var(--line); background: var(--surface); border-radius: 999px;
  padding: 6px 12px; cursor: pointer; color: var(--ink); font-size: 13px;
}

/* -------------------------------------------------------------- status dot */

.dot { width: 8px; height: 8px; border-radius: 50%; flex: 0 0 auto; display: inline-block; }
.dot-ok { background: var(--ok); }
.dot-down { background: var(--bad); }
.dot-unknown { background: var(--idle); }

/* ------------------------------------------------------------- chip strip */

.stripwrap {
  position: sticky; top: 53px; z-index: 15;
  background: var(--bg); border-bottom: 1px solid var(--line); padding: 10px 0 11px;
}
.strip {
  display: flex; gap: 6px; overflow-x: auto; padding: 0 18px;
  scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.strip::-webkit-scrollbar { display: none; }
.chip {
  flex: 0 0 auto; display: flex; align-items: center; gap: 6px;
  border: 1px solid var(--line); border-radius: 999px; padding: 6px 11px;
  cursor: pointer; font-size: 12.5px; white-space: nowrap;
  background: var(--surface); color: var(--muted); text-decoration: none;
}
.chip:hover { text-decoration: none; }
.chip .dot { width: 7px; height: 7px; }
.chip-stale1 { background: var(--stale1); }
.chip-stale2 { background: var(--stale2); color: var(--stale-ink); }

/* ------------------------------------------------------------- feed cards */

.cards { padding: 16px 18px 0; display: flex; flex-direction: column; gap: 12px; }
.card {
  animation: ph-in .18s ease both;
  border: 1px solid var(--line); border-radius: 14px; padding: 15px 15px 12px;
  background: var(--surface);
  transition: background .35s ease, border-color .35s ease;
  scroll-margin-top: 108px;
}
.card-stale1 { background: var(--stale1); }
.card-stale2 { background: var(--stale2); }
.card-flash { animation: ph-in .18s ease both, ph-flash .7s ease .18s both; border-color: var(--accent); }
.card-top { display: flex; align-items: baseline; gap: 9px; }
.card-top .dot { transform: translateY(-1px); }
.card-name {
  border: 0; background: none; padding: 0; cursor: pointer; text-align: left;
  font-size: 16.5px; font-weight: 600; letter-spacing: -.01em; color: var(--ink);
}
.card-name:hover { text-decoration: none; color: var(--accent); }
.prio {
  appearance: none; border: 1px solid var(--line); background: var(--surface);
  border-radius: 8px; padding: 4px 8px; cursor: pointer;
  font-family: var(--mono); font-size: 12px; color: var(--muted);
}
.card-next { margin: 11px 0 0; padding-left: 17px; }
.next-text { font-size: 16px; margin-top: 4px; text-wrap: pretty; }
.next-empty { color: var(--faint); }
.card-meta {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin: 12px 0 0; padding-left: 17px; font-size: 12px; color: var(--faint);
}
.card-meta.is-stale .touched { color: var(--stale-ink); }
.pill-stale {
  font-family: var(--mono); font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase;
  border: 1px solid var(--stale2); color: var(--stale-ink); border-radius: 999px; padding: 2px 7px;
}
.card-links { display: flex; gap: 8px; }
.card-links a {
  font-family: var(--mono); font-size: 11px; color: var(--muted);
  border-bottom: 1px solid var(--line);
}
.card-acts {
  display: flex; gap: 8px; margin-top: 13px; padding-top: 12px;
  border-top: 1px solid var(--line);
}
.act {
  flex: 1; height: 44px; border: 1px solid var(--line); border-radius: 10px;
  cursor: pointer; font-size: 13.5px; background: var(--surface); color: var(--muted);
}
.act-primary { border: 0; background: var(--accent-soft); color: var(--accent); font-weight: 500; }
.act form { display: contents; }
.feed-footer { text-align: center; padding: 26px 0 6px; font-size: 12.5px; color: var(--faint); }

/* ---------------------------------------------------------- project page */

.back { border: 0; background: none; padding: 0 0 14px; cursor: pointer; font-size: 13px; color: var(--muted); display: inline-block; }
.title-input {
  width: 100%; border: 0; border-bottom: 1px solid transparent; background: none;
  padding: 2px 0; font-size: 26px; font-weight: 600; letter-spacing: -.02em; outline: none;
}
.title-input:focus { border-bottom-color: var(--line); }
.statusrow { display: flex; gap: 8px; margin: 12px 0 4px; flex-wrap: wrap; align-items: center; }
.status-pill {
  border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px;
  font-size: 12.5px; cursor: pointer; background: var(--surface); color: var(--muted);
  text-transform: capitalize;
}
.status-pill[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent); }
.prio-round { border-radius: 999px; padding: 6px 12px; }
.desc-input {
  width: 100%; margin-top: 10px; border: 0; background: none; padding: 0; resize: none;
  outline: none; font-size: 14.5px; color: var(--muted); line-height: 1.5; font-family: inherit;
}
.linkrow { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0 22px; }
.linkpill {
  font-family: var(--mono); font-size: 11.5px; color: var(--muted);
  border: 1px solid var(--line); border-radius: 999px; padding: 5px 10px;
}
.linkpill:hover { text-decoration: none; color: var(--ink); }
.linkpill-add {
  color: var(--faint); border: 1px dashed var(--line); background: none; cursor: pointer;
}
.links-edit { width: 100%; margin-top: 8px; }

.todos { display: flex; flex-direction: column; }
.todo-row {
  display: flex; align-items: center; gap: 8px; padding: 9px 0;
  border-bottom: 1px solid var(--line);
}
.check {
  width: 22px; height: 22px; flex: 0 0 auto; border: 1px solid var(--line);
  border-radius: 6px; background: var(--surface); cursor: pointer;
  color: var(--faint); font-size: 12px; line-height: 1;
}
.check:hover { color: var(--ok); border-color: var(--ok); }
.todo-text {
  flex: 1; min-width: 0; font-size: 15px; text-wrap: pretty; line-height: 1.45;
  border: 0; background: none; padding: 2px 0; outline: none; font-family: inherit;
  resize: none; overflow: hidden; field-sizing: content;
}
.todo-text:focus { border-bottom: 1px solid var(--line); }
.tbtn {
  height: 34px; padding: 0 8px; border: 0; background: none; cursor: pointer;
  font-size: 12px; color: var(--faint);
}
.tbtn-box {
  width: 34px; height: 34px; padding: 0; border: 1px solid var(--line);
  border-radius: 8px; background: var(--surface); color: var(--muted);
}
.tbtn:disabled { opacity: .3; cursor: default; }
.dashed {
  margin-top: 12px; border: 1px dashed var(--line); background: none; border-radius: 10px;
  padding: 11px 14px; width: 100%; text-align: left; cursor: pointer;
  color: var(--faint); font-size: 14px;
}
.dashed:hover { color: var(--ink); border-color: var(--muted); }
details.plain > summary { cursor: pointer; list-style: none; font-size: 13px; color: var(--faint); }
details.plain > summary::-webkit-details-marker { display: none; }
.done-row {
  padding: 7px 0; font-size: 14px; color: var(--faint);
  border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 8px;
}
.done-row s { flex: 1; }

.logrow { display: flex; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.logwhen {
  flex: 0 0 84px; font-family: var(--mono); font-size: 11.5px;
  color: var(--faint); padding-top: 2px;
}
.logtext { flex: 1; font-size: 14.5px; text-wrap: pretty; white-space: pre-wrap; }
.logproject { border: 0; background: none; padding: 2px 0 0; cursor: pointer; font-size: 12px; color: var(--muted); }

.danger-zone { margin: 44px 0 0; padding-top: 18px; border-top: 1px solid var(--line); }
.btn-danger-outline {
  border: 1px solid var(--line); background: none; border-radius: 10px;
  padding: 11px 16px; cursor: pointer; color: var(--bad); font-size: 14px;
}

/* --------------------------------------------------------------- index */

.group { margin-bottom: 28px; }
.idxrow {
  display: flex; align-items: center; gap: 10px; padding: 11px 0;
  border-bottom: 1px solid var(--line);
}
.idxopen {
  flex: 1; min-width: 0; text-align: left; border: 0; background: none; padding: 0;
  cursor: pointer; color: var(--ink); display: flex; flex-direction: column; gap: 2px;
}
.idxopen:hover { text-decoration: none; }
.idxname { font-size: 15px; }
.idxdesc { font-size: 12.5px; color: var(--faint); text-wrap: pretty; }
.idxshort { font-family: var(--mono); font-size: 11px; color: var(--faint); }

/* --------------------------------------------------- forms, buttons, auth */

.field {
  width: 100%; height: 48px; padding: 0 14px; background: var(--surface);
  border: 1px solid var(--line); border-radius: 10px; outline: none; font-family: inherit;
}
.field-lg { height: 52px; font-size: 16px; }
.field:focus { border-color: var(--accent); }
.label-micro {
  display: block; font-size: 12px; letter-spacing: .08em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 6px;
}
.btn-primary {
  width: 100%; height: 50px; border: 0; border-radius: 10px;
  background: var(--accent); color: #fff; font-weight: 500; cursor: pointer;
}
.btn-primary:disabled { background: var(--raise); color: var(--faint); cursor: not-allowed; }
.hint { margin-top: 6px; font-size: 12px; color: var(--faint); }

.prio-choices { display: flex; flex-direction: column; gap: 6px; }
.prio-choice {
  display: flex; align-items: flex-start; gap: 11px; text-align: left; width: 100%;
  padding: 11px 13px; border-radius: 10px; cursor: pointer;
  border: 1px solid var(--line); background: var(--surface);
}
.prio-choice input { position: absolute; opacity: 0; pointer-events: none; }
.prio-choice:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.prio-choice:has(input:checked) .prio-n,
.prio-choice:has(input:checked) .prio-label { color: var(--accent); }
.prio-n { font-family: var(--mono); font-size: 12px; padding-top: 2px; color: var(--ink); }
.prio-body { flex: 1; min-width: 0; }
.prio-label { display: block; font-size: 14.5px; color: var(--ink); }
.prio-hint { display: block; font-size: 12.5px; color: var(--faint); text-wrap: pretty; margin-top: 1px; }

.login {
  min-height: 100vh; display: flex; flex-direction: column; justify-content: center;
  padding: 32px 24px; max-width: 400px; margin: 0 auto;
}
.login h1 { font-size: 28px; font-weight: 600; letter-spacing: -.02em; margin: 10px 0 28px; }
.login .field { margin-bottom: 18px; }
.login .field:last-of-type { margin-bottom: 24px; }
.login p { margin-top: 20px; font-size: 13px; color: var(--faint); text-wrap: pretty; }

/* ------------------------------------------------------ sheets and modals */

dialog { padding: 0; border: 0; background: none; color: var(--ink); max-width: none; max-height: none; }
dialog::backdrop { background: rgba(10, 9, 12, .38); }
dialog.modal::backdrop { background: rgba(10, 9, 12, .45); }

dialog.sheet {
  width: 100%; max-width: 520px; margin: auto auto 0; position: fixed;
  inset: 0; top: auto; border-radius: 18px 18px 0 0;
}
dialog.sheet .sheet-body {
  background: var(--bg); border-radius: 18px 18px 0 0;
  padding: 16px 18px 22px; animation: ph-in .16s ease both;
}
.sheet-head { display: flex; align-items: center; margin-bottom: 14px; }
.sheet-title { font-size: 16px; font-weight: 600; }
.sheet-close { border: 0; background: none; font-size: 20px; color: var(--faint); cursor: pointer; padding: 4px 8px; }
.segmented {
  display: flex; gap: 6px; margin-top: 10px; background: var(--raise);
  border-radius: 10px; padding: 4px;
}
.segmented label {
  flex: 1; height: 40px; border-radius: 8px; cursor: pointer; font-size: 13.5px;
  display: flex; align-items: center; justify-content: center; color: var(--faint);
}
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented label:has(input:checked) { background: var(--surface); color: var(--ink); }
.sheet .btn-primary { height: 52px; margin-top: 12px; }

dialog.modal { margin: auto; width: calc(100% - 40px); max-width: 380px; }
dialog.modal .modal-body {
  background: var(--bg); border: 1px solid var(--line); border-radius: 14px;
  padding: 20px; animation: ph-in .16s ease both;
}
.modal-title { font-size: 17px; font-weight: 600; margin-bottom: 8px; }
.modal-body p { margin: 0 0 14px; font-size: 14px; color: var(--muted); text-wrap: pretty; }
.modal-body strong { color: var(--ink); }
.modal-actions { display: flex; gap: 8px; }
.modal-actions button { flex: 1; height: 46px; border-radius: 10px; cursor: pointer; }
.btn-cancel { border: 1px solid var(--line); background: var(--surface); }
.btn-destroy { border: 0; background: var(--bad); color: #fff; }
.btn-destroy:disabled { background: var(--raise); color: var(--faint); cursor: not-allowed; }

/* Its own keyframes: ph-in ends at `transform: none`, which would undo the
   centring translate. */
@keyframes ph-toast-in {
  from { opacity: 0; transform: translate(-50%, 6px); }
  to { opacity: 1; transform: translateX(-50%); }
}
#toast {
  position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 80;
  background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 999px;
  font-size: 13.5px; animation: ph-toast-in .16s ease both;
  max-width: calc(100% - 36px); text-align: center;
}
#toast:empty { display: none; }

.empty-state { text-align: center; padding: 40px 18px; color: var(--faint); }
.empty-state .btn-primary { max-width: 240px; margin: 16px auto 0; }
