:root {
  color-scheme: light;
  --bg: #eadfce;
  --ink: #251d15;
  --muted: #746657;
  --line: rgba(73, 55, 36, .14);
  --panel: rgba(255, 250, 241, .78);
  --panel-strong: rgba(255, 252, 246, .92);
  --cyan: #13766c;
  --amber: #93682d;
  --green: #367a55;
  --red: #a84539;
  --shadow: 0 1px 1px rgba(73, 55, 36, .08), 0 12px 26px rgba(73, 55, 36, .10);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  overflow-x: hidden;
  background:
    linear-gradient(180deg, rgba(255, 250, 241, .38), rgba(233, 223, 208, 0) 180px),
    var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

button,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

noscript {
  display: block;
  padding: 24px;
}

a {
  color: inherit;
}

.suite-topbar {
  background: rgba(255, 252, 246, .98) !important;
  border-bottom: 1px solid rgba(92, 78, 62, .16) !important;
  color: #25150d !important;
  backdrop-filter: none;
}

.suite-app-name,
.suite-topbar-actions,
.suite-topbar-actions a {
  color: #25150d !important;
}

.suite-topbar-actions {
  gap: 8px !important;
}

.suite-topbar .sync,
.suite-topbar .stat {
  border-color: rgba(92, 78, 62, .18);
  background: rgba(255, 255, 255, .66);
  color: #665f55;
}

.suite-topbar .sync-local {
  border-color: rgba(85, 139, 126, .32);
  color: #4f7f74;
}

.suite-topbar .ai-stat {
  border-color: rgba(85, 139, 126, .26);
  color: #4f7f74;
}

.paper-strip {
  position: relative;
  z-index: 20;
  display: grid;
  box-sizing: border-box;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 22px;
  width: 100%;
  max-width: 100vw;
  padding: 12px clamp(16px, 3vw, 34px);
  border-bottom: 1px solid rgba(92, 78, 62, .16);
  background: rgba(255, 252, 246, .98);
  color: #25150d;
}

.paper-copy {
  min-width: 0;
}

.paper-copy span {
  display: block;
  margin-bottom: 4px;
  color: rgba(95, 78, 59, .62);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.paper-copy strong {
  display: block;
  color: #25150d;
  font-size: 28px;
  line-height: 1.02;
  overflow-wrap: anywhere;
}

.paper-copy p {
  max-width: 880px;
  margin: 6px 0 0;
  color: rgba(63, 48, 35, .72);
  font-size: 13px;
  font-weight: 650;
  line-height: 1.35;
  overflow-wrap: break-word;
}

.paper-actions {
  display: flex;
  align-items: center;
  gap: 9px;
}

.paper-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border: 1px solid rgba(92, 78, 62, .20);
  border-radius: 6px;
  padding: 0 14px;
  background: rgba(92, 78, 62, .05);
  color: #25150d;
  font-size: 13px;
  font-weight: 900;
  white-space: nowrap;
  text-decoration: none;
}

.paper-button.primary {
  border-color: rgba(209, 172, 81, .46);
  background: #e7bd66;
  color: #21140d;
}

.app-shell {
  width: min(calc(100% - 24px), 720px);
  min-height: 100vh;
  margin: 0 auto;
  padding: 0 0 52px;
}

.memory-shell {
  width: min(calc(100% - 24px), 1780px);
}

.ao-labs-button {
  position: fixed;
  left: 12px;
  top: 12px;
  z-index: 90;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 36px;
  border: 1px solid rgba(73, 55, 36, .14);
  border-radius: 8px;
  padding: 6px 10px 6px 7px;
  background: rgba(255, 252, 246, .86);
  color: rgba(37, 29, 21, .82);
  box-shadow: 0 10px 24px rgba(73, 55, 36, .12);
  font-size: 12px;
  font-weight: 820;
  line-height: 1;
  text-decoration: none;
}

.ao-labs-button img {
  display: block;
  width: 22px;
  height: 22px;
}

.ao-labs-button:hover,
.ao-labs-button:focus-visible {
  background: rgba(255, 252, 246, .96);
  color: var(--ink);
  outline: none;
}

.topbar {
  position: relative;
  top: auto;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 46px;
  padding: 7px 0;
  background: rgba(255, 252, 246, .84);
  border-bottom: 1px solid var(--line);
  backdrop-filter: none;
}

.brand {
  color: var(--ink);
  font-size: 13px;
  font-weight: 900;
  text-decoration: none;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.status-strip {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 7px;
}

.topbar-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-width: 0;
}

.ao-home {
  width: 32px;
  height: 32px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 32px;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.ao-home img {
  width: 30px;
  height: 30px;
  display: block;
}

.sync,
.stat {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 10px;
  background: rgba(255, 255, 255, .58);
  color: var(--muted);
  font-size: 12px;
  font-weight: 820;
  white-space: nowrap;
}

.sync-local {
  border-color: rgba(141, 231, 155, .42);
  color: var(--green);
}

.ai-stat {
  border-color: rgba(104, 214, 200, .35);
  color: var(--cyan);
}

.sync-browser {
  border-color: rgba(230, 179, 77, .42);
  color: var(--amber);
}

.memory-wall {
  padding: 56px 0 56px;
}

.memory-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 22px;
  align-items: end;
  padding: 0 0 20px;
  border-bottom: 1px solid var(--line);
}

.memory-hero h1 {
  max-width: 680px;
  font-size: clamp(36px, 5vw, 68px);
  line-height: .92;
  font-weight: 900;
}

.memory-lede {
  max-width: 540px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 18px;
  font-weight: 650;
  line-height: 1.34;
}

.memory-counts {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.memory-count {
  min-width: 104px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, .68);
}

.memory-count strong,
.memory-count span {
  display: block;
}

.memory-count strong {
  color: var(--ink);
  font-size: 22px;
  line-height: 1;
}

.memory-count span {
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.memory-capture {
  display: grid;
  gap: 12px;
  max-width: 560px;
  margin-top: 28px;
  padding: 18px 0 0;
  border-top: 1px solid var(--line);
}

.memory-capture h2 {
  color: var(--ink);
  font-size: 18px;
  font-weight: 820;
  line-height: 1.2;
}

.memory-gallery {
  display: grid;
  gap: 14px;
  padding-top: 0;
}

.memory-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.memory-card {
  display: block;
  width: 100%;
  min-width: 0;
  margin: 0;
}

.memory-wall .memory-note-card {
  min-height: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 18px 56px 14px 18px;
  background:
    linear-gradient(150deg, rgba(255, 252, 246, .98), rgba(238, 225, 205, .82));
}

.memory-note-card .item-text {
  font-size: clamp(17px, 1.25vw, 22px);
  line-height: 1.22;
  font-weight: 760;
}

.memory-image-card {
  background: rgba(255, 250, 241, .88);
}

.memory-image-card .file-visual {
  padding: 8px;
  background: rgba(255, 252, 246, .74);
}

.memory-image-card .file-visual img {
  height: auto;
  object-fit: contain;
  border-radius: 5px;
}

.memory-wall .file-card {
  display: block;
}

.memory-wall .item-card {
  border: 1px solid rgba(73, 55, 36, .12);
  border-radius: 10px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.memory-wall .item-body {
  border-top: 1px solid rgba(73, 55, 36, .08);
  background: rgba(255, 250, 241, .86);
  padding: 10px 12px 11px;
}

.memory-wall .item-title {
  font-size: 14px;
  font-weight: 720;
  line-height: 1.25;
}

.memory-wall .item-meta {
  margin-top: 7px;
  color: rgba(74, 60, 45, .62);
  font-size: 11px;
  font-weight: 760;
}

.memory-image-card .item-body {
  min-height: 30px;
  padding: 8px 12px 9px;
}

.memory-image-card .item-title {
  display: none;
}

.memory-image-card .item-meta {
  margin-top: 0;
}

.memory-empty {
  padding: 28px 0;
  color: var(--muted);
  font-size: 16px;
  font-weight: 680;
}

.system-view,
.artifact-section,
.design-log-section,
.purchase-section,
.portfolio-section {
  border-bottom: 1px solid var(--line);
  padding: 22px 0;
}

.system-title-block {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: end;
}

.system-title-copy {
  min-width: 0;
}

.system-summary,
.section-note {
  max-width: 780px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 15px;
  font-weight: 650;
  line-height: 1.42;
}

.system-actions,
.artifact-grid,
.portfolio-grid {
  display: grid;
  gap: 10px;
}

.system-actions {
  grid-template-columns: repeat(2, max-content);
}

.system-button,
.artifact-card {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(255, 255, 255, .62);
  color: var(--ink);
  font-size: 12px;
  font-weight: 840;
  text-decoration: none;
}

.system-button {
  padding: 0 14px;
  white-space: nowrap;
}

.system-button.primary {
  border-color: rgba(230, 179, 77, .42);
  background: rgba(230, 179, 77, .9);
  color: #120f09;
}

.system-button:hover,
.system-button:focus-visible,
.artifact-card:hover,
.artifact-card:focus-visible {
  border-color: rgba(104, 214, 200, .68);
  outline: none;
}

.system-facts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 20px;
}

.system-fact,
.portfolio-block,
.artifact-card {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(255, 255, 255, .54);
}

.system-fact,
.portfolio-block {
  padding: 14px;
}

.system-fact-label,
.log-label,
.portfolio-label {
  margin: 0;
  color: var(--amber);
  font-size: 12px;
  font-weight: 900;
  line-height: 1.18;
}

.system-fact-value,
.log-value,
.portfolio-value {
  margin: 8px 0 0;
  color: var(--ink);
  font-size: 14px;
  font-weight: 650;
  line-height: 1.38;
}

.artifact-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.artifact-card {
  display: block;
  color: inherit;
  text-decoration: none;
}

.log-rows {
  display: grid;
  border: 1px solid var(--line);
  border-radius: 7px;
  overflow: hidden;
}

.log-row {
  display: grid;
  grid-template-columns: minmax(140px, .22fr) minmax(0, 1fr);
  gap: 16px;
  padding: 13px 14px;
  background: rgba(255, 255, 255, .42);
}

.log-row + .log-row {
  border-top: 1px solid var(--line);
}

.design-figure-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.design-figure {
  min-width: 0;
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #f4f1ea;
}

.design-figure img {
  display: block;
  width: 100%;
  height: 190px;
  box-sizing: border-box;
  padding: 10px;
  object-fit: contain;
  object-position: top center;
  background: #fff;
}

.design-figure figcaption {
  padding: 10px 12px;
  border-top: 1px solid rgba(0, 0, 0, .12);
  background: #fffaf2;
  color: var(--muted);
  font-size: 12px;
  font-weight: 680;
  line-height: 1.35;
}

.design-figure figcaption strong {
  color: var(--ink);
}

.table-scroll {
  max-width: 100%;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 7px;
}

.purchase-table {
  width: 100%;
  min-width: 920px;
  border-collapse: collapse;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.36;
}

.purchase-table th,
.purchase-table td {
  padding: 12px 13px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.purchase-table th {
  color: var(--amber);
  font-size: 11px;
  font-weight: 900;
}

.purchase-table tbody tr:last-child td {
  border-bottom: 0;
}

.purchase-table td:first-child,
.purchase-table td:nth-child(2),
.purchase-table td:last-child {
  font-weight: 830;
}

.purchase-table td:nth-child(3) {
  color: var(--muted);
}

.inline-link {
  color: var(--cyan);
  text-decoration: none;
  font-weight: 820;
}

.inline-link:hover,
.inline-link:focus-visible {
  text-decoration: underline;
}

.portfolio-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.plain-system-view {
  display: block;
  padding: 28px 0 12px;
}

.plain-system-view h1 {
  font-size: 24px;
  line-height: 1.2;
  font-weight: 720;
}

.plain-lede {
  margin-top: 5px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 560;
  line-height: 1.35;
}

.plain-state-list {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  margin: 16px 0 0;
  border-top: 1px solid var(--line);
  color: var(--ink);
}

.plain-state-list dt,
.plain-state-list dd {
  margin: 0;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
  line-height: 1.35;
}

.plain-state-list dt {
  color: var(--muted);
  font-weight: 600;
}

.plain-state-list dd {
  font-weight: 560;
}

.plain-file-links {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 15px;
}

.plain-file-link {
  color: var(--cyan);
  font-size: 14px;
  font-weight: 650;
  text-decoration: none;
}

.plain-file-link:hover,
.plain-file-link:focus-visible {
  text-decoration: underline;
}

.home-geometry {
  margin: 16px 0 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 14px 0 10px;
}

.home-geometry img {
  display: block;
  width: 100%;
  max-height: 300px;
  object-fit: contain;
  background: #fff;
}

.home-geometry figcaption {
  margin-top: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 560;
}

.progress-section,
.issues-section {
  padding: 16px 0 6px;
}

.progress-section h2,
.issues-section h2 {
  margin: 0 0 10px;
  color: var(--ink);
  font-size: 18px;
  font-weight: 720;
  line-height: 1.2;
  text-transform: none;
}

.progress-table,
.issue-list {
  margin: 0;
  padding: 0;
}

.progress-table {
  width: 100%;
  border-collapse: collapse;
  border-top: 1px solid var(--line);
}

.progress-table th,
.progress-table td {
  border-bottom: 1px solid var(--line);
  padding: 10px 0;
  text-align: left;
  vertical-align: top;
}

.progress-table th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  line-height: 1.25;
}

.progress-table th + th,
.progress-table td + td {
  padding-left: 18px;
}

.progress-time {
  width: 150px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 720;
  line-height: 1.34;
}

.progress-description {
  color: var(--muted);
  font-size: 14px;
  font-weight: 540;
  line-height: 1.38;
}

.progress-location {
  width: 165px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 650;
  line-height: 1.34;
}

.issue-list {
  display: grid;
  gap: 0;
  border-top: 1px solid var(--line);
}

.issue-item {
  display: grid;
  grid-template-columns: minmax(190px, .38fr) minmax(0, 1fr);
  gap: 16px;
  align-items: baseline;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
}

.issue-item strong {
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.34;
}

.issue-item span {
  color: var(--muted);
  font-size: 14px;
  font-weight: 540;
  line-height: 1.38;
}

.design-figure.figure-wide {
  grid-column: span 3;
}

.design-figure.figure-wide img {
  height: auto;
  max-height: 430px;
  object-fit: contain;
}

.plain-details {
  margin-top: 8px;
  border-top: 1px solid var(--line);
}

.plain-details summary {
  min-height: 42px;
  display: flex;
  align-items: center;
  color: var(--ink);
  font-size: 14px;
  font-weight: 650;
  cursor: pointer;
}

.plain-details-body {
  padding: 0 0 14px;
}

.section-drawer {
  border-bottom: 1px solid var(--line);
  margin-top: 0;
}

.section-drawer > .plain-details-body > section {
  border-bottom: 0;
}

.section-drawer .section-head {
  display: none;
}

.records-section {
  display: grid;
  gap: 0;
}

.plain-details-body > .log-row {
  border-top: 1px solid var(--line);
}

.plain-system-view .log-rows,
.plain-system-view .table-scroll {
  border-radius: 0;
  border-left: 0;
  border-right: 0;
}

.plain-system-view .log-row {
  background: transparent;
}

.plain-system-view .log-label {
  color: var(--muted);
  text-transform: none;
}

.plain-system-view .log-value {
  font-weight: 560;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, .95fr);
  gap: 16px;
  align-items: start;
  padding: 16px 0 12px;
}

.capture-workspace {
  grid-template-columns: minmax(0, 1fr);
}

.capture-panel,
.state-panel,
.notes-library,
.focus-library,
.library {
  min-width: 0;
}

.intro {
  max-width: 780px;
  margin-bottom: 10px;
}

.domain,
.section-label {
  margin: 0 0 9px;
  color: var(--amber);
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: clamp(30px, 3vw, 38px);
  font-weight: 900;
  line-height: .96;
}

.intro h2 {
  font-size: 24px;
  font-weight: 840;
  line-height: 1.05;
}

.tagline {
  max-width: 620px;
  margin-top: 6px;
  color: var(--muted);
  font-size: clamp(15px, 1.2vw, 17px);
  font-weight: 590;
  line-height: 1.35;
}

.current-line {
  max-width: 620px;
  margin-top: 16px;
  color: var(--ink);
  font-size: 15px;
  font-weight: 650;
  line-height: 1.4;
}

.current-line span {
  margin-right: 9px;
  color: var(--cyan);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.composer {
  display: grid;
  gap: 10px;
}

.dropzone {
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(255, 255, 255, .60);
  transition: border-color .18s ease, background .18s ease, box-shadow .18s ease;
}

.dropzone:focus-within,
.dropzone.drag-active {
  border-color: rgba(27, 118, 111, .42);
  background: rgba(27, 118, 111, .06);
  box-shadow: 0 0 0 3px rgba(27, 118, 111, .08);
}

.note-input {
  width: 100%;
  min-height: 72px;
  resize: vertical;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 7px 7px 0 0;
  outline: none;
  padding: 13px 14px;
  background: transparent;
  color: var(--ink);
  font-size: 16px;
  font-weight: 590;
  line-height: 1.38;
}

.note-input:focus {
  box-shadow: none;
}

.note-input::placeholder {
  color: rgba(37, 31, 25, .42);
}

.file-inline,
.save-button,
.refresh-button,
.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--ink);
  font-weight: 840;
}

