/* ===================== Round 2: task-first screens ===================== */
.link-btn { border: none; background: none; padding: 0; font: inherit; font-weight: 700; font-size: 14px; color: var(--text); cursor: pointer; text-align: left; text-decoration: underline; text-decoration-color: rgba(41, 240, 180, .4); text-underline-offset: 4px; overflow-wrap: anywhere; }
.link-btn:hover { color: var(--accent-2); text-decoration-color: var(--accent); }
.lr-sub .link-btn { font-size: 12px; font-weight: 500; color: var(--text-dim); }
.u-cell .u-meta { display: flex; flex-direction: column; min-width: 0; }
.u-cell .u-meta b, .u-cell .u-meta span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.phone-only { display: none; }

/* phone lists: one tappable card per person */
.mcards { flex-direction: column; gap: 8px; }
.mcard { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 6px 10px; width: 100%; padding: 14px; text-align: left;
  background: var(--panel); border: 1px solid var(--border-soft); border-radius: 16px; color: var(--text); font: inherit; cursor: pointer; transition: border-color .15s, background .15s; }
.mcard:active { background: var(--panel-2); }
.mcard-side { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.mcard-foot { grid-column: 1 / -1; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding-left: 45px; font-size: 12px; color: var(--muted); }

/* profile + license drawer */
.avatar-lg { width: 52px; height: 52px; font-size: 17px; }
.prof-hero { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 16px; }
.prof-hero .u-meta { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.prof-hero .u-meta > b { font-size: 19px; letter-spacing: -.02em; }
.prof-hero .u-meta > span { color: var(--text-dim); font-size: 13px; overflow-wrap: anywhere; }
.prof-badges { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-top: 8px; font-size: 12px; }
.prof-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); background: var(--bg-2); border: 1px solid var(--border-soft); border-radius: 14px; margin: 12px 0; }
.prof-stats > div { padding: 12px 14px; min-width: 0; }
.prof-stats > div + div { border-left: 1px solid var(--border-soft); }
.prof-stats span { display: block; font-size: 11.5px; color: var(--muted); font-weight: 600; }
.prof-stats b { display: block; font-size: 17px; margin-top: 3px; letter-spacing: -.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.prof-stats b span { display: inline; font-size: inherit; color: inherit; font-weight: inherit; }
.prof-sec { border-top: 1px solid var(--border-soft); padding: 14px 0 6px; margin-top: 14px; }
.prof-sec h4 { margin: 0 0 8px; font-size: 13px; font-weight: 700; color: var(--text); display: inline-flex; gap: 8px; }
.prof-fold summary { cursor: pointer; list-style: none; display: flex; align-items: center; justify-content: space-between; }
.prof-fold summary::-webkit-details-marker { display: none; }
.prof-fold summary::after { content: ""; width: 8px; height: 8px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); margin: -4px 4px 0 0; transition: transform .2s var(--ease); }
.prof-fold[open] summary::after { transform: rotate(225deg); margin-top: 4px; }
.prof-fold summary h4 { margin: 0; }
.prof-fold[open] summary { margin-bottom: 8px; }
.prof-fold.danger summary h4 { color: #ff9a9a; }
.prof-danger { display: flex; gap: 10px; flex-wrap: wrap; padding-bottom: 6px; }
.prof-more summary { cursor: pointer; font-size: 12.5px; color: var(--text-dim); margin: 6px 0; }
.lic-line { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 8px 0; font-size: 12.5px; }
.lic-line + .lic-line { border-top: 1px dashed var(--border-soft); }
.lic-tokens { margin-left: auto; color: var(--text-dim); }
.drawer-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.drawer-body > .btn-block { margin-bottom: 4px; }

/* API manager */
.flow { list-style: none; counter-reset: flow; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; padding: 0; margin: 0 0 16px; }
.flow li { counter-increment: flow; position: relative; background: var(--panel); border: 1px solid var(--border-soft); border-radius: var(--radius); padding: 16px 18px 16px 56px; min-width: 0; }
.flow li::before { content: counter(flow); position: absolute; left: 16px; top: 15px; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: 12.5px; font-weight: 700; background: var(--forest); color: var(--accent); box-shadow: inset 0 0 0 1px rgba(41, 240, 180, .3); }
.flow b { display: block; font-size: 13.5px; }
.flow span { display: block; font-size: 12.5px; color: var(--text-dim); margin-top: 3px; }
.catalog-card { margin-bottom: 16px; }
.prov-lines { padding: 0 20px 14px; }
.prov-line { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--border-soft); }
.prov-line .prov-logo { width: 34px; height: 34px; font-size: 13px; border-radius: 10px; flex-shrink: 0; }
.prov-line .u-meta { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.prov-line .u-meta span { color: var(--muted); font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.p-sub { font-size: 12px; color: var(--muted); margin-top: 6px; }
.klist { display: flex; flex-direction: column; }
.krow { display: grid; grid-template-columns: minmax(200px, 1.2fr) minmax(180px, 1.3fr) minmax(0, 1fr) auto; align-items: center; gap: 16px; padding: 12px 20px; border-top: 1px solid var(--border-soft); }
.krow.clickable { cursor: pointer; }
.krow:hover { background: rgba(214, 255, 240, .025); }
.krow-meter span { display: block; font-size: 12px; color: var(--text-dim); margin-top: 6px; white-space: nowrap; }
.krow-meter b { color: var(--text); }
.meter { height: 6px; background: var(--raise); border-radius: 4px; overflow: hidden; }
.meter i { display: block; height: 100%; background: var(--accent); border-radius: 4px; }
.meter-red i { background: var(--red); }
.krow-meta { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; font-size: 12px; min-width: 0; }

/* plans: one full-width row per plan; the strip is the summary an admin
   scans, the body is the editor laid out across the width when opened. */
.plans-grid { display: flex; flex-direction: column; gap: 10px; }
.plan-row { background: var(--panel); border: 1px solid var(--border-soft); border-radius: var(--radius); min-width: 0; }
.plan-row.on { border-color: rgba(41, 240, 180, .22); }
.plan-row[open] { border-color: rgba(41, 240, 180, .4); }
.plan-strip { list-style: none; display: grid; grid-template-columns: minmax(170px, 1.1fr) repeat(4, minmax(78px, auto)) minmax(0, 3fr) auto 20px; align-items: center; gap: 8px 22px; padding: 14px 20px; cursor: pointer; border-radius: var(--radius); }
.plan-strip::-webkit-details-marker { display: none; }
.plan-strip:hover { background: var(--panel-2); }
.plan-strip:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
#zdr-card .plan-strip, #plan-free .plan-strip { grid-template-columns: minmax(170px, 1.1fr) repeat(3, minmax(78px, auto)) minmax(0, 3fr) auto 20px; }
#zdr-card .plan-strip { grid-template-columns: minmax(170px, 1.1fr) minmax(78px, auto) minmax(0, 1fr) 20px; }
.ps-title { display: flex; align-items: center; gap: 8px; min-width: 0; }
.ps-title .plan-name { font-size: 17px; }
.ps-cell { display: flex; flex-direction: column; line-height: 1.2; white-space: nowrap; }
.ps-cell b { font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; }
.ps-cell small { font-size: 11px; color: var(--muted); }
.ps-note { font-size: 12.5px; color: var(--text-dim); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ps-note b { color: var(--text); font-weight: 600; }
.ps-fusion { color: var(--purple); font-weight: 600; }
.ps-chev { width: 8px; height: 8px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); justify-self: center; transition: transform .15s; }
.plan-row[open] .ps-chev { transform: translateY(3px) rotate(-135deg); }
.plan-body { padding: 4px 20px 18px; border-top: 1px solid var(--border-soft); }
.plan-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 0 28px; }
.plan-grid > .plan-sec { border-top: 0; }
.plan-sec-models .plan-models { max-height: 520px; }
.plan-sec-models .pm-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(460px, 100%), 1fr)); column-gap: 12px; }
.zdr-ids { width: 100%; margin-top: 14px; }
@media (max-width: 1100px) {
  .plan-strip, #zdr-card .plan-strip, #plan-free .plan-strip { grid-template-columns: 1fr repeat(3, auto) 20px; }
  .plan-strip .ps-note { grid-column: 1 / -1; grid-row: 2; white-space: normal; }
  .plan-strip > .badge { grid-row: 1; }
}
.plan-sec { border-top: 1px solid var(--border-soft); padding-top: 14px; margin-top: 16px; }
.plan-sec h4 { margin: 0 0 10px; font-size: 13px; font-weight: 700; display: flex; justify-content: space-between; align-items: baseline; }
.plan-sec h4 span { font-size: 12px; font-weight: 600; color: var(--accent); }
.plan-sec .hint { margin: -4px 0 10px; }
.plan-sec .plan-fields { margin-bottom: 0; }
.plan-filter-row { display: flex; gap: 8px; margin: 4px 0 8px; }
.plan-filter-row .plan-provider-filter { flex: 0 0 auto; }
.plan-filter { width: 100%; margin: 0; }
.plan-models { max-height: 460px; display: block; padding: 4px 6px 6px; }
.pm-group { position: sticky; top: -4px; z-index: 1; background: var(--bg-2); font-size: 11px; font-weight: 700; color: var(--muted); padding: 8px 8px 4px; }
.pm-list { display: flex; flex-direction: column; gap: 2px; }
/* Keep scrolling and typing in one plan's list from relaying out the page. */
.plan-models { contain: layout paint; overscroll-behavior: contain; }
.plan-model { contain: layout style; }
.plan-model input { transition: none; }
.pm-list + .pm-group { margin-top: 6px; border-top: 1px solid var(--border-soft); }
.pm-list:first-of-type .plan-model { background: rgba(41, 240, 180, .05); }
/* Two-line model row: full name, vendor and OpenRouter id on top; the Straitly
   mapping below with its state, so nothing an admin must compare is truncated. */
