:root {
  color-scheme: light;
  font-size: 15px;
  --ink: #040707;
  --accent: #040707;
  --accent-ink: #ffFC00;
  --bg: #fafafa;
  --surface: #ffffff;
  --muted: #4a4f4f;
  --line: #e2e4e4;
  --ok: #26734a;
  --ok-bg: #edf7f1;
  --warn: #805400;
  --warn-bg: #fff6dc;
  --bad: #a52a21;
  --bad-bg: #fff0ee;
  --info: #245b91;
  --info-bg: #edf5ff;
  --white: #ffffff;
  --wash: #f4f5f5;
  --wash-strong: #f0f2f2;
  --neutral-badge: #eef0f0;
  --ink-hover: #171b1b;
  --sidebar-text: rgba(255, 255, 255, 0.72);
  --sidebar-hover: rgba(255, 255, 255, 0.09);
  --sidebar-active: rgba(255, 255, 255, 0.06);
  --shadow-sm: 0 1px 2px rgba(4, 7, 7, 0.07);
  --shadow-md: 0 5px 14px rgba(4, 7, 7, 0.12);
  --shadow-lg: 0 10px 28px rgba(4, 7, 7, 0.14);
}

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

html {
  min-width: 0;
  max-width: 100%;
  overflow-x: hidden;
  background: var(--bg);
}

body {
  min-width: 0;
  max-width: 100%;
  margin: 0;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--ink);
  font-family: "Open Sans", "Segoe UI", system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  overflow-wrap: break-word;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

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

h1,
h2,
h3 {
  margin: 0 0 12px;
  color: var(--ink);
  font-family: "Archivo Black", Arial, sans-serif;
  font-weight: 400;
  line-height: 1.2;
}

a {
  color: var(--ink);
  text-underline-offset: 2px;
}

img {
  max-width: 100%;
  height: auto;
}

pre {
  max-width: 100%;
  overflow: auto;
}

code,
kbd,
samp {
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
}

hr {
  height: 0;
  margin: 20px 0;
  border: 0;
  border-top: 1px solid var(--line);
}

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

:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
  outline: 3px solid var(--accent-ink);
  outline-offset: 2px;
  box-shadow: 0 0 0 2px var(--ink);
}

.shell {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  min-width: 0;
  min-height: 100vh;
  max-width: 100%;
}

.sidebar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  align-self: start;
  width: 240px;
  height: 100vh;
  min-height: 0;
  padding: 24px 16px;
  overflow-y: auto;
  background: var(--ink);
  color: var(--white);
}

.sidebar .brand {
  position: relative;
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  gap: 8px;
  padding: 0 0 6px;
  color: var(--white);
  font-family: "Archivo Black", Arial, sans-serif;
  font-size: 20px;
  line-height: 1.1;
  text-decoration: none;
  white-space: nowrap;
}

.sidebar .brand::before {
  width: 8px;
  height: 8px;
  flex: 0 0 8px;
  border-radius: 50%;
  background: var(--accent-ink);
  content: "";
}

.sidebar .brand::after {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 3px;
  border-radius: 999px;
  background: var(--accent-ink);
  content: "";
}

.sidebar nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  margin-top: 28px;
}

.sidebar nav a {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 10px 12px;
  border-radius: 8px;
  color: var(--sidebar-text);
  font-weight: 600;
  line-height: 1.25;
  text-decoration: none;
  transition: background-color 150ms ease, color 150ms ease;
}

.sidebar nav a:hover {
  background: var(--sidebar-hover);
  color: var(--white);
}

.sidebar nav a.active {
  background: var(--sidebar-active);
  color: var(--accent-ink);
}

.sidebar nav a.active::before {
  position: absolute;
  top: 8px;
  bottom: 8px;
  left: 0;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--accent-ink);
  content: "";
}

.sidebar .nav-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  min-height: 20px;
  margin-left: auto;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--accent-ink);
  color: var(--ink);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
}

.sidebar .sidebar-foot {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--sidebar-hover);
  color: var(--sidebar-text);
  font-size: 12px;
}

.sidebar .sidebar-foot small {
  display: block;
  margin-bottom: 8px;
  color: var(--sidebar-text);
  font-size: 12px;
}