.file-inline {
  position: relative;
  justify-content: flex-start;
  min-height: 42px;
  border: 0;
  border-radius: 0 0 7px 7px;
  padding: 0 14px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 720;
  gap: 8px;
}

.file-inline input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.composer-footer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 118px;
  gap: 10px;
  align-items: center;
}

.save-button {
  min-height: 46px;
  border-color: transparent;
  background: #bff5d7;
  color: #08100d;
  gap: 8px;
}

.pending-list {
  display: flex;
  min-height: 24px;
  flex-wrap: wrap;
  gap: 6px;
}

.pending-chip {
  display: inline-flex;
  max-width: min(280px, 100%);
  min-height: 24px;
  align-items: center;
  overflow: hidden;
  border: 1px solid rgba(104, 214, 200, .38);
  border-radius: 999px;
  padding: 0 9px;
  color: var(--cyan);
  font-size: 11px;
  font-weight: 780;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.state-panel {
  margin-top: 2px;
  padding: 0;
  background: transparent;
}

.state-card {
  min-height: 0;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 18px;
  background: rgba(255, 255, 255, .56);
  box-shadow: var(--shadow);
}

.section-head h2 {
  font-size: 24px;
  font-weight: 840;
  line-height: 1.05;
}

.state-note {
  color: var(--muted);
  font-size: 16px;
  font-weight: 650;
  line-height: 1.5;
}

.state-list {
  display: grid;
  gap: 10px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.state-list li {
  position: relative;
  color: var(--muted);
  font-size: 15px;
  font-weight: 650;
  line-height: 1.36;
  padding-left: 16px;
}

.state-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: .62em;
  width: 5px;
  height: 5px;
  border-radius: 999px;
  background: var(--cyan);
  opacity: .9;
}

.notes-library,
.focus-library,
.library {
  border-top: 1px solid var(--line);
  padding-top: 24px;
  margin-top: 18px;
}

.codex-output {
  margin-top: 16px;
}

.codex-output-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
}

