@font-face {
  font-family: "iA Writer Quattro";
  src: url("quattro.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
}
@font-face {
  font-family: "iA Writer Quattro";
  src: url("quattro-bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
}
@font-face {
  font-family: "iA Writer Mono";
  src: url("mono.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
}

:root {
  --ink: #14352F;
  --paper: #D7F0E8;
  --desk: #C5E6DC;
  --panel: #E8F7F2;
  --pill: #B5DDD2;
  --muted: #467269;
  --rule: #9CC9BE;
  --accent: #B34219;
  --done: #1E7656;
  --doing: #8F5A00;
  --alarm: #C13349;
  --header: 4rem;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  background: var(--ink);
  color: var(--ink);
  font-family: "iA Writer Quattro", "Liberation Sans", sans-serif;
  font-size: 16px;
  line-height: 1.45;
}

.frame {
  min-height: 100vh;
  background: var(--ink);
  color: var(--paper);
}

header {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  height: var(--header);
  padding: 0 1.5rem;
  gap: 0.5rem;
  background: var(--ink);
  color: var(--paper);
  border-bottom: 2px solid var(--accent);
}

.wordmark {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-style: italic;
  font-size: 1.25rem;
  font-weight: 500;
  letter-spacing: -0.02em;
  color: var(--paper);
}

.wordmark svg { color: var(--accent); }

.chrome {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  min-height: 1.75rem;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--paper) 25%, transparent);
  background: color-mix(in srgb, var(--paper) 10%, transparent);
  color: color-mix(in srgb, var(--paper) 80%, transparent);
  font-family: "iA Writer Mono", ui-monospace, monospace;
  font-size: 0.75rem;
  white-space: nowrap;
}

.chip.open {
  border-color: var(--accent);
  color: var(--paper);
}

.avatar {
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 999px;
  background:
    radial-gradient(circle at 35% 30%, #f3d7c4 0 28%, transparent 29%),
    radial-gradient(circle at 50% 70%, #c47a4a 0 55%, #6b3a24 56%);
  border: 1px solid color-mix(in srgb, var(--paper) 30%, transparent);
}

.page {
  background: var(--paper);
  min-height: calc(100vh - var(--header));
  color: var(--ink);
  padding: 2rem 2.5rem 4rem;
}

.ghost-title {
  font-size: 2.4rem;
  font-weight: 500;
  letter-spacing: -0.03em;
  color: color-mix(in srgb, var(--ink) 55%, var(--paper));
  margin-bottom: 1.25rem;
}

.ghost-row {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  color: color-mix(in srgb, var(--ink) 38%, var(--paper));
  font-size: 1rem;
  padding: 0.35rem 0;
}
.ghost-row .dot {
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--ink) 28%, var(--paper));
}
.ghost-row.indent { padding-left: 1.25rem; }

.panel {
  position: fixed;
  top: calc(var(--header) + 8px);
  right: 5.5rem;
  width: 384px;
  max-height: calc(100vh - var(--header) - 24px);
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0.85rem 1rem 1rem;
  background: var(--panel);
  color: var(--ink);
  border-radius: 1rem;
  box-shadow:
    0 1px 0 color-mix(in srgb, var(--ink) 8%, transparent),
    0 24px 48px -20px color-mix(in srgb, var(--ink) 38%, transparent);
  ring: none;
  outline: 1px solid color-mix(in srgb, var(--rule) 40%, transparent);
  z-index: 50;
}

.section {
  padding: 0.15rem 0 0.55rem;
}
.section + .section {
  border-top: 1px solid color-mix(in srgb, var(--rule) 55%, transparent);
  padding-top: 0.55rem;
  margin-top: 0.15rem;
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.15rem 0 0.4rem;
  color: var(--muted);
  font-size: 0.72rem;
  letter-spacing: 0.01em;
}
.section-head .name {
  font-weight: 700;
  color: var(--ink);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.section-head.needs .name { color: var(--alarm); }
.section-head .count { color: var(--muted); }

.collapsed {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  background: none;
  border: 0;
  padding: 0.42rem 0;
  color: var(--muted);
  font: inherit;
  font-size: 0.8rem;
  cursor: default;
}
.collapsed .left {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.chev {
  display: inline-block;
  width: 0.55rem;
  color: color-mix(in srgb, var(--muted) 80%, var(--panel));
}

.row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  column-gap: 0.75rem;
  min-height: 1.85rem;
  padding: 0.18rem 0;
}
.row .label {
  font-size: 0.875rem;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 0.45rem;
  min-width: 0;
}
.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-left: 0.15rem;
}
.chip-soft {
  font-size: 0.68rem;
  line-height: 1.2;
  color: var(--muted);
  background: color-mix(in srgb, var(--pill) 55%, var(--panel));
  border-radius: 999px;
  padding: 0.12rem 0.45rem;
  white-space: nowrap;
}

.hint {
  grid-column: 1 / -1;
  font-size: 0.75rem;
  line-height: 1.45;
  color: var(--muted);
  padding: 0.1rem 0 0.35rem;
}
.hint.alarm { color: var(--alarm); }
.hint.doing { color: var(--doing); }

.switch {
  width: 2.05rem;
  height: 1.15rem;
  border-radius: 999px;
  background: var(--rule);
  position: relative;
  flex-shrink: 0;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ink) 6%, transparent);
}
.switch.on { background: var(--done); }
.switch::after {
  content: "";
  position: absolute;
  top: 0.12rem;
  left: 0.12rem;
  width: 0.9rem;
  height: 0.9rem;
  border-radius: 999px;
  background: var(--panel);
  box-shadow: 0 1px 2px color-mix(in srgb, var(--ink) 18%, transparent);
}
.switch.on::after { left: 1.02rem; }

