:root {
  color-scheme: light;
  --ink: #17231f;
  --ink-soft: #59645f;
  --forest: #1f4036;
  --forest-bright: #2d5c4c;
  --gold: #c7a756;
  --gold-ink: #80601e;
  --gold-soft: #f0e4bd;
  --paper: #f7f3ea;
  --surface: #fffdf8;
  --surface-muted: #efebe2;
  --line: rgba(23, 35, 31, 0.13);
  --danger: #a13c35;
  --danger-soft: #f9e7e3;
  --warning: #95631f;
  --warning-soft: #fff1cf;
  --success: #2e6b50;
  --success-soft: #e0f1e8;
  --info-soft: #e8efed;
  --shadow: 0 18px 48px rgba(23, 35, 31, 0.16);
  --shadow-small: 0 1px 2px rgba(23, 35, 31, 0.04);
  --radius-xl: 24px;
  --radius-lg: 18px;
  --radius-md: 14px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  font-family: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--paper);
  -webkit-text-size-adjust: 100%;
}

body {
  min-width: 0;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}

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

button,
select {
  cursor: pointer;
}

button:disabled,
input:disabled,
textarea:disabled,
select:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

button,
a,
input,
textarea,
select {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 3px solid rgba(31, 64, 54, 0.52);
  outline-offset: 2px;
}

[hidden] {
  display: none !important;
}

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

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

.eyebrow {
  margin: 0 0 0.3rem;
  color: var(--gold-ink);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.login-view {
  display: grid;
  min-height: 100vh;
  min-height: 100dvh;
  padding: calc(1.25rem + var(--safe-top)) 1rem calc(1.25rem + var(--safe-bottom));
  place-items: center;
  background:
    linear-gradient(155deg, rgba(23, 35, 31, 0.97), rgba(31, 64, 54, 0.95)),
    var(--ink);
}

.login-card {
  width: 100%;
  min-width: 0;
  max-width: 27rem;
  padding: clamp(1.45rem, 5vw, 2.25rem);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-xl);
  background: var(--surface);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.3);
}

.brand-mark {
  display: grid;
  width: 3.4rem;
  height: 3.4rem;
  margin-bottom: 1.6rem;
  border-radius: 1rem;
  color: var(--ink);
  background: var(--gold);
  font-size: 1rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  place-items: center;
}

.login-card h1 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.15rem, 10vw, 3.15rem);
  font-weight: 500;
  letter-spacing: -0.045em;
  line-height: 1;
  overflow-wrap: anywhere;
}

.login-lead {
  margin: 0.85rem 0 1.8rem;
  color: var(--ink-soft);
  line-height: 1.5;
}

.stack {
  display: grid;
  gap: 1rem;
}

.field {
  display: grid;
  gap: 0.45rem;
  color: var(--ink);
  font-size: 0.85rem;
  font-weight: 750;
}

.field input,
.field textarea,
.field select,
.composer textarea,
.message-composer textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  color: var(--ink);
  background: #fff;
  box-shadow: inset 0 1px 1px rgba(23, 35, 31, 0.025);
  font-weight: 500;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

.field input,
.field select {
  min-height: 3.25rem;
  padding: 0.75rem 0.9rem;
}

.field textarea {
  min-height: 7rem;
  padding: 0.85rem 0.9rem;
  line-height: 1.45;
  resize: vertical;
}

.field input:focus,
.field textarea:focus,
.field select:focus,
.composer textarea:focus,
.message-composer textarea:focus {
  border-color: var(--gold);
  outline: none;
  box-shadow: 0 0 0 4px rgba(199, 167, 86, 0.14);
}

.field-grid {
  display: grid;
  gap: 1rem;
}

.button {
  display: inline-flex;
  min-height: 2.75rem;
  padding: 0.65rem 1rem;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  border: 0;
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 800;
  text-decoration: none;
  transition: transform 120ms ease, background 150ms ease, opacity 150ms ease;
}

.button:active:not(:disabled),
.icon-button:active:not(:disabled),
.nav-item:active:not(:disabled),
.conversation-item:active:not(:disabled) {
  transform: scale(0.97);
}

.button-primary {
  color: #fff;
  background: var(--forest);
  box-shadow: 0 7px 18px rgba(31, 64, 54, 0.22);
}

.button-primary:hover:not(:disabled) {
  background: var(--forest-bright);
}

.button-secondary {
  border: 1px solid rgba(31, 64, 54, 0.2);
  color: var(--forest);
  background: var(--success-soft);
}

.button-quiet {
  border: 1px solid var(--line);
  color: var(--ink);
  background: transparent;
}

.button-danger-quiet {
  border: 1px solid rgba(161, 60, 53, 0.2);
  color: var(--danger);
  background: var(--danger-soft);
}

.button-wide {
  width: 100%;
}

.button-small {
  min-height: 2.75rem;
  padding: 0.45rem 0.75rem;
  font-size: 0.78rem;
}

.form-error {
  margin: 0;
  padding: 0.8rem 0.95rem;
  border-radius: 0.85rem;
  color: var(--danger);
  background: var(--danger-soft);
  font-size: 0.82rem;
  font-weight: 650;
  line-height: 1.4;
}

.policy-note {
  display: flex;
  gap: 0.65rem;
  align-items: flex-start;
  color: var(--ink-soft);
  background: var(--info-soft);
  font-size: 0.75rem;
  line-height: 1.45;
}

.compact-policy {
  margin-top: 1.35rem;
  padding: 0.8rem;
  border-radius: 0.9rem;
}

.policy-note p {
  margin: 0;
}

.policy-icon {
  display: grid;
  flex: 0 0 auto;
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 50%;
  color: #fff;
  background: var(--forest);
  font-size: 0.75rem;
  font-weight: 900;
  place-items: center;
}

.app-shell {
  width: min(100%, 72rem);
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 auto;
  padding-bottom: calc(5.8rem + var(--safe-bottom));
}

.app-header {
  position: sticky;
  z-index: 20;
  top: 0;
  display: flex;
  min-height: calc(5rem + var(--safe-top));
  padding: calc(0.9rem + var(--safe-top)) 1rem 0.85rem;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(23, 35, 31, 0.08);
  background: rgba(247, 243, 234, 0.94);
  backdrop-filter: blur(18px);
}

