:root {
  color-scheme: light;
  --ink: #172321;
  --muted: #697674;
  --paper: #f3f5f1;
  --panel: #ffffff;
  --forest: #12312f;
  --forest-2: #1d4944;
  --lime: #c9ef79;
  --mint: #e5f1e8;
  --blue: #577de8;
  --red: #c85c52;
  --amber: #a87112;
  --line: #dfe5e0;
  --shadow: 0 16px 45px rgba(23, 47, 44, .10);
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
a { color: inherit; }
.is-hidden { display: none !important; }
.boot-screen { position: fixed; inset: 0; z-index: 100; display: grid; place-content: center; justify-items: center; background: var(--paper); color: var(--muted); }
.boot-mark { width: 58px; height: 58px; display: grid; place-items: center; border-radius: 18px; background: var(--forest); color: var(--lime); font-size: 26px; font-weight: 800; box-shadow: var(--shadow); }
.boot-screen p { margin-top: 16px; font-size: 13px; }

.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; }
.brand-mark { width: 39px; height: 39px; display: grid; place-items: center; border-radius: 12px; background: var(--forest); color: var(--lime); font-weight: 800; }
.brand strong, .brand small { display: block; }
.brand strong { letter-spacing: .07em; }
.brand small { margin-top: 2px; color: var(--muted); font-size: 10px; }
.brand-light { color: white; }
.brand-light .brand-mark { background: var(--lime); color: var(--forest); }
.brand-light small { color: #9eb4b1; }

.login-screen { min-height: 100vh; display: grid; grid-template-columns: minmax(390px, .95fr) minmax(460px, 1.05fr); }
.login-intro { display: flex; flex-direction: column; justify-content: space-between; padding: 42px clamp(36px, 5vw, 76px); background: var(--forest); color: white; overflow: hidden; }
.login-intro::after { content: ""; position: fixed; width: 430px; height: 430px; left: -170px; bottom: -200px; border: 1px solid rgba(201,239,121,.25); border-radius: 50%; box-shadow: 0 0 0 80px rgba(255,255,255,.025), 0 0 0 160px rgba(255,255,255,.02); }
.eyebrow, .section-kicker { margin: 0 0 13px; color: #7ba29c; font-size: 10px; font-weight: 800; letter-spacing: .17em; text-transform: uppercase; }
.login-intro .eyebrow { color: var(--lime); }
.login-intro h1 { margin: 0; font-size: clamp(38px, 4.5vw, 62px); line-height: 1.12; letter-spacing: -.045em; }
.login-intro > div > p:last-child { max-width: 590px; color: #b7c8c5; line-height: 1.8; }
.login-principles { position: relative; z-index: 1; display: flex; gap: 18px; margin: 0; padding: 0; list-style: none; }
.login-principles li { flex: 1; display: grid; gap: 6px; color: #c3d0ce; font-size: 12px; }
.login-principles span { color: var(--lime); font-size: 10px; font-weight: 800; }
.login-card { width: min(100%, 610px); margin: auto; padding: 46px clamp(24px, 6vw, 72px); }
.back-link { display: inline-block; margin-bottom: 34px; color: var(--muted); text-decoration: none; font-size: 13px; }
.mode-tabs { display: flex; gap: 6px; margin-bottom: 38px; padding: 5px; border-radius: 13px; background: #e9ede8; }
.mode-tab { flex: 1; min-height: 39px; border: 0; border-radius: 10px; background: transparent; color: var(--muted); font-weight: 700; font-size: 13px; }
.mode-tab.is-active { background: white; color: var(--forest); box-shadow: 0 3px 10px rgba(20,40,38,.08); }
.login-card h2, .dialog-card h2 { margin: 0; font-size: 30px; letter-spacing: -.03em; }
.subcopy { margin: 11px 0 28px; color: var(--muted); font-size: 13px; line-height: 1.7; }
label { display: grid; gap: 9px; margin: 17px 0; color: #40504d; font-size: 12px; font-weight: 700; }
input, select, textarea { width: 100%; border: 1px solid #d4ddd7; border-radius: 12px; background: white; color: var(--ink); outline: none; }
input, select { height: 48px; padding: 0 14px; }
textarea { padding: 13px 14px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: #4a786f; box-shadow: 0 0 0 3px rgba(74,120,111,.13); }
.password-field { position: relative; }
.password-field input { padding-right: 64px; }
.text-button { position: absolute; right: 7px; top: 7px; height: 34px; border: 0; background: transparent; color: #39736b; font-size: 12px; font-weight: 700; }
.field-hint { margin: -7px 0 0; color: var(--muted); font-size: 11px; }
code { padding: 2px 5px; border-radius: 5px; background: #e8ece8; color: #304a46; }
.primary-button, .secondary-button, .danger-button { min-height: 44px; padding: 0 18px; border-radius: 12px; font-weight: 750; }
.primary-button { border: 1px solid var(--forest); background: var(--forest); color: white; box-shadow: 0 8px 20px rgba(18,49,47,.15); }
.primary-button:hover { background: var(--forest-2); }
.secondary-button { border: 1px solid #ced8d2; background: white; color: var(--forest); }
.secondary-button:hover { background: #edf2ee; }
.danger-button { border: 1px solid #edcbc6; background: #fff4f2; color: #9f443c; }
.full-button { width: 100%; margin-top: 8px; }
button:disabled { cursor: wait; opacity: .62; }
.inline-status { margin-top: 14px; padding: 12px 14px; border-radius: 11px; background: #e8f0ea; color: #315b54; font-size: 12px; line-height: 1.6; }
.inline-status.is-error { background: #fff0ee; color: #994b43; }
.demo-accounts { margin-top: 30px; padding-top: 22px; border-top: 1px solid var(--line); }
.demo-accounts > p { margin: 0 0 11px; color: var(--muted); font-size: 11px; }
.account-chips { display: flex; flex-wrap: wrap; gap: 7px; }
.account-chip { padding: 7px 9px; border: 1px solid #d9e1dc; border-radius: 8px; background: white; color: #53615f; font-size: 10px; }
.account-chip:hover { border-color: #71968f; color: #1d5049; }
.privacy-box { margin-top: 25px; padding: 17px; border-radius: 14px; background: #eaf0e9; }
.privacy-box strong { font-size: 12px; }
.privacy-box p { margin: 7px 0 0; color: var(--muted); font-size: 11px; line-height: 1.7; }

.app-shell { min-height: 100vh; display: grid; grid-template: 72px 1fr / 250px 1fr; }
.app-header { position: sticky; top: 0; z-index: 20; grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; padding: 0 25px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.96); backdrop-filter: blur(12px); }
.identity-button { display: flex; align-items: center; gap: 11px; min-height: 46px; padding: 7px 11px 7px 14px; border: 1px solid var(--line); border-radius: 13px; background: white; text-align: left; }
.identity-button span, .identity-button small { display: block; }
.identity-button span { font-size: 12px; font-weight: 800; }
.identity-button small { margin-top: 2px; color: var(--muted); font-size: 10px; }
.identity-button b { margin-left: 8px; color: #72817e; }
.side-nav { position: sticky; top: 72px; height: calc(100vh - 72px); display: flex; flex-direction: column; padding: 24px 16px; border-right: 1px solid var(--line); background: #edf1ec; }
.side-user { display: flex; align-items: center; gap: 11px; padding: 0 8px 23px; border-bottom: 1px solid #d5ded8; }
.side-user > span { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 12px; background: #d9e9da; color: #2c6058; font-weight: 800; }
.side-user strong, .side-user small { display: block; max-width: 155px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-user strong { font-size: 12px; }
.side-user small { margin-top: 3px; color: var(--muted); font-size: 9px; }
.side-nav nav { display: grid; gap: 5px; margin-top: 22px; }
.nav-button { display: flex; align-items: center; gap: 12px; min-height: 43px; padding: 0 13px; border: 0; border-radius: 11px; background: transparent; color: #5c6b68; text-align: left; font-size: 12px; font-weight: 700; }
.nav-button span { width: 22px; color: #81908d; font-size: 15px; text-align: center; }
.nav-button:hover { background: rgba(255,255,255,.65); }
.nav-button.is-active { background: var(--forest); color: white; }
.nav-button.is-active span { color: var(--lime); }
.side-security { display: flex; align-items: flex-start; gap: 9px; margin-top: auto; padding: 14px; border: 1px solid #d7e0da; border-radius: 12px; background: rgba(255,255,255,.55); }
.side-security > span { color: #59a05e; font-size: 8px; }
.side-security p { margin: 0; }
.side-security strong, .side-security small { display: block; }
.side-security strong { font-size: 10px; }
.side-security small { margin-top: 3px; color: var(--muted); font-size: 9px; }
.app-main { min-width: 0; padding: 34px clamp(25px, 4vw, 58px) 70px; outline: none; }
.mobile-nav { display: none; }
.context-alert { margin-bottom: 20px; padding: 13px 16px; border: 1px solid #d9e0bf; border-radius: 12px; background: #f3f7df; color: #5b652f; font-size: 12px; }

.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 28px; }
.page-heading h1 { margin: 0; font-size: clamp(27px, 3vw, 39px); letter-spacing: -.035em; }
.page-heading p { margin: 8px 0 0; color: var(--muted); font-size: 13px; }
.page-heading .heading-actions { display: flex; gap: 8px; }
.metric-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 13px; margin-bottom: 23px; }
.metric-card { min-height: 120px; padding: 20px; border: 1px solid var(--line); border-radius: 17px; background: var(--panel); }
.metric-card span { color: var(--muted); font-size: 11px; }
.metric-card strong { display: block; margin-top: 18px; font-size: 29px; letter-spacing: -.03em; }
.metric-card small { display: block; margin-top: 5px; color: #7a8986; font-size: 10px; }
.content-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(260px, .65fr); gap: 18px; }
.panel { border: 1px solid var(--line); border-radius: 18px; background: var(--panel); box-shadow: 0 7px 25px rgba(24,47,44,.04); }
.panel-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 20px; border-bottom: 1px solid #e8ece9; }
.panel-header h2 { margin: 0; font-size: 15px; }
.panel-header p { margin: 4px 0 0; color: var(--muted); font-size: 10px; }
.panel-body { padding: 20px; }
.link-button { border: 0; background: transparent; color: #376f66; font-size: 11px; font-weight: 750; }
.stack-list { display: grid; gap: 10px; }
.record-card { width: 100%; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 14px; padding: 17px; border: 1px solid #e1e6e2; border-radius: 14px; background: white; color: inherit; text-align: left; }
.record-card:hover { border-color: #96afa9; box-shadow: 0 8px 22px rgba(24,48,44,.07); }
.record-card h3 { margin: 0; font-size: 14px; }
.record-card p { margin: 7px 0 0; color: var(--muted); font-size: 11px; line-height: 1.6; }
.record-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.tag, .status-pill { display: inline-flex; align-items: center; min-height: 24px; padding: 0 9px; border-radius: 99px; font-size: 9px; font-weight: 750; }
.tag { background: #eef2ee; color: #52635f; }
.status-pill { background: #edf2ff; color: #4963a5; }
.status-pill.status-approved, .status-pill.status-published, .status-pill.status-accepted { background: #e5f3e2; color: #3f7345; }
.status-pill.status-rejected, .status-pill.status-revoked { background: #fff0ed; color: #a54e45; }
.status-pill.status-pending, .status-pill.status-submitted { background: #fff4dc; color: #956517; }
.record-arrow { align-self: center; color: #8d9a97; }
.empty-state, .error-state, .loading-state { display: grid; justify-items: center; padding: 52px 20px; text-align: center; }
.state-icon { width: 48px; height: 48px; display: grid; place-items: center; margin-bottom: 15px; border-radius: 15px; background: #edf2ed; color: #56766f; font-size: 20px; }
.empty-state h3, .error-state h3 { margin: 0; font-size: 16px; }
.empty-state p, .error-state p { max-width: 430px; margin: 8px 0 18px; color: var(--muted); font-size: 11px; line-height: 1.65; }
.loading-line { width: min(100%, 460px); height: 12px; margin: 7px 0; border-radius: 20px; background: linear-gradient(90deg,#edf0ed 25%,#e2e7e3 40%,#edf0ed 65%); background-size: 400% 100%; animation: shimmer 1.3s infinite; }
.loading-line.short { width: min(70%, 320px); }
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }
.quick-list { display: grid; gap: 9px; }
.quick-button { display: flex; align-items: center; gap: 11px; min-height: 48px; padding: 0 13px; border: 1px solid #e2e7e3; border-radius: 12px; background: #f9faf8; color: #344744; text-align: left; font-size: 11px; font-weight: 700; }
.quick-button span { width: 26px; height: 26px; display: grid; place-items: center; border-radius: 8px; background: #e3eee4; color: #417067; }
.notice { padding: 15px; border-radius: 13px; background: #eef3e7; color: #4c625c; font-size: 11px; line-height: 1.7; }
.notice strong { display: block; margin-bottom: 4px; color: #263b37; }
.notice.warning { background: #fff5df; color: #7a5b27; }
.notice.danger { background: #fff0ee; color: #934d46; }

.toolbar { display: flex; flex-wrap: wrap; gap: 9px; margin-bottom: 18px; }
.search-input { flex: 1 1 260px; }
.search-input input { background: white; }
.segmented { display: flex; padding: 4px; border-radius: 12px; background: #e9ede9; }
.segment-button { min-height: 38px; padding: 0 14px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); font-size: 11px; font-weight: 700; }
.segment-button.is-active { background: white; color: var(--forest); box-shadow: 0 3px 9px rgba(20,40,38,.07); }
.detail-layout { display: grid; grid-template-columns: minmax(0, 1fr) 290px; gap: 18px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.form-grid .span-2 { grid-column: span 2; }
.form-section { margin-bottom: 25px; }
.form-section h3 { margin: 0 0 7px; font-size: 14px; }
.form-section > p { margin: 0 0 15px; color: var(--muted); font-size: 10px; }
.project-extension { margin: 4px 0 0; padding-top: 24px; border-top: 1px solid var(--line); }
.sticky-actions { position: sticky; top: 92px; align-self: start; }
.action-stack { display: grid; gap: 9px; }
.action-stack button { width: 100%; }
.detail-list { margin: 0; }
.detail-row { display: grid; grid-template-columns: 145px 1fr; gap: 15px; padding: 14px 0; border-bottom: 1px solid #e8ece9; }
.detail-row:last-child { border-bottom: 0; }
.detail-row dt { color: var(--muted); font-size: 10px; }
.detail-row dd { margin: 0; font-size: 12px; line-height: 1.65; white-space: pre-wrap; }
.request-card { padding: 16px; border: 1px solid #e1e7e2; border-radius: 14px; background: white; }
.request-card header { display: flex; justify-content: space-between; gap: 12px; }
.request-card h3 { margin: 0; font-size: 13px; }
.request-card p { margin: 8px 0 0; color: var(--muted); font-size: 11px; line-height: 1.6; }
.card-actions { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 14px; }
.card-actions button { min-height: 34px; padding: 0 12px; font-size: 10px; }
.conversation-layout { min-height: 560px; display: grid; grid-template-columns: 300px 1fr; overflow: hidden; }
.conversation-list { border-right: 1px solid var(--line); }
.conversation-item { width: 100%; padding: 15px 17px; border: 0; border-bottom: 1px solid #edf0ed; background: white; text-align: left; }
.conversation-item:hover, .conversation-item.is-active { background: #eef3ef; }
.conversation-item strong { display: block; font-size: 11px; }
.conversation-item small { display: block; margin-top: 5px; color: var(--muted); font-size: 9px; }
.message-pane { min-width: 0; display: flex; flex-direction: column; }
.message-header { padding: 16px 19px; border-bottom: 1px solid var(--line); }
.message-header strong { font-size: 12px; }
.messages { flex: 1; max-height: 430px; overflow: auto; display: flex; flex-direction: column; gap: 10px; padding: 20px; background: #f8faf7; }
.message { max-width: 76%; padding: 10px 12px; border-radius: 13px 13px 13px 3px; background: white; box-shadow: 0 3px 10px rgba(20,40,38,.05); font-size: 11px; line-height: 1.65; }
.message.mine { align-self: flex-end; border-radius: 13px 13px 3px 13px; background: #dff0d9; }
.message small { display: block; margin-top: 5px; color: #81908d; font-size: 8px; }
.message.is-retracted { color: #73807d; font-style: italic; }
.message-meta { display: flex !important; align-items: center; justify-content: flex-end; gap: 8px; }
.message-recall { border: 0; padding: 0; background: transparent; color: #2f6258; font: inherit; cursor: pointer; }
.message-recall:hover { text-decoration: underline; }
.message-form { display: flex; gap: 9px; padding: 14px; border-top: 1px solid var(--line); }
.message-form input { flex: 1; }
.profile-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.profile-card { padding: 20px; border: 1px solid var(--line); border-radius: 16px; background: white; }
.profile-card h2 { margin: 0 0 16px; font-size: 15px; }
.profile-card dl { margin: 0; }
.profile-card .detail-row { grid-template-columns: 100px 1fr; }
.context-profile-summary { margin-bottom: 18px; overflow: hidden; }
.profile-summary-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; padding: 22px 22px 18px; background: linear-gradient(130deg, #f8fbf7, #edf5ed); }
.profile-summary-head .section-kicker { margin-bottom: 8px; }
.profile-summary-head h2 { margin: 0; font-size: 22px; letter-spacing: -.025em; }
.profile-summary-head h2 + p { margin: 7px 0 0; color: var(--muted); font-size: 11px; line-height: 1.6; }
.profile-badges { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.profile-preview-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 1px solid var(--line); }
.profile-preview-field { min-width: 0; padding: 17px 20px; border-right: 1px solid #e8ece9; border-bottom: 1px solid #e8ece9; }
.profile-preview-field:nth-child(3n) { border-right: 0; }
.profile-preview-field > span { display: flex; align-items: center; gap: 6px; margin-bottom: 7px; color: var(--muted); font-size: 9px; }
.profile-preview-field > span b { padding: 2px 5px; border-radius: 5px; background: #fff0df; color: #8e5d12; font-size: 8px; }
.profile-preview-value { min-width: 0; color: #2b403c; font-size: 11px; font-weight: 700; line-height: 1.6; overflow-wrap: anywhere; }
.profile-preview-field.is-sensitive { background: #fffdfa; }
.profile-empty-copy { grid-column: 1 / -1; margin: 0; padding: 22px; color: var(--muted); font-size: 11px; }
.profile-summary-action { display: flex; justify-content: flex-end; padding: 10px 17px 13px; }
.profile-lock { margin: 0 0 18px; }
.profile-sensitive-notice { margin: 0 0 18px; }
.profile-sections { display: grid; gap: 18px; }
.profile-security-note { margin-top: 18px; }
.profile-field-list { margin: 0; }
.profile-field { display: grid; grid-template-columns: minmax(120px, 190px) minmax(0, 1fr); gap: 18px; padding: 15px 0; border-bottom: 1px solid #e8ece9; }
.profile-field:last-child { border-bottom: 0; }
.profile-field > dt { display: flex; align-items: flex-start; flex-wrap: wrap; gap: 6px; color: var(--muted); font-size: 10px; line-height: 1.55; }
.profile-field > dd { min-width: 0; margin: 0; color: #263a36; font-size: 12px; line-height: 1.7; white-space: pre-wrap; overflow-wrap: anywhere; }
.profile-field.is-sensitive { margin: 0 -10px; padding-right: 10px; padding-left: 10px; border-radius: 10px; background: #fffdfa; }
.sensitive-badge { display: inline-flex; padding: 2px 6px; border-radius: 6px; background: #fff0df; color: #8e5d12; font-size: 8px; font-weight: 750; white-space: nowrap; }
.empty-value { color: #9aa5a2; }
.value-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.value-chips i { padding: 3px 8px; border-radius: 99px; background: #eef3ef; color: #405b55; font-size: 10px; font-style: normal; font-weight: 600; }
.profile-value-list { display: grid; gap: 7px; margin: 0; padding-left: 18px; }
.profile-object { display: grid; gap: 7px; margin: 0; }
.profile-object > div { display: grid; grid-template-columns: minmax(80px, .38fr) minmax(0, 1fr); gap: 10px; padding: 7px 9px; border-radius: 8px; background: #f5f7f4; }
.profile-object dt { color: var(--muted); font-size: 9px; }
.profile-object dd { min-width: 0; margin: 0; }

.sheet-dialog { width: min(92vw, 520px); padding: 0; border: 0; border-radius: 22px; background: transparent; }
.sheet-dialog::backdrop { background: rgba(13,32,30,.55); backdrop-filter: blur(3px); }
.dialog-card { margin: 0; padding: 25px; border-radius: 20px; background: white; box-shadow: 0 30px 80px rgba(0,0,0,.24); }
.dialog-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.dialog-card > p { color: var(--muted); font-size: 11px; line-height: 1.7; }
.icon-button { width: 34px; height: 34px; border: 0; border-radius: 10px; background: #edf1ed; color: #5d6d69; font-size: 20px; }
.context-options { display: grid; gap: 8px; margin-top: 20px; }
.context-option { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 58px; padding: 10px 13px; border: 1px solid var(--line); border-radius: 12px; background: white; text-align: left; }
.context-option:hover { border-color: #75978f; }
.context-option.is-current { border-color: #6f948c; background: #eef5ef; }
.context-option strong, .context-option small { display: block; }
.context-option strong { font-size: 12px; }
.context-option small { margin-top: 4px; color: var(--muted); font-size: 9px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 22px; }
.toast-region { position: fixed; right: 20px; bottom: 20px; z-index: 100; display: grid; gap: 8px; }
.toast { width: min(360px, calc(100vw - 32px)); padding: 13px 15px; border-radius: 12px; background: var(--forest); color: white; box-shadow: 0 15px 35px rgba(0,0,0,.2); font-size: 11px; line-height: 1.6; }
.toast.is-error { background: #853f3a; }

@media (max-width: 900px) {
  .login-screen { grid-template-columns: 1fr; }
  .login-intro { min-height: 420px; padding: 30px 28px; }
  .login-principles { display: none; }
  .login-card { padding-top: 34px; padding-bottom: 70px; }
  .app-shell { display: block; padding-bottom: calc(68px + env(safe-area-inset-bottom)); }
  .app-header { height: 64px; padding: 0 16px; }
  .app-header .brand small { display: none; }
  .side-nav { display: none; }
  .app-main { padding: 24px 16px 40px; }
  .mobile-nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: grid; min-height: calc(62px + env(safe-area-inset-bottom)); padding: 5px 5px env(safe-area-inset-bottom); border-top: 1px solid var(--line); background: rgba(255,255,255,.97); backdrop-filter: blur(14px); }
  .mobile-nav .nav-button { min-width: 0; min-height: 52px; display: grid; place-items: center; align-content: center; gap: 2px; padding: 0 2px; border-radius: 10px; font-size: 9px; text-align: center; }
  .mobile-nav .nav-button span { font-size: 15px; }
  .mobile-nav .nav-button.is-active { background: #e9f1e9; color: var(--forest); }
  .mobile-nav .nav-button.is-active span { color: #397268; }
  .metric-grid { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .metric-card { min-height: 101px; padding: 14px; }
  .metric-card strong { margin-top: 14px; font-size: 22px; }
  .content-grid, .detail-layout { grid-template-columns: 1fr; }
  .profile-preview-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .profile-preview-field:nth-child(3n) { border-right: 1px solid #e8ece9; }
  .profile-preview-field:nth-child(2n) { border-right: 0; }
  .sticky-actions { position: static; }
}

@media (max-width: 600px) {
  .identity-button { max-width: 180px; }
  .identity-button span, .identity-button small { max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .page-heading { align-items: flex-start; }
  .page-heading .heading-actions { flex-direction: column; }
  .page-heading h1 { font-size: 27px; }
  .metric-grid { grid-template-columns: 1fr; }
  .metric-card { min-height: 86px; display: grid; grid-template-columns: 1fr auto; align-items: center; }
  .metric-card strong { grid-column: 2; grid-row: 1 / 3; margin: 0; }
  .metric-card small { grid-column: 1; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .span-2 { grid-column: 1; }
  .detail-row { grid-template-columns: 1fr; gap: 4px; }
  .conversation-layout { grid-template-columns: 1fr; }
  .conversation-list { border-right: 0; }
  .message-pane.is-hidden-mobile { display: none; }
  .profile-grid { grid-template-columns: 1fr; }
  .profile-summary-head { display: grid; }
  .profile-badges { justify-content: flex-start; }
  .profile-preview-grid { grid-template-columns: 1fr; }
  .profile-preview-field, .profile-preview-field:nth-child(2n), .profile-preview-field:nth-child(3n) { border-right: 0; }
  .profile-field { grid-template-columns: 1fr; gap: 6px; }
  .profile-object > div { grid-template-columns: 1fr; gap: 3px; }
  .toast-region { right: 16px; bottom: 82px; }
}

@media (prefers-reduced-motion: reduce) { .loading-line { animation: none; } }