.codex-output-card {
  position: relative;
  display: block;
  min-width: 0;
  min-height: 112px;
  border: 1px solid rgba(27, 118, 111, .22);
  border-radius: 7px;
  background: rgba(255, 255, 255, .56);
  box-shadow: var(--shadow);
  color: inherit;
  text-decoration: none;
}

a.codex-output-card {
  cursor: pointer;
}

a.codex-output-card:hover,
a.codex-output-card:focus-visible {
  border-color: rgba(27, 118, 111, .52);
  background: rgba(27, 118, 111, .07);
  outline: none;
}

.codex-output-card .item-body {
  padding: 16px;
}

.state-bridge-rows {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.state-bridge-row {
  display: grid;
  grid-template-columns: minmax(118px, .28fr) minmax(0, 1fr);
  gap: 12px;
  align-items: baseline;
}

.state-bridge-label {
  color: var(--cyan);
  font-size: 12px;
  font-weight: 820;
  line-height: 1.25;
}

.state-bridge-value {
  color: var(--muted);
  font-size: 12px;
  font-weight: 720;
  line-height: 1.35;
}

.focus-library {
  padding-bottom: 8px;
}

.top-feed {
  border-top: 0;
  border-bottom: 1px solid var(--line);
  margin-top: 0;
  padding-top: 16px;
  padding-bottom: 18px;
}

.feed-controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.archive-library {
  border-top: 0;
  margin-top: 12px;
  padding-top: 0;
}

.section-head {
  display: grid;
  gap: 7px;
  margin-bottom: 14px;
}

.section-head-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.refresh-button {
  min-height: 34px;
  gap: 7px;
  padding: 0 12px;
  background: rgba(255, 255, 255, .56);
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.refresh-button:hover,
.refresh-button:focus-visible {
  border-color: rgba(104, 214, 200, .7);
  color: var(--cyan);
}

.library-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.useful-layout {
  display: grid;
  gap: 22px;
}

.useful-block {
  min-width: 0;
}

.notes-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.ideas-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.tip-grid {
  gap: 10px;
}

.focus-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.focus-card {
  grid-template-rows: 360px auto;
  background: rgba(255, 255, 255, .62);
}

.focus-card .item-body {
  padding: 17px 18px 18px;
}

.focus-card .item-title {
  font-size: 21px;
  line-height: 1.18;
}

.focus-card .item-meta {
  margin-top: 10px;
}

.focus-reason {
  margin-top: 12px;
  color: var(--cyan);
  font-size: 13px;
  font-weight: 830;
  line-height: 1.25;
}

.archive-drawer {
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(255, 255, 255, .48);
}

.archive-summary {
  min-height: 48px;
  display: flex;
  align-items: center;
  padding: 0 14px;
  color: var(--muted);
  cursor: pointer;
  font-size: 13px;
  font-weight: 820;
  list-style: none;
}

.archive-summary::-webkit-details-marker {
  display: none;
}

.archive-drawer[open] .archive-summary {
  border-bottom: 1px solid var(--line);
}

.archive-grid {
  padding: 12px;
}

.approved-drawer {
  margin-top: 2px;
  border-color: rgba(230, 179, 77, .32);
  background: rgba(230, 179, 77, .035);
}

.approved-drawer .archive-summary {
  color: var(--ink);
}

.approved-bank-body,
.approved-bank-block {
  display: grid;
  gap: 12px;
}

.item-card {
  position: relative;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.note-card {
  min-height: 140px;
  padding: 16px 56px 16px 16px;
}

.notes-library .note-card {
  min-height: 116px;
}

.idea-card {
  min-height: 118px;
}

.tip-grid .idea-card {
  min-height: 132px;
  background:
    linear-gradient(155deg, rgba(104, 214, 200, .085), rgba(255, 250, 240, .04) 42%, rgba(230, 179, 77, .04));
}

.tip-grid .idea-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: linear-gradient(180deg, var(--cyan), rgba(230, 179, 77, .75));
}

.idea-card .item-body {
  padding-right: 126px;
}

.tip-grid .idea-card .item-body {
  padding: 18px 126px 18px 18px;
}

.tip-grid .item-title {
  font-size: 18px;
  line-height: 1.32;
}

.item-text,
.item-title {
  color: var(--ink);
  font-size: 17px;
  font-weight: 680;
  line-height: 1.28;
  overflow-wrap: anywhere;
}

.item-meta {
  margin-top: 12px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 720;
}

.item-title a {
  color: var(--cyan);
  text-decoration: none;
}

.item-title a:hover,
.item-title a:focus-visible {
  text-decoration: underline;
}

.file-card {
  display: grid;
  grid-template-rows: 190px auto;
}

.file-visual {
  min-width: 0;
  min-height: 0;
  background: #eee7db;
}

.file-visual img,
.browser-paper-preview iframe {
  display: block;
  width: 100%;
  height: 100%;
}

.file-visual img {
  object-fit: cover;
}

.file-icon {
  height: 100%;
  display: grid;
  place-items: center;
  color: var(--amber);
  font-size: 24px;
  font-weight: 900;
}

.paper-visual {
  position: relative;
  isolation: isolate;
}

.paper-visual::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, .02), rgba(37, 31, 25, .20));
  z-index: 1;
}