.sidebar .sidebar-foot form {
  margin: 0;
}

.sidebar .logout {
  display: inline-flex;
  align-items: center;
  padding: 2px 0;
  border: 0;
  background: transparent;
  color: var(--sidebar-text);
  font: inherit;
  font-weight: 600;
  line-height: 1.4;
  text-decoration: none;
  cursor: pointer;
}

.sidebar .logout:hover {
  color: var(--white);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.main {
  justify-self: start;
  width: 100%;
  min-width: 0;
  max-width: 1400px;
  padding: 28px 32px;
}

.page-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
}

.page-head h1 {
  margin: 0;
  font-size: 26px;
}

.page-head .actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

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

.small {
  font-size: 13px;
}

.empty {
  display: grid;
  min-height: 120px;
  padding: 28px;
  place-items: center;
  border: 1px dashed var(--line);
  border-radius: 10px;
  color: var(--muted);
  text-align: center;
}

.card {
  min-width: 0;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
}

.card > :last-child {
  margin-bottom: 0;
}

.card h2 {
  margin: 0 0 12px;
  font-family: "Open Sans", "Segoe UI", system-ui, sans-serif;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.35;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}

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

.grid > *,
.grid-2 > *,
.stats > * {
  min-width: 0;
}

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
}

.stat {
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
}

.stat .num {
  color: var(--ink);
  font-family: "Archivo Black", Arial, sans-serif;
  font-size: 28px;
  line-height: 1.15;
}

.stat .label {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.05em;
  line-height: 1.3;
  text-transform: uppercase;
}

.stat.alert {
  border-left: 4px solid var(--bad);
}

.table-wrap {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  -webkit-overflow-scrolling: touch;
}

.table {
  width: 100%;
  max-width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  font-size: 14px;
}

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

.table th {
  padding: 10px 12px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.05em;
  line-height: 1.35;
  text-transform: uppercase;
  white-space: nowrap;
}

.table td {
  padding: 10px 12px;
}

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

.table tbody tr:hover {
  background: var(--wash);
}

.badge {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--neutral-badge);
  color: var(--ink);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
  white-space: nowrap;
}

.badge-new,
.badge-requested,
.badge-sent,
.badge-open,
.badge-contract_sent,
.badge-viewed,
.badge-review {
  background: var(--info-bg);
  color: var(--info);
}

.badge-active,
.badge-paid,
.badge-signed,
.badge-confirmed,
.badge-done,
.badge-completed,
.badge-converted {
  background: var(--ok-bg);
  color: var(--ok);
}

.badge-in_progress,
.badge-todo,
.badge-paused,
.badge-draft,
.badge-contacted {
  background: var(--warn-bg);
  color: var(--warn);
}

.badge-declined,
.badge-voided,
.badge-void,
.badge-cancelled,
.badge-uncollectible,
.badge-ended,
.badge-spam,
.badge-no_show,
.badge-failed {
  background: var(--bad-bg);
  color: var(--bad);
}

.badge-backlog,
.badge-prospect,
.badge-archived {
  background: var(--neutral-badge);
  color: var(--muted);
}

.prio-high,
.prio-urgent,
.prio-low {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
}

.prio-high {
  background: var(--warn-bg);
  color: var(--warn);
}

.prio-urgent {
  background: var(--bad-bg);
  color: var(--bad);
  font-weight: 700;
}

.prio-low {
  background: var(--neutral-badge);
  color: var(--muted);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 16px;
  border: 1px solid var(--ink);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  font-weight: 600;
  line-height: 1.25;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 150ms ease, border-color 150ms ease, color 150ms ease;
}

.btn:hover {
  border-color: var(--muted);
  background: var(--wash);
}

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

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

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

.btn-ghost:hover {
  border-color: var(--muted);
  background: var(--wash);
}

.btn-danger {
  border-color: var(--bad);
  background: transparent;
  color: var(--bad);
}

.btn-danger:hover {
  border-color: var(--bad);
  background: var(--bad-bg);
  color: var(--bad);
}

.btn-sm {
  padding: 5px 10px;
  font-size: 13px;
}

.btn:disabled,
.btn[aria-disabled="true"] {
  cursor: not-allowed;
  opacity: 0.55;
}