.pip {
  width: 0.42rem;
  height: 0.42rem;
  border-radius: 999px;
  flex-shrink: 0;
}
.pip.wait { background: var(--doing); }
.pip.fail { background: var(--alarm); }
.pip.pending { background: var(--accent); }

.confirm {
  grid-column: 1 / -1;
  margin: 0.15rem 0 0.45rem;
  padding: 0.55rem 0.65rem;
  border-radius: 0.55rem;
  background: color-mix(in srgb, var(--alarm) 8%, var(--panel));
  border: 1px solid color-mix(in srgb, var(--alarm) 22%, var(--rule));
}
.confirm p {
  font-size: 0.75rem;
  color: var(--ink);
  line-height: 1.45;
  margin-bottom: 0.5rem;
}
.confirm .acts {
  display: flex;
  gap: 0.4rem;
}
.btn {
  font: inherit;
  font-size: 0.72rem;
  padding: 0.28rem 0.55rem;
  border-radius: 0.4rem;
  border: 1px solid var(--rule);
  background: var(--panel);
  color: var(--ink);
}
.btn.danger {
  border-color: color-mix(in srgb, var(--alarm) 45%, var(--rule));
  color: var(--alarm);
}

.source {
  grid-column: 1 / -1;
  margin: 0.15rem 0 0.4rem;
  padding: 0.5rem 0.6rem;
  border: 1px solid color-mix(in srgb, var(--rule) 70%, transparent);
  border-radius: 0.5rem;
  font-size: 0.72rem;
}
.source .sum {
  color: var(--muted);
  margin-bottom: 0.4rem;
}
.source pre {
  font-family: "iA Writer Mono", ui-monospace, monospace;
  font-size: 0.68rem;
  line-height: 1.45;
  color: var(--ink);
  white-space: pre-wrap;
  max-height: 7.5rem;
  overflow: auto;
  background: color-mix(in srgb, var(--desk) 55%, var(--panel));
  padding: 0.45rem 0.5rem;
  border-radius: 0.35rem;
}
.source .acts {
  display: flex;
  gap: 0.4rem;
  margin-top: 0.45rem;
}

.foot {
  margin-top: 0.35rem;
  padding-top: 0.7rem;
  border-top: 1px solid color-mix(in srgb, var(--rule) 55%, transparent);
  font-size: 0.72rem;
  line-height: 1.5;
  color: var(--muted);
  overflow-wrap: anywhere;
}
.foot code {
  font-family: "iA Writer Mono", ui-monospace, monospace;
  font-size: 0.68rem;
}

.views {
  position: fixed;
  left: 2.5rem;
  bottom: 1.5rem;
  z-index: 60;
  display: flex;
  gap: 0.75rem;
  font-size: 0.8rem;
}
.views a {
  color: color-mix(in srgb, var(--ink) 55%, var(--paper));
  text-decoration: none;
}
.views a.on, .views a:hover { color: var(--ink); }

.panel::-webkit-scrollbar { width: 0.45rem; }
.panel::-webkit-scrollbar-thumb {
  background: color-mix(in srgb, var(--ink) 22%, transparent);
  border-radius: 999px;
}