.browser-paper-preview,
.paper-preview-empty {
  width: 100%;
  height: 100%;
}

.browser-paper-preview {
  overflow: hidden;
  background: #f6f2e9;
}

.browser-paper-preview iframe {
  border: 0;
  background: #f6f2e9;
  pointer-events: none;
}

.paper-preview-empty {
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, rgba(255, 255, 255, .74), rgba(238, 231, 219, .68));
  color: rgba(37, 31, 25, .54);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.paper-badge {
  position: absolute;
  z-index: 2;
  left: 14px;
}

.paper-badge {
  top: 12px;
  border: 1px solid rgba(45, 36, 28, .18);
  border-radius: 999px;
  padding: 4px 8px;
  background: rgba(255, 252, 246, .76);
  color: var(--ink);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
  backdrop-filter: blur(8px);
}

.paper-card .item-title {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.paper-card {
  cursor: pointer;
}

.paper-card:focus-visible {
  outline: 2px solid rgba(104, 214, 200, .55);
  outline-offset: 3px;
}

.item-body {
  min-width: 0;
  padding: 14px;
}

.item-actions {
  position: absolute;
  right: 10px;
  top: 10px;
  display: flex;
  gap: 7px;
  opacity: 0;
  transform: translateY(-2px);
  transition: opacity .16s ease, transform .16s ease;
}

.item-card:hover .item-actions,
.item-card:focus-within .item-actions {
  opacity: 1;
  transform: translateY(0);
}

.icon-button {
  width: 36px;
  height: 36px;
  padding: 0;
  border-color: rgba(73, 55, 36, .16);
  background: rgba(255, 250, 241, .90);
  box-shadow: 0 8px 18px rgba(73, 55, 36, .12);
  backdrop-filter: none;
}

.icon-button:hover,
.icon-button:focus-visible {
  border-color: rgba(104, 214, 200, .7);
  color: var(--cyan);
}

.icon-button.active {
  background: rgba(104, 214, 200, .12);
}

.icon-button.feedback-useful.active,
.icon-button.feedback-useful:hover,
.icon-button.feedback-useful:focus-visible {
  border-color: rgba(141, 231, 155, .7);
  color: var(--green);
}

.icon-button.feedback-not-useful.active,
.icon-button.feedback-not-useful:hover,
.icon-button.feedback-not-useful:focus-visible {
  border-color: rgba(244, 106, 95, .72);
  color: var(--red);
}

.icon-button.feedback-skip:hover,
.icon-button.feedback-skip:focus-visible {
  border-color: rgba(230, 179, 77, .7);
  color: var(--amber);
}

.icon-button.danger:hover,
.icon-button.danger:focus-visible {
  border-color: rgba(244, 106, 95, .72);
  color: var(--red);
}

.paper-kept {
  border-color: rgba(141, 231, 155, .32);
}

.paper-dismissed {
  opacity: .48;
}

svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  stroke-width: 2.1;
}

