/* HSY Ecosystem Mockup — DESIGN.md tokens
   Seed: oklch(0.45 0.086 170) oxidized teal · copper accent */

:root {
  --bg: #ffffff;
  --surface: #ffffff;
  --surface-2: #f7f7f7;
  --ink: #000000;
  --muted: #333333;
  --line: #e5e5e5;
  --primary: #fdb913;
  --primary-ink: #000000;
  --accent: #fdb913;
  --accent-ink: #000000;
  --ok: #2d6a4f;
  --warn: #b8860b;
  --danger: #8b0000;
  --focus: #c99700;
  --shadow: rgb(0 0 0 / 0.06);

  --rail-bg: #ffffff;
  --rail-ink: #000000;
  --rail-muted: #333333;
  --rail-line: #e5e5e5;
  --rail-hover: #f7f7f7;
  --rail-active-bg: #fdb913;
  --rail-active-ink: #000000;
  --top-bg: #ffffff;
  --top-line: #e5e5e5;
  --brand-mark-bg: #fdb913;
  --brand-mark-ink: #000000;

  --rail: 15rem;
  --top: 3.25rem;
  --radius: 0.5rem;
  --radius-lg: 0.75rem;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --dur: 180ms;
  --font: "IBM Plex Sans", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
}

/* Tek tema — koyu mod devre dışı */
[data-theme="dark"] {
  --bg: #ffffff;
  --surface: #ffffff;
  --surface-2: #f7f7f7;
  --ink: #000000;
  --muted: #333333;
  --line: #e5e5e5;
  --primary: #fdb913;
  --primary-ink: #000000;
  --accent: #fdb913;
  --accent-ink: #000000;
  --focus: #c99700;
  --shadow: rgb(0 0 0 / 0.06);
  --rail-bg: #ffffff;
  --rail-ink: #000000;
  --rail-muted: #333333;
  --rail-line: #e5e5e5;
  --rail-hover: #f7f7f7;
  --rail-active-bg: #fdb913;
  --rail-active-ink: #000000;
  --top-bg: #ffffff;
  --top-line: #e5e5e5;
  --brand-mark-bg: #fdb913;
  --brand-mark-ink: #000000;
}

#themeToggle,
#brandThemePicker {
  display: none !important;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  color-scheme: light;
}

body {
  margin: 0;
  min-height: 100dvh;
  font-family: var(--font);
  font-size: 0.875rem;
  line-height: 1.45;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background-color 240ms var(--ease), color 240ms var(--ease);
}

.rail,
.top,
.card,
.btn,
.brand-theme-picker button {
  transition: background-color 240ms var(--ease), color 240ms var(--ease), border-color 240ms var(--ease), box-shadow 240ms var(--ease);
}

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

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.app {
  display: grid;
  grid-template-columns: var(--rail) 1fr;
  grid-template-rows: var(--top) 1fr;
  min-height: 100dvh;
}

/* ── Rail ── */
.rail {
  grid-row: 1 / -1;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1rem 0.75rem;
  background: var(--rail-bg, var(--surface));
  border-right: 1px solid var(--rail-line, var(--line));
  color: var(--rail-ink, var(--ink));
  overflow-x: hidden;
  overflow-y: auto;
  min-height: 0;
  height: 100dvh;
  position: sticky;
  top: 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.35rem 0.5rem;
}

.brand-mark {
  width: 2rem;
  height: 2rem;
  border-radius: var(--radius);
  background: var(--brand-mark-bg, var(--primary));
  color: var(--brand-mark-ink, var(--primary-ink));
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.brand-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.brand-text strong {
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--rail-ink, var(--ink));
}

.brand-text span {
  font-size: 0.6875rem;
  color: var(--rail-muted, var(--muted));
}

.rail > .nav {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  flex: 1;
}

.nav-btn {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  width: 100%;
  padding: 0.55rem 0.65rem;
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  color: var(--rail-muted, var(--muted));
  cursor: pointer;
  text-align: left;
  text-decoration: none;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}

.nav-btn:hover {
  background: var(--rail-hover, var(--surface-2));
  color: var(--rail-ink, var(--ink));
}

.nav-btn[aria-current="page"] {
  background: var(--rail-active-bg, var(--primary));
  color: var(--rail-active-ink, var(--primary-ink));
}

.nav-btn i {
  font-size: 1.1rem;
  opacity: 0.9;
}

.nav-btn.nav-logout {
  margin-top: 0.35rem;
  color: var(--rail-muted, var(--muted));
}