button.linklike {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  line-height: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}

button.linklike:hover {
  color: var(--muted);
}

.form {
  width: 100%;
  max-width: 640px;
}

.field {
  min-width: 0;
  margin-bottom: 14px;
}

.field label {
  display: block;
  margin-bottom: 4px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="url"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="datetime-local"],
select,
textarea {
  display: block;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  line-height: 1.5;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="url"]:focus,
input[type="tel"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
input[type="date"]:focus,
input[type="datetime-local"]:focus,
select:focus,
textarea:focus {
  border-color: var(--ink);
}

input[aria-invalid="true"],
select[aria-invalid="true"],
textarea[aria-invalid="true"] {
  border-color: var(--bad);
}

textarea {
  min-height: 110px;
  resize: vertical;
}

::placeholder {
  color: var(--muted);
  opacity: 0.8;
}

.help {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.errorlist {
  margin: 4px 0 0;
  padding: 0;
  color: var(--bad);
  font-size: 13px;
  list-style: none;
}

.errorlist li + li {
  margin-top: 2px;
}

.inline-form {
  display: inline;
}

.row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.row > * {
  min-width: 0;
  flex: 1 1 180px;
}

.tabs {
  display: flex;
  gap: 4px;
  margin: 16px 0;
  overflow-x: auto;
  border-bottom: 1px solid var(--line);
  overscroll-behavior-inline: contain;
}

.tabs a {
  flex: 0 0 auto;
  padding: 8px 14px;
  border-bottom: 3px solid transparent;
  color: var(--muted);
  line-height: 1.4;
  text-decoration: none;
  white-space: nowrap;
}

.tabs a:hover {
  color: var(--ink);
}

.tabs a.active {
  border-bottom-color: var(--accent);
  color: var(--ink);
  font-weight: 700;
}

.kanban-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.kanban {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(210px, 1fr);
  align-items: stretch;
  gap: 14px;
  width: 100%;
  max-width: 100%;
  padding-bottom: 8px;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
}

.kanban-col {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 420px;
  padding: 10px;
  border-radius: 10px;
  background: var(--wash-strong);
}

.kanban-col h2 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 4px 4px 10px;
  font-size: 13px;
  letter-spacing: 0.06em;
  line-height: 1.3;
  text-transform: uppercase;
}

.kanban-col .count {
  display: inline-flex;
  min-width: 24px;
  padding: 2px 7px;
  justify-content: center;
  border-radius: 999px;
  background: var(--neutral-badge);
  color: var(--muted);
  font-family: "Open Sans", "Segoe UI", system-ui, sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0;
}

.kanban-list {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 8px;
  min-height: 60px;
}

.kcard {
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  cursor: grab;
  transition: border-color 150ms ease, box-shadow 150ms ease, transform 150ms ease;
}

.kcard:hover {
  border-color: var(--muted);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.kcard:active {
  cursor: grabbing;
}

.kcard a.title {
  display: block;
  color: var(--ink);
  font-weight: 600;
  line-height: 1.4;
  text-decoration: none;
}

.kcard a.title:hover {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.kcard .kcard-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.kcard.sortable-ghost {
  border-style: dashed;
  opacity: 0.4;
}

.kcard.sortable-chosen {
  box-shadow: var(--shadow-lg);
}

.kanban.readonly .kcard {
  cursor: default;
}

.kanban.readonly .kcard:hover {
  box-shadow: var(--shadow-sm);
  transform: none;
}

.thread {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 60vh;
  min-height: 0;
  padding: 12px;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior-y: contain;
  border-radius: 10px;
  background: var(--wash);
}

.msg {
  align-self: flex-start;
  max-width: 78%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--ink);
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.msg.mine {
  align-self: flex-end;
  border-color: var(--ink);
  background: var(--ink);
  color: var(--white);
}

.msg .msg-meta {
  margin-top: 4px;
  font-size: 11px;
  opacity: 0.7;
}

.msg.mine a {
  color: var(--accent-ink);
}

.composer {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

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

.conv-list li a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  text-decoration: none;
}

.conv-list li a:hover {
  background: var(--wash);
}

.conv-list li a.unread {
  font-weight: 700;
}

.conv-list li:last-child a {
  border-bottom: 0;
}

.unread-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  flex: 0 0 8px;
  margin-left: auto;
  border: 1px solid var(--ink);
  border-radius: 50%;
  background: var(--accent-ink);
  box-shadow: 0 0 0 1px var(--ink);
}

.timeline {
  margin-left: 6px;
  padding: 0;
  border-left: 2px solid var(--line);
  list-style: none;
}

.timeline li {
  position: relative;
  padding: 0 0 14px 16px;
}

.timeline li::before {
  position: absolute;
  top: 5px;
  left: -5px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ink);
  box-shadow: 0 0 0 2px var(--bg);
  content: "";
}

.timeline li:last-child {
  padding-bottom: 0;
}

.timeline time {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.flashes {
  margin: 0 0 16px;
  padding: 0;
  list-style: none;
}

.flash {
  margin-bottom: 8px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--info);
  border-radius: 8px;
  background: var(--info-bg);
  color: var(--ink);
}

.flash:last-child {
  margin-bottom: 0;
}

.flash-success {
  border-left-color: var(--ok);
  background: var(--ok-bg);
}

.flash-error {
  border-left-color: var(--bad);
  background: var(--bad-bg);
}

.flash-info {
  border-left-color: var(--info);
  background: var(--info-bg);
}

.flash-warning {
  border-left-color: var(--warn);
  background: var(--warn-bg);
}

.auth-wrap {
  display: grid;
  min-height: 100vh;
  min-width: 0;
  padding: 16px;
  place-items: center;
  background: var(--bg);
}

.auth-card {
  width: 100%;
  max-width: 420px;
  padding: 32px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow-md);
}