.toast {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 50;
  max-width: min(360px, calc(100vw - 32px));
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 12px 14px;
  background: #fffaf2;
  color: var(--ink);
  font-size: 13px;
  font-weight: 760;
  box-shadow: var(--shadow);
}

@media (max-width: 900px) {
  .paper-strip {
    display: block;
    grid-template-columns: 1fr;
    align-items: start;
    overflow: hidden;
  }

  .paper-copy strong {
    max-width: min(100%, 27ch);
    font-size: clamp(16px, 4.1vw, 20px);
    line-height: 1.08;
  }

  .paper-actions {
    margin-top: 14px;
    justify-content: flex-start;
  }

  .system-title-block,
  .system-actions,
  .system-facts,
  .artifact-grid,
  .design-figure-grid,
  .portfolio-grid,
  .workspace,
  .codex-output-grid,
  .ideas-grid,
  .notes-grid,
  .focus-grid,
  .library-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .memory-hero {
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
  }

  .memory-counts {
    justify-content: flex-start;
  }

  .memory-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .system-actions {
    align-items: stretch;
  }

  .system-button {
    width: 100%;
  }

  .design-figure img {
    aspect-ratio: auto;
    height: auto;
    object-fit: contain;
  }

  .state-panel {
    padding: 0;
  }

  .focus-card {
    grid-template-rows: 300px auto;
  }

  .save-button {
    min-height: 54px;
  }
}

