/* Mobile work surface. Desktop layouts and every guarded action retain their contracts. */
.mobile-identity,
.mobile-context-line,
.mobile-mode-note,
.mobile-shell-menu,
.mobile-chat-bar,
.mobile-filter-trigger,
.mobile-specialist-name {
  display: none;
}
.advanced-filter-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.voice-options summary {
  cursor: pointer;
  font-size: 11px;
  color: var(--muted);
  padding: 8px 0;
}
.voice-options .check-field {
  margin-top: 8px;
}
@media (max-width: 720px) {
  :root {
    --mobile-nav-height: 64px;
    --bg: #fff;
    --paper: #fff;
    --ink: #23312e;
    --muted: #708078;
    --line: #e0e6df;
  }
  html,
  body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: #fff;
  }
  #app {
    height: 100%;
  }
  .layout[data-mobile-page] {
    height: 100dvh;
    min-height: 0;
    display: block;
    background: #fff;
    overflow: hidden;
  }
  .layout[data-mobile-page] .main-wrap {
    height: 100%;
    min-height: 0;
    display: flex;
    flex-direction: column;
    padding-bottom: calc(
      var(--mobile-nav-height) + env(safe-area-inset-bottom)
    );
  }
  .layout[data-mobile-page] .topbar {
    position: relative;
    flex: none;
    height: auto;
    min-height: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 3px 8px;
    padding: 7px 14px 6px;
    border: 0;
    background: #fff;
    backdrop-filter: none;
    z-index: 20;
  }
  .topbar .breadcrumb,
  .topbar .top-actions > .avatar,
  .topbar .top-actions > button:not(.mobile-shell-menu) {
    display: none;
  }
  .topbar .top-actions {
    gap: 4px;
    margin-left: auto;
    flex-shrink: 0;
  }
  .topbar .top-actions > .pill {
    font-size: 13px;
    max-width: 76px;
    padding: 4px 6px;
    line-height: 1.15;
  }
  .topbar .locale-select {
    min-height: 44px;
    width: 52px;
    padding: 7px 4px;
    border-color: transparent;
    background: transparent;
    font-size: 13px;
  }
  .mobile-shell-menu {
    display: inline-flex;
    min-width: 44px;
    min-height: 44px;
    border-color: transparent;
  }
  .mobile-identity {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 6px;
    flex: 1;
  }
  .mobile-brand-icon {
    width: 26px;
    height: 26px;
    border-radius: 7px;
    display: grid;
    place-items: center;
    background: #cceba2;
    color: #12362a;
    font-size: 25px;
    font-weight: 800;
    letter-spacing: -2px;
    padding-right: 2px;
    flex: none;
  }
  .mobile-identity strong {
    font-size: 20px;
    letter-spacing: -0.8px;
  }
  .mobile-role {
    display: none;
  }
  .mobile-context-line {
    display: block;
    width: 100%;
    color: #718177;
    font:
      13px/1.5 ui-monospace,
      monospace;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .mobile-mode-note {
    display: block;
    width: 100%;
    color: #6c7a70;
    font-size: 13px;
    line-height: 1.4;
    padding-bottom: 2px;
  }
  .workspace-context,
  .fixture-banner {
    display: none !important;
  }
  .page {
    flex: 1;
    min-height: 0;
    width: 100%;
    padding: 10px 14px 20px;
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
    scrollbar-width: thin;
  }
  #main:focus {
    outline: none;
  }
  .page > .banner {
    flex: none;
    margin-bottom: 8px;
    font-size: 13px;
    padding: 8px 10px;
  }
  .bottom-nav {
    height: calc(var(--mobile-nav-height) + env(safe-area-inset-bottom));
    min-height: 64px;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    align-items: center;
    padding: 5px 8px calc(5px + env(safe-area-inset-bottom));
    background: #fffffffa;
    border-top: 1px solid #e6eae3;
    box-shadow: none;
  }
  .bottom-nav a {
    width: 100%;
    min-height: 50px;
    font-size: 13px;
    gap: 4px;
  }
  .bottom-nav a.active {
    background: #edf6e5;
    font-weight: 600;
  }
  .bottom-nav svg {
    width: 19px;
    height: 19px;
  }
  .button,
  .icon-button,
  .row-link {
    min-height: 44px;
  }
  .button {
    font-size: 14px;
  }
  .icon-button {
    min-width: 44px;
  }
  .page-header {
    margin-bottom: 12px;
    gap: 10px;
  }
  .page-header h1 {
    font-size: 21px;
    letter-spacing: -0.6px;
  }
  .page-header .eyebrow {
    display: none;
  }
  .page-header .subtitle {
    font-size: 13px;
    line-height: 1.45;
  }
  .page-header > .buttons {
    max-width: none;
  }
  .page-header > .buttons > .button {
    min-height: 44px;
  }
  .panel {
    box-shadow: none;
    border-radius: 12px;
  }
  .panel-head {
    padding: 12px 10px;
    gap: 8px;
  }
  .panel-head h2 {
    font-size: 13px;
    font-weight: 650;
  }
  .panel-body {
    padding: 0 10px 12px;
  }
  .empty {
    min-height: 0;
    padding: 22px 12px;
  }
  .empty > svg {
    width: 22px;
    height: 22px;
    margin-bottom: 8px;
  }
  .empty h3 {
    font-size: 14px;
  }
  .empty p {
    font-size: 13px;
    max-width: 280px;
  }
  /* Owner overview: filters and six metrics form one compact first viewport. */
  .owner-overview > .page-header {
    display: none;
  }
  .owner-overview > .filters {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 44px;
    gap: 4px;
    margin: 0 0 10px;
  }
  .filters > .period-tabs {
    grid-column: 1/-1;
    display: flex;
    width: 100%;
    max-width: 100%;
    background: transparent;
    padding: 0;
    border: 0;
    gap: 2px;
    overflow-x: auto;
  }
  .period-tabs button {
    flex: 1 0 auto;
    min-width: 44px;
    min-height: 44px;
    padding: 9px 7px;
    font-size: 13px;
    border: 1px solid #edf0e8;
    border-radius: 9px;
    white-space: nowrap;
  }
  .period-tabs button.active {
    background: #e8f1de;
    border-color: #ceddc1;
  }
  .owner-overview .source-chips {
    grid-column: 1;
    display: flex;
    gap: 3px;
    padding: 0;
    overflow: visible;
  }
  .source-chips .source-chip {
    min-height: 44px;
    flex: 1;
    min-width: 0;
    padding: 8px 5px;
    border-radius: 9px;
    font-size: 13px;
    font-weight: 400;
  }
  .source-chips .source-chip:first-child {
    font-size: 13px;
  }
  .source-chips .source-chip.selected {
    background: #e8f1de;
    border-color: #ceddc1;
  }
  .advanced-filter-controls,
  .filters > .freshness {
    display: none;
  }
  .mobile-filter-trigger {
    display: flex;
    grid-column: 2;
    grid-row: 2;
    width: 44px;
    min-width: 44px;
    min-height: 44px;
    padding: 9px;
    font-size: 0;
    border-radius: 9px;
    background: #fff;
  }
  .mobile-filter-trigger svg {
    width: 18px;
    height: 18px;
  }
  .filters > .field {
    grid-column: 1/-1;
  }
  .owner-overview .reference-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
    margin-bottom: 14px;
  }
  .reference-metrics .metric {
    min-height: 90px;
    padding: 10px 12px 9px;
    border: 1px solid #dfe5dc;
    border-radius: 13px;
    box-shadow: none;
    background: #fff;
  }
  .reference-metrics .metric-label {
    font-size: 13px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    line-height: 1.3;
  }
  .reference-metrics .metric-label svg {
    display: none;
  }
  .reference-metrics .metric-value {
    font:
      27px/1.1 Georgia,
      "Times New Roman",
      serif;
    margin: 5px 0 4px;
    letter-spacing: -0.8px;
  }
  .reference-metrics .metric-foot {
    font-size: 13px;
    line-height: 1.3;
  }
  .metric-action {
    position: relative;
  }
  .metric-action .metric-link::before {
    content: "";
    position: absolute;
    inset: 0;
  }
  .metric-link::after {
    font-size: 13px;
  }
  .source-performance {
    border: 0;
    border-radius: 0;
    margin-top: 3px;
  }
  .source-performance .panel-head {
    padding: 4px 0 7px;
  }
  .source-performance .panel-head h2 {
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.6px;
  }
  .source-performance .panel-head > span {
    font-size: 13px;
    max-width: 136px;
    text-align: right;
  }
  .source-performance .table-wrap,
  .profile-accounts > .table-wrap {
    width: 100%;
    overflow-x: hidden;
  }
  .source-performance table,
  .profile-accounts table {
    table-layout: fixed;
    min-width: 0 !important;
    width: 100%;
    border-collapse: collapse;
  }
  .source-performance th,
  .source-performance td,
  .profile-accounts th,
  .profile-accounts td {
    font-size: 13px;
    padding: 8px 3px;
    vertical-align: middle;
    overflow-wrap: anywhere;
    word-break: normal;
    white-space: normal;
    text-align: right;
  }
  .source-performance th,
  .profile-accounts th {
    font-size: 13px;
    line-height: 1.25;
    letter-spacing: 0.25px;
    font-weight: 500;
  }
  .source-performance th:first-child,
  .source-performance td:first-child {
    width: 20%;
    text-align: left;
  }
  .profile-accounts th:first-child,
  .profile-accounts td:first-child {
    width: 23%;
    text-align: left;
  }
  .source-performance td .row-link,
  .profile-accounts td .row-link {
    font-size: 13px;
    font-weight: 500;
    display: flex;
    align-items: center;
    min-height: 44px;
    text-decoration: none;
  }
  .source-performance tr,
  .profile-accounts tr {
    border-bottom: 1px solid #edf0e9;
  }
  .profile-accounts .platform {
    font-size: 13px;
    gap: 2px;
  }
  .profile-accounts .platform-icon {
    display: none;
  }
  .metric-method {
    font-size: 13px;
    margin: 9px 0 16px;
  }
  .owner-overview .dashboard-grid {
    margin-top: 16px;
  }
  .owner-overview > .panel {
    margin-top: 16px;
  }
  /* Compact agents like the reference list, not a wall of administrative cards. */
  .agent-directory > .page-header .subtitle {
    display: none;
  }
  .agent-directory .list-grid {
    gap: 0;
  }
  .agent-directory-card {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 0 8px;
    border: 0;
    border-bottom: 1px solid var(--line);
    border-radius: 0;
    padding: 12px 0;
    box-shadow: none;
  }
  .agent-directory-card .card-header {
    margin: 0;
    gap: 9px;
    grid-column: 1;
  }
  .agent-directory-card .agent-avatar {
    width: 28px;
    height: 28px;
    background: #f0f6e9;
  }
  .agent-directory-card .agent-avatar svg {
    width: 18px;
    height: 18px;
  }
  .agent-directory-card .agent-name-link {
    font-size: 14px;
    line-height: 1.4;
  }
  .agent-directory-card .card-header p {
    display: none;
  }
  .agent-directory-card > .status-row {
    grid-column: 1;
    gap: 6px;
    margin: 4px 0 0 37px;
  }
  .agent-directory-card .pill {
    font-size: 13px;
    padding: 3px 5px;
  }
  .agent-directory-card > p,
  .agent-directory-card > dl {
    display: none;
  }
  .agent-directory-card .card-footer {
    grid-column: 2;
    grid-row: 1/3;
    display: flex;
    flex-direction: column;
    border: 0;
    gap: 0;
    padding: 0;
    margin: 0;
  }
  .agent-directory-card .card-footer > a:nth-child(2) {
    display: none;
  }
  .agent-directory-card .card-footer .button {
    min-height: 44px;
    padding: 4px 8px;
    font-size: 13px;
    border: 0;
    background: transparent;
  }
  .agent-directory > .section-title {
    margin-top: 24px;
  }
  .agent-directory > .section-title ~ .list-grid .card {
    padding: 14px;
    margin-bottom: 10px;
  }
  /* Profile first shows its work area. Details/configuration follow that content. */
  .agent-profile {
    display: flex;
    flex-direction: column;
  }
  .agent-profile > .back-link {
    order: 0;
    min-height: 44px;
    display: flex;
    align-items: center;
    font-size: 13px;
    margin: 0;
  }
  .agent-profile > .profile-header {
    order: 1;
    margin-bottom: 6px;
    gap: 8px;
    position: relative;
  }
  .profile-header .agent-avatar {
    width: 25px;
    height: 25px;
    background: transparent;
  }
  .profile-header > div:last-child {
    min-width: 0;
    flex: 1;
  }
  .profile-header h1 {
    font-size: 20px;
    padding-right: 48px;
  }
  .profile-header .subtitle {
    margin: 5px 0 7px;
    font-size: 13px;
    line-height: 1.4;
  }
  .profile-header .status-row {
    gap: 5px;
  }
  .profile-header .status-row .small {
    font-size: 13px;
  }
  .profile-header .pill {
    font-size: 13px;
    padding: 3px 6px;
  }
  .profile-chat-action {
    position: absolute;
    top: 0;
    right: 0;
    width: 44px;
    min-height: 44px;
    font-size: 0;
    padding: 10px;
  }
  .agent-profile > .profile-tabs {
    order: 2;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 2px;
    margin: 5px 0 10px;
  }
  .profile-tab {
    min-height: 44px;
    font-size: 13px;
    line-height: 1.35;
    padding: 8px 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
  }
  .agent-profile > .panel {
    order: 3;
    border: 0;
    border-radius: 0;
  }
  .agent-profile > .panel > .panel-head {
    display: none;
  }
  .agent-profile > .contract-readiness {
    order: 4;
    margin-top: 20px;
    font-size: 13px;
  }
  .profile-content {
    min-height: 0;
  }
  .profile-content .scope-note {
    font-size: 13px;
    line-height: 1.35;
    padding: 4px 0 7px;
  }
  .profile-content .empty {
    padding: 18px 0;
    align-items: flex-start;
    text-align: left;
  }
  .profile-content .empty svg {
    display: none;
  }
  /* Full-height chat: only messages scroll. Composer is always above app navigation. */
  .page-chat {
    display: flex;
    flex-direction: column;
    padding: 4px 10px 0;
    overflow: hidden;
  }
  .page-chat > .specialist-chat {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
  }
  .specialist-chat > .page-header,
  .specialist-chat .conversation-drawer {
    display: none !important;
  }
  .mobile-chat-bar {
    display: flex;
    flex: none;
    min-height: 44px;
    align-items: center;
    gap: 4px;
    padding: 0 1px;
  }
  .mobile-chat-bar > .button {
    border: 0;
    background: transparent;
    padding: 10px;
    min-height: 44px;
  }
  .mobile-chat-current {
    min-width: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
  }
  .mobile-chat-current strong {
    font-size: 13px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .mobile-chat-current span {
    font-size: 13px;
    color: var(--muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .specialist-chips {
    flex: none;
    display: flex;
    margin: 0 0 5px;
    padding: 0;
    min-height: 44px;
    gap: 3px;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .specialist-chip {
    min-height: 44px;
    padding: 8px 10px;
    gap: 5px;
    border-radius: 9px;
    border-color: transparent;
    font-size: 13px;
    font-weight: 400;
  }
  .specialist-chip.selected {
    background: #e8f2dd;
    border-color: #d3e2c7;
  }
  .specialist-chip svg {
    width: 14px;
    height: 14px;
  }
  .desktop-specialist-name {
    display: none;
  }
  .mobile-specialist-name {
    display: inline;
  }
  .specialist-chat > .chat-layout {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    height: auto;
    max-height: none;
    gap: 0;
  }
  .specialist-chat .chat-pane {
    display: flex;
    flex-direction: column;
    flex: 1;
    height: auto;
    min-height: 0;
    border: 0;
    border-radius: 0;
    overflow: hidden;
  }
  .chat-pane > .panel-head {
    display: none;
  }
  .chat-pane > .run-status {
    flex: none;
    padding: 5px 8px;
    margin: 0 0 5px;
    border: 1px solid var(--line);
    border-radius: 8px;
    font-size: 13px;
  }
  .run-status > .status-row {
    font-size: 13px;
    gap: 5px;
  }
  .run-status .pill {
    font-size: 13px;
    padding: 2px 5px;
  }
  .run-status details {
    margin-top: 3px;
    max-height: 140px;
    overflow: auto;
  }
  .run-status summary {
    min-height: 24px;
    display: flex;
    align-items: center;
  }
  .chat-pane > .messages {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 8px 3px 12px;
    gap: 14px;
    scrollbar-width: thin;
  }
  .message {
    flex: none;
    max-width: 100%;
    font-size: 16px;
    line-height: 1.55;
  }
  .message.assistant {
    border: 1px solid #edf0e7;
    background: #fff;
    border-radius: 11px;
    padding: 10px;
    width: 100%;
  }
  .message.user {
    max-width: 90%;
    padding: 9px 11px;
  }
  .message-role {
    font-size: 13px;
    margin-bottom: 6px;
    font-weight: 500;
  }
  .message-links {
    gap: 5px;
  }
  .message-links .button,
  .message-links a {
    min-height: 36px;
    padding: 6px 8px;
    font-size: 13px;
  }
  .report-content .table-wrap {
    margin: 8px 0;
    overflow: auto;
  }
  .report-content table {
    min-width: 0 !important;
    width: 100%;
  }
  .report-content th,
  .report-content td {
    padding: 5px 4px;
    font-size: 13px;
    white-space: normal;
    overflow-wrap: anywhere;
  }
  .report-content p + p,
  .report-content ul,
  .report-content h3 {
    margin-top: 7px;
  }
  .report-content li + li {
    margin-top: 5px;
  }
  .chat-pane > .composer {
    flex: none;
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr) 44px 44px;
    align-items: end;
    gap: 0 2px;
    padding: 7px 0 3px;
    border-top: 1px solid #e0e6dd;
    background: #fff;
  }
  .composer textarea {
    grid-column: 2;
    grid-row: 1;
    min-height: 44px;
    height: 44px;
    max-height: 112px;
    padding: 11px 7px;
    resize: none;
    font-size: 14px;
    line-height: 1.45;
    overflow-y: auto;
    border: 0;
    border-radius: 8px;
    background: #f7faf3;
  }
  .composer textarea:focus-visible {
    outline-offset: -3px;
  }
  .composer > .composer-bottom,
  .composer > .composer-bottom > .buttons {
    display: contents;
  }
  .composer-bottom > .buttons > .button:first-child {
    grid-column: 1;
    grid-row: 1;
    min-width: 40px;
    width: 40px;
    height: 44px;
    border: 0;
    padding: 10px;
  }
  .composer-bottom > .buttons > .button:nth-child(2) {
    grid-column: 3;
    grid-row: 1;
    min-width: 44px;
    height: 44px;
    border-radius: 15px;
    background: #e8f3dd;
    border-color: transparent;
    padding: 10px;
    color: #235b40;
  }
  .composer-bottom > .button {
    grid-column: 4;
    grid-row: 1;
    min-width: 44px;
    width: 44px;
    height: 44px;
    font-size: 0;
    padding: 10px;
    border-radius: 50%;
    background: #19362d;
  }
  .composer-bottom > .button svg {
    width: 20px;
    height: 20px;
  }
  .composer > .upload-list {
    grid-column: 1/-1;
    grid-row: 1;
  }
  .composer > .upload-list:not(:empty) {
    grid-row: auto;
    padding: 4px 8px;
  }
  .composer > .upload-list:empty,
  .composer > .form-error:empty {
    display: none;
  }
  .composer > .voice-controls,
  .composer > .form-error {
    grid-column: 1/-1;
  }
  .voice-controls {
    padding: 0 4px;
    margin: 0;
  }
  .voice-controls[data-voice-state="idle"] > .voice-status {
    display: none;
  }
  .voice-status {
    font-size: 13px;
    line-height: 1.4;
    margin: 4px 0;
  }
  .voice-actions {
    gap: 6px;
  }
  .voice-actions > .button {
    min-height: 44px;
  }
  .voice-options {
    font-size: 13px;
  }
  .voice-options > summary {
    min-height: 32px;
    padding: 8px 1px;
    font-size: 13px;
    color: #7b887e;
  }
  .voice-options[open] {
    max-height: 190px;
    overflow-y: auto;
  }
  .voice-options .check-field {
    min-height: 44px;
    padding: 7px 0;
    font-size: 13px;
  }
  .voice-options .composer-hint {
    font-size: 13px;
    line-height: 1.45;
    margin: 6px 0;
  }
  .mobile-sheet {
    position: fixed;
    inset: auto 0 0;
    margin: 0;
    max-width: none;
    width: 100%;
    max-height: 80dvh;
    border-radius: 19px 19px 0 0;
    border: 1px solid var(--line);
    padding: 0;
  }
  .mobile-sheet .modal-head {
    padding: 13px 16px 8px;
  }
  .mobile-sheet .modal-head h2 {
    font-size: 16px;
  }
  .mobile-sheet .modal-body {
    padding: 8px 16px 16px;
    overflow: auto;
    max-height: calc(80dvh - 140px);
  }
  .mobile-sheet .modal-foot {
    padding: 10px 16px calc(12px + env(safe-area-inset-bottom));
  }
  .mobile-menu-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 7px;
  }
  .mobile-menu-item {
    min-height: 66px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-size: 13px;
    line-height: 1.2;
    color: var(--ink);
    text-decoration: none;
    border-radius: 10px;
    background: #f7faf3;
    padding: 8px 4px;
  }
  .mobile-menu-item svg {
    width: 21px;
    height: 21px;
    color: #55725e;
  }
  .mobile-menu-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: 10px;
  }
  .mobile-menu-notice {
    font-size: 13px;
    line-height: 1.4;
    margin-top: 13px;
  }
  .mobile-conversation-list .chat-item {
    display: flex;
    min-height: 56px;
    border-radius: 7px;
    margin-bottom: 4px;
  }
  .modal:not(.mobile-sheet) {
    max-height: calc(100dvh - 24px);
    width: calc(100% - 24px);
  }
  .modal .modal-body {
    min-height: 0;
  }
  .modal .modal-foot .button {
    min-height: 44px;
  }
}
@media (max-width: 720px) {
  .agent-profile {
    position: relative;
  }
  .agent-profile > .profile-chat-action {
    order: 1;
    position: absolute;
    top: 44px;
    right: 0;
    z-index: 2;
  }
}
@media (max-width: 720px) {
  :root[data-mobile-keyboard="true"] .mobile-context-line,
  :root[data-mobile-keyboard="true"] .mobile-mode-note {
    display: none;
  }
  :root[data-mobile-keyboard="true"] .layout[data-mobile-page] .bottom-nav {
    display: none;
  }
  :root[data-mobile-keyboard="true"] .layout[data-mobile-page] .main-wrap {
    padding-bottom: 0;
  }
  .layout[data-mobile-page] {
    position: fixed;
    top: var(--mobile-viewport-top, 0px);
    left: 0;
    right: 0;
    height: var(--mobile-viewport-height, 100dvh);
  }
  .layout[data-mobile-page] .bottom-nav {
    position: absolute;
    bottom: 0;
  }
  .chat-pane > .panel-head {
    display: flex;
    padding: 0;
    min-height: 0;
    border: 0;
    justify-content: flex-end;
  }
  .chat-pane > .panel-head > div {
    display: none;
  }
  .chat-pane > .panel-head:has(> button) {
    padding: 0 2px 5px;
  }
  .chat-pane > .panel-head > .button {
    min-height: 44px;
    font-size: 13px;
    padding: 7px 10px;
  }
  .login-main {
    height: 100dvh;
    min-height: 0;
    overflow-y: auto;
  }
}
@media (max-width: 720px) and (max-height: 560px) {
  .mobile-context-line,
  .mobile-mode-note {
    display: none;
  }
}
@media (max-width: 720px) {
  input,
  select,
  textarea,
  .composer textarea,
  .topbar .locale-select,
  .filters input,
  .filters select {
    font-size: 16px;
  }
  .topbar .locale-select {
    width: 56px;
  }
  .source-performance td,
  .profile-accounts td,
  .source-performance td .row-link,
  .profile-accounts td .row-link {
    font-size: 13px;
  }
  .source-performance th,
  .profile-accounts th {
    font-size: 13px;
  }
  .chat-pane > .composer {
    grid-template-columns: 44px minmax(0, 1fr) 44px 44px;
  }
  .composer-bottom > .buttons > .button:first-child {
    min-width: 44px;
    width: 44px;
  }
}
@media (max-width: 720px) {
  .mobile-filter-trigger {
    position: relative;
  }
  .mobile-filter-count {
    position: absolute;
    top: 2px;
    right: 2px;
    min-width: 15px;
    height: 15px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: #286342;
    color: #fff;
    font-size: 13px;
    line-height: 1;
  }
}
.mobile-dashboard-agents {
  display: none;
}
.overview-deeper {
  margin-top: 20px;
}
.overview-deeper > summary {
  font-size: 13px;
  color: var(--muted);
  padding: 12px 0;
  cursor: pointer;
}
@media (max-width: 720px) {
  .owner-overview > p.subtitle {
    font-size: 13px;
    margin: 7px 0 0;
  }
  .owner-overview .metric-method {
    font-size: 13px;
    margin: 5px 0 10px;
  }
  .mobile-dashboard-agents {
    display: block;
    margin-top: 14px;
  }
  .mobile-agents-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
  }
  .mobile-agents-heading h2 {
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.7px;
    font-weight: 500;
    color: var(--muted);
  }
  .mobile-all-agents {
    font-size: 13px;
    min-height: 44px;
    display: flex;
    align-items: center;
    color: var(--muted);
    text-decoration: none;
  }
  .mobile-agent-row {
    padding: 8px 0 4px;
    border-bottom: 1px solid #eef1e8;
  }
  .mobile-agent-identity {
    display: flex;
    align-items: center;
    gap: 8px;
  }
  .mobile-agent-identity > svg {
    width: 18px;
    height: 18px;
    color: #55765e;
  }
  .mobile-agent-name {
    font-size: 13px;
    color: var(--ink);
    text-decoration: none;
    flex: 1;
    min-width: 0;
  }
  .mobile-agent-identity .pill {
    font-size: 13px;
    padding: 2px 4px;
    background: transparent;
  }
  .mobile-agent-row > p {
    margin: 3px 0 0 26px;
    font-size: 13px;
    line-height: 1.4;
  }
  .mobile-agent-actions {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-left: 26px;
  }
  .mobile-agent-open {
    display: flex;
    min-height: 44px;
    align-items: center;
    font-size: 13px;
    color: var(--muted);
    text-decoration: none;
  }
  .mobile-agent-actions .button {
    border: 0;
    padding: 6px 9px;
    font-size: 13px;
    min-height: 44px;
    color: var(--muted);
  }
  .mobile-agent-actions svg {
    width: 15px;
    height: 15px;
  }
  .overview-deeper {
    margin-top: 18px;
  }
  .overview-deeper > summary {
    min-height: 44px;
    font-size: 13px;
  }
}
/* Image-driven corrections: financial tokens never split; actions stay inside each row. */
.decision-primary-effect {
  font-size: 20px;
  font-weight: 650;
  line-height: 1.4;
  margin: 15px 0;
}
.decision-exact > summary {
  cursor: pointer;
  min-height: 44px;
  display: flex;
  align-items: center;
  font-size: 12px;
  color: var(--muted);
}
@media (max-width: 720px) {
  .source-performance table,
  .profile-accounts table,
  .report-content table {
    table-layout: auto;
  }
  .source-performance th,
  .source-performance td,
  .profile-accounts th,
  .profile-accounts td {
    width: auto !important;
    min-width: 0 !important;
    padding-left: 3px;
    padding-right: 3px;
    word-break: normal;
    overflow-wrap: normal;
  }
  .source-performance th,
  .profile-accounts th {
    white-space: nowrap;
  }
  .source-performance td:not(:first-child),
  .profile-accounts td:not(:first-child),
  .numeric-token {
    white-space: nowrap;
    word-break: normal;
    overflow-wrap: normal;
  }
  .source-performance td:first-child,
  .profile-accounts td:first-child {
    white-space: normal;
  }
  .report-content td:first-child {
    min-width: 0;
  }
  .report-content th {
    white-space: nowrap;
    font-size: 13px;
  }
  .report-content td {
    word-break: normal;
    overflow-wrap: normal;
  }
  .report-content td:first-child {
    overflow-wrap: anywhere;
  }
  .profile-header .subtitle {
    padding-right: 48px;
    min-height: 38px;
  }
  .source-performance .table-wrap,
  .profile-accounts .table-wrap,
  .profile-decisions .table-wrap,
  .profile-tasks .table-wrap,
  .profile-journal .table-wrap,
  .profile-holds .table-wrap,
  .campaign-performance-table,
  .page-tasks .table-wrap {
    overflow: visible;
  }
  .source-performance table,
  .profile-accounts table,
  .profile-decisions table,
  .profile-tasks table,
  .profile-journal table,
  .profile-holds table,
  .campaign-performance-table table,
  .page-tasks .table-wrap table {
    display: block;
    width: 100%;
    min-width: 0 !important;
  }
  .source-performance thead,
  .profile-accounts thead,
  .profile-decisions thead,
  .profile-tasks thead,
  .profile-journal thead,
  .profile-holds thead,
  .campaign-performance-table thead,
  .page-tasks .table-wrap thead {
    display: none;
  }
  .source-performance tbody,
  .profile-accounts tbody,
  .profile-decisions tbody,
  .profile-tasks tbody,
  .profile-journal tbody,
  .profile-holds tbody,
  .campaign-performance-table tbody,
  .page-tasks .table-wrap tbody {
    display: grid;
    gap: 10px;
  }
  .source-performance tr,
  .profile-accounts tr,
  .profile-decisions tr,
  .profile-tasks tr,
  .profile-journal tr,
  .profile-holds tr,
  .campaign-performance-table tr,
  .page-tasks .table-wrap tr {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    border: 1px solid var(--line);
    border-radius: 11px;
    padding: 10px;
    gap: 5px 10px;
  }
  .source-performance td,
  .profile-accounts td,
  .profile-decisions td,
  .profile-tasks td,
  .profile-journal td,
  .profile-holds td,
  .campaign-performance-table td,
  .page-tasks .table-wrap td {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    min-width: 0 !important;
    padding: 0;
    border: 0;
    font-size: 13px;
    white-space: normal;
    overflow-wrap: anywhere;
  }
  .source-performance td::before,
  .profile-accounts td::before,
  .profile-decisions td::before,
  .profile-tasks td::before,
  .profile-journal td::before,
  .profile-holds td::before,
  .campaign-performance-table td::before,
  .page-tasks .table-wrap td::before {
    content: attr(data-label);
    display: block;
    color: var(--muted);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-bottom: 3px;
  }
  .source-performance td:first-child,
  .profile-accounts td:first-child,
  .profile-decisions td:first-child,
  .profile-tasks td:first-child,
  .profile-journal td:first-child,
  .profile-holds td:first-child,
  .campaign-performance-table td:first-child,
  .page-tasks .table-wrap td:first-child {
    grid-column: 1/-1;
  }
  .profile-decisions td:last-child,
  .profile-tasks td:last-child,
  .campaign-performance-table td:last-child,
  .page-tasks .table-wrap td:last-child {
    align-items: flex-end;
    justify-content: flex-end;
  }
  .profile-decisions td:last-child::before,
  .profile-tasks td:last-child::before,
  .campaign-performance-table td:last-child::before {
    display: none;
  }
  .profile-journal td:last-child,
  .profile-holds td:nth-child(2) {
    grid-column: 1/-1;
  }
  .profile-decisions td .button,
  .profile-tasks td .button,
  .campaign-performance-table td .button,
  .page-tasks .table-wrap td .button {
    min-height: 44px;
  }
  .campaign-performance-table td:first-child .row-link {
    min-height: 44px;
    font-size: 13px;
  }
  .decision-primary-effect {
    font-size: 18px;
  }
  .decision-target dd {
    font-size: 13px;
    line-height: 1.45;
    overflow-wrap: anywhere;
  }
}