.auth-card h1 {
  font-size: 24px;
}

.auth-card .brand-mark {
  display: inline-block;
  margin-bottom: 16px;
  padding: 7px 12px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-ink);
  font-family: "Archivo Black", Arial, sans-serif;
  font-size: 13px;
  line-height: 1.2;
}

.days {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
}

.day {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
}

.day h3 {
  margin: 0 0 8px;
  font-size: 14px;
}

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

.slot {
  position: relative;
  display: inline-flex;
}

.slot input {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  margin: -1px !important;
  padding: 0 !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  clip-path: inset(50%) !important;
  border: 0 !important;
  white-space: nowrap !important;
}

.slot span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  font-size: 13px;
  line-height: 1.2;
  cursor: pointer;
}

.slot span:hover {
  border-color: var(--muted);
  background: var(--wash);
}

.slot input:checked + span {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--accent-ink);
}

.slot input:focus-visible + span {
  outline: 3px solid var(--accent-ink);
  outline-offset: 2px;
  box-shadow: 0 0 0 2px var(--ink);
}

.slot input:disabled + span {
  cursor: not-allowed;
  opacity: 0.45;
}

.money {
  font-variant-numeric: tabular-nums;
}

.right {
  text-align: right;
}

.stack > * + * {
  margin-top: 12px;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.toolbar > * {
  max-width: 100%;
}

.pill-link {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.25;
  text-decoration: none;
}

.pill-link:hover {
  border-color: var(--muted);
  background: var(--wash);
}

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

  .sidebar {
    position: sticky;
    top: 0;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 12px;
    width: 100%;
    height: auto;
    min-height: 0;
    padding: 10px 12px;
    overflow: visible;
  }

  .sidebar .brand {
    flex: 0 0 auto;
    font-size: 16px;
  }

  .sidebar nav {
    flex: 1 1 auto;
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 4px;
    min-width: 0;
    margin-top: 0;
    padding: 2px 0;
    overflow-x: auto;
    overflow-y: hidden;
    overscroll-behavior-inline: contain;
    scrollbar-width: none;
    -ms-overflow-style: none;
    -webkit-overflow-scrolling: touch;
  }

  .sidebar nav::-webkit-scrollbar {
    display: none;
  }

  .sidebar nav a {
    flex: 0 0 auto;
    padding: 8px 10px;
    white-space: nowrap;
  }

  .sidebar .sidebar-foot {
    flex: 0 0 auto;
    margin: 0;
    padding: 0;
    border-top: 0;
    color: transparent;
    font-size: 0;
    line-height: 1;
  }

  .sidebar .sidebar-foot small,
  .sidebar .sidebar-foot p,
  .sidebar .sidebar-foot .user-info {
    display: none;
  }

  .sidebar .sidebar-foot form {
    display: inline;
    margin: 0;
    font-size: 0;
  }

  .sidebar .logout {
    color: var(--accent-ink);
    font-size: 13px;
    white-space: nowrap;
  }

  .main {
    width: 100%;
    max-width: 100%;
    padding: 16px;
  }

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

  .kanban {
    grid-auto-columns: minmax(270px, 82vw);
    scroll-snap-type: x mandatory;
  }

  .kanban-col {
    scroll-snap-align: start;
  }

  .msg {
    max-width: 90%;
  }
}