.nav-btn.nav-logout:hover {
  background: color-mix(in srgb, #b42318 10%, transparent);
  color: #b42318;
}

.nav-group {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  margin: 0.2rem 0 0.15rem;
  padding: 0.35rem 0 0.15rem;
  border-top: 1px solid var(--rail-line, var(--line));
  border-bottom: 1px solid var(--rail-line, var(--line));
}

.nav-group-label {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  padding: 0.35rem 0.65rem 0.2rem;
  color: var(--rail-ink, var(--ink));
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1.25;
  text-transform: none;
}

.nav-group-label i {
  font-size: 1rem;
  margin-top: 0.05rem;
  color: var(--rail-active-bg, var(--primary));
  flex-shrink: 0;
}

.nav-group-label span {
  min-width: 0;
  white-space: normal;
}

.nav-sub {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  padding-left: 0.35rem;
}

.nav-sub-btn {
  padding-left: 0.75rem;
}

.rail > .nav {
  overflow-y: auto;
  min-height: 0;
  padding-bottom: 0.25rem;
}

.rail-foot {
  display: none;
}

.persona {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.35rem;
}

.persona.is-clickable {
  cursor: pointer;
  border-radius: 0.55rem;
  transition: background 140ms ease;
}

.persona.is-clickable:hover {
  background: color-mix(in srgb, var(--primary) 12%, transparent);
}

.top-persona {
  padding: 0.25rem 0.5rem;
  border: 1px solid var(--line);
  border-radius: 0.65rem;
  background: var(--surface);
  gap: 0.65rem;
  flex-shrink: 0;
}

.top-persona .avatar {
  width: 2rem;
  height: 2rem;
  font-size: 0.75rem;
  background: #111;
  color: var(--primary);
}

.top-persona .persona-meta {
  text-align: left;
}

.top-persona .persona-meta strong {
  font-size: 0.8125rem;
  color: var(--ink);
}

.top-persona .persona-meta span {
  font-size: 0.6875rem;
  color: var(--muted);
}

.avatar {
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--rail-active-bg, var(--primary)) 18%, var(--rail-bg, var(--surface)));
  color: var(--rail-active-bg, var(--primary));
  display: grid;
  place-items: center;
  font-size: 0.6875rem;
  font-weight: 600;
  overflow: hidden;
  flex-shrink: 0;
}

.avatar.has-image {
  color: transparent;
}

.persona-meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.persona-meta strong {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--rail-ink, var(--ink));
}

.persona-meta span {
  font-size: 0.6875rem;
  color: var(--rail-muted, var(--muted));
}

/* ── Topbar ── */
.top {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0 1.25rem;
  border-bottom: 1px solid var(--top-line, var(--line));
  background: var(--top-bg, var(--bg));
}

.crumb {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--muted);
  font-size: 0.8125rem;
  min-width: 0;
  flex: 1;
}

.crumb strong {
  color: var(--ink);
  font-weight: 600;
}

.search {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  width: min(22rem, 40vw);
  padding: 0.4rem 0.65rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--muted);
}

.search input {
  border: 0;
  background: transparent;
  outline: none;
  width: 100%;
  color: var(--ink);
}

.search input::placeholder {
  color: var(--muted);
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  transition: background var(--dur) var(--ease), transform 120ms var(--ease);
}

.icon-btn:hover {
  background: var(--surface-2);
}

.icon-btn:active {
  transform: scale(0.96);
}

.top #themeToggle {
  margin-left: auto;
}

.sync-pill {
  display: none !important;
}

.sync-pill[data-state="syncing"] {
  background: color-mix(in oklch, var(--primary) 12%, var(--surface));
  color: var(--primary);
  border-color: color-mix(in oklch, var(--primary) 28%, var(--line));
}

.sync-pill[data-state="syncing"] .ph-arrows-clockwise {
  animation: spin 1.1s linear infinite;
}

/* ── Main ── */
.main {
  overflow: auto;
  padding: 1.25rem 1.5rem 2rem;
  background: var(--bg);
}

.view {
  display: none;
  animation: fadeIn var(--dur) var(--ease);
}

.view.is-active {
  display: block;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.view-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.view-head h1 {
  margin: 0;
  font-size: 1.375rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

.view-head p {
  margin: 0.25rem 0 0;
  color: var(--muted);
  max-width: 48ch;
}

.actions {
  display: flex;
  gap: 0.5rem;
  flex-shrink: 0;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-height: 2.25rem;
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius);
  border: 1px solid transparent;
  cursor: pointer;
  font-weight: 500;
  font-size: 0.8125rem;
  white-space: nowrap;
  transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease),
    transform 120ms var(--ease);
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: var(--primary);
  color: var(--primary-ink);
}