/* Narrow phones keep the source beside its account, rather than clipping finance. */
.profile-account-source {
  display: none;
}
.workflow-current {
  padding: 12px 16px;
}
.workflow-current-stage h3 {
  margin: 0 0 8px;
}
.workflow-current-stage > .button {
  margin-top: 12px;
}
.workflow-current-stage + .workflow-current-stage {
  margin-top: 16px;
}
.workflow-history > summary,
.handoff-advanced > summary {
  min-height: 44px;
  display: flex;
  align-items: center;
  cursor: pointer;
  color: var(--muted);
  font-size: 12px;
}
.workflow-history > summary::before,
.handoff-advanced > summary::before {
  content: "▸";
  margin-right: 7px;
}
.workflow-history[open] > summary::before,
.handoff-advanced[open] > summary::before {
  content: "▾";
}
.workflow-run > .panel:has(.workflow-current) {
  margin-top: 12px;
}
.handoff-outputs h3 {
  font-size: 13px;
  margin: 0 0 8px;
}
@media (max-width: 380px) {
  .profile-accounts th:nth-child(2),
  .profile-accounts td:nth-child(2) {
    display: none;
  }
  .profile-account-source {
    display: block;
    font-size: 13px;
    color: var(--muted);
    padding-bottom: 6px;
  }
}
@media (max-width: 720px) {
  .page-tasks .task-list tr {
    gap: 3px 10px;
    padding: 8px 10px;
  }
  .page-tasks .task-list td::before {
    display: none;
  }
  .page-tasks .task-list td:first-child .row-link {
    min-height: 44px;
    font-size: 13px;
    text-align: left;
  }
  .page-tasks .task-list td:nth-child(2) {
    color: var(--muted);
    font-size: 13px;
  }
  .page-tasks .task-list td:nth-child(3) {
    align-items: flex-end;
  }
  .page-tasks .task-list td:nth-child(4),
  .page-tasks .task-list td:nth-child(5),
  .page-tasks .task-list td:last-child:not(:has(button)) {
    display: none;
  }
  .page-tasks .task-list td:last-child:has(button) {
    grid-column: 1/-1;
  }
}

/* Readable cards retain every financial value. / Читабельні картки з усіма фінансовими значеннями. */
@media (max-width: 720px) {
  .small,
  .decision-exact > summary,
  .workflow-history > summary,
  .handoff-advanced > summary {
    font-size: 13px;
  }
  .source-performance td,
  .profile-accounts td {
    font-size: 14px;
    text-align: left;
    width: auto !important;
  }
  .profile-accounts td:nth-child(2) {
    display: flex;
  }
  .profile-account-source {
    display: none;
  }
  .voice-transcript {
    max-height: 80px;
    overflow-y: auto;
    font-size: 16px;
    line-height: 1.45;
    margin: 6px 0;
    overflow-wrap: anywhere;
  }
}