@media (max-width: 560px) {
  .suite-topbar {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    gap: 8px 10px !important;
  }

  .suite-brand-cluster,
  .suite-topbar-actions {
    flex: 1 0 100% !important;
    justify-content: flex-start !important;
  }

  .suite-app-name {
    max-width: none !important;
    overflow: visible !important;
  }

  .paper-copy strong {
    max-width: min(100%, 27ch);
    font-size: clamp(16px, 4.1vw, 20px);
    line-height: 1.08;
    word-break: normal;
  }

  .paper-copy p {
    display: none;
    max-width: calc(100vw - 32px);
    word-break: break-word;
  }

  .paper-button {
    width: 100%;
  }

  .app-shell {
    width: calc(100% - 12px);
    margin-left: 6px;
    margin-right: auto;
  }

  .memory-wall {
    padding-top: 52px;
  }

  .memory-hero h1 {
    font-size: 40px;
  }

  .memory-lede {
    font-size: 16px;
  }

  .memory-count {
    min-width: calc(50% - 5px);
  }

  .memory-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .item-actions {
    opacity: 1;
    transform: none;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .status-strip {
    justify-content: flex-start;
  }

  .workspace {
    padding-top: 28px;
  }

  .system-view,
  .artifact-section,
  .design-log-section,
  .purchase-section,
  .portfolio-section {
    padding: 18px 0;
  }

  .log-row {
    grid-template-columns: minmax(0, 1fr);
    gap: 5px;
  }

  .issue-item {
    grid-template-columns: minmax(0, 1fr);
    gap: 4px;
    align-items: start;
  }

  .progress-table thead {
    display: none;
  }

  .progress-table,
  .progress-table tbody,
  .progress-table tr,
  .progress-table td {
    display: block;
    width: 100%;
  }

  .progress-table tr {
    padding: 10px 0;
    border-bottom: 1px solid var(--line);
  }

  .progress-table td {
    border-bottom: 0;
    padding: 2px 0;
  }

  .progress-table td + td {
    padding-left: 0;
  }

  .progress-location {
    color: var(--muted);
  }

  .table-scroll {
    overflow-x: visible;
  }

  .purchase-table {
    min-width: 0;
    font-size: 13px;
  }

  .purchase-table thead {
    display: none;
  }

  .purchase-table,
  .purchase-table tbody,
  .purchase-table tr,
  .purchase-table td {
    display: block;
    width: 100%;
  }

  .purchase-table tr {
    padding: 13px;
    border-bottom: 1px solid var(--line);
  }

  .purchase-table tbody tr:last-child {
    border-bottom: 0;
  }

  .purchase-table td {
    padding: 0;
    border-bottom: 0;
  }

  .purchase-table td + td {
    margin-top: 8px;
  }

  .purchase-table td::before {
    display: block;
    margin-bottom: 3px;
    color: var(--amber);
    font-size: 11px;
    font-weight: 900;
  }

  .purchase-table td:nth-child(1)::before {
    content: "Part";
  }

  .purchase-table td:nth-child(2)::before {
    content: "Qty";
  }

  .purchase-table td:nth-child(3)::before {
    content: "Spec";
  }

  .purchase-table td:nth-child(4)::before {
    content: "Source";
  }

  .purchase-table td:nth-child(5)::before {
    content: "Total";
  }

  .state-bridge-rows {
    gap: 10px;
  }

  .state-bridge-row {
    grid-template-columns: minmax(0, 1fr);
    gap: 3px;
  }

  h1 {
    font-size: 28px;
  }

  .plain-system-view h1 {
    font-size: 24px;
  }

  .plain-state-list {
    grid-template-columns: minmax(0, 1fr);
  }

  .plain-state-list dt {
    padding-bottom: 2px;
    border-bottom: 0;
  }

  .plain-state-list dd {
    padding-top: 0;
  }

  .tagline {
    font-size: 15px;
  }

  .note-input {
    min-height: 84px;
    font-size: 16px;
  }

  .composer-footer {
    grid-template-columns: minmax(0, 1fr);
  }

  .file-card {
    grid-template-rows: 180px auto;
  }

  .focus-card {
    grid-template-rows: 260px auto;
  }
}