.app-header h1 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.7rem;
  font-weight: 500;
  letter-spacing: -0.025em;
}

.icon-button {
  display: grid;
  flex: 0 0 auto;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--ink);
  background: rgba(255, 253, 248, 0.72);
  font-size: 1.7rem;
  place-items: center;
  transition: transform 120ms ease, background 150ms ease;
}

.icon-button svg {
  width: 1.25rem;
  height: 1.25rem;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.refreshing svg {
  animation: rotate 700ms linear infinite;
}

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

.offline-bar {
  padding: 0.45rem 1rem;
  color: #fff;
  background: var(--warning);
  font-size: 0.75rem;
  font-weight: 750;
  text-align: center;
}

.screen {
  padding: 1rem;
}

.toolbar {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  justify-content: space-between;
}

.filter-row {
  display: flex;
  min-width: 0;
  margin: -0.25rem;
  padding: 0.25rem;
  gap: 0.45rem;
  overflow-x: auto;
  scrollbar-width: none;
}

.filter-row::-webkit-scrollbar {
  display: none;
}

.filter-chip {
  display: inline-flex;
  min-height: 2.75rem;
  padding: 0.45rem 0.72rem;
  gap: 0.35rem;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink-soft);
  background: rgba(255, 253, 248, 0.75);
  font-size: 0.76rem;
  font-weight: 750;
  white-space: nowrap;
}

.filter-chip span {
  display: grid;
  min-width: 1.25rem;
  height: 1.25rem;
  padding: 0 0.25rem;
  border-radius: 999px;
  color: var(--ink);
  background: var(--surface-muted);
  font-size: 0.68rem;
  place-items: center;
}

.filter-chip.active {
  border-color: var(--forest);
  color: #fff;
  background: var(--forest);
}

.filter-chip:last-child {
  grid-column: 2;
}

.filter-chip.active span {
  color: var(--forest);
  background: var(--gold-soft);
}

.create-button {
  flex: 0 0 auto;
  min-height: 2.75rem;
  padding: 0.5rem 0.8rem;
}

.card-list,
.conversation-list {
  display: grid;
  margin-top: 1rem;
  gap: 0.75rem;
}

.task-card {
  position: relative;
  display: grid;
  width: 100%;
  padding: 1rem;
  gap: 0.75rem;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  color: var(--ink);
  background: var(--surface);
  box-shadow: none;
  text-align: left;
}

.task-card::before {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 0.26rem;
  background: var(--gold);
  content: "";
}

.task-card.priority-urgent::before,
.task-card.is-overdue::before {
  background: var(--danger);
}

.task-card.priority-high::before {
  background: #d07a34;
}

.task-card.priority-low::before {
  background: #8fa9a0;
}

.task-card.is-closed {
  box-shadow: none;
  opacity: 0.72;
}

.task-card-top,
.task-card-bottom,
.detail-status-line {
  display: flex;
  gap: 0.6rem;
  align-items: center;
  justify-content: space-between;
}

.task-card h2 {
  margin: 0;
  font-size: 1rem;
  line-height: 1.3;
}