@media (max-width: 400px) {
  .sidebar {
    gap: 8px;
    padding-inline: 10px;
  }

  .sidebar .brand {
    gap: 6px;
    font-size: 14px;
  }

  .sidebar nav a {
    padding-inline: 8px;
  }

  .sidebar .logout {
    font-size: 12px;
  }

  .card {
    padding: 16px;
  }

  .auth-card {
    padding: 24px;
  }
}

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

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition: none !important;
  }

  .kcard:hover,
  .kanban.readonly .kcard:hover {
    transform: none;
  }
}

/* Additions after integration */
.brand span { display: block; font-family: "Open Sans", sans-serif; font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--accent-ink); }
a.stat { color: inherit; text-decoration: none; display: block; }
button.linklike.unread { font-weight: 700; }
[hidden] { display: none !important; }
.kanban-filter select { width: auto; min-width: 220px; }
.detail-list { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0; }
.detail-list dt { color: var(--muted); font-size: 13px; }
.detail-list dd { margin: 0; overflow-wrap: anywhere; }
.sr-only { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; border:0; }

.sidebar .logout { color: var(--accent-ink); text-decoration: underline; font-size: 13px; margin-top: 6px; }
.sidebar .sidebar-foot .small { display: block; overflow-wrap: anywhere; }
@media (max-width: 859.98px) {
  .sidebar { flex-wrap: wrap; row-gap: 6px; }
  .sidebar .brand { flex: 1 1 auto; min-width: 0; }
  .sidebar .brand span { display: inline; margin-left: 6px; }
  .sidebar .sidebar-foot { order: 2; }
  .sidebar .sidebar-foot .small { display: none; }
  .sidebar nav { order: 3; flex: 1 1 100%; }
}
@media (min-width: 860px) {
  .sidebar { position: sticky; top: 0; height: 100vh; overflow-y: auto; }
}
.sidebar .brand span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Analytics (/studio/analytics/) */
.an-section { font-size: 17px; margin: 28px 0 10px; }
.an-funnel { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; }
.an-funnel li { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; background: var(--wash); border-radius: 8px; }
.an-step { font-size: 13px; color: var(--muted); }
.an-num { font-size: 22px; font-weight: 700; }
.an-bar { display: grid; grid-template-columns: minmax(0, 2fr) minmax(60px, 3fr) auto; gap: 10px; align-items: center; padding: 4px 0; font-size: 13px; }
.an-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.an-track { height: 8px; background: var(--wash-strong); border-radius: 4px; overflow: hidden; }
.an-track > span { display: block; height: 100%; background: var(--ink); border-radius: 4px; }
.an-n { min-width: 2.5em; text-align: right; font-variant-numeric: tabular-nums; }
.an-spark { display: block; width: 100%; height: 80px; color: var(--ink); }
.an-months { display: flex; gap: 6px; align-items: flex-end; height: 160px; }
.an-month { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; height: 100%; min-width: 0; }
.an-cols { flex: 1; width: 100%; display: flex; gap: 2px; align-items: flex-end; justify-content: center; }
.an-col { width: 40%; max-width: 18px; min-height: 1px; border-radius: 3px 3px 0 0; }
.an-col.invoiced, .an-key.invoiced { background: var(--line); }
.an-col.paid, .an-key.paid { background: var(--ok); }
.an-key { display: inline-block; width: 10px; height: 10px; border-radius: 2px; vertical-align: middle; margin-left: 8px; }
