﻿.app-shell {
  display: grid;
  grid-template-columns: var(--rail-collapsed) minmax(0, 1fr);
  gap: 24px;
  height: 100vh;
  min-height: 0;
  max-width: 2512px;
  margin: 0 auto;
  padding: 24px 24px 132px;
  overflow: hidden;
}

.folder-rail {
  position: sticky;
  top: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 74px;
  height: calc(100vh - 36px);
  padding: 8px;
  border-radius: 16px;
  background-image: none;
  background-color: transparent;
  border: 1px solid transparent;
  overflow: visible;
  z-index: 24;
  box-shadow: none;
}

.brand-lockup {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 68px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  width: 56px;
  height: 56px;
  flex: 0 0 56px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  background: rgba(246, 247, 242, 0.92);
  object-fit: contain;
  object-position: center;
  padding: 4px;
  box-shadow: none;
}

.brand-copy,
.folder-copy,
.logout-form b {
  min-width: 0;
  opacity: 0;
  transform: translateX(-6px);
  white-space: nowrap;
  pointer-events: none;
}

.folder-button:hover .folder-copy,
.folder-button:focus-visible .folder-copy,
.logout-form button:hover b,
.logout-form button:focus-visible b {
  opacity: 1;
  transform: translateX(0);
  pointer-events: auto;
}

.topbar h2,
.pane-heading h3 {
  margin: 0;
}

.folder-list {
  display: grid;
  justify-items: start;
  gap: 8px;
}

