@font-face {
  font-family: Igoe;
  src: url("/assets/Igoe.otf") format("opentype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
:root {
  color-scheme: dark;
  --bg: #070707;
  --panel: #101010;
  --line: #30302c;
  --red: #ff190c;
  --text: #f3f0e7;
  --muted: #aaa99f;
  --green: #a4cdac;
  --mono: ui-monospace, SFMono-Regular, Consolas, monospace;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font:
    16px/1.55 Arial,
    Helvetica,
    sans-serif;
}
button,
input,
textarea,
select {
  font: inherit;
}
button,
a,
input,
textarea,
select {
  touch-action: manipulation;
}
button,
a {
  -webkit-tap-highlight-color: transparent;
}
a {
  color: inherit;
  text-underline-offset: 4px;
}
button {
  cursor: pointer;
}
button:disabled {
  cursor: wait;
  opacity: 0.5;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 2px solid #f3f0e7;
  outline-offset: 4px;
}
button,
input,
textarea,
select {
  border-radius: 0;
}
h1,
h2,
h3,
p {
  margin: 0;
}
h1 {
  font-size: clamp(30px, 4.2vw, 56px);
  line-height: 1.05;
  letter-spacing: -0.04em;
  max-width: 1000px;
  overflow-wrap: anywhere;
}
h2 {
  font-size: 24px;
  line-height: 1.2;
  letter-spacing: -0.02em;
}
h3 {
  font-size: 18px;
}
p + p {
  margin-top: 12px;
}
.muted,
small {
  color: var(--muted);
}
.eyebrow {
  font: 12px/1.6 var(--mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 14px;
}
.red {
  color: var(--red);
}
.igoe {
  font-family: Igoe, Arial, sans-serif;
  font-weight: 400;
  letter-spacing: 0;
}
.skip {
  position: absolute;
  top: -100px;
}
.skip:focus {
  top: 8px;
  left: 8px;
  z-index: 100;
  background: var(--red);
  padding: 10px;
  color: black;
}
.topbar {
  min-height: 80px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 18px 4vw;
  background: #070707;
}
.brand {
  display: flex;
  align-items: center;
  gap: 16px;
  text-decoration: none;
}
.brand img {
  height: 38px;
  width: 33px;
  object-fit: contain;
}
.brand span {
  font: 12px var(--mono);
  letter-spacing: 0.15em;
}
.brand b {
  color: var(--red);
  font-weight: 400;
}
#account {
  display: flex;
  gap: 18px;
  align-items: center;
  font-size: 13px;
}
#main {
  max-width: 1440px;
  margin: auto;
  padding: 42px 4vw 80px;
  min-height: 75vh;
}
.loading {
  color: var(--muted);
  padding: 50px 0;
}
.btn {
  min-height: 44px;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  padding: 11px 18px;
  font-weight: 700;
  text-decoration: none;
  line-height: 1.35;
}
.btn:hover {
  background: #22221e;
  border-color: #66665d;
}
.btn.primary {
  background: var(--red);
  border-color: var(--red);
  color: #050505;
}
.btn.primary:hover {
  background: #ff493d;
}
.btn.small {
  padding: 8px 12px;
  min-height: 40px;
  font-size: 13px;
}
.textbtn {
  background: none;
  border: 0;
  color: var(--muted);
  padding: 8px 0;
  text-decoration: underline;
  text-underline-offset: 4px;
  font-size: 13px;
}
.textbtn:hover {
  color: var(--text);
}
.row {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}
.between {
  justify-content: space-between;
}
.stack {
  display: grid;
  gap: 20px;
}
.pagehead {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 24px;
  margin: 0 0 32px;
}
.pagehead p {
  margin-top: 16px;
}
.pagehead .btn {
  flex-shrink: 0;
}
.nav {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 28px;
  overflow-x: auto;
}
.nav button {
  background: none;
  border: 0;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  padding: 12px 20px;
  white-space: nowrap;
}
.nav button[aria-current="page"] {
  color: var(--text);
  border-color: var(--red);
}
.metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border: 1px solid var(--line);
  margin-bottom: 32px;
}
.metric {
  padding: 20px 24px;
  border-right: 1px solid var(--line);
}
.metric:last-child {
  border: 0;
}
.metric strong {
  display: block;
  font:
    32px/1.3 Igoe,
    Arial,
    sans-serif;
  margin-top: 8px;
}
.metric span {
  font: 11px var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 330px), 1fr));
  gap: 18px;
}
.card {
  padding: 24px;
  border: 1px solid var(--line);
  background: var(--panel);
  min-width: 0;
}
.card h3 {
  overflow-wrap: anywhere;
}
.card p {
  margin-top: 12px;
}
.card .cardfoot {
  border-top: 1px solid var(--line);
  margin-top: 20px;
  padding-top: 18px;
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}
.empty {
  padding: 42px;
  border: 1px dashed #44443d;
  max-width: 760px;
}
.empty p {
  color: var(--muted);
  margin: 14px 0 24px;
}
.badge {
  display: inline-block;
  font: 11px/1.5 var(--mono);
  padding: 5px 8px;
  border: 1px solid #494941;
  color: var(--muted);
  text-transform: uppercase;
  white-space: nowrap;
}
.badge.approved,
.badge.completed,
.badge.delivered {
  color: var(--green);
  border-color: #3d6345;
}
.badge.awaiting_approval,
.badge.changes_requested,
.badge.paused {
  color: #ffae79;
  border-color: #82522e;
}
.bar {
  height: 4px;
  background: #33332e;
  margin: 16px 0 8px;
}
.bar > i {
  height: 100%;
  display: block;
  background: var(--red);
}
.sprint-card h3 {
  font-size: 23px;
  margin-top: 16px;
}
.next {
  color: var(--text);
  font-size: 14px;
}
.workspace {
  display: grid;
  grid-template-columns: 245px minmax(0, 1fr);
  gap: 28px;
  margin-top: 30px;
}
.phasenav {
  display: grid;
  gap: 6px;
  align-self: start;
  position: sticky;
  top: 20px;
}
.phase-tab {
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  padding: 16px 12px;
  text-align: left;
  display: grid;
  grid-template-columns: 40px 1fr;
  column-gap: 12px;
  align-items: start;
  width: 100%;
}
.phase-tab > span:first-child {
  font:
    20px/1.2 Igoe,
    Arial,
    sans-serif;
  color: #77776c;
}
.phase-tab strong {
  font-size: 14px;
  display: block;
  font-weight: 500;
}
.phase-tab small {
  font: 10px var(--mono);
  text-transform: uppercase;
  display: block;
  margin-top: 6px;
}
.phase-tab[aria-current="step"] {
  border-color: var(--red);
  background: #21100d;
  color: var(--text);
}
.phase-tab[aria-current="step"] > span:first-child {
  color: var(--red);
}
.phase-tab:hover {
  background: #1b1b17;
}
.phasecontent {
  min-width: 0;
}
.phasehead {
  padding-bottom: 24px;
  margin-bottom: 26px;
  border-bottom: 1px solid var(--line);
}
.phasehead h2 {
  font-size: clamp(26px, 3.5vw, 40px);
}
.phasehead .muted {
  margin-top: 14px;
}
.field {
  display: grid;
  gap: 8px;
  margin-bottom: 18px;
  min-width: 0;
}
.field > span,
.field > label {
  font-size: 13px;
  color: var(--muted);
}
input,
textarea,
select {
  width: 100%;
  color: var(--text);
  background: #0a0a08;
  border: 1px solid #49493f;
  padding: 12px 14px;
  min-height: 46px;
}
textarea {
  resize: vertical;
  min-height: 110px;
  line-height: 1.5;
}
.formgrid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 18px;
}
.full {
  grid-column: 1/-1;
}
.formfoot {
  border-top: 1px solid var(--line);
  padding-top: 20px;
  margin-top: 12px;
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  flex-wrap: wrap;
}
.help {
  font-size: 13px;
  color: var(--muted);
  margin: 12px 0 20px;
}
.block {
  margin-bottom: 26px;
}
.block h3 {
  font: 11px var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--muted);
  margin-bottom: 10px;
}
.prose {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  max-width: 75ch;
}
.system-map {
  margin: 0;
  max-width: 100%;
  overflow-x: auto;
  padding: 18px 20px;
  border: 1px solid var(--line);
  background: #10100e;
  color: var(--text);
  font: 14px/1.65 var(--mono);
  white-space: pre;
  tab-size: 2;
  -webkit-overflow-scrolling: touch;
}
textarea[name="system_map"] {
  min-height: 320px;
  font-family: var(--mono);
  font-size: 14px;
  line-height: 1.6;
  white-space: pre;
  overflow-x: auto;
  overflow-wrap: normal;
  tab-size: 2;
}
.flow {
  list-style: none;
  counter-reset: step;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 10px;
}
.flow li {
  border: 1px solid var(--line);
  padding: 15px 16px 15px 52px;
  position: relative;
  background: #10100e;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.flow li:before {
  counter-increment: step;
  content: counter(step, decimal-leading-zero);
  position: absolute;
  left: 15px;
  top: 17px;
  color: var(--red);
  font: 12px var(--mono);
}
.checklist {
  list-style: none;
  padding: 0;
  display: grid;
  gap: 10px;
}
.checklist li {
  display: flex;
  gap: 12px;
}
.checklist .done {
  color: var(--green);
}
.approval {
  background: #23130c;
  border: 1px solid #745037;
  padding: 24px;
  margin-top: 28px;
}
.approval p {
  margin: 12px 0 18px;
}
.approved-note {
  background: #122017;
  border: 1px solid #3d6345;
  padding: 18px;
  margin-bottom: 24px;
}
.noticebox {
  padding: 18px 20px;
  border-left: 2px solid var(--red);
  background: #19110f;
  margin: 20px 0;
  color: #d8c7be;
  font-size: 14px;
}
.history {
  border-top: 1px solid var(--line);
  padding-top: 20px;
  margin-top: 28px;
}
.history summary {
  cursor: pointer;
  color: var(--muted);
  font-size: 14px;
}
.event {
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}
.event p {
  margin-top: 8px;
}
.task {
  display: flex;
  gap: 12px;
  align-items: start;
  padding: 15px 0;
  border-bottom: 1px solid var(--line);
}
.task input {
  width: 20px;
  min-height: 20px;
  flex-shrink: 0;
  margin-top: 3px;
  accent-color: var(--red);
}
.task span {
  overflow-wrap: anywhere;
}
.task small {
  display: block;
}
.task.done span {
  text-decoration: line-through;
  color: var(--muted);
}
.attachments {
  padding: 20px;
  border: 1px solid var(--line);
  margin-top: 24px;
}
.attachments h3 {
  margin-bottom: 12px;
}
.file {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.file span {
  overflow-wrap: anywhere;
  min-width: 0;
}
.file small {
  display: block;
}
.measure {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border: 1px solid var(--line);
  margin: 20px 0;
}
.measure > div {
  padding: 18px;
  border-right: 1px solid var(--line);
}
.measure > div:last-child {
  border: 0;
}
.measure small {
  font: 11px var(--mono);
  text-transform: uppercase;
}
.measure strong {
  display: block;
  font-size: 28px;
  overflow-wrap: anywhere;
  margin: 8px 0;
}
.auth {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 8vw;
  align-items: center;
  min-height: 65vh;
  padding: 30px 3vw;
}
.auth-copy h1 {
  max-width: 640px;
}
.auth-copy > p {
  margin: 24px 0;
  color: var(--muted);
  max-width: 490px;
}
.auth-steps {
  margin-top: 30px;
  display: grid;
  gap: 12px;
  font: 12px var(--mono);
  color: var(--muted);
}
.auth-steps span {
  color: var(--red);
  margin-right: 12px;
}
.authbox {
  padding: 30px;
  border: 1px solid var(--line);
  background: var(--panel);
  max-width: 480px;
  width: 100%;
  justify-self: end;
}
.authbox h2 {
  margin-bottom: 12px;
}
.authbox > p {
  margin-bottom: 28px;
}
.authbox .btn {
  width: 100%;
}
.authbox .help {
  margin-bottom: 0;
}
.backlink {
  display: block;
  margin-top: 26px;
  font-size: 13px;
  color: var(--muted);
}
#notice {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 40;
  max-width: min(540px, calc(100vw - 32px));
  padding: 0;
}
#notice:not(:empty) {
  padding: 16px 24px;
  border: 1px solid #888877;
  background: #22221c;
  box-shadow: 0 10px 50px #0009;
}
.error {
  color: #ffb5aa !important;
}
.error:not(:empty) {
  padding: 12px 0;
}
.success {
  color: var(--green);
}
dialog {
  color: var(--text);
  background: #11110f;
  border: 1px solid #4b4b40;
  padding: 28px;
  width: min(640px, calc(100% - 28px));
  max-height: 90dvh;
  overflow: auto;
}
dialog::backdrop {
  background: #000b;
  backdrop-filter: blur(4px);
}
dialog h2 {
  margin: 0 0 24px;
}
.modal-close {
  float: right;
  font-size: 22px;
  padding: 0 8px;
  background: transparent;
  border: 0;
  color: var(--muted);
}
.access-row {
  display: flex;
  gap: 18px;
  align-items: center;
  justify-content: space-between;
  padding: 22px 0;
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}
.access-row small {
  display: block;
}
.access-row .row {
  gap: 8px;
}
.search {
  max-width: 320px;
  margin-bottom: 24px;
}
.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 22px;
}
.toolbar h2 {
  font-size: 20px;
}
.print-only {
  display: none;
}
@media (max-width: 900px) {
  .workspace {
    grid-template-columns: 195px minmax(0, 1fr);
    gap: 20px;
  }
  .phase-tab {
    padding: 12px 8px;
    grid-template-columns: 40px 1fr;
    gap: 8px;
  }
  .auth {
    gap: 4vw;
    padding: 20px 0;
  }
  .metrics .metric {
    padding: 18px;
  }
  .authbox {
    padding: 24px;
  }
}
@media (max-width: 680px) {
  .topbar {
    min-height: 66px;
    padding: 14px 20px;
  }
  .brand img {
    height: 32px;
    width: 28px;
  }
  .brand {
    gap: 12px;
  }
  #account {
    gap: 10px;
  }
  #account .account-name {
    display: none;
  }
  #main {
    padding: 28px 20px 60px;
  }
  .pagehead {
    display: block;
    margin-bottom: 26px;
  }
  .pagehead > .btn,
  .pagehead > .row {
    margin-top: 20px;
  }
  .pagehead h1 {
    font-size: 36px;
  }
  .metrics {
    grid-template-columns: 1fr 1fr;
  }
  .metrics .metric {
    border-bottom: 1px solid var(--line);
  }
  .metrics .metric:nth-child(2) {
    border-right: 0;
  }
  .metrics .metric:nth-child(n + 3) {
    border-bottom: 0;
  }
  .nav button {
    padding: 12px 14px;
  }
  .card {
    padding: 20px;
  }
  .workspace {
    display: block;
  }
  .phasenav {
    position: static;
    display: flex;
    overflow-x: auto;
    gap: 8px;
    margin: 0 -20px 28px;
    padding: 0 20px 10px;
  }
  .phase-tab {
    width: 176px;
    flex-shrink: 0;
    padding: 14px;
    border-color: var(--line);
    grid-template-columns: 40px 1fr;
  }
  .phase-tab small {
    font-size: 9px;
  }
  .phasehead h2 {
    font-size: 30px;
  }
  .phasehead {
    margin-bottom: 22px;
  }
  .formgrid {
    grid-template-columns: 1fr;
  }
  .auth {
    display: block;
    padding: 12px 0;
  }
  .auth-copy h1 {
    font-size: 40px;
  }
  .auth-copy > p {
    margin: 18px 0;
  }
  .auth-steps {
    display: none;
  }
  .authbox {
    margin: 32px 0 0;
    max-width: 100%;
    padding: 24px;
  }
  .auth-copy .eyebrow {
    font-size: 11px;
  }
  .formfoot {
    justify-content: stretch;
  }
  .formfoot .btn {
    flex: 1;
  }
  .empty {
    padding: 26px;
  }
  .measure > div {
    padding: 12px;
  }
  .measure strong {
    font-size: 24px;
  }
  .approval {
    padding: 20px;
  }
  .badge {
    font-size: 10px;
  }
  .prose {
    font-size: 16px;
  }
  .field {
    margin-bottom: 16px;
  }
  .file {
    align-items: start;
  }
  .noticebox {
    font-size: 13px;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
  }
}
@media print {
  .topbar,
  .phasenav,
  .nav,
  .btn,
  .textbtn,
  #notice,
  .formfoot,
  .backlink {
    display: none !important;
  }
  body {
    background: white;
    color: black;
  }
  .workspace {
    display: block;
  }
  .card,
  .block,
  .phasehead {
    break-inside: avoid;
  }
  #main {
    padding: 0;
    max-width: none;
  }
  .prose {
    color: black;
  }
  .print-only {
    display: block;
  }
}
/* Quiet, persistent change notices: never cover phase text or move the reader. */
.notification {
  margin-bottom: 12px;
}
.notification.unread {
  border-left: 3px solid var(--red, #ff1800);
}
/* HOAN System Map · caja alineada a la izquierda + diagrama centrado */
.system-map {
  box-sizing: border-box;

  width: min(100%, 760px);
  margin: 24px auto 24px 0;

  padding: 28px 32px;

  white-space: pre;
  overflow-x: auto;

  font-family: var(--mono);
  line-height: 1.6;

  text-align: center;
  -webkit-overflow-scrolling: touch;
}

.system-map > code {
  display: inline-block;
  min-width: max-content;

  font: inherit;
  color: inherit;

  white-space: pre;
  text-align: left;
}

@media (max-width: 768px) {
  .system-map {
    width: 100%;
    margin: 20px 0;
    padding: 20px 16px;

    font-size: 0.9rem;
    overflow-x: auto;
  }

  .system-map > code {
    min-width: max-content;
  }
}
