:root {
  color-scheme: dark;
  --bg: #080a0a;
  --ink: #fffaf0;
  --muted: #aeb6b2;
  --line: rgba(255, 255, 255, .11);
  --panel: rgba(255, 250, 240, .048);
  --panel-strong: rgba(255, 250, 240, .07);
  --cyan: #68d6c8;
  --amber: #e6b34d;
  --green: #8de79b;
  --red: #f46a5f;
  --shadow: 0 18px 48px rgba(0, 0, 0, .28);
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  overflow-x: hidden;
  background: 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;
}

.app-shell {
  width: min(calc(100% - 32px), 1120px);
  min-height: 100vh;
  margin: 0 auto;
  padding: 0 0 72px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 46px;
  padding: 7px 0;
  background: rgba(8, 10, 10, .78);
  border-bottom: 1px solid rgba(255, 255, 255, .07);
  backdrop-filter: blur(16px);
}

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

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

.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, .045);
  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);
}

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

.capture-panel,
.state-panel,
.priority-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;
}

.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, .035);
  transition: border-color .18s ease, background .18s ease, box-shadow .18s ease;
}

.dropzone:focus-within,
.dropzone.drag-active {
  border-color: rgba(104, 214, 200, .58);
  background: rgba(104, 214, 200, .055);
  box-shadow: 0 0 0 3px rgba(104, 214, 200, .1);
}

.note-input {
  width: 100%;
  min-height: 72px;
  resize: vertical;
  border: 0;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
  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(255, 250, 240, .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: #d7fffa;
  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, 250, 240, .04);
  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;
}

.priority-panel {
  padding: 12px 0 4px;
}

.priority-card {
  border: 1px solid rgba(104, 214, 200, .32);
  border-radius: 7px;
  padding: 16px 18px 17px;
  background:
    linear-gradient(155deg, rgba(104, 214, 200, .09), rgba(255, 250, 240, .045) 54%, rgba(230, 179, 77, .055));
  box-shadow: var(--shadow);
}

.priority-label {
  margin-bottom: 10px;
  color: var(--cyan);
}

.priority-text {
  max-width: 980px;
  color: var(--ink);
  font-size: 26px;
  font-weight: 900;
  line-height: 1.16;
  overflow-wrap: anywhere;
}

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

.priority-meta {
  margin-top: 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 790;
  line-height: 1.25;
}

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

.top-feed {
  border-top: 0;
  border-bottom: 1px solid var(--line);
  margin-top: 0;
  padding-top: 18px;
  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, 250, 240, .045);
  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, 250, 240, .06);
}

.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, .025);
}

.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: #111;
}

.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(0, 0, 0, .02), rgba(0, 0, 0, .68));
  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, 250, 240, .08), rgba(255, 250, 240, .025));
  color: rgba(255, 250, 240, .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(255, 250, 240, .22);
  border-radius: 999px;
  padding: 4px 8px;
  background: rgba(0, 0, 0, .46);
  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: 8px;
  top: 8px;
  display: flex;
  gap: 6px;
}

.icon-button {
  width: 34px;
  height: 34px;
  padding: 0;
  background: rgba(0, 0, 0, .62);
  backdrop-filter: blur(8px);
}

.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: #0d1111;
  color: var(--ink);
  font-size: 13px;
  font-weight: 760;
  box-shadow: var(--shadow);
}

@media (max-width: 900px) {
  .workspace,
  .ideas-grid,
  .notes-grid,
  .focus-grid,
  .library-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .state-panel {
    padding: 0;
  }

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

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

@media (max-width: 560px) {
  .app-shell {
    width: min(calc(100% - 24px), 366px);
    margin-left: 12px;
    margin-right: auto;
  }

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

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

  .workspace {
    padding-top: 28px;
  }

  .priority-panel {
    padding-top: 10px;
  }

  .priority-card {
    padding: 14px;
  }

  .priority-text {
    font-size: 21px;
    line-height: 1.18;
  }

  h1 {
    font-size: 34px;
  }

  .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;
  }
}