.btn-primary:hover {
  filter: brightness(1.06);
}

.btn-ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--ink);
}

.btn-ghost:hover {
  background: var(--surface);
}

.btn-accent {
  background: var(--accent);
  color: var(--accent-ink);
}

/* ── Overview strip ── */
.strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  overflow: hidden;
  margin-bottom: 1.25rem;
}

.strip-item {
  padding: 0.95rem 1.1rem;
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.strip-item:last-child {
  border-right: 0;
}

.strip-label {
  font-size: 0.75rem;
  color: var(--muted);
}

.strip-value {
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.strip-hint {
  font-size: 0.6875rem;
  color: var(--muted);
  font-family: var(--mono);
}

/* ── Split panels ── */
.split {
  display: grid;
  grid-template-columns: minmax(16rem, 0.42fr) 1fr;
  gap: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--bg);
  min-height: 28rem;
}

.panel {
  background: var(--bg);
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.panel + .panel {
  border-left: 1px solid var(--line);
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.7rem 0.9rem;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.panel-head h2 {
  margin: 0;
  font-size: 0.8125rem;
  font-weight: 600;
}

.panel-body {
  padding: 0.5rem;
  overflow: auto;
  flex: 1;
}

/* ── Tree ── */
.tree {
  list-style: none;
  margin: 0;
  padding: 0;
}

.tree ul {
  list-style: none;
  margin: 0;
  padding: 0 0 0 1.1rem;
}

.tree-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  width: 100%;
  padding: 0.35rem 0.45rem;
  border: 0;
  border-radius: calc(var(--radius) - 2px);
  background: transparent;
  cursor: pointer;
  text-align: left;
  color: var(--ink);
  transition: background var(--dur) var(--ease);
}

.tree-row:hover {
  background: var(--surface);
}

.tree-row.is-selected {
  background: color-mix(in oklch, var(--primary) 12%, var(--surface));
  color: var(--primary);
}

.tree-row .name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.8125rem;
}

.tree-row .chev {
  color: var(--muted);
  transition: transform var(--dur) var(--ease);
}

.tree-row[aria-expanded="true"] .chev {
  transform: rotate(90deg);
}

.status-dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 999px;
  flex-shrink: 0;
  background: var(--ok);
}

.status-dot[data-state="syncing"] {
  background: var(--primary);
  box-shadow: 0 0 0 3px color-mix(in oklch, var(--primary) 25%, transparent);
  animation: pulse 1.4s var(--ease) infinite;
}

.status-dot[data-state="waiting"] {
  background: var(--warn);
}

.status-dot[data-state="conflict"] {
  background: var(--danger);
}

.status-dot[data-state="idle"] {
  background: var(--line);
}

