:root {
  --bg: #ffffff;
  --sidebar-bg: #f7f7f5;
  --panel: #ffffff;
  --panel-soft: #f1f1ef;
  --ink: #20201f;
  --muted: #716f6a;
  --line: #dfddd8;
  --accent: #20201f;
  --accent-strong: #111110;
  --danger: #5d5953;
  --metric: #5f5d58;
  --progress: #2b2b29;
  --chip-ink: #4c4a46;
  --shadow: 0 12px 32px rgba(18, 18, 17, 0.08);
  --radius: 6px;
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

button,
input,
select,
textarea {
  transition:
    border-color 160ms ease,
    background-color 160ms ease,
    box-shadow 160ms ease,
    color 160ms ease;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 1px solid #b9b6ae;
  outline-offset: 2px;
}

.nav-item:focus-visible {
  outline: 0;
  border-color: #b9b6ae;
  box-shadow: 0 0 0 2px rgba(32, 32, 31, 0.06);
}

.auth-gate {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
}

.auth-shell {
  display: grid;
  width: min(960px, 100%);
  grid-template-columns: 280px minmax(0, 430px);
  justify-content: center;
  gap: 56px;
  align-items: center;
}

.auth-brand {
  align-self: start;
}

.auth-panel {
  display: grid;
  gap: 18px;
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.88);
  box-shadow: var(--shadow);
}

.auth-panel h2 {
  margin: 0;
  font-size: clamp(32px, 5vw, 52px);
  font-weight: 780;
  line-height: 0.98;
}

.auth-copy {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.auth-actions {
  display: grid;
  gap: 10px;
}

.auth-actions .primary-button {
  width: 100%;
}

.auth-error {
  margin: 0;
  padding: 10px 12px;
  border: 1px solid #ded8d3;
  border-radius: var(--radius);
  background: #fbf6f4;
  color: #5d5953;
  font-size: 13px;
  font-weight: 650;
}

.app-shell {
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  height: 100vh;
  padding: 12px 10px;
  border-right: 1px solid #e7e5df;
  background: var(--sidebar-bg);
  overflow-y: auto;
}

.brand {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 8px;
  align-items: center;
  min-height: 38px;
  padding: 4px 6px;
  border-radius: var(--radius);
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: var(--ink);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.brand h1,
.brand p,
.topbar h2,
.topbar p,
.section-heading h2,
.idea-card h3,
.detail-panel h3,
.inspector h2,
.calendar-day h3,
.research-item h3 {
  margin: 0;
}

.brand h1 {
  font-size: 14px;
  line-height: 1.15;
}

.brand p,
.muted {
  color: var(--muted);
}

.brand p {
  margin-top: 2px;
  font-size: 12px;
}

.workspace-switcher {
  position: relative;
  padding: 0 2px;
}

.workspace-button {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) 16px;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 42px;
  padding: 5px 7px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: #ecebe7;
  color: var(--ink);
  text-align: left;
}

.workspace-button:hover,
.workspace-button[aria-expanded="true"] {
  border-color: #ddd9d2;
  background: #fff;
}

.workspace-dot {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background: var(--ink);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
}

.workspace-copy,
.workspace-option span:last-child {
  display: grid;
  min-width: 0;
  gap: 1px;
}

.workspace-copy span,
.workspace-option small {
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workspace-copy strong,
.workspace-option strong {
  overflow: hidden;
  font-size: 13px;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workspace-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 2px;
  right: 2px;
  z-index: 35;
  display: grid;
  gap: 8px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.98);
  box-shadow: var(--shadow);
}

.workspace-list {
  display: grid;
  gap: 3px;
  max-height: 260px;
  overflow-y: auto;
}

.workspace-option-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 30px;
  gap: 3px;
  align-items: center;
  border-radius: var(--radius);
}

.workspace-option {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 5px 7px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: transparent;
  color: var(--ink);
  text-align: left;
}

.workspace-option-row.active .workspace-option,
.workspace-option:hover {
  background: #f2f1ee;
}

.workspace-remove {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: transparent;
  color: var(--muted);
  font-size: 18px;
}

.workspace-remove:hover {
  border-color: #e3e0da;
  background: #f8f8f6;
  color: var(--ink);
}

