@import url("../v2-layout.css?v=20261013-list-end1");

:root {
  color-scheme: light;
  --canvas: var(--v2-surface-canvas);
  --surface: oklch(0.992 0.0018 245);
  --surface-soft: oklch(0.975 0.003 245);
  --surface-strong: oklch(0.945 0.004 245);
  --line: oklch(0.89 0.006 245);
  --text: oklch(0.22 0.012 250);
  --text-secondary: oklch(0.46 0.016 250);
  --text-tertiary: oklch(0.61 0.014 250);
  --agent: oklch(0.46 0.065 242);
  --agent-soft: oklch(0.955 0.012 242);
  --waiting: oklch(0.48 0.025 245);
  --waiting-soft: oklch(0.952 0.006 245);
  --attention: oklch(0.52 0.082 68);
  --attention-soft: oklch(0.965 0.026 78);
  --success: oklch(0.46 0.075 153);
  --radius-sm: 8px;
  --radius-md: 12px;
  --shadow-float: 0 16px 40px oklch(0.22 0.018 250 / 0.14);
  font-family: Inter, "Noto Sans SC", "PingFang SC", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { background: var(--canvas); }
body { margin: 0; min-width: 320px; background: var(--canvas); color: var(--text); font: 14px/1.62 Inter, "Noto Sans SC", "PingFang SC", system-ui, sans-serif; }
button, input { font: inherit; }
a, button { color: inherit; }
button:focus-visible, a:focus-visible, input:focus-visible { outline: 2px solid var(--agent); outline-offset: 3px; }
[hidden] { display: none !important; }
.svg-defs { position: absolute; width: 0; height: 0; overflow: hidden; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

.site-header { position: sticky; top: 0; z-index: 20; height: 64px; background: var(--canvas); }
.site-header.is-scrolled { box-shadow: inset 0 -1px var(--line); }
.site-header__inner { width: min(var(--v2-layout-shell), calc(100% - var(--v2-layout-gutter))); height: 100%; margin: 0 auto; display: flex; align-items: center; gap: 32px; }
.brand { display: inline-flex; align-items: center; gap: 8px; font-size: 18px; font-weight: 650; text-decoration: none; }
.brand__mark { width: 20px; height: 20px; }
.main-nav { align-self: stretch; display: flex; align-items: center; gap: 8px; }
.main-nav a { min-height: 40px; padding: 0 14px; border-radius: var(--radius-sm); display: inline-flex; align-items: center; color: var(--text-secondary); font-weight: 500; text-decoration: none; }
.main-nav a:hover { background: var(--surface-strong); color: var(--text); }
.main-nav .is-current { background: var(--v2-nav-selected); color: var(--text); font-weight: 600; }
.header-actions { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.agent-identity { position: relative; }
.agent-identity__trigger { min-height: 40px; padding: 0 10px; border: 0; border-radius: var(--radius-sm); background: transparent; display: inline-flex; align-items: center; gap: 7px; font-weight: 400; cursor: pointer; }
.agent-identity__trigger:hover, .agent-identity__trigger[aria-expanded="true"] { background: var(--v2-nav-selected); }
.agent-identity__status { width: 16px; height: 16px; display: grid; place-items: center; }
.agent-identity__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--success); }
.agent-identity__chevron { width: 16px; height: 16px; color: var(--text-tertiary); transition: transform 140ms ease; }
.agent-identity__trigger[aria-expanded="true"] .agent-identity__chevron { transform: rotate(180deg); }
.agent-identity__panel { position: absolute; z-index: 30; top: calc(100% + 8px); right: 0; width: 320px; padding: 8px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface); box-shadow: var(--shadow-float); }
.agent-identity__section-label { margin: 0; padding: 10px 12px 7px; color: var(--text-tertiary); font-size: 11px; font-weight: 650; }
.agent-identity__current, .agent-identity__option { width: 100%; padding: 10px 12px; border-radius: var(--radius-sm); display: grid; grid-template-columns: 1fr auto; text-align: left; text-decoration: none; }
.agent-identity__current { position: relative; background: transparent; }
.agent-identity__current:hover, .agent-identity__option:hover { background: var(--surface-soft); }
.agent-identity__current strong, .agent-identity__option strong { font-size: 13px; }
.agent-identity__current .agent-identity__current-label { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.agent-identity__current-check { position: absolute; top: 50%; right: 12px; width: 16px; height: 16px; color: var(--text); transform: translateY(-50%); }
.agent-identity__current small, .agent-identity__option small { grid-column: 1 / -1; color: var(--text-secondary); font-size: 11px; }
.agent-identity__divider { height: 1px; margin: 8px 12px; background: color-mix(in oklch, var(--line) 54%, transparent); }
.agent-identity__option--single { display: flex; align-items: center; justify-content: space-between; }
.agent-identity__option--single svg { width: 16px; height: 16px; }
.account-trigger { width: 40px; height: 40px; border-radius: 50%; background: var(--surface-strong); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; text-decoration: none; }
.mobile-nav-toggle { display: none; }

.cooperation-page { width: min(var(--v2-layout-index), calc(100% - var(--v2-layout-gutter))); margin: 0 auto; padding: 52px 0 80px; }
.page-heading { position: relative; min-height: 88px; display: flex; align-items: flex-start; justify-content: space-between; gap: 48px; isolation: isolate; }
.page-heading::after { content: ""; position: absolute; z-index: -1; right: 4px; bottom: 2px; width: clamp(210px, 22vw, 292px); aspect-ratio: 1916 / 821; background: url("../../assets/illustrations/cooperation-header-a-soft-ribbon-v2.png") right center / contain no-repeat; opacity: 0.18; pointer-events: none; user-select: none; }
.page-heading__copy { padding-top: 8px; }
.page-heading h1 { margin: 0; font-size: 30px; line-height: 1.24; font-weight: 680; letter-spacing: -0.022em; }
.page-heading p { margin: 10px 0 0; color: var(--text-secondary); font-size: 14px; line-height: 1.55; }
.income-summary { width: min(260px, 32%); padding: 7px 0 0; }
.income-summary dl { margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.income-summary dt { color: var(--text-secondary); font-size: 11px; line-height: 1.45; white-space: nowrap; }
.income-summary dd { min-height: 29px; margin: 4px 0 0; color: var(--text); font-size: 21px; line-height: 1.35; font-weight: 620; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.list-workspace { margin-top: 18px; }
.list-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.list-tools { position: relative; display: flex; align-items: center; gap: 8px; }
.status-filter-menu { position: relative; flex: 0 0 auto; }
.filter-trigger { width: 40px; height: 40px; padding: 0; border: 0; border-radius: var(--radius-sm); background: var(--surface); color: var(--text-tertiary); display: grid; place-items: center; cursor: pointer; transition: background-color 140ms ease-out, color 140ms ease-out; }
.filter-trigger svg { width: 16px; height: 16px; }
.filter-trigger:hover, .filter-trigger[aria-expanded="true"] { background: var(--surface-strong); color: var(--text); }
.filter-trigger.has-filter, .filter-trigger.has-filter:hover, .filter-trigger.has-filter[aria-expanded="true"] { background: var(--text); color: var(--surface); }
.filter-trigger:focus-visible { outline: 2px solid var(--agent); outline-offset: 2px; }
.status-filter-panel { position: absolute; z-index: 20; top: calc(100% + 8px); left: 0; width: min(240px, calc(100vw - 32px)); max-height: 336px; padding: 8px; overflow-y: auto; border: 1px solid color-mix(in oklch, var(--line) 52%, transparent); border-radius: var(--radius-md); background: var(--surface); box-shadow: 0 14px 34px oklch(0.22 0.018 250 / 0.1); scrollbar-width: none; }
.status-filter-panel::-webkit-scrollbar { width: 0; height: 0; display: none; }
.status-filter-option { width: 100%; min-height: 38px; padding: 7px 8px; border: 0; border-radius: 8px; background: transparent; color: var(--text-secondary); display: flex; align-items: center; justify-content: space-between; gap: 12px; text-align: left; cursor: pointer; }
.status-filter-option:hover { background: var(--surface-soft); color: var(--text); }
.status-filter-option.is-selected { background: var(--surface-soft); color: var(--text); font-weight: 580; }
.status-filter-option svg { width: 15px; height: 15px; flex: 0 0 auto; opacity: 0; }
.status-filter-option.is-selected svg { opacity: 1; }
.status-filter-option:focus-visible { outline: 2px solid var(--agent); outline-offset: -2px; }
.group-tabs { display: flex; align-items: center; gap: 12px; overflow-x: auto; }
.group-tabs button { position: relative; width: auto; min-width: 72px; min-height: 40px; padding: 0; border: 0; background: transparent; color: var(--text-secondary); flex: 0 0 auto; display: block; white-space: nowrap; cursor: pointer; }
.group-tabs .tab-label { width: auto; min-height: 40px; margin: 0 auto; padding: 0 14px; border: 1px solid transparent; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; gap: 2px; transition: color 120ms ease-out, background-color 120ms ease-out; }
.group-tabs .tab-title { flex: 0 0 auto; }
.group-tabs button:not(.is-active):hover .tab-label { background: var(--surface-strong); color: oklch(0.14 0.012 250); }
.group-tabs .tab-unread { width: 22px; min-width: 22px; height: 22px; padding: 0 3px; border: 2px solid var(--canvas); border-radius: 999px; background: oklch(0.55 0.2 27); color: oklch(0.99 0.002 245); display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; font-size: 10px; line-height: 1; font-weight: 600; font-variant-numeric: tabular-nums; pointer-events: none; }
.group-tabs button.is-active .tab-label { border-color: oklch(0.885 0.009 245); background: oklch(0.988 0.004 245); color: var(--text); font-weight: 700; }
.group-tabs button.is-active .tab-unread { border-color: oklch(0.988 0.004 245); color: oklch(0.99 0.002 245); }
.group-tabs button:not(.is-active):hover .tab-unread { border-color: var(--surface-strong); }
.group-tabs button:focus-visible { outline: 0; }
.group-tabs button:focus-visible .tab-label { outline: 2px solid var(--agent); outline-offset: 2px; }
.search-field { width: 252px; min-height: 40px; padding: 0 12px; border-radius: var(--radius-sm); background: var(--surface); display: flex; align-items: center; gap: 8px; color: var(--text-tertiary); }
.search-field:focus-within { box-shadow: inset 0 0 0 1px oklch(0.73 0.012 245); }
.search-field svg { width: 16px; height: 16px; flex: 0 0 auto; }
.search-field input { min-width: 0; flex: 1; border: 0; outline: 0; background: transparent; color: var(--text); }
.search-field input::placeholder { color: var(--text-tertiary); }

.active-filters { margin-top: 12px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.filter-chip { min-height: 30px; padding: 0 9px 0 10px; border: 1px solid var(--line); border-radius: 999px; background: transparent; color: var(--text-secondary); display: inline-flex; align-items: center; gap: 5px; font-size: 12px; cursor: pointer; }
.filter-chip:hover { border-color: color-mix(in oklch, var(--line) 70%, var(--text-tertiary)); color: var(--text); }
.filter-chip:focus-visible { outline: 2px solid var(--agent); outline-offset: 2px; }
.filter-chip svg { width: 13px; height: 13px; }
.active-filters:not([hidden]) + .conversation-list { margin-top: 10px; }

.conversation-list { margin-top: 18px; padding: 8px; border-radius: var(--radius-md); background: var(--surface); display: grid; gap: 4px; }
.thread-row { min-width: 0; padding: 17px 18px; border-radius: 10px; display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 14px; align-items: start; text-decoration: none; }
.thread-row:hover { background: var(--surface-soft); }
.thread-row__avatar-wrap { position: relative; width: 40px; height: 40px; display: block; }
.thread-row__avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--surface-strong); color: var(--text-secondary); display: grid; place-items: center; font-size: 13px; font-weight: 580; }
.thread-row__avatar.tone-blue { background: oklch(0.94 0.02 242); color: oklch(0.42 0.07 242); }
.thread-row__avatar.tone-red { background: oklch(0.95 0.02 25); color: oklch(0.46 0.07 25); }
.thread-row__avatar.tone-yellow { background: oklch(0.955 0.025 78); color: oklch(0.49 0.06 68); }
.thread-row__avatar.tone-green { background: oklch(0.95 0.02 153); color: oklch(0.44 0.065 153); }
.thread-row__avatar.is-logo { border: 1px solid oklch(0.91 0.008 245); background: var(--surface); }
.thread-row__avatar.is-logo img { width: 27px; height: 27px; object-fit: contain; }
.thread-row__unread { position: absolute; top: -6px; right: -7px; min-width: 18px; height: 18px; padding: 0 5px; border: 2px solid var(--surface); border-radius: 999px; background: oklch(0.55 0.2 27); color: oklch(0.99 0.002 245); display: inline-flex; align-items: center; justify-content: center; font-size: 10px; line-height: 1; font-weight: 600; }
.thread-row__content { min-width: 0; display: block; overflow: hidden; }
.thread-row__top { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; min-width: 0; }
.thread-row__heading { min-width: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 5px 8px; }
.thread-row__heading strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; line-height: 1.45; font-weight: 590; }
.thread-row__counterparty { min-width: 0; overflow: hidden; color: var(--text-tertiary); font-size: 12px; line-height: 1.5; text-overflow: ellipsis; white-space: nowrap; }
.thread-row__timing { flex: 0 0 auto; padding-top: 1px; display: inline-flex; align-items: center; justify-content: flex-end; gap: 8px; white-space: nowrap; }
.thread-row__time { color: var(--text-tertiary); font-size: 10px; }
.thread-row__deadline { color: var(--text-secondary); font-size: 10px; font-weight: 520; }
.thread-row__deadline.is-urgent, .thread-row__deadline.is-overdue { color: var(--attention); }
.thread-row__summary { max-width: 100%; margin: 5px 0 0; overflow: hidden; color: var(--text-secondary); display: block; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.thread-row__preview { margin-top: 12px; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--surface-soft); display: grid; gap: 5px; }
.thread-row__preview-line { min-width: 0; overflow: hidden; color: var(--text-secondary); display: block; font-size: 13px; line-height: 1.45; text-overflow: ellipsis; white-space: nowrap; }
.thread-row__preview-sender { color: var(--agent); }
.thread-status { min-height: 26px; padding: 3px 8px; border-radius: 6px; background: var(--waiting-soft); color: var(--waiting); display: inline-flex; align-items: center; font-size: 11px; font-weight: 500; white-space: nowrap; }
.thread-status.is-agent { background: var(--agent-soft); color: var(--agent); }
.thread-status.is-attention { background: var(--attention-soft); color: var(--attention); }
.thread-status.is-success { background: color-mix(in oklch, var(--success) 9%, var(--surface)); color: var(--success); }
.thread-row__latest { min-width: 0; margin-top: 7px; overflow: hidden; color: var(--text-secondary); display: block; font-size: 13px; line-height: 1.55; text-overflow: ellipsis; white-space: nowrap; }
.thread-row__latest > span:first-child { color: var(--text); }
.thread-row__message-type { margin-right: 3px; color: var(--text-tertiary) !important; }

.empty-state { margin-top: 18px; min-height: 280px; padding: 44px 24px 56px; border-radius: 0; background: transparent; text-align: center; }
.empty-state__illustration { width: 124px; height: 124px; margin: 0 auto 16px; display: block; object-fit: contain; opacity: 0.84; user-select: none; }
.empty-state h3 { margin: 0; font-size: 16px; font-weight: 600; }
.empty-state p { margin: 8px 0 0; color: var(--text-secondary); }
.text-action { margin-top: 14px; padding: 0; border: 0; background: transparent; color: var(--agent); cursor: pointer; }

@media (max-width: 760px) {
  .site-header { height: auto; min-height: 60px; }
  .site-header__inner { width: calc(100% - var(--v2-layout-gutter-mobile)); min-height: 60px; padding: 10px 0; flex-wrap: wrap; gap: 10px; }
  .mobile-nav-toggle { margin-left: auto; min-height: 36px; padding: 0 10px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); display: inline-flex; align-items: center; }
  .main-nav { order: 3; width: 100%; height: auto; padding: 8px 0 12px; display: none; }
  .main-nav.is-open { display: flex; }
  .header-actions { margin-left: 0; }
  .agent-identity { display: none; }
  .account-trigger { width: 36px; height: 36px; }
  .cooperation-page { width: calc(100% - var(--v2-layout-gutter-mobile)); padding: 20px 0 56px; }
  .page-heading { min-height: 0; flex-direction: column; gap: 18px; }
  .page-heading__copy { padding-top: 0; }
  .page-heading h1 { font-size: 24px; line-height: 1.32; letter-spacing: -.016em; }
  .page-heading::after { display: none; }
  .income-summary { width: 100%; padding-top: 14px; border-top: 1px solid color-mix(in oklch, var(--line) 62%, transparent); }
  .income-summary dl { max-width: 260px; gap: 24px; }
  .income-summary dd { min-height: 25px; font-size: 18px; }
  .list-workspace { margin-top: 16px; }
  .list-toolbar { align-items: stretch; flex-direction: column; gap: 12px; }
  .group-tabs { overflow-x: auto; }
  .list-tools { width: 100%; }
  .search-field { width: auto; flex: 1; }
  .search-field input { font-size: 16px; }
  .conversation-list { margin-top: 14px; }
  .thread-row { grid-template-columns: 36px minmax(0, 1fr); column-gap: 12px; row-gap: 0; padding: 14px 12px; }
  .thread-row__avatar-wrap { width: 36px; height: 36px; }
  .thread-row__avatar { width: 36px; height: 36px; }
  .thread-row__content { display: contents; }
  .thread-row__top { grid-column: 2; min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 3px 8px; }
  .thread-row__heading { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 3px 7px; }
  .thread-row__heading strong { grid-column: 1 / -1; }
  .thread-row__heading > .thread-status { grid-column: 1; grid-row: 2; }
  .thread-row__counterparty { grid-column: 2; }
  .thread-row__timing { max-width: none; padding-top: 2px; align-self: start; white-space: nowrap; text-align: right; }
  .thread-row__deadline { display: none; }
  .thread-row__heading strong { display: block; white-space: nowrap; }
  .thread-status { min-height: 22px; padding: 2px 7px; font-size: 10px; line-height: 1.35; }
  .thread-row__summary, .thread-row__latest, .thread-row__preview { grid-column: 1 / -1; }
  .thread-row__summary, .thread-row__latest { margin-top: 10px; }
  .thread-row__preview { margin-top: 10px; }
  .thread-row__summary, .thread-row__latest { white-space: normal; }
  .thread-row__preview-line { white-space: nowrap; }
}

@media (max-width: 520px) {
  .main-nav { overflow-x: auto; }
}