.mode-nav {
  display: grid;
  justify-items: start;
  gap: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.folder-button {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 0;
  min-height: 56px;
  width: 56px;
  height: 56px;
  max-width: var(--rail-expanded);
  padding: 8px;
  border-radius: 16px;
  text-align: left;
  border-color: rgba(255, 255, 255, 0.05);
  background-image: none;
  background-color: rgba(255, 255, 255, 0.03);
  box-shadow: var(--shadow-card);
}

.folder-button:hover,
.folder-button:focus-visible,
.logout-form button:hover,
.logout-form button:focus-visible {
  gap: 12px;
  width: min(var(--rail-expanded), calc(100vw - 32px));
  z-index: 40;
  background-color: rgba(22, 22, 26, 0.99);
  border-color: var(--stroke-active);
  box-shadow: var(--shadow-elevated);
  transform: translateX(0);
}

.folder-icon,
.logout-icon {
  display: inline-grid;
  flex: 0 0 36px;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 0;
  border-radius: 0;
  background: transparent;
  border-color: transparent;
  color: var(--ink);
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.folder-icon svg,
.logout-icon svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.folder-button[data-folder-icon="knowledge"] .folder-icon {
  color: #c9fff0;
}

.folder-button[data-folder-icon="journal"] .folder-icon {
  color: #ffd07a;
}

.folder-button[data-folder-icon="learning"] .folder-icon {
  color: #b9c8ff;
}

.folder-button[data-folder-icon="therapy"] .folder-icon {
  color: #ff9fb2;
}

.folder-button[data-folder-icon="incubator"] .folder-icon {
  color: #b4f08b;
}

.folder-button[data-folder-icon="todo"] .folder-icon {
  color: #ff8f5a;
}

.folder-button[data-folder-icon="daily"] .folder-icon,
.mobile-folder-strip [data-mobile-mode="daily"] .folder-icon {
  color: #7ee2a8;
}

.folder-button[data-folder-icon="portfolio"] .folder-icon,
.mobile-folder-strip [data-mobile-mode="portfolio"] .folder-icon {
  color: #4eadff;
}

.folder-name {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  color: #f3f4f6;
  font-weight: 600;
}

.folder-copy {
  display: grid;
  flex: 1 1 auto;
}

.folder-button small {
  color: var(--muted);
  font-weight: 400;
}

.folder-button.is-active:not(:hover):not(:focus-visible) {
  border-color: rgba(255, 255, 255, 0.22);
  background-image: none;
  background-color: transparent;
  box-shadow: none;
}

.mobile-folder-strip button.is-active,
.todo-tabs button.is-active {
  border-color: var(--stroke-active);
  background-image: none;
  background-color: rgba(255, 255, 255, 0.03);
  box-shadow: var(--shadow-card);
}

.count-badge,
.mobile-folder-strip [data-folder-count] {
  display: inline-grid;
  min-width: 24px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  color: inherit;
  font-size: 0.68rem;
  font-weight: 600;
}

.logout-form {
  margin-top: auto;
}

.logout-form button {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 0;
  width: 56px;
  height: 56px;
  max-width: var(--rail-expanded);
  color: var(--muted-strong);
  padding: 10px;
  text-align: left;
}

.logout-form b {
  font-size: 0.92rem;
}

.workspace {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 24px;
  min-width: 0;
  min-height: 0;
}

.topbar {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto;
  grid-template-areas:
    "title metrics"
    "title modes";
  align-items: center;
  gap: 24px;
  min-height: 150px;
  padding: 28px;
  border-radius: 20px;
  border-color: var(--stroke-soft);
  background-image: none;
  background-color: rgba(22, 22, 26, 0.98);
  box-shadow: var(--shadow-card);
}

.topbar::after {
  content: "";
  position: absolute;
  left: 20px;
  right: 20px;
  bottom: 0;
  height: 1px;
  background: rgba(255, 255, 255, 0.05);
}

.topbar > div:first-child {
  grid-area: title;
}

.topbar h2 {
  max-width: 13ch;
  color: #f3f4f6;
  font-weight: 800;
  font-size: clamp(3rem, 6vw, 4.8rem);
  line-height: 0.84;
  letter-spacing: -0.055em;
}

.top-metrics,
.mode-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.top-metrics {
  grid-area: metrics;
  justify-content: flex-end;
}

.metric-pill {
  display: inline-grid;
  min-width: 86px;
  min-height: 48px;
  align-content: center;
  padding: 6px 11px;
  border: 1px solid var(--glass-line-soft);
  border-radius: var(--radius);
  background-image: none;
  background-color: rgba(255, 255, 255, 0.045);
  color: var(--muted);
  font-size: 0.76rem;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.metric-pill strong {
  color: var(--ink);
  font-size: 1.15rem;
  line-height: 1;
}

.mode-buttons {
  grid-area: modes;
  justify-content: flex-end;
}

.mode-buttons button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  color: #f3f4f6;
  border-color: rgba(255, 255, 255, 0.05);
  background-image: none;
  background-color: rgba(255, 255, 255, 0.03);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  box-shadow: none;
}

.mode-icon {
  display: inline-grid;
  flex: 0 0 30px;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  background-color: rgba(255, 255, 255, 0.09);
  color: #f3f4f6;
}

.mode-icon svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.mode-button[data-open-mode="proposals"] .mode-icon {
  color: #ffd07a;
}

.proposal-count-badge {
  position: static;
  display: inline-grid;
  flex: 0 0 auto;
  min-width: 24px;
  height: 24px;
  place-items: center;
  margin-left: 2px;
  padding: 0 7px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  background: rgba(180, 184, 192, 0.16);
  color: rgba(255, 255, 255, 0.78);
  font-family: var(--font-mono);
  font-size: 10px;
  line-height: 1;
  box-shadow: none;
}

.proposal-count-badge[hidden] {
  display: none;
}

.mode-button[data-open-mode="therapy"] .mode-icon {
  color: #ff9fb2;
}

.mobile-folder-strip {
  display: none;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(320px, 0.36fr) minmax(0, 1fr);
  gap: 24px;
  height: var(--content-grid-height, auto);
  min-height: 0;
}

.app-shell.has-open-detail .content-grid {
  grid-template-columns: minmax(300px, 0.32fr) minmax(0, 1fr);
}

.list-pane,
.detail-pane {
  min-width: 0;
  overflow: hidden;
  border-radius: 20px;
  background-image: none;
  background-color: rgba(22, 22, 26, 0.96);
  border: 1px solid var(--stroke-soft);
  box-shadow: var(--shadow-card);
}

.detail-pane {
  display: flex;
  min-height: 0;
  overflow: hidden;
  overscroll-behavior: contain;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.6);
}

.list-pane {
  display: flex;
  flex-direction: column;
}

.pane-heading {
  display: grid;
  grid-template-columns: 1fr minmax(160px, 260px);
  gap: 24px;
  align-items: end;
  padding: 24px;
  border-bottom: 1px solid var(--line);
}

.pane-heading input {
  min-height: 40px;
  padding: 0 12px;
}

.todo-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 16px 24px;
  border-bottom: 1px solid var(--line);
}

.scroll-list {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 24px;
  scrollbar-color: rgba(120, 224, 210, 0.34) rgba(255, 255, 255, 0.06);
}