@keyframes pulse {
  50% {
    box-shadow: 0 0 0 5px color-mix(in oklch, var(--primary) 0%, transparent);
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ── File table ── */
.file-table {
  width: 100%;
  border-collapse: collapse;
}

.file-table th {
  text-align: left;
  font-size: 0.6875rem;
  font-weight: 500;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.55rem 0.7rem;
  border-bottom: 1px solid var(--line);
}

.file-table td {
  padding: 0.65rem 0.7rem;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

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

.file-table tr.flash-route td {
  animation: routeFlash 1.1s var(--ease);
}

@keyframes routeFlash {
  0% {
    background: color-mix(in oklch, var(--accent) 28%, transparent);
  }
  100% {
    background: transparent;
  }
}

.file-name {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 500;
}

.file-name i {
  color: var(--primary);
}

.mono {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--muted);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-size: 0.6875rem;
  font-weight: 500;
  background: var(--surface-2);
  border: 1px solid var(--line);
}

.badge-ok {
  background: color-mix(in oklch, var(--ok) 14%, var(--surface));
  color: var(--ok);
  border-color: color-mix(in oklch, var(--ok) 28%, var(--line));
}

.badge-wait {
  background: color-mix(in oklch, var(--warn) 16%, var(--surface));
  color: color-mix(in oklch, var(--warn) 70%, var(--ink));
  border-color: color-mix(in oklch, var(--warn) 30%, var(--line));
}

.badge-danger {
  background: color-mix(in oklch, var(--danger) 12%, var(--surface));
  color: var(--danger);
  border-color: color-mix(in oklch, var(--danger) 28%, var(--line));
}

/* ── Groups board ── */
.groups {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.85rem;
}

.group-col {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  min-height: 18rem;
  display: flex;
  flex-direction: column;
}

.group-col-head {
  padding: 0.85rem 0.95rem;
  border-bottom: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.group-col-head h3 {
  margin: 0;
  font-size: 0.9375rem;
  font-weight: 600;
}

.team {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  background: var(--bg);
  border: 1px solid var(--line);
  font-size: 0.6875rem;
  color: var(--muted);
}

.chip strong {
  color: var(--ink);
  font-weight: 500;
}

.firm-list {
  list-style: none;
  margin: 0;
  padding: 0.55rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  flex: 1;
}

.firm-card {
  padding: 0.65rem 0.7rem;
  border-radius: var(--radius);
  background: var(--bg);
  border: 1px solid var(--line);
  cursor: grab;
  transition: border-color var(--dur) var(--ease), transform var(--dur) var(--ease),
    box-shadow var(--dur) var(--ease);
}

.firm-card:hover {
  border-color: color-mix(in oklch, var(--primary) 40%, var(--line));
}

.firm-card.is-dragging {
  opacity: 0.45;
  transform: scale(0.98);
}

.firm-card.is-drop-target {
  outline: 2px dashed var(--primary);
  outline-offset: -2px;
}

.firm-card h4 {
  margin: 0 0 0.2rem;
  font-size: 0.8125rem;
  font-weight: 600;
}

.firm-card p {
  margin: 0;
  font-size: 0.6875rem;
  color: var(--muted);
}

.group-col.is-over {
  background: color-mix(in oklch, var(--primary) 6%, var(--surface));
  border-color: color-mix(in oklch, var(--primary) 35%, var(--line));
}

/* ── Requests / intake ── */
.composer {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.field label {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--muted);
}

.field input,
.field select,
.field textarea {
  min-height: 2.35rem;
  padding: 0.5rem 0.65rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  transition: border-color var(--dur) var(--ease);
}

.field textarea {
  min-height: 5.5rem;
  resize: vertical;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--primary);
  outline: none;
  box-shadow: 0 0 0 3px color-mix(in oklch, var(--primary) 18%, transparent);
}

.path-preview {
  grid-column: 1 / -1;
  padding: 0.7rem 0.85rem;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px dashed var(--line);
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--muted);
}

.path-preview strong {
  color: var(--primary);
  font-weight: 500;
}

.inbox {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.inbox-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 0.95rem;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.inbox-head h2 {
  margin: 0;
  font-size: 0.875rem;
  font-weight: 600;
}

.feed {
  list-style: none;
  margin: 0;
  padding: 0;
}

.feed-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.75rem;
  align-items: center;
  padding: 0.8rem 0.95rem;
  border-bottom: 1px solid var(--line);
}

.feed-item:last-child {
  border-bottom: 0;
}

.feed-item.is-new {
  animation: routeFlash 1.4s var(--ease);
}

.feed-ico {
  width: 2rem;
  height: 2rem;
  border-radius: var(--radius);
  display: grid;
  place-items: center;
  background: color-mix(in oklch, var(--primary) 12%, var(--surface));
  color: var(--primary);
}

.feed-body strong {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
}

.feed-body span {
  font-size: 0.75rem;
  color: var(--muted);
}

/* ── Activity / activity rail ── */
.activity {
  margin-top: 1.25rem;
  border-top: 1px solid var(--line);
  padding-top: 1rem;
}

.activity h2 {
  margin: 0 0 0.75rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--muted);
}