.plan-model { display: grid !important; grid-template-columns: auto minmax(0, 1fr) auto; column-gap: 10px; row-gap: 6px; align-items: center; padding: 9px 10px !important; border: 1px solid transparent; }
.plan-model + .plan-model { border-top-color: var(--border-soft); }
.pm-main { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.pm-name { font-size: 13px; font-weight: 600; line-height: 1.3; overflow-wrap: anywhere; }
.pm-meta { display: flex; align-items: center; gap: 6px; min-width: 0; }
.pm-src { flex: 0 0 auto; font-size: 10.5px; color: var(--muted); }
.pm-id { min-width: 0; font: 11px/1.3 ui-monospace, SFMono-Regular, Consolas, monospace; color: var(--muted); overflow-wrap: anywhere; }
.pm-route { grid-column: 2 / 4; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; min-width: 0; }
.pm-route-name { flex: 1 0 100%; padding-left: 52px; font-size: 11px; color: var(--muted); }
.pm-route-name:empty { display: none; }
.pm-route-label { flex: 0 0 auto; font-size: 11px; color: var(--muted); }
.pm-route .plan-route-input { flex: 1 1 auto; min-width: 0; width: auto; font: 11.5px ui-monospace, SFMono-Regular, Consolas, monospace; }
.pm-route-state { flex: 0 0 auto; font-size: 10.5px; font-weight: 700; border-radius: 999px; padding: 2px 8px; color: var(--muted); background: var(--panel-2); }
.pm-route-state::before { content: "Not mapped"; }
.plan-model[data-straitly="1"] .pm-route-state { color: var(--accent); background: var(--accent-soft); }
.plan-model[data-straitly="1"] .pm-route-state::before { content: "Mapped"; }
.plan-model[data-straitly="warn"] .pm-route-state { color: #ffb547; background: rgba(255, 181, 71, .12); }
.plan-model[data-straitly="warn"] .pm-route-state::before { content: "Check model"; }
.plan-model[data-straitly="warn"] .pm-route-name { color: #ffb547; }
.pm-empty { font-size: 12px; color: var(--muted); padding: 8px; }
.plan-adv { margin-top: 16px; border-top: 1px solid var(--border-soft); padding-top: 12px; }
.plan-adv summary { cursor: pointer; font-size: 13px; font-weight: 700; color: var(--text-dim); }
.plan-adv[open] summary { margin-bottom: 10px; }
.plan-foot { border-top: 1px solid var(--border-soft); padding-top: 14px; }

/* data */
.dcard-head { cursor: pointer; }
.policy-bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; background: var(--panel); border: 1px solid var(--border-soft); border-radius: 14px; padding: 12px 16px; margin: -6px 0 16px; }
.policy-bar b { display: block; font-size: 13px; }
.policy-bar span { display: block; font-size: 12px; color: var(--muted); }

/* announcements */
.ann-compose { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 20px; padding: 20px; }
.ann-write { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.ann-write h2, .ann-list-head h2 { margin: 0 0 4px; font-size: 15px; font-weight: 700; }
.ann-levels { width: fit-content; max-width: 100%; overflow-x: auto; }
.ann-levels button { display: inline-flex; align-items: center; gap: 7px; }
.ann-levels i { width: 8px; height: 8px; border-radius: 50%; }
.dot-info { background: var(--blue); } .dot-release, .dot-success { background: var(--accent); } .dot-warning { background: var(--amber); }
.ann-preview-wrap { background: var(--bg-2); border: 1px dashed var(--border); border-radius: 14px; padding: 14px; min-width: 0; }
.ann-preview-label { font-size: 11.5px; font-weight: 700; color: var(--muted); margin-bottom: 10px; }
.ann-note { background: var(--panel); border: 1px solid var(--border-soft); border-left: 3px solid var(--blue); border-radius: 12px; padding: 12px 14px; }
.ann-note-release, .ann-note-success { border-left-color: var(--accent); }
.ann-note-warning { border-left-color: var(--amber); }
.ann-list-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 4px 0 12px; flex-wrap: wrap; }
.ann-card { background: var(--panel); border: 1px solid var(--border-soft); border-radius: var(--radius); }
.ann-card.is-hidden { opacity: .62; }
.ann-card-actions { align-items: center; gap: 14px; }
.mini-toggle { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 12px; color: var(--text-dim); cursor: pointer; }

@media (max-width: 1100px) {
  .krow { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; }
  .krow-meta { display: none; }
}
@media (max-width: 900px) {
  .flow { grid-template-columns: 1fr; }
  .ann-compose { grid-template-columns: 1fr; }
}
@media (max-width: 820px) {
  .desk-only { display: none; }
  .phone-only { display: flex; }
  .krow { grid-template-columns: minmax(0, 1fr) auto; gap: 10px; padding: 14px 16px; }
  .krow-meter { grid-column: 1 / -1; grid-row: 2; }
  .krow .btn { grid-column: 2; grid-row: 1; }
  .policy-bar { margin-top: 0; }
  .ann-card-actions { width: 100%; }
  .ann-card-actions .btn { margin-left: auto; }
}
@media (max-width: 640px) {
  .prof-stats b { font-size: 15px; }
}
.dcard-body.plain { white-space: normal; display: flex; flex-direction: column; gap: 4px; }
.chart-total { font-size: 20px; letter-spacing: -.02em; }

/* Zero-retention model list on the Plans screen. */
.zdr-ids { width: 100%; font-family: var(--mono, monospace); font-size: 12px; resize: vertical; }