.workspace-remove:disabled {
  cursor: not-allowed;
  opacity: 0.35;
}

.workspace-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 34px;
  gap: 6px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.workspace-form input {
  min-height: 34px;
  font-size: 13px;
}

.workspace-form .icon-button {
  width: 34px;
  min-height: 34px;
  font-size: 18px;
}

.nav-list {
  display: grid;
  gap: 1px;
  margin-top: 6px;
}

.nav-item {
  display: grid;
  grid-template-columns: 22px 1fr;
  align-items: center;
  gap: 7px;
  min-height: 30px;
  padding: 0 8px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: transparent;
  color: #52504b;
  font-size: 14px;
  text-align: left;
}

.nav-item span {
  display: grid;
  place-items: center;
  color: #6f6c66;
  font-size: 15px;
}

.nav-item.active,
.nav-item:hover {
  border-color: transparent;
  background: #ecebe7;
  color: var(--ink);
}

.side-panel {
  padding: 12px 8px;
  border: 0;
  border-radius: var(--radius);
  background: transparent;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.section-heading h2 {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.metric-list {
  display: grid;
  gap: 7px;
}

.metric-list div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.metric-list strong {
  font-size: 16px;
}

.metric-list span {
  color: var(--muted);
  font-size: 12px;
}

.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag,
.format-chip,
.stage-pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  white-space: nowrap;
}

.tag {
  padding: 3px 9px;
  background: #ecebe7;
  color: #4f4d48;
  border: 1px solid #dfddd7;
  font-size: 12px;
}

.workspace {
  min-width: 0;
  padding: 18px 32px 42px;
  background: #fff;
}

.topbar {
  display: grid;
  gap: 18px;
  width: min(1120px, 100%);
  margin: 0 auto 18px;
  padding-top: 28px;
}

.page-heading {
  display: grid;
  align-items: start;
  gap: 5px;
}

.page-icon {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  margin-bottom: 8px;
  border-radius: 8px;
  background: #f1f0ec;
  color: #56534d;
  font-size: 30px;
  line-height: 1;
}

.eyebrow {
  margin: 0 0 4px;
  color: #5e5b55;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.topbar h2 {
  font-size: clamp(34px, 6vw, 48px);
  font-weight: 760;
  line-height: 1.05;
}

.topbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  flex-wrap: wrap;
  padding: 6px 0 10px;
  border-top: 1px solid #efede8;
  border-bottom: 1px solid #efede8;
}

.search-field {
  display: grid;
  grid-template-columns: 20px minmax(140px, 220px);
  align-items: center;
  gap: 5px;
  min-height: 32px;
  padding: 0 9px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: transparent;
  color: var(--muted);
  font-size: 13px;
}

.search-field:hover,
.search-field:focus-within {
  background: #f7f6f3;
  border-color: #e7e4de;
}

.search-field input,
select,
input,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  outline: none;
}

.search-field input {
  border: 0;
  padding: 0;
}

select,
input {
  min-height: 40px;
  padding: 0 10px;
}

.topbar-actions select,
.topbar-actions input,
.topbar-actions button {
  min-height: 32px;
}

.topbar-actions select {
  width: auto;
  min-width: 132px;
  background: transparent;
  border-color: transparent;
  font-size: 13px;
}

.topbar-actions select:hover,
.topbar-actions select:focus {
  background: #f7f6f3;
  border-color: #e7e4de;
}

textarea {
  min-height: 86px;
  padding: 10px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: #a7a49c;
  box-shadow: 0 0 0 3px rgba(32, 32, 31, 0.08);
}

.primary-button,
.ghost-button,
.icon-button,
.danger-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  font-weight: 650;
}

.primary-button {
  padding: 0 14px;
  background: var(--accent);
  color: #fff;
}

.primary-button:hover {
  background: var(--accent-strong);
}

.ghost-button {
  padding: 0 14px;
  border-color: var(--line);
  background: #fff;
  color: var(--ink);
}

.ghost-button:hover,
.icon-button:hover {
  border-color: #c9c6bf;
  background: #f8f8f6;
}

.danger-button {
  padding: 0 14px;
  border-color: #d7d4ce;
  background: #f6f6f4;
  color: var(--danger);
}