.list-item {
  position: relative;
  overflow: hidden;
  display: grid;
  gap: 5px;
  width: 100%;
  min-height: 72px;
  margin-bottom: 12px;
  padding: 24px;
  text-align: left;
  border: 1px solid var(--stroke-soft);
  border-radius: 20px;
  background-image: none;
  background-color: rgba(22, 22, 26, 0.96);
  box-shadow: var(--shadow-card);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.todo-card {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.todo-action {
  min-width: 0;
  min-height: 34px;
  padding: 0 10px;
  color: #b6f6cb;
  border-color: rgba(74, 222, 128, 0.1);
  background-image: none;
  background-color: transparent;
  box-shadow: none;
  font-weight: 600;
  opacity: 0.1;
  transition:
    opacity 180ms ease,
    background-color 180ms ease,
    border-color 180ms ease,
    transform 180ms ease,
    color 180ms ease;
}

.task-item:hover .complete-btn,
.task-item:focus-within .complete-btn {
  opacity: 1;
}

.complete-btn:hover,
.complete-btn:focus-visible {
  opacity: 1;
  color: #c7f9d8;
  border-color: rgba(74, 222, 128, 0.18);
  background-image: none;
  background-color: rgba(74, 222, 128, 0.06);
}

.todo-action[data-todo-status="completed"] {
  color: var(--muted);
  border-color: rgba(255, 255, 255, 0.06);
  background-image: none;
  background-color: transparent;
}

.list-item strong {
  color: #f3f4f6;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.list-item small,
.meta-line {
  color: rgba(255, 255, 255, 0.3);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.detail-content {
  flex: 1;
  min-height: 0;
  max-height: 100%;
  padding: 24px;
  overflow-y: auto;
  scrollbar-gutter: stable;
  display: grid;
  align-content: start;
  gap: 20px;
}

.detail-content h2,
.detail-content h3 {
  margin-top: 0;
}

.detail-content h2 {
  color: var(--ink);
  font-size: clamp(2.2rem, 4.2vw, 4rem);
  font-weight: 800;
  letter-spacing: -0.045em;
  line-height: 0.9;
}

.detail-section-label,
.detail-utility-label,
.detail-utility-card > span:not(.priority-dots) {
  display: block;
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.18em;
  line-height: 1.2;
  text-transform: uppercase;
}

.truncate-ellipsis {
  display: block;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.clamp-2 {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.755fr) minmax(196px, 0.245fr);
  gap: 24px;
  min-width: 0;
  min-height: 0;
  align-items: start;
}

.detail-layout.todo-detail {
  display: grid;
  grid-template-columns: minmax(0, 0.755fr) minmax(196px, 0.245fr);
  gap: 24px;
}

.detail-utility-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-auto-rows: minmax(112px, 1fr);
  gap: 12px;
  grid-auto-flow: dense;
}

.todo-detail .detail-utility-grid {
  grid-template-columns: 1fr;
  grid-auto-rows: minmax(96px, auto);
}

.detail-utility-card {
  min-width: 0;
  min-height: 112px;
  aspect-ratio: 1 / 0.82;
  padding: 18px;
  border-radius: 18px;
  box-shadow: var(--shadow-card);
  position: relative;
  overflow: hidden;
  display: grid;
  align-content: space-between;
  gap: 6px;
  border: 1px solid var(--stroke-soft);
  background-image: none;
  background-color: rgba(255, 255, 255, 0.032);
}

.todo-detail .detail-utility-card {
  width: 100%;
  aspect-ratio: auto;
}

.detail-utility-card > strong {
  min-width: 0;
  color: var(--ink-soft);
  overflow-wrap: anywhere;
}

.detail-utility-card small {
  color: var(--muted);
  overflow-wrap: anywhere;
}

.detail-pane,
.detail-utility-card,
.todo-meta-card,
.todo-description,
.todo-checklist,
.raw-note-panel {
  /* Keep the soft top light on the detail surfaces instead of the full app shell. */
  box-shadow: var(--shadow-elevated);
}

.detail-canvas,
.detail-sidebar {
  display: grid;
  gap: 20px;
  min-width: 0;
  align-content: start;
}

.detail-canvas {
  max-width: none;
}

.detail-sidebar {
  position: sticky;
  top: 0;
  align-self: start;
  padding-top: 2px;
}

.detail-sidebar .todo-meta-grid {
  grid-template-columns: 1fr;
}

.detail-sidebar .todo-meta-card,
.detail-sidebar .frontmatter-box {
  padding: 18px 20px;
}

.hairline-divider {
  height: 1px;
  border: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.05), transparent);
}

.detail-layout .mode-buttons {
  justify-content: flex-start;
}

.detail-layout .mode-buttons button {
  min-width: 0;
}

.note-detail .note-editor textarea {
  min-height: min(56vh, 640px);
}