.timeline {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.timeline li {
  display: grid;
  grid-template-columns: 4.5rem 1fr;
  gap: 0.75rem;
  font-size: 0.8125rem;
}

.timeline time {
  font-family: var(--mono);
  font-size: 0.6875rem;
  color: var(--muted);
  padding-top: 0.15rem;
}

/* ── Toast ── */
.toasts {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 40;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  width: min(22rem, calc(100vw - 2rem));
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  display: flex;
  gap: 0.65rem;
  align-items: flex-start;
  padding: 0.75rem 0.85rem;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: 0 4px 8px var(--shadow);
  animation: toastIn 220ms var(--ease);
}

.toast[data-kind="success"] {
  border-color: color-mix(in oklch, var(--accent) 45%, var(--line));
}

.toast-ico {
  color: var(--accent);
  margin-top: 0.1rem;
}

.toast strong {
  display: block;
  font-size: 0.8125rem;
}

.toast span {
  font-size: 0.75rem;
  color: var(--muted);
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* ── Mock banner ── */
.mock-tag {
  position: fixed;
  left: 50%;
  bottom: 0.85rem;
  transform: translateX(-50%);
  z-index: 30;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  background: color-mix(in oklch, var(--ink) 88%, transparent);
  color: var(--bg);
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  pointer-events: none;
}

/* ── Responsive ── */
@media (max-width: 1100px) {
  .groups {
    grid-template-columns: 1fr;
  }

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

  .strip-item:nth-child(2) {
    border-right: 0;
  }

  .strip-item:nth-child(1),
  .strip-item:nth-child(2) {
    border-bottom: 1px solid var(--line);
  }
}

@media (max-width: 900px) {
  .app {
    grid-template-columns: 1fr;
    grid-template-rows: auto var(--top) 1fr;
  }

  .rail {
    grid-row: auto;
    flex-direction: row;
    align-items: center;
    overflow-x: auto;
    padding: 0.55rem 0.75rem;
    gap: 0.75rem;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .rail > .nav {
    flex-direction: row;
    flex: 1;
  }

  .nav-group {
    flex-direction: row;
    align-items: center;
    border: 0;
    margin: 0;
    padding: 0;
    gap: 0.15rem;
  }

  .nav-group-label span {
    display: none;
  }

  .nav-sub {
    flex-direction: row;
    margin-left: 0;
    padding-left: 0;
    border-left: 0;
  }

  .nav-btn span {
    display: none;
  }

  .nav-btn.nav-logout span {
    display: none;
  }

  .top-persona .persona-meta {
    display: none;
  }

  .rail-foot {
    display: none;
  }

  .brand-text {
    display: none;
  }

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

  .panel + .panel {
    border-left: 0;
    border-top: 1px solid var(--line);
  }

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

  .search {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 10000;
  background: var(--primary);
  color: var(--primary-ink);
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius);
}

.skip-link:focus {
  left: 0.75rem;
  top: 0.75rem;
}

#adminEnvBadge.is-dev {
  background: color-mix(in oklch, var(--warn) 16%, var(--surface));
  border: 1px solid color-mix(in oklch, var(--warn) 30%, var(--line));
  color: color-mix(in oklch, var(--warn) 70%, var(--ink));
  border-radius: 999px;
  padding: 0.15rem 0.5rem;
}

/* Soft page transitions */
body.atlas-page-enter .main,
body.atlas-page-enter .page-content {
  animation: atlasPageIn 280ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

body.atlas-page-leave .main,
body.atlas-page-leave .page-content {
  animation: atlasPageOut 180ms ease both;
}

@keyframes atlasPageIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

@keyframes atlasPageOut {
  from { opacity: 1; transform: none; }
  to { opacity: 0; transform: translateY(-6px); }
}

/* Profile modal */
.atlas-profile-modal {
  position: fixed;
  inset: 0;
  z-index: 12000;
  display: grid;
  place-items: center;
  padding: 1rem;
}

.atlas-profile-modal[hidden] { display: none !important; }

.atlas-profile-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
}

.atlas-profile-sheet {
  position: relative;
  z-index: 1;
  width: min(28rem, 100%);
  max-height: min(90dvh, 40rem);
  overflow: auto;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 1rem;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.18);
}

.atlas-profile-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.9rem 1rem;
  border-bottom: 1px solid var(--line);
}

.atlas-profile-head h2 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.atlas-profile-head .icon-btn i,
.atlas-modal .close span {
  pointer-events: none;
}

.atlas-profile-body {
  padding: 1rem;
}

.atlas-profile-avatar-row {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin-bottom: 1rem;
}

.atlas-profile-avatar {
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 999px;
  background: #111;
  color: var(--primary);
  display: grid;
  place-items: center;
  font-weight: 700;
  overflow: hidden;
  flex-shrink: 0;
  background-size: cover;
  background-position: center;
}

.atlas-profile-avatar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.atlas-profile-section {
  margin: 0 0 0.35rem;
  font-size: 0.9rem;
  font-weight: 650;
}

.atlas-profile-hint {
  margin: 0 0 0.85rem;
  font-size: 0.8rem;
  color: var(--muted);
}

.atlas-profile-actions {
  display: grid;
  gap: 0.5rem;
}

body.atlas-profile-open {
  overflow: hidden;
}

@media (prefers-reduced-motion: reduce) {
  body.atlas-page-enter .main,
  body.atlas-page-enter .page-content,
  body.atlas-page-leave .main,
  body.atlas-page-leave .page-content {
    animation: none !important;
  }
}