.task-description-preview {
  display: -webkit-box;
  margin: -0.25rem 0 0;
  overflow: hidden;
  color: var(--ink-soft);
  font-size: 0.82rem;
  line-height: 1.4;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.status-pill,
.priority-pill,
.unread-pill {
  display: inline-flex;
  min-height: 1.65rem;
  padding: 0.25rem 0.55rem;
  align-items: center;
  border-radius: 999px;
  font-size: 0.67rem;
  font-weight: 850;
  letter-spacing: 0.015em;
  white-space: nowrap;
}

.status-new {
  color: #52605b;
  background: #ebe8df;
}

.status-in_progress {
  color: #245845;
  background: #dff0e7;
}

.status-review {
  color: #805b22;
  background: #fff0c9;
}

.status-done {
  color: #466a5b;
  background: #e6efeb;
}

.status-cancelled {
  color: #736e69;
  background: #e9e6e2;
}

.priority-pill {
  color: var(--warning);
  background: var(--warning-soft);
}

.priority-pill.priority-urgent {
  color: var(--danger);
  background: var(--danger-soft);
}

.task-meta {
  display: flex;
  min-width: 0;
  gap: 0.4rem;
  align-items: center;
  color: var(--ink-soft);
  font-size: 0.72rem;
  font-weight: 650;
}

.task-meta .separator::before {
  color: rgba(23, 35, 31, 0.3);
  content: "•";
}

.due-overdue {
  color: var(--danger);
  font-weight: 850;
}

.assignee-chip {
  display: flex;
  min-width: 0;
  gap: 0.45rem;
  align-items: center;
  color: var(--ink-soft);
  font-size: 0.73rem;
  font-weight: 750;
}

.avatar,
.profile-avatar {
  display: grid;
  flex: 0 0 auto;
  border-radius: 50%;
  color: #fff;
  background: var(--forest);
  font-weight: 850;
  place-items: center;
}

.avatar {
  width: 2.15rem;
  height: 2.15rem;
  font-size: 0.68rem;
}

.small-avatar {
  width: 2.5rem;
  height: 2.5rem;
  font-size: 0.73rem;
}

.empty-state {
  padding: 4rem 1.5rem;
  color: var(--ink-soft);
  text-align: center;
}

.empty-state h2 {
  margin: 0.8rem 0 0.35rem;
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.35rem;
  font-weight: 500;
}

.empty-state p {
  margin: 0;
  font-size: 0.85rem;
}

.empty-icon {
  display: grid;
  width: 3.5rem;
  height: 3.5rem;
  margin: 0 auto;
  border-radius: 50%;
  color: var(--forest);
  background: var(--gold-soft);
  font-size: 1.3rem;
  font-weight: 900;
  place-items: center;
}

.section-hint {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.8rem;
}

.conversation-item,
.person-button {
  display: grid;
  width: 100%;
  padding: 0.9rem;
  gap: 0.8rem;
  align-items: center;
  border: 1px solid var(--line);
  color: var(--ink);
  background: var(--surface);
  text-align: left;
}

.conversation-item {
  grid-template-columns: auto minmax(0, 1fr) auto;
  border-radius: var(--radius-lg);
  box-shadow: none;
}

.conversation-copy,
.person-copy {
  min-width: 0;
}

.conversation-line {
  display: flex;
  gap: 0.5rem;
  align-items: baseline;
  justify-content: space-between;
}

.conversation-copy h2,
.person-copy strong {
  display: block;
  margin: 0;
  overflow: hidden;
  font-size: 0.9rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.conversation-copy p,
.person-copy span {
  display: block;
  margin: 0.3rem 0 0;
  overflow: hidden;
  color: var(--ink-soft);
  font-size: 0.76rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.conversation-time {
  color: var(--ink-soft);
  font-size: 0.64rem;
  white-space: nowrap;
}

.conversation-tail {
  display: grid;
  min-width: 1.5rem;
  justify-items: end;
}

.unread-pill,
.nav-badge {
  color: #fff;
  background: var(--danger);
}

.unread-pill {
  min-width: 1.5rem;
  justify-content: center;
}

.admin-conversation-mark {
  margin-top: 0.3rem;
  color: var(--warning);
  font-size: 0.65rem;
  font-weight: 800;
}

.profile-screen {
  display: grid;
  gap: 0.85rem;
}

.profile-card,
.settings-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: none;
}

.profile-card {
  display: flex;
  padding: 1.1rem;
  gap: 0.9rem;
  align-items: center;
}

.profile-avatar {
  width: 3.6rem;
  height: 3.6rem;
  background: var(--gold);
  font-size: 1rem;
}

.profile-card h2 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.35rem;
  font-weight: 500;
}

.profile-card p {
  margin: 0.25rem 0 0;
  font-size: 0.8rem;
}

.settings-card {
  padding: 1.05rem;
}

.settings-copy {
  display: flex;
  margin-bottom: 1rem;
  gap: 0.8rem;
}

.settings-icon {
  display: grid;
  flex: 0 0 auto;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.8rem;
  color: var(--forest);
  background: var(--gold-soft);
  font-size: 1.25rem;
  font-weight: 900;
  place-items: center;
}

.settings-card h2 {
  margin: 0;
  font-size: 0.95rem;
}

.settings-card p {
  margin: 0.35rem 0 0;
  color: var(--ink-soft);
  font-size: 0.78rem;
  line-height: 1.5;
}

.settings-help {
  padding: 0.75rem;
  border-radius: 0.8rem;
  background: var(--warning-soft);
}

.password-hint {
  margin: -0.35rem 0 0;
  font-size: 0.72rem;
  line-height: 1.45;
}

.policy-card {
  border-color: rgba(199, 167, 86, 0.28);
  background: linear-gradient(145deg, var(--surface), #fff8e7);
}

.app-info {
  display: grid;
  gap: 0.7rem;
}

.app-info > div {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  color: var(--ink-soft);
  font-size: 0.78rem;
}

.app-info strong {
  color: var(--ink);
}

.bottom-nav {
  position: fixed;
  z-index: 50;
  right: 0;
  bottom: 0;
  left: 0;
  display: grid;
  min-height: calc(4.6rem + var(--safe-bottom));
  padding: 0.45rem max(0.75rem, calc((100vw - 40rem) / 2)) var(--safe-bottom);
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid rgba(23, 35, 31, 0.1);
  background: rgba(255, 253, 248, 0.94);
  backdrop-filter: blur(20px);
}

.nav-item {
  position: relative;
  display: grid;
  padding: 0.3rem;
  gap: 0.12rem;
  justify-items: center;
  border: 0;
  border-radius: 0.85rem;
  color: #626e69;
  background: transparent;
  font-size: 0.66rem;
  font-weight: 750;
  transition: color 150ms ease, transform 120ms ease;
}

.nav-item svg {
  width: 1.45rem;
  height: 1.45rem;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.75;
}

.nav-item.active {
  color: var(--forest);
}

.nav-item.active::before {
  position: absolute;
  top: 0;
  width: 1.8rem;
  height: 0.2rem;
  border-radius: 999px;
  background: var(--gold);
  content: "";
}

.nav-badge {
  position: absolute;
  z-index: 1;
  top: 0.05rem;
  left: calc(50% + 0.45rem);
  display: grid;
  min-width: 1.15rem;
  height: 1.15rem;
  padding: 0 0.25rem;
  border: 2px solid var(--surface);
  border-radius: 999px;
  font-size: 0.58rem;
  font-weight: 850;
  place-items: center;
}

dialog {
  padding: 0;
  border: 0;
  color: var(--ink);
  background: transparent;
}

dialog::backdrop {
  background: rgba(11, 19, 16, 0.55);
  backdrop-filter: blur(3px);
}

.sheet-dialog {
  width: 100%;
  max-width: none;
  max-height: calc(100dvh - var(--safe-top));
  margin: auto 0 0;
}

.dialog-shell {
  width: 100%;
  max-height: calc(100dvh - var(--safe-top));
  overflow: hidden;
  border-radius: 1.5rem 1.5rem 0 0;
  background: var(--paper);
  box-shadow: var(--shadow);
}

.dialog-header,
.conversation-header {
  display: grid;
  padding: 0.85rem 1rem;
  gap: 0.7rem;
  align-items: center;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 253, 248, 0.94);
}

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

.dialog-header h2,
.conversation-header h2 {
  margin: 0;
  overflow: hidden;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.2rem;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dialog-close {
  border: 0;
  background: transparent;
}

.dialog-spacer {
  width: 2.75rem;
}

.dialog-body {
  max-height: calc(100dvh - 5rem - var(--safe-top));
  padding: 1rem 1rem calc(1.15rem + var(--safe-bottom));
  overflow-y: auto;
}

.dialog-actions {
  position: sticky;
  bottom: calc(-1.15rem - var(--safe-bottom));
  display: flex;
  margin: 0 -1rem calc(-1.15rem - var(--safe-bottom));
  padding: 0.85rem 1rem calc(0.85rem + var(--safe-bottom));
  gap: 0.65rem;
  justify-content: flex-end;
  border-top: 1px solid var(--line);
  background: rgba(255, 253, 248, 0.95);
  backdrop-filter: blur(16px);
}

.detail-description {
  margin: 1.1rem 0;
  white-space: pre-wrap;
  color: var(--ink-soft);
  font-size: 0.88rem;
  line-height: 1.55;
}

.detail-description:empty::before {
  color: #929b97;
  content: "Описание не добавлено";
}

.detail-facts {
  display: grid;
  margin: 0;
  gap: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
}

.detail-facts > div {
  display: flex;
  padding: 0.8rem;
  gap: 0.75rem;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  font-size: 0.78rem;
}

.detail-facts > div:last-child {
  border-bottom: 0;
}

.detail-facts dt {
  color: var(--ink-soft);
}

.detail-facts dd {
  margin: 0;
  font-weight: 750;
  text-align: right;
}

.progress-actions {
  display: grid;
  margin-top: 1rem;
  gap: 0.6rem;
  grid-template-columns: 1fr 1fr;
}

.comments-section {
  margin-top: 1.5rem;
}

.comments-section h3 {
  margin: 0 0 0.8rem;
  font-size: 0.9rem;
}

.comment-list {
  display: grid;
  gap: 0.65rem;
}

.comment {
  padding: 0.75rem;
  border-radius: 0.9rem;
  background: var(--surface-muted);
}

.comment.mine {
  background: var(--success-soft);
}

.comment-head {
  display: flex;
  margin-bottom: 0.3rem;
  gap: 0.6rem;
  justify-content: space-between;
  color: var(--ink-soft);
  font-size: 0.65rem;
}

.comment-head strong {
  color: var(--ink);
}

.comment p {
  margin: 0;
  white-space: pre-wrap;
  font-size: 0.78rem;
  line-height: 1.45;
}

.composer,
.message-composer {
  display: grid;
  gap: 0.55rem;
  align-items: end;
  grid-template-columns: minmax(0, 1fr) auto;
}

.composer {
  margin-top: 0.8rem;
}

.composer textarea,
.message-composer textarea {
  min-height: 2.75rem;
  max-height: 9rem;
  padding: 0.75rem 0.9rem;
  line-height: 1.35;
  resize: none;
}

.send-button {
  display: grid;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: #fff;
  background: var(--forest);
  font-size: 1.15rem;
  font-weight: 900;
  place-items: center;
}

.people-list {
  display: grid;
  gap: 0.55rem;
}

.person-button {
  grid-template-columns: auto minmax(0, 1fr) auto;
  border-radius: var(--radius-md);
}

.person-arrow {
  color: var(--ink-soft);
  font-size: 1.3rem;
}

.conversation-dialog {
  width: 100%;
  max-width: none;
  height: 100%;
  max-height: none;
  margin: 0;
}

.conversation-shell {
  display: grid;
  width: 100%;
  height: 100dvh;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  background: var(--paper);
}

.conversation-header {
  padding-top: calc(0.65rem + var(--safe-top));
  grid-template-columns: auto auto minmax(0, 1fr);
}

.conversation-heading {
  min-width: 0;
}

.conversation-heading p {
  margin: 0.15rem 0 0;
  overflow: hidden;
  color: var(--ink-soft);
  font-size: 0.68rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-view-notice {
  padding: 0.6rem 0.8rem;
  color: #76551f;
  background: var(--warning-soft);
  font-size: 0.7rem;
  font-weight: 650;
  line-height: 1.4;
  text-align: center;
}

.message-list {
  display: flex;
  padding: 1rem;
  gap: 0.55rem;
  overflow-y: auto;
  flex-direction: column;
  scroll-behavior: smooth;
}

.message-loading {
  position: absolute;
  top: 50%;
  right: 0;
  left: 0;
  color: var(--ink-soft);
  font-size: 0.78rem;
  text-align: center;
}

.message-date {
  align-self: center;
  margin: 0.3rem 0;
  padding: 0.3rem 0.6rem;
  border-radius: 999px;
  color: var(--ink-soft);
  background: rgba(235, 232, 223, 0.88);
  font-size: 0.65rem;
  font-weight: 700;
}

.message {
  max-width: min(82%, 32rem);
  padding: 0.65rem 0.75rem 0.45rem;
  align-self: flex-start;
  border-radius: 0.35rem 1rem 1rem 1rem;
  background: var(--surface);
  box-shadow: 0 3px 10px rgba(23, 35, 31, 0.07);
}

.message.mine {
  align-self: flex-end;
  border-radius: 1rem 0.35rem 1rem 1rem;
  background: var(--success-soft);
}

.message-author {
  margin: 0 0 0.2rem;
  color: var(--forest);
  font-size: 0.63rem;
  font-weight: 850;
}

.message-body {
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 0.84rem;
  line-height: 1.45;
}

.message-time {
  display: block;
  margin: 0.2rem 0 0;
  color: var(--ink-soft);
  font-size: 0.58rem;
  text-align: right;
}

.message-composer {
  padding: 0.65rem 0.75rem calc(0.65rem + var(--safe-bottom));
  border-top: 1px solid var(--line);
  background: var(--surface);
}

.message-composer.is-readonly {
  display: block;
  color: var(--ink-soft);
  background: var(--warning-soft);
  font-size: 0.75rem;
  text-align: center;
}

.loading-overlay {
  position: fixed;
  z-index: 200;
  inset: 0;
  display: grid;
  padding: 1rem;
  align-content: center;
  justify-items: center;
  color: #fff;
  background: rgba(23, 35, 31, 0.72);
  backdrop-filter: blur(5px);
}

.loading-overlay p {
  margin: 0.7rem 0 0;
  font-size: 0.8rem;
  font-weight: 750;
}

.spinner {
  width: 2rem;
  height: 2rem;
  border: 3px solid rgba(255, 255, 255, 0.25);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: rotate 700ms linear infinite;
}

.toast-region {
  position: fixed;
  z-index: 300;
  right: 1rem;
  bottom: calc(5.5rem + var(--safe-bottom));
  left: 1rem;
  display: grid;
  gap: 0.5rem;
  pointer-events: none;
}

.toast {
  width: min(100%, 28rem);
  margin: 0 auto;
  padding: 0.85rem 1rem;
  border-radius: 0.9rem;
  color: #fff;
  background: var(--ink);
  box-shadow: var(--shadow);
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.4;
  animation: toast-in 180ms ease-out;
}

.toast.error {
  background: var(--danger);
}

@keyframes toast-in {
  from { transform: translateY(0.6rem); opacity: 0; }
}

@media (min-width: 42rem) {
  .field-grid {
    grid-template-columns: 1fr 1fr;
  }

  .screen {
    padding: 1.25rem 1.5rem;
  }

  .app-header {
    padding-right: 1.5rem;
    padding-left: 1.5rem;
  }

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

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

  .profile-screen {
    max-width: 38rem;
    margin: 0 auto;
  }

  .sheet-dialog {
    width: min(100% - 2rem, 38rem);
    margin: auto;
  }

  .sheet-dialog .dialog-shell {
    border-radius: var(--radius-xl);
  }

  .compact-dialog {
    width: min(100% - 2rem, 30rem);
  }

  .conversation-dialog {
    width: min(100% - 2rem, 52rem);
    height: min(92dvh, 52rem);
    margin: auto;
  }

  .conversation-shell {
    height: min(92dvh, 52rem);
    overflow: hidden;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow);
  }

  .conversation-header {
    padding-top: 0.85rem;
  }
}

@media (min-width: 72rem) {
  .card-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

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

/* Premium Team · mobile-first "warm precision" layer */

.app-shell {
  width: min(100%, 64rem);
  padding-bottom: calc(5.35rem + var(--safe-bottom));
}

.app-header {
  min-height: calc(5.35rem + var(--safe-top));
  padding: calc(0.72rem + var(--safe-top)) 1rem 0.72rem;
}

.header-copy {
  min-width: 0;
}

.header-copy .eyebrow {
  margin-bottom: 0.18rem;
  font-size: 0.66rem;
  letter-spacing: 0.12em;
}

.app-header h1 {
  font-family: inherit;
  font-size: clamp(1.45rem, 6.2vw, 1.85rem);
  font-weight: 780;
  letter-spacing: -0.035em;
  line-height: 1.05;
}

.screen-subtitle {
  margin: 0.22rem 0 0;
  overflow: hidden;
  color: var(--ink-soft);
  font-size: 0.72rem;
  font-weight: 560;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.header-actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.header-avatar {
  width: 2.75rem;
  height: 2.75rem;
  border: 2px solid rgba(199, 167, 86, 0.62);
  background: var(--forest);
  font-size: 0.72rem;
}

.screen {
  padding: 0.9rem 0.85rem 1.5rem;
}

.scope-tabs {
  display: grid;
  padding: 0.22rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border: 1px solid var(--line);
  border-radius: 0.95rem;
  background: rgba(239, 235, 226, 0.72);
}

.scope-tabs button {
  min-height: 2.75rem;
  padding: 0.55rem 0.75rem;
  border: 0;
  border-radius: 0.75rem;
  color: var(--ink-soft);
  background: transparent;
  font-size: 0.8rem;
  font-weight: 760;
}

.scope-tabs button.active {
  color: var(--ink);
  background: var(--surface);
  box-shadow: 0 1px 3px rgba(23, 35, 31, 0.08);
}

.scope-tabs button span {
  display: inline-grid;
  min-width: 1.25rem;
  height: 1.25rem;
  margin-left: 0.25rem;
  padding: 0 0.25rem;
  border-radius: 999px;
  color: var(--ink-soft);
  background: var(--surface-muted);
  font-size: 0.66rem;
  place-items: center;
}

.control-summary {
  display: grid;
  margin-top: 0.8rem;
  gap: 0.5rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.control-metric {
  display: grid;
  min-width: 0;
  min-height: 4.65rem;
  padding: 0.7rem 0.55rem;
  gap: 0.15rem;
  align-content: center;
  justify-items: start;
  border: 1px solid var(--line);
  border-radius: 1rem;
  color: var(--ink-soft);
  background: var(--surface);
  font-size: 0.65rem;
  font-weight: 720;
  text-align: left;
}

.control-metric::after {
  width: 1.6rem;
  height: 0.16rem;
  margin-top: 0.24rem;
  border-radius: 999px;
  background: var(--forest);
  content: "";
}

.control-metric.metric-warning::after {
  background: var(--gold);
}

.control-metric.metric-danger::after {
  background: var(--danger);
}

.control-metric.active {
  border-color: rgba(31, 64, 54, 0.48);
  box-shadow: inset 0 0 0 1px rgba(31, 64, 54, 0.12);
}

.control-value {
  color: var(--ink);
  font-size: 1.35rem;
  font-weight: 820;
  letter-spacing: -0.04em;
  line-height: 1;
}

.screen-tools {
  display: grid;
  margin-top: 0.8rem;
  gap: 0.5rem;
  grid-template-columns: minmax(0, 1fr);
}

.task-tools:has(.compact-select:not([hidden])) {
  grid-template-columns: minmax(0, 1fr) minmax(8.5rem, 0.68fr);
}

.search-field {
  display: flex;
  min-width: 0;
  min-height: 2.9rem;
  padding: 0 0.82rem;
  gap: 0.55rem;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink-soft);
  background: rgba(255, 253, 248, 0.88);
}

.search-field:focus-within {
  border-color: var(--forest);
  box-shadow: 0 0 0 3px rgba(31, 64, 54, 0.1);
}

.search-field svg {
  flex: 0 0 auto;
  width: 1.1rem;
  height: 1.1rem;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-width: 1.8;
}

.search-field input {
  min-width: 0;
  width: 100%;
  min-height: 2.75rem;
  padding: 0;
  border: 0;
  outline: 0;
  color: var(--ink);
  background: transparent;
  font-size: 1rem;
}

.search-field input::placeholder {
  color: #7b8580;
}

.compact-select select {
  width: 100%;
  min-height: 2.9rem;
  padding: 0.55rem 2rem 0.55rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
  background: var(--surface);
  font-size: 0.8rem;
  font-weight: 650;
}

.filter-toolbar {
  margin-top: 0.55rem;
}

.filter-row {
  display: grid;
  width: 100%;
  margin: 0;
  padding: 0;
  gap: 0.35rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  overflow: visible;
  scroll-snap-type: none;
}

.filter-chip {
  width: 100%;
  min-width: 0;
  min-height: 2.75rem;
  padding: 0.42rem 0.25rem;
  justify-content: center;
  border-color: transparent;
  background: transparent;
  font-size: 0.7rem;
  line-height: 1.15;
  text-align: center;
  white-space: normal;
}

.filter-chip:hover:not(.active) {
  border-color: var(--line);
  background: rgba(255, 253, 248, 0.72);
}

.filter-chip.active {
  border-color: var(--forest);
  color: #fff;
  background: var(--forest);
}

.card-list {
  margin-top: 0.7rem;
  gap: 0.58rem;
}

.task-card {
  min-height: 8.15rem;
  padding: 0.88rem 0.9rem 0.82rem 1rem;
  gap: 0.55rem;
  border-radius: 1rem;
  background: var(--surface);
}

.task-card::before {
  width: 0.2rem;
}

.task-card h2 {
  font-size: 0.96rem;
  font-weight: 770;
  letter-spacing: -0.012em;
  line-height: 1.34;
}

.task-labels {
  display: flex;
  min-width: 0;
  gap: 0.35rem;
  align-items: center;
}

.task-alert {
  color: var(--danger);
  font-size: 0.66rem;
  font-weight: 780;
  white-space: nowrap;
}

.task-description-preview {
  margin-top: -0.12rem;
  font-size: 0.78rem;
  line-height: 1.42;
}

.status-pill,
.priority-pill,
.unread-pill {
  min-height: 1.55rem;
  font-size: 0.66rem;
}

.task-card-bottom {
  margin-top: auto;
  padding-top: 0.1rem;
  gap: 0.5rem;
}

.task-meta {
  min-width: 6rem;
  font-size: 0.69rem;
  line-height: 1.3;
}

.assignee-chip {
  max-width: 52%;
  font-size: 0.69rem;
}

.assignee-chip > span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.assignee-chip .avatar {
  width: 1.8rem;
  height: 1.8rem;
  font-size: 0.58rem;
}

.fab {
  position: fixed;
  z-index: 45;
  right: max(1rem, calc((100vw - 64rem) / 2 + 1rem));
  bottom: calc(5.2rem + var(--safe-bottom));
  display: inline-flex;
  width: 3.5rem;
  height: 3.5rem;
  padding: 0;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 50%;
  color: #fff;
  background: var(--forest);
  box-shadow: 0 9px 24px rgba(31, 64, 54, 0.25);
  font-size: 1.55rem;
  font-weight: 500;
  line-height: 1;
}

.fab:active:not(:disabled) {
  transform: scale(0.96);
}

.fab-label {
  display: none;
}

.conversation-list {
  margin-top: 0.7rem;
  gap: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 1.1rem;
  background: var(--surface);
}

.conversation-item {
  min-height: 4.55rem;
  padding: 0.68rem 0.75rem;
  gap: 0.7rem;
  border: 0;
  border-bottom: 1px solid rgba(23, 35, 31, 0.09);
  border-radius: 0;
  background: transparent;
}

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

.conversation-item:hover {
  background: rgba(239, 235, 226, 0.54);
}

.conversation-item > .avatar {
  width: 2.65rem;
  height: 2.65rem;
  border: 1px solid rgba(199, 167, 86, 0.35);
  font-size: 0.72rem;
}

.conversation-copy h2,
.person-copy strong {
  font-size: 0.86rem;
  font-weight: 780;
}

.conversation-copy p,
.person-copy span {
  margin-top: 0.22rem;
  font-size: 0.74rem;
}

.conversation-time {
  font-size: 0.66rem;
}

.conversation-arrow {
  color: var(--ink-soft);
  font-size: 1.25rem;
  line-height: 1;
}

.corporate-chat-hint {
  margin: 0.65rem 0 0;
  padding: 0.68rem 0.78rem;
  border: 1px solid rgba(149, 99, 31, 0.16);
  border-radius: 0.85rem;
  color: #76551f;
  background: var(--warning-soft);
  line-height: 1.4;
}

.quick-due-row {
  display: flex;
  margin-top: -0.25rem;
  padding: 0.15rem 0;
  gap: 0.42rem;
  overflow-x: auto;
  scrollbar-width: none;
}

.quick-due-row::-webkit-scrollbar {
  display: none;
}

.quick-due-row button {
  min-height: 2.75rem;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink-soft);
  background: var(--surface);
  font-size: 0.74rem;
  font-weight: 720;
  white-space: nowrap;
}

.quick-due-row button.active {
  border-color: var(--forest);
  color: #fff;
  background: var(--forest);
}

.field-help {
  color: var(--ink-soft);
  font-size: 0.7rem;
  font-weight: 520;
  line-height: 1.35;
}

.section-heading-row {
  display: flex;
  margin-bottom: 0.8rem;
  gap: 0.5rem;
  align-items: baseline;
  justify-content: space-between;
}

.section-heading-row h3 {
  margin: 0;
}

.section-heading-row span {
  color: var(--ink-soft);
  font-size: 0.66rem;
}

.comment-list {
  position: relative;
  gap: 0;
}

.comment-list::before {
  position: absolute;
  top: 0.8rem;
  bottom: 0.8rem;
  left: 0.56rem;
  width: 1px;
  background: var(--line);
  content: "";
}

.comment.timeline-item {
  position: relative;
  display: grid;
  padding: 0 0 0.78rem;
  gap: 0.68rem;
  grid-template-columns: 1.18rem minmax(0, 1fr);
  border-radius: 0;
  background: transparent;
}

.timeline-marker {
  position: relative;
  z-index: 1;
  display: grid;
  width: 1.18rem;
  height: 1.18rem;
  margin-top: 0.22rem;
  border: 2px solid var(--paper);
  border-radius: 50%;
  color: #fff;
  background: var(--forest);
  font-size: 0.58rem;
  font-weight: 900;
  place-items: center;
}

.timeline-item.comment .timeline-marker {
  color: var(--forest);
  background: var(--gold-soft);
  font-size: 1rem;
}

.timeline-content {
  min-width: 0;
  padding: 0.68rem 0.72rem;
  border: 1px solid var(--line);
  border-radius: 0.9rem;
  background: var(--surface);
}

.timeline-item.event .timeline-content {
  border-color: transparent;
  background: rgba(239, 235, 226, 0.72);
}

.timeline-item.mine.comment .timeline-content {
  border-color: rgba(46, 107, 80, 0.16);
  background: var(--success-soft);
}

.dialog-search {
  margin-bottom: 0.75rem;
}

.dialog-shell,
.dialog-body,
.message-list {
  overscroll-behavior: contain;
}

.conversation-shell {
  background: var(--paper);
}

.conversation-header {
  min-height: calc(4.65rem + var(--safe-top));
  background: rgba(255, 253, 248, 0.96);
}

.conversation-header h2 {
  font-family: inherit;
  font-size: 1rem;
  font-weight: 790;
}

.conversation-heading p {
  font-size: 0.7rem;
}

.admin-view-notice {
  padding: 0.65rem 0.9rem;
  border-bottom: 1px solid rgba(149, 99, 31, 0.14);
  font-size: 0.72rem;
}

.message-list {
  padding: 0.75rem 0.72rem 1rem;
  gap: 0.38rem;
  background:
    radial-gradient(circle at 20% 0%, rgba(199, 167, 86, 0.08), transparent 16rem),
    var(--paper);
}

.message-date {
  margin: 0.4rem 0;
  background: rgba(239, 235, 226, 0.94);
  font-size: 0.68rem;
}

.message {
  max-width: min(84%, 32rem);
  padding: 0.62rem 0.72rem 0.42rem;
  border: 1px solid rgba(23, 35, 31, 0.08);
  border-radius: 1.05rem 1.05rem 1.05rem 0.38rem;
  background: var(--surface);
  box-shadow: none;
}

.message.mine {
  border-color: rgba(46, 107, 80, 0.12);
  border-radius: 1.05rem 1.05rem 0.38rem 1.05rem;
  background: var(--success-soft);
}

.message-body {
  font-size: 0.86rem;
  line-height: 1.43;
}

.message-author {
  font-size: 0.68rem;
}

.message-time {
  min-height: 0.9rem;
  font-size: 0.63rem;
}

.message-time.pending {
  color: var(--warning);
}

.message-composer {
  padding: 0.58rem 0.65rem calc(0.58rem + var(--safe-bottom));
  gap: 0.45rem;
  background: rgba(255, 253, 248, 0.97);
}

.composer textarea,
.message-composer textarea {
  min-height: 2.9rem;
  padding: 0.76rem 0.9rem;
  border-radius: 1.15rem;
  font-size: 1rem;
}

.send-button {
  width: 2.9rem;
  height: 2.9rem;
}

.profile-screen {
  gap: 0.65rem;
}

.profile-card,
.settings-card {
  border-radius: 1rem;
}

.task-draft-notice {
  padding: 0.82rem 0.9rem;
  border: 1px solid rgba(199, 167, 86, 0.32);
  border-radius: 0.95rem;
  background: linear-gradient(135deg, var(--gold-soft), #fff8e7);
}

.task-draft-notice strong,
.task-draft-notice span {
  display: block;
}

.task-draft-notice strong {
  font-size: 0.78rem;
}

.task-draft-notice p {
  margin: 0.35rem 0;
  color: var(--ink);
  font-size: 0.8rem;
  font-weight: 560;
  line-height: 1.4;
}

.task-draft-notice span,
.assistant-privacy {
  color: var(--ink-soft);
  font-size: 0.7rem;
  line-height: 1.4;
}

.task-draft-notice ul {
  display: grid;
  margin: 0.65rem 0 0;
  padding: 0.6rem 0.75rem 0.6rem 1.65rem;
  gap: 0.28rem;
  border-radius: 0.75rem;
  color: var(--danger);
  background: rgba(161, 60, 53, 0.08);
  font-size: 0.72rem;
  font-weight: 650;
  line-height: 1.35;
}

.assistant-lead {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.84rem;
  line-height: 1.5;
}

.voice-capture {
  display: grid;
  gap: 0.55rem;
}

.voice-capture-button {
  display: flex;
  width: 100%;
  min-height: 5.1rem;
  padding: 0.8rem;
  gap: 0.85rem;
  align-items: center;
  border: 1px solid rgba(31, 64, 54, 0.18);
  border-radius: 1.1rem;
  color: var(--ink);
  background: var(--success-soft);
  text-align: left;
}

.voice-capture-button.is-recording {
  border-color: rgba(161, 60, 53, 0.38);
  background: var(--danger-soft);
}

.voice-capture-icon {
  display: grid;
  flex: 0 0 auto;
  width: 3.15rem;
  height: 3.15rem;
  border-radius: 50%;
  color: #fff;
  background: var(--forest);
  place-items: center;
}

.is-recording .voice-capture-icon {
  background: var(--danger);
  animation: voice-pulse 1.2s ease-in-out infinite;
}

.voice-capture-icon svg {
  width: 1.45rem;
  height: 1.45rem;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.voice-capture-button > span:last-child {
  display: grid;
  gap: 0.22rem;
}

.voice-capture-button strong {
  font-size: 0.88rem;
}

.voice-capture-button small {
  color: var(--ink-soft);
  font-size: 0.7rem;
}

.assistant-divider {
  display: flex;
  gap: 0.7rem;
  align-items: center;
  color: var(--ink-soft);
  font-size: 0.68rem;
  text-transform: uppercase;
}

.assistant-divider::before,
.assistant-divider::after {
  height: 1px;
  flex: 1;
  background: var(--line);
  content: "";
}

.assistant-privacy {
  margin: -0.25rem 0 0;
}

@keyframes voice-pulse {
  50% { box-shadow: 0 0 0 0.5rem rgba(161, 60, 53, 0.12); }
}

.desktop-brand {
  display: none;
}

.bottom-nav {
  min-height: calc(4.35rem + var(--safe-bottom));
  padding-top: 0.35rem;
  background: rgba(255, 253, 248, 0.96);
}

.bottom-nav:has(.assistant-nav-item:not([hidden])) {
  grid-template-columns: repeat(4, 1fr);
}

.nav-item {
  min-height: 3.4rem;
  font-size: 0.68rem;
}

.nav-item svg {
  width: 1.35rem;
  height: 1.35rem;
}

.nav-item.active::before {
  top: -0.35rem;
  width: 2rem;
}

@media (max-width: 25rem) {
  .task-tools:has(.compact-select:not([hidden])) {
    grid-template-columns: minmax(0, 1fr);
  }

  .control-metric {
    min-height: 4.35rem;
    padding-right: 0.42rem;
    padding-left: 0.42rem;
    font-size: 0.6rem;
  }

  .task-card-bottom {
    align-items: flex-end;
  }

  .assignee-chip {
    max-width: 48%;
  }
}

@media (min-width: 24rem) {
  .filter-row {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .filter-chip:last-child {
    grid-column: auto;
  }
}

@media (min-width: 42rem) {
  .screen {
    padding: 1.1rem 1.35rem 2rem;
  }

  .control-summary {
    max-width: 36rem;
  }

  .screen-tools {
    max-width: 42rem;
  }

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

  .conversation-list {
    max-width: 42rem;
    grid-template-columns: 1fr;
  }

  .fab {
    width: auto;
    min-width: 3.5rem;
    padding: 0 1.05rem;
    gap: 0.42rem;
    border-radius: 999px;
    font-size: 1.25rem;
  }

  .fab-label {
    display: inline;
    font-size: 0.78rem;
    font-weight: 780;
  }
}

@media (min-width: 64rem) {
  body {
    background: var(--surface-muted);
  }

  .app-shell {
    display: grid;
    width: min(100%, 96rem);
    min-height: 100dvh;
    padding-bottom: 0;
    grid-template-columns: 15rem minmax(0, 1fr);
    grid-template-rows: auto auto 1fr;
    border-right: 1px solid var(--line);
    border-left: 1px solid var(--line);
    background: var(--paper);
  }

  .app-header {
    grid-column: 2;
    grid-row: 1;
    padding: 1rem 2rem;
  }

  .offline-bar {
    grid-column: 2;
    grid-row: 2;
  }

  .screen {
    width: 100%;
    min-width: 0;
    padding: 1.45rem 2rem 3rem;
    grid-column: 2;
    grid-row: 3;
  }

  .bottom-nav {
    position: sticky;
    top: 0;
    right: auto;
    bottom: auto;
    left: auto;
    display: flex;
    width: 15rem;
    height: 100dvh;
    min-height: 100dvh;
    padding: 1.35rem 0.85rem;
    gap: 0.35rem;
    flex-direction: column;
    align-self: start;
    grid-column: 1;
    grid-row: 1 / 4;
    border-top: 0;
    border-right: 1px solid rgba(255, 255, 255, 0.11);
    background: var(--forest);
    backdrop-filter: none;
  }

  .desktop-brand {
    display: flex;
    min-height: 4.2rem;
    margin: 0 0 1rem;
    padding: 0 0.55rem;
    gap: 0.7rem;
    align-items: center;
    color: #fff;
  }

  .desktop-brand > span {
    display: grid;
    width: 2.55rem;
    height: 2.55rem;
    border-radius: 0.8rem;
    color: var(--forest);
    background: var(--gold);
    font-size: 0.75rem;
    font-weight: 900;
    letter-spacing: 0.08em;
    place-items: center;
  }

  .desktop-brand div {
    display: grid;
    gap: 0.12rem;
  }

  .desktop-brand strong {
    font-size: 0.82rem;
    letter-spacing: 0.01em;
  }

  .desktop-brand small {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.64rem;
  }

  .nav-item {
    display: flex;
    width: 100%;
    min-height: 3.25rem;
    padding: 0.7rem 0.85rem;
    gap: 0.75rem;
    align-items: center;
    justify-content: flex-start;
    border-radius: 0.85rem;
    color: rgba(255, 255, 255, 0.68);
    font-size: 0.78rem;
    text-align: left;
  }

  .nav-item:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.07);
  }

  .nav-item.active {
    color: #fff;
    background: rgba(255, 255, 255, 0.12);
  }

  .assistant-nav-item {
    margin-top: 0.7rem;
    border: 1px solid rgba(199, 167, 86, 0.34);
    color: #f2df9e;
    background: rgba(199, 167, 86, 0.08);
  }

  .assistant-nav-item:hover,
  .assistant-nav-item[aria-expanded="true"] {
    border-color: rgba(199, 167, 86, 0.72);
    color: #fff;
    background: rgba(199, 167, 86, 0.16);
  }

  .nav-item.active::before {
    top: 50%;
    left: 0;
    width: 0.2rem;
    height: 1.65rem;
    transform: translateY(-50%);
  }

  .nav-badge {
    top: 0.42rem;
    right: 0.5rem;
    left: auto;
    border-color: var(--forest);
  }

  .scope-tabs {
    max-width: 34rem;
  }

  .control-summary,
  .screen-tools,
  .conversation-list {
    max-width: none;
  }

  .screen-tools,
  .task-tools:has(.compact-select:not([hidden])) {
    display: flex;
    grid-template-columns: none;
    align-items: center;
  }

  .screen-tools .search-field {
    flex: 1 1 24rem;
  }

  .screen-tools .compact-select {
    flex: 0 0 14rem;
  }

  .filter-row {
    display: flex;
    width: 100%;
    gap: 0.35rem;
    flex-wrap: wrap;
  }

  .filter-chip {
    width: auto;
    padding: 0.45rem 0.78rem;
    font-size: 0.74rem;
    white-space: nowrap;
  }

  .screen-tools .fab {
    position: static;
    width: auto;
    height: 2.9rem;
    min-width: max-content;
    padding: 0 1rem;
    gap: 0.42rem;
    border-radius: 999px;
    font-size: 1.2rem;
    box-shadow: none;
  }

  .screen-tools .fab-label {
    display: inline;
    font-size: 0.78rem;
    font-weight: 780;
  }

  .conversation-list {
    gap: 0.75rem;
    overflow: visible;
    border: 0;
    border-radius: 0;
    background: transparent;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .conversation-item,
  .conversation-item:last-child {
    border: 1px solid var(--line);
    border-radius: 1rem;
    background: var(--surface);
  }

  .profile-screen {
    width: min(100%, 52rem);
    max-width: 52rem;
  }

  .toast-region {
    left: calc(15rem + 1rem);
    bottom: 1rem;
  }
}

@media (min-width: 72rem) {
  .card-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