.icon-button {
  width: 40px;
  padding: 0;
  border-color: var(--line);
  background: #fff;
  color: var(--ink);
  font-size: 20px;
}

.topbar-actions .primary-button,
.topbar-actions .ghost-button,
.topbar-actions .icon-button {
  padding: 0 10px;
  font-size: 13px;
}

.topbar-actions .icon-button {
  width: 32px;
  font-size: 16px;
}

.connection-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  width: min(1120px, 100%);
  margin: -4px auto 18px;
}

.connection-card {
  display: grid;
  align-content: start;
  gap: 5px;
  min-height: 86px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfbfa;
  color: var(--ink);
  text-align: left;
}

.connection-card:hover,
.connection-card.active {
  border-color: #c9c6bf;
  background: #fff;
}

.connection-card span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.connection-card strong {
  overflow: hidden;
  font-size: 14px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.connection-card small {
  display: -webkit-box;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.account-area {
  position: relative;
}

.login-button,
.account-button,
.account-menu button {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  font: inherit;
}

.login-button {
  padding: 0 14px;
  font-weight: 650;
}

.login-button:hover,
.account-button:hover,
.account-menu button:hover {
  border-color: #c9c6bf;
  background: #f8f8f6;
}

.account-menu-wrap {
  position: relative;
}

.account-button {
  display: grid;
  grid-template-columns: 30px minmax(100px, 1fr) 16px;
  align-items: center;
  gap: 9px;
  min-width: 206px;
  padding: 4px 10px 4px 5px;
  text-align: left;
}

.topbar-actions .account-button {
  grid-template-columns: 24px minmax(86px, 1fr) 14px;
  min-width: 180px;
  padding: 3px 8px 3px 4px;
}

.topbar-actions .avatar {
  width: 24px;
  height: 24px;
  font-size: 10px;
}

.avatar {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.03em;
  overflow: hidden;
}

.avatar img,
.settings-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.account-copy {
  display: grid;
  min-width: 0;
  gap: 1px;
}

.account-copy strong,
.menu-profile strong,
.menu-meta strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-copy strong {
  font-size: 13px;
}

.account-copy span,
.menu-profile span,
.menu-meta span {
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chevron {
  color: var(--muted);
  font-size: 16px;
  line-height: 1;
}

.account-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 30;
  display: grid;
  width: 280px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.98);
  box-shadow: var(--shadow);
}

.menu-profile {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 8px;
}

.menu-profile .avatar {
  width: 34px;
  height: 34px;
}

.menu-profile div {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.menu-meta {
  display: grid;
  gap: 4px;
  margin: 6px 0;
  padding: 10px 8px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.menu-meta strong {
  color: var(--ink);
  font-size: 13px;
}

.account-menu button {
  justify-content: flex-start;
  width: 100%;
  padding: 0 10px;
  border-color: transparent;
  text-align: left;
  font-weight: 600;
}

.composer {
  width: min(1120px, 100%);
  margin: 0 auto 18px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
}

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

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.wide {
  grid-column: span 2;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 14px;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.board {
  display: grid;
  grid-template-columns: repeat(6, minmax(180px, 1fr));
  gap: 10px;
  width: min(1120px, 100%);
  margin: 0 auto;
  overflow-x: auto;
  padding-bottom: 10px;
}

.column {
  min-height: calc(100vh - 132px);
  border: 0;
  border-radius: var(--radius);
  background: #f7f6f3;
}

.column.drag-over {
  border-color: #aaa79f;
  background: rgba(32, 32, 31, 0.04);
}

.column-header {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 48px;
  padding: 0 10px;
  border-bottom: 1px solid #ece9e2;
  background: rgba(247, 246, 243, 0.96);
  border-radius: var(--radius) var(--radius) 0 0;
}

.column-header h3 {
  margin: 0;
  color: #4d4a45;
  font-size: 13px;
}

.column-count {
  display: grid;
  place-items: center;
  min-width: 24px;
  height: 24px;
  border-radius: 999px;
  background: var(--panel-soft);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.card-stack {
  display: grid;
  align-content: start;
  gap: 8px;
  padding: 8px;
}

.idea-card {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid #e6e3dc;
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: none;
}

.idea-card:hover {
  border-color: #bebbb4;
  background: #fff;
  box-shadow: 0 2px 8px rgba(18, 18, 17, 0.04);
}

.idea-card[draggable="true"] {
  cursor: grab;
}

.idea-card.dragging {
  opacity: 0.5;
}

.card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.format-chip {
  padding: 3px 8px;
  background: #f0efec;
  color: var(--chip-ink);
  border: 1px solid #e0ddd7;
  font-size: 12px;
  font-weight: 750;
}

.score {
  color: var(--metric);
  font-size: 13px;
  font-weight: 800;
}

.idea-card h3 {
  color: var(--ink);
  font-size: 14px;
  line-height: 1.25;
}

.hook {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.task-progress {
  display: grid;
  gap: 7px;
}

.progress-bar {
  height: 5px;
  overflow: hidden;
  border-radius: 999px;
  background: #e9e8e4;
}

.progress-fill {
  height: 100%;
  width: 0;
  background: var(--progress);
}

.task-progress span {
  color: var(--muted);
  font-size: 12px;
}

.empty-column,
.empty-state {
  padding: 16px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.map-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 16px;
  width: min(1120px, 100%);
  margin: 0 auto;
  min-height: calc(100vh - 124px);
}

.map-surface,
.detail-panel,
.research-form,
.research-item,
.calendar-day {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.map-surface,
.detail-panel,
.research-form,
.research-item,
.calendar-day,
.column {
  box-shadow: 0 1px 0 rgba(18, 18, 17, 0.02);
}

.map-surface {
  position: relative;
  min-height: 560px;
  overflow: auto;
}

#ideaMap {
  display: block;
  width: 100%;
  min-width: 760px;
  height: 100%;
  min-height: 560px;
}

.detail-panel {
  padding: 16px;
}

.detail-panel h3 {
  font-size: 20px;
}

.detail-panel p {
  line-height: 1.45;
}

.map-detail-list {
  display: grid;
  gap: 8px;
  margin: 16px 0;
}

.map-detail-list div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}

.map-detail-list span {
  color: var(--muted);
  font-size: 13px;
}

.map-detail-list strong {
  font-size: 13px;
  text-align: right;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(130px, 1fr));
  gap: 10px;
  width: min(1120px, 100%);
  margin: 0 auto;
}

.calendar-day {
  min-height: 150px;
  padding: 10px;
}

.calendar-day h3 {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
  font-size: 13px;
}

.calendar-date {
  color: var(--muted);
  font-weight: 700;
}

.calendar-chip {
  display: block;
  width: 100%;
  margin-top: 8px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f6f6f4;
  color: var(--ink);
  text-align: left;
  font-size: 12px;
  font-weight: 800;
}

.calendar-chip:hover {
  border-color: #c9c6bf;
  background: #efeeeb;
}

.research-layout {
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  gap: 16px;
  width: min(1120px, 100%);
  margin: 0 auto;
}

.research-form {
  display: grid;
  align-content: start;
  gap: 12px;
  padding: 16px;
}

.research-list {
  display: grid;
  align-content: start;
  gap: 10px;
}

.research-item {
  display: grid;
  gap: 8px;
  padding: 14px;
}

.research-item h3 {
  font-size: 16px;
}

.research-item a {
  color: var(--ink);
  text-decoration-color: #aaa79f;
  overflow-wrap: anywhere;
}

.research-item p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.research-link-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.link-pill {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  min-height: 26px;
  padding: 4px 9px;
  border: 1px solid #dfddd7;
  border-radius: 999px;
  background: #f2f1ee;
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

button.link-pill:hover {
  border-color: #c9c6bf;
  background: #fff;
}

.muted-pill {
  color: var(--muted);
}

.settings-layout {
  display: grid;
  max-width: 720px;
  margin: 0 auto;
}

.settings-card {
  display: grid;
  gap: 18px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.settings-card h3 {
  margin: 0 0 6px;
  font-size: 24px;
  line-height: 1.1;
}

.photo-row {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  gap: 16px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfbfa;
}

.settings-avatar {
  display: grid;
  place-items: center;
  width: 88px;
  height: 88px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  font-size: 26px;
  font-weight: 800;
  letter-spacing: 0.03em;
}

.photo-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.upload-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  font-weight: 650;
  cursor: pointer;
}

.upload-button:hover {
  border-color: #c9c6bf;
  background: #f8f8f6;
}

#photoInput {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

#settingsEmail {
  color: var(--muted);
  background: #f8f8f6;
}

.inspector {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 20;
  display: grid;
  align-content: start;
  gap: 14px;
  width: min(440px, 100vw);
  height: 100vh;
  padding: 22px;
  border-left: 1px solid var(--line);
  background: var(--panel);
  box-shadow: var(--shadow);
  transform: translateX(105%);
  transition: transform 180ms ease;
  overflow-y: auto;
}

.inspector.open {
  transform: translateX(0);
}

.close-inspector {
  justify-self: end;
}

.inspector h2 {
  font-size: 24px;
  line-height: 1.15;
}

.inspector-block {
  display: grid;
  gap: 10px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
}

.inspector-block h3 {
  margin: 0;
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.linked-source-list {
  display: grid;
  gap: 8px;
}

.linked-source {
  display: grid;
  gap: 4px;
  width: 100%;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfbfa;
  color: var(--ink);
  text-align: left;
}

.linked-source:hover {
  border-color: #c9c6bf;
  background: #fff;
}

.linked-source strong,
.linked-source span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.linked-source strong {
  font-size: 13px;
}

.linked-source span {
  color: var(--muted);
  font-size: 12px;
}

.task-row {
  display: grid;
  grid-template-columns: 20px 1fr;
  gap: 8px;
  align-items: start;
  color: var(--ink);
  font-weight: 600;
}

.task-row input {
  width: 18px;
  min-height: 18px;
  margin-top: 2px;
  accent-color: var(--ink);
}

.task-row.done span {
  color: var(--muted);
  text-decoration: line-through;
}

.inspector-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(18, 18, 17, 0.28);
  backdrop-filter: blur(8px);
}

.login-modal {
  position: relative;
  display: grid;
  gap: 16px;
  width: min(420px, 100%);
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow);
}

.login-modal h2 {
  margin: 0;
  font-size: 26px;
  line-height: 1.1;
}

.login-modal form {
  display: grid;
  gap: 12px;
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
}

@media (max-width: 1180px) {
  .app-shell {
    grid-template-columns: 220px minmax(0, 1fr);
  }

  .board {
    grid-template-columns: repeat(6, 190px);
  }

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

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

@media (max-width: 680px) {
  .auth-shell {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .auth-panel {
    padding: 22px;
  }

  .app-shell {
    display: block;
  }

  .sidebar {
    position: static;
    height: auto;
    gap: 14px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .sidebar .side-panel {
    display: none;
  }

  .nav-list {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .nav-item {
    grid-template-columns: 1fr;
    justify-items: center;
    min-height: 54px;
    text-align: center;
    font-size: 12px;
  }

  .workspace {
    padding: 18px;
  }

  .topbar {
    display: grid;
  }

  .topbar-actions {
    justify-content: stretch;
  }

  .search-field {
    grid-template-columns: 24px minmax(0, 1fr);
    width: 100%;
  }

  .form-grid,
  .research-layout,
  .map-layout {
    grid-template-columns: 1fr;
  }

  .wide {
    grid-column: auto;
  }

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

@media (max-width: 560px) {
  .auth-gate {
    padding: 18px;
  }

  .auth-panel h2 {
    font-size: 34px;
  }

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

  .topbar-actions > * {
    width: 100%;
  }

  .connection-strip {
    grid-template-columns: 1fr;
  }

  .photo-row {
    grid-template-columns: 1fr;
  }

  .settings-avatar {
    justify-self: center;
  }

  .account-area,
  .login-button,
  .account-button {
    width: 100%;
  }

  .account-menu {
    left: 0;
    right: 0;
    width: 100%;
  }

  .primary-button,
  .ghost-button,
  .danger-button {
    width: 100%;
  }

  .icon-button {
    width: 40px;
  }

  .calendar-grid {
    grid-template-columns: 1fr;
  }
}
