:root {
  color-scheme: light;
  --bg: #f8f9fb;
  --surface: #ffffff;
  --surface-soft: #f4f5f7;
  --text: #111827;
  --muted: #6b7280;
  --faint: #9ca3af;
  --line: #e5e7eb;
  --line-strong: #d1d5db;
  --primary: #111827;
  --accent: #53657f;
  --accent-soft: #eef3f8;
  --radius: 9px;
  --sidebar: 260px;
  --bottom-nav: 64px;
  --shadow: 0 1px 2px rgba(17, 24, 39, 0.04);
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-height: 100%;
  margin: 0;
  overflow-x: hidden;
}

body {
  background: var(--bg);
  color: var(--text);
  font: 14px/1.58 -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  letter-spacing: 0;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

button svg,
a svg,
.nav-icon svg,
.mobile-bottom-nav svg {
  display: block;
  max-width: 24px;
  max-height: 24px;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-layout {
  display: grid;
  grid-template-columns: var(--sidebar) minmax(0, 1fr);
  height: 100dvh;
  min-height: 100dvh;
  overflow: hidden;
}

.side-nav {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
  width: var(--sidebar);
  height: 100dvh;
  overflow-y: auto;
  overscroll-behavior: contain;
  border-right: 1px solid var(--line);
  padding: 18px 16px;
  background: #f6f7f9;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: #111827;
  color: #fff;
  font-weight: 750;
}

.brand strong,
.brand small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand strong {
  font-size: 14px;
  line-height: 1.28;
}

.brand small {
  color: var(--muted);
  font-size: 12px;
}

.side-brand {
  margin: 0 44px 18px 0;
}

.side-toggle,
.sidebar-reopen {
  position: absolute;
  top: 20px;
  right: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: #4b5563;
  box-shadow: none;
}

.sidebar-reopen {
  display: none;
}

body.nav-collapsed .app-layout {
  grid-template-columns: minmax(0, 1fr);
}

body.nav-collapsed .side-nav {
  display: none;
}

body.nav-collapsed .sidebar-reopen {
  position: fixed;
  top: 18px;
  left: 18px;
  z-index: 60;
  display: inline-flex;
}

body.nav-collapsed .lawyer-composer-card,
body.nav-collapsed .chat-composer,
body.nav-collapsed .chat-input-wrap {
  left: 0;
}

.new-chat,
.side-links a,
.side-settings-links .settings-entry {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 42px;
  border: 0;
  border-radius: 10px;
  padding: 0 12px;
  background: transparent;
  color: #1f2937;
  font-size: 14px;
  font-weight: 620;
  text-align: left;
}

.new-chat {
  margin: 0 0 8px;
}

.side-links,
.side-settings-links {
  display: grid;
  gap: 8px;
}

.nav-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 20px;
  width: 20px;
  height: 20px;
  color: #374151;
  font-size: 0;
}

.nav-icon svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.new-chat:hover,
.side-links a:hover,
.side-links .active,
.side-settings-links .settings-entry:hover,
.side-settings-links .settings-entry.active {
  background: #ebedf0;
}

.side-history {
  margin-top: 18px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.side-history p {
  margin: 0 0 8px;
  padding: 0 12px;
  color: #8b929e;
  font-size: 12px;
  font-weight: 650;
}

.history-empty {
  padding: 8px 12px;
  color: var(--faint);
  font-size: 12px;
}

.history-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 26px;
  align-items: center;
  gap: 4px;
  margin: 3px 6px;
  border-radius: 8px;
}

.history-open {
  display: grid;
  gap: 2px;
  min-width: 0;
  min-height: 38px;
  border: 0;
  border-radius: 8px;
  padding: 6px 8px;
  background: transparent;
  color: #334155;
  text-align: left;
}

.history-open:hover {
  background: #f2f4f7;
}

.history-open span {
  color: #8b929e;
  font-size: 11px;
}

.history-open strong {
  overflow: hidden;
  color: #334155;
  font-size: 12px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-actions {
  display: flex;
  justify-content: center;
}

.history-delete {
  width: 24px;
  height: 24px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #9aa3af;
  font-size: 16px;
  line-height: 1;
}

.history-delete:hover {
  background: #f2f4f7;
  color: #475569;
}

.side-footer {
  position: relative;
  min-height: 54px;
  margin-top: auto;
}

.settings-entry {
  border: 0;
}

.settings-popover {
  position: absolute;
  right: 0;
  bottom: 48px;
  left: 0;
  z-index: 40;
  border: 1px solid #d7dde5;
  border-radius: 14px;
  padding: 10px 12px;
  background: #fff;
  color: #111827;
  box-shadow: 0 18px 46px rgba(15, 23, 42, 0.16);
}

.settings-popover[hidden] {
  display: none;
}

.settings-popover-user {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  min-height: 42px;
  color: #8b929e;
}

.settings-popover-user strong,
.settings-popover-user small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.settings-popover-user strong {
  color: #8b929e;
  font-size: 14px;
  font-weight: 600;
}

.settings-popover-user small {
  color: #a3aab4;
  font-size: 11px;
}

.settings-popover-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  color: #9aa3af;
}

.settings-popover-row {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  width: 100%;
  min-height: 46px;
  border: 0;
  border-top: 1px solid #edf1f5;
  padding: 0;
  background: transparent;
  color: #111827;
  font-size: 16px;
  font-weight: 760;
  text-align: left;
}

.settings-popover-row.muted {
  color: #8b929e;
  font-weight: 650;
}

.settings-popover-row.danger {
  color: #1f2937;
}

.settings-popover-row b {
  color: #a3aab4;
  font-size: 24px;
  font-weight: 400;
}

.settings-popover-row:hover {
  color: #111827;
}

.chat-workspace,
.lawyer-detail,
.article-center {
  min-width: 0;
  height: 100dvh;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.chat-panel {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
  background: #fff;
}

.chat-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 68px;
  border-bottom: 1px solid var(--line);
  padding: 0 28px;
}

.assistant-id {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.assistant-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 32px;
  width: 32px;
  height: 32px;
  border-radius: var(--radius);
  background: var(--primary);
  color: #fff;
  font-size: 12px;
  font-weight: 750;
}

.assistant-id strong,
.assistant-id small {
  display: block;
}

.assistant-id strong {
  font-size: 15px;
  line-height: 1.25;
}

.assistant-id small {
  color: var(--muted);
  font-size: 12px;
}

.status-dot {
  color: #6b7280;
  font-size: 12px;
}

.chat-body {
  flex: 1;
  width: min(760px, calc(100% - 48px));
  margin: 0 auto;
  padding: clamp(76px, 15vh, 132px) 0 28px;
}

.welcome-block {
  margin-bottom: 62px;
}

.welcome-block h1 {
  margin: 0;
  font-size: clamp(23px, 2vw, 28px);
  font-weight: 680;
  line-height: 1.35;
}

.suggested-prompts {
  display: grid;
  gap: 7px;
}

.suggested-prompts button {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 36px;
  border: 1px solid #e1e5ea;
  border-radius: var(--radius);
  padding: 8px 10px;
  background: #fff;
  color: #4b5563;
  font-size: 13px;
  text-align: left;
  box-shadow: none;
}

.suggested-prompts button:hover {
  border-color: #cfd5dd;
  background: #fafafa;
}

.suggested-prompts span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 24px;
  width: 24px;
  height: 24px;
  border-radius: 7px;
  background: #f3f4f6;
  color: #6b7280;
  font-weight: 750;
}

.suggested-prompts b {
  margin-left: auto;
  color: var(--muted);
  font-weight: 650;
}

.prompt-answer-thread {
  display: grid;
  gap: 12px;
  width: 100%;
  margin: 16px 0;
}

.prompt-answer {
  width: fit-content;
  max-width: min(720px, 100%);
  border-radius: var(--radius);
  padding: 12px 14px;
}

.prompt-answer.user {
  justify-self: end;
  background: var(--primary);
  color: #fff;
}

.prompt-answer.ai {
  justify-self: start;
  width: min(720px, 100%);
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
}

.prompt-answer strong {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  line-height: 1.4;
}

.prompt-answer p {
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.prompt-answer.is-loading p {
  color: var(--muted);
}

.agent-legal-disclaimer {
  width: min(720px, 100%);
  margin: -4px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.process-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: min(720px, 100%);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  background: #fff;
}

.process-card strong {
  display: block;
  margin-bottom: 4px;
  font-size: 13px;
}

.process-card p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.agent-recommend-card {
  display: grid;
}

.agent-recommend-list {
  display: grid;
  gap: 8px;
  width: 100%;
}

.agent-recommend-item {
  display: grid;
  gap: 2px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px;
  background: #f9fafb;
}

.agent-recommend-item strong {
  margin: 0;
}

.agent-recommend-item span,
.agent-recommend-item small {
  color: var(--muted);
  font-size: 12px;
}

.agent-summary-preview {
  align-items: flex-start;
}

.summary-preview-actions {
  display: grid;
  gap: 8px;
  flex: 0 0 148px;
}

.summary-preview-actions .primary-small,
.summary-preview-actions .ghost-button {
  width: 100%;
}

.handoff-reasons {
  margin-top: 6px !important;
}

.composer-wrap,
.lawyer-composer-card {
  width: min(760px, calc(100% - 48px));
  margin: 0 auto;
  padding: 10px 0 16px;
  background: #fff;
}

.composer-wrap {
  position: sticky;
  bottom: 0;
}

.chat-input {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 70px;
  border: 1px solid #cfd5dd;
  border-radius: 10px;
  padding: 10px;
  background: #fff;
  box-shadow: none;
}

.chat-input:focus-within {
  border-color: #aeb6c2;
}

.chat-input input {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 48px;
  border: 0;
  border-radius: var(--radius);
  padding: 0 12px;
  color: var(--text);
  outline: none;
}

.chat-input input::placeholder {
  color: #9aa2af;
}

.tool-button,
.send-button,
.ghost-button,
.primary-small {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: var(--radius);
  white-space: nowrap;
}

.tool-button {
  flex: 0 0 44px;
  width: 44px;
  height: 48px;
  background: transparent;
  color: #6b7280;
}

.send-button {
  flex: 0 0 44px;
  width: 44px;
  height: 48px;
  padding: 0;
  background: transparent;
  color: #9aa2af;
}

.tool-button svg,
.send-button svg {
  width: 23px;
  height: 23px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.tool-button:hover,
.ghost-button:hover,
.send-button:hover {
  background: #e8eaee;
  color: #374151;
}

.primary-small:hover {
  background: #0b1220;
}

.home-page:not(.has-chat) .chat-topbar {
  display: none;
}

.home-page:not(.has-chat) .chat-panel {
  position: relative;
  display: block;
  min-height: 100dvh;
}

.home-page:not(.has-chat) .chat-body {
  position: absolute;
  top: calc(50% - 150px);
  left: 50%;
  width: min(640px, calc(100% - 48px));
  padding: 0;
  transform: translateX(-50%);
}

.home-page:not(.has-chat) .welcome-block {
  margin: 0 0 24px;
  text-align: center;
}

.home-page:not(.has-chat) .welcome-block h1 {
  font-size: clamp(28px, 3vw, 38px);
  font-weight: 760;
  letter-spacing: 0;
}

.home-page:not(.has-chat) .composer-wrap {
  position: absolute;
  top: 50%;
  right: auto;
  bottom: auto;
  left: 50%;
  width: min(640px, calc(100% - 48px));
  padding: 0;
  transform: translate(-50%, -50%);
}

.home-page:not(.has-chat) .chat-input {
  min-height: 96px;
  align-items: flex-end;
  padding: 12px;
}

.home-page:not(.has-chat) .chat-input input {
  align-self: stretch;
  min-height: 68px;
  padding: 0 8px 26px;
}

.home-page:not(.has-chat) .suggested-prompts {
  position: absolute;
  top: 258px;
  left: 0;
  width: 100%;
  margin: 0;
}

.home-page:not(.has-chat) .notice {
  width: min(640px, calc(100% - 48px));
  margin: 14px auto 0;
  text-align: left;
}

.primary-small {
  min-height: 44px;
  padding: 0 16px;
  background: var(--primary);
  color: #fff;
  font-weight: 700;
}

.ghost-button {
  min-height: 34px;
  padding: 0 12px;
  background: #f3f4f6;
  color: #1f2937;
  font-weight: 650;
}

.notice,
.ai-boundary-note {
  margin: 8px 2px 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.mobile-header,
.mobile-bottom-nav {
  display: none;
}

.lawyer-detail {
  position: relative;
  min-height: 100dvh;
  padding: 28px 24px 0;
  background: #fff;
}

.lawyer-chat-thread {
  width: min(760px, 100%);
  margin: 0 auto;
  padding-bottom: 168px;
}

.profile-message-bubble,
.ai-suggestion-card {
  width: 100%;
  border: 1px solid #e1e5ea;
  border-radius: var(--radius);
  padding: 12px;
  background: #fff;
  box-shadow: var(--shadow);
}

.ai-suggestion-card {
  margin-top: 14px;
}

.lawyer-mini-card {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  gap: 11px;
  align-items: center;
}

.profile-photo {
  position: relative;
}

.profile-photo.compact {
  width: 48px;
  height: 58px;
}

.profile-photo img {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: var(--radius);
  object-fit: cover;
}

.profile-photo span {
  position: absolute;
  top: -5px;
  right: -4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border: 2px solid #fff;
  border-radius: 999px;
  background: #7a4f67;
  color: #fff;
  font-size: 9px;
  font-weight: 800;
}

.lawyer-mini-card-main {
  min-width: 0;
}

.lawyer-mini-card-main .eyebrow {
  margin: 0 0 3px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 650;
}

.lawyer-mini-card-main h1 {
  margin: 0 0 5px;
  color: var(--text);
  font-size: 16px;
  line-height: 1.2;
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 5px;
}

.meta-row span {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 6px;
  background: #f8f9fb;
  color: var(--muted);
  font-size: 11px;
}

.lawyer-mini-card-main small {
  display: block;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lawyer-mini-card-actions {
  display: grid;
  grid-template-columns: repeat(2, auto);
  gap: 6px;
}

.lawyer-mini-card-actions button {
  display: none;
}

.lawyer-message {
  margin-bottom: 12px;
}

.lawyer-message p {
  margin: 0 0 8px;
  color: var(--text);
  font-size: 14px;
  line-height: 1.7;
}

.lawyer-message p:last-child {
  margin-bottom: 0;
}

.lawyer-prompts {
  display: grid;
  gap: 8px;
}

.lawyer-composer-card {
  position: fixed;
  right: 0;
  bottom: 0;
  left: var(--sidebar);
}

.lawyer-composer-card .ai-boundary-note {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lawyer-page,
.lawyer-profile-page,
.account-workspace {
  min-width: 0;
  height: 100dvh;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 28px 24px 72px;
  background: #fff;
}

.account-page .account-workspace {
  padding: 42px 48px 64px;
  background: #f7f8fa;
}

.lawyer-list-head,
.lawyer-cards,
.profile-page-head,
.profile-full-layout,
.account-shell {
  width: min(980px, 100%);
  margin-right: auto;
  margin-left: auto;
}

.lawyer-list-head,
.profile-page-head,
.profile-intro-sheet,
.profile-linked-actions article,
.lawyer-ai-card,
.account-shell {
  border: 1px solid #dfe5ec;
  border-radius: var(--radius);
  background: #fff;
}

.lawyer-list-head,
.profile-page-head,
.account-shell {
  display: grid;
  gap: 12px;
  margin-bottom: 14px;
  padding: 18px;
}

.account-page .account-shell {
  width: min(1120px, 100%);
  border: 0;
  background: transparent;
  padding: 0;
  gap: 18px;
}

.account-page [data-account-dashboard] {
  display: grid;
  gap: 16px;
}

.lawyer-list-head .eyebrow,
.profile-page-head .eyebrow {
  margin: 0;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
}

.lawyer-list-head h1,
.profile-page-head h1,
.account-title h1 {
  margin: 0;
  font-size: 22px;
  line-height: 1.35;
}

.account-title {
  display: grid;
  gap: 6px;
}

.account-title p {
  margin: 0;
  color: #7b8492;
  font-size: 13px;
  font-weight: 650;
}

.lawyer-search {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  border: 1px solid #dbe2ea;
  border-radius: 10px;
  padding: 0 14px;
  background: #fbfcfe;
}

.lawyer-search span {
  color: var(--accent);
}

.lawyer-search input {
  flex: 1 1 auto;
  min-width: 0;
  border: 0;
  background: transparent;
  color: #7b8492;
  outline: 0;
}

.field-filter,
.tag-row,
.lawyer-mini-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.field-filter button,
.tag-row span,
.lawyer-mini-meta span,
.lawyer-card-status,
.agent-status-pill {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  max-width: 100%;
  min-height: 24px;
  border: 1px solid #dfe5ec;
  border-radius: 6px;
  padding: 2px 8px;
  background: var(--accent-soft);
  color: #64748b;
  font-size: 12px;
}

.lawyer-card-status {
  justify-self: start;
}

.field-filter button {
  min-height: 30px;
  background: #fff;
}

.field-filter .active {
  border-color: #cdd8e6;
  background: var(--accent-soft);
  color: #334155;
}

.lawyer-cards {
  display: grid;
  gap: 14px;
}

.lawyer-ai-card {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 16px;
  padding: 18px;
  transition: border-color 0.16s ease, background-color 0.16s ease;
}

.lawyer-ai-card:hover {
  border-color: #ccd5e1;
  background: #fbfcfe;
}

.lawyer-avatar,
.single-profile-head .profile-photo {
  position: relative;
}

.lawyer-avatar img,
.single-profile-head .profile-photo img {
  display: block;
  width: 72px;
  height: 86px;
  border-radius: var(--radius);
  object-fit: cover;
}

.lawyer-avatar span,
.single-profile-head .profile-photo span {
  position: absolute;
  top: -5px;
  right: -4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border: 2px solid #fff;
  border-radius: 999px;
  background: #7a4f67;
  color: #fff;
  font-size: 9px;
  font-weight: 800;
}

.lawyer-card-main,
.profile-tab-content,
.profile-main-copy {
  min-width: 0;
}

.lawyer-card-main {
  display: grid;
  align-content: start;
  gap: 8px;
}

.lawyer-card-title,
.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.lawyer-card-title h2,
.profile-copy-section h2,
.profile-tab-content h2,
.section-title h2 {
  margin: 0;
  font-size: 17px;
  line-height: 1.35;
}

.lawyer-card-title b,
.section-title a,
.profile-tab-content a,
.back-link {
  color: #334155;
  font-size: 13px;
  font-weight: 700;
}

.lawyer-card-main p,
.profile-copy-section p,
.profile-tab-content p,
.account-title span {
  margin: 0;
  color: var(--muted);
}

.single-profile-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: start;
}

.single-profile-head .eyebrow {
  margin: 0 0 4px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
}

.single-profile-head h1 {
  margin: 0 0 8px;
  font-size: 20px;
  line-height: 1.25;
}

.profile-tab-card,
.digital-card-strip,
.human-consult-cta,
.consult-status-board,
.session-note,
.human-message-list,
.human-composer,
.account-settings-overview {
  border: 1px solid #dfe5ec;
  border-radius: var(--radius);
  padding: 14px;
  background: #fff;
}

.profile-tab-nav {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
}

.profile-tab-nav button {
  min-height: 30px;
  border: 1px solid #dfe5ec;
  border-radius: 6px;
  padding: 0 10px;
  background: #fff;
  color: var(--muted);
}

.profile-tab-nav .active {
  background: var(--accent-soft);
  color: #334155;
}

.digital-card-strip {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
}

.fake-qr {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  background: linear-gradient(135deg, #e2e8f0 25%, transparent 25%) 0 0 / 12px 12px, #f8fafc;
}

.card-actions {
  display: flex;
  gap: 8px;
}

.profile-page-title {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
}

.profile-page-title img {
  width: 72px;
  height: 88px;
  border-radius: var(--radius);
  object-fit: cover;
}

.profile-full-layout {
  display: grid;
  gap: 12px;
}

.profile-intro-sheet,
.profile-linked-actions article {
  padding: 16px;
}

.profile-copy-section + .profile-copy-section {
  margin-top: 18px;
}

.profile-linked-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.title-list {
  display: grid;
  gap: 8px;
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
}

.title-list a {
  color: #334155;
}

.account-settings-overview {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.settings-workbench {
  min-width: 0;
  height: 100dvh;
  overflow-y: auto;
  background: #f7f8fa;
}

.settings-board {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 40px;
  width: min(1180px, calc(100% - 56px));
  margin: 0 auto;
  padding: 48px 0 64px;
}

.settings-panel-nav {
  position: sticky;
  top: 48px;
  align-self: start;
}

.settings-panel-nav h1 {
  margin: 0 0 42px;
  color: #111827;
  font-size: 28px;
  line-height: 1.25;
}

.settings-panel-nav nav {
  display: grid;
  gap: 12px;
}

.settings-panel-nav a {
  display: flex;
  align-items: center;
  min-height: 44px;
  border-radius: 8px;
  padding: 0 14px;
  color: #6b7280;
  font-size: 16px;
  font-weight: 700;
}

.settings-panel-nav a.active,
.settings-panel-nav a:hover {
  background: #f1f3f6;
  color: #111827;
  box-shadow: inset 3px 0 0 #111827;
}

.settings-detail-card {
  border: 1px solid #dfe5ec;
  border-radius: 10px;
  padding: 44px 48px;
  background: #fff;
  color: #111827;
}

.settings-detail-section {
  scroll-margin-top: 32px;
}

.settings-detail-section + .settings-detail-section {
  margin-top: 48px;
  border-top: 1px solid #edf1f5;
  padding-top: 42px;
}

.settings-detail-section h2 {
  margin: 0 0 22px;
  font-size: 24px;
  line-height: 1.35;
}

.settings-detail-section h3 {
  margin: 28px 0 12px;
  font-size: 18px;
  line-height: 1.35;
}

.settings-detail-section p,
.settings-detail-section li {
  color: #374151;
  font-size: 16px;
  line-height: 1.8;
}

.settings-detail-section ul {
  display: grid;
  gap: 8px;
  margin: 14px 0 0;
  padding-left: 22px;
}

.settings-effective {
  color: #111827 !important;
  font-weight: 700;
}

.settings-quick-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 18px 0 24px;
}

.settings-quick-actions a,
.settings-quick-actions button {
  display: grid;
  gap: 6px;
  min-height: 92px;
  border: 1px solid #dfe5ec;
  border-radius: 8px;
  padding: 14px;
  background: #fbfcfe;
  color: #111827;
  text-align: left;
}

.settings-quick-actions strong {
  font-size: 15px;
}

.settings-quick-actions span {
  color: #6b7280;
  font-size: 13px;
}

.settings-auth-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
  margin: 0 0 24px;
}

.settings-auth-form label {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.settings-auth-form span {
  color: #6b7280;
  font-size: 12px;
  font-weight: 700;
}

.settings-auth-form input {
  width: 100%;
  min-height: 42px;
  border: 1px solid #dfe5ec;
  border-radius: 8px;
  padding: 0 12px;
  background: #fff;
  color: #111827;
}

.settings-auth-form button {
  min-height: 42px;
  border: 0;
  border-radius: 8px;
  padding: 0 18px;
  background: #111827;
  color: #fff;
  font-weight: 700;
}

.settings-auth-form button:disabled {
  opacity: 0.55;
  cursor: default;
}

.settings-auth-card {
  display: grid;
  gap: 8px;
  margin: 0 0 24px;
  border: 1px solid #dfe5ec;
  border-radius: 8px;
  padding: 16px;
  background: #fbfcfe;
}

.settings-auth-card strong,
.settings-auth-card span {
  display: block;
}

.settings-auth-card span {
  color: #6b7280;
  font-size: 13px;
}

.settings-auth-card a {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  border-radius: 8px;
  padding: 0 14px;
  background: #111827;
  color: #fff;
  font-weight: 700;
}

.login-page {
  min-height: 100vh;
  background:
    linear-gradient(120deg, rgba(17, 24, 39, 0.06), rgba(37, 99, 235, 0.05)),
    #f7f9fc;
  color: #111827;
}

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px 18px;
}

.login-panel {
  width: min(100%, 440px);
  border: 1px solid #dfe5ec;
  border-radius: 8px;
  padding: 28px;
  background: #fff;
  box-shadow: 0 18px 50px rgba(15, 23, 42, 0.08);
}

.login-brand {
  margin-bottom: 28px;
}

.login-heading {
  display: grid;
  gap: 8px;
  margin-bottom: 22px;
}

.login-heading p,
.login-heading h1 {
  margin: 0;
}

.login-heading p {
  color: #2563eb;
  font-size: 13px;
  font-weight: 800;
}

.login-heading h1 {
  font-size: 28px;
  line-height: 1.2;
  letter-spacing: 0;
}

.login-auth-form {
  grid-template-columns: 1fr;
  margin-bottom: 18px;
}

.login-auth-form button {
  width: 100%;
}

.login-help-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: -4px;
  color: #6b7280;
  font-size: 13px;
  line-height: 1.5;
}

.login-help-row a {
  color: #2563eb;
  font-weight: 700;
}

.login-help-row span {
  text-align: right;
}

.login-actions {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
  font-weight: 700;
}

.login-actions a {
  color: #4b5563;
}

.settings-inline-action {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  margin-top: 16px;
  color: #2563eb;
  font-weight: 700;
}

.article-center {
  min-height: 100dvh;
  padding: 42px 48px 56px;
  background: #f7f8fa;
}

.article-head,
.filter-panel,
.article-results {
  width: min(1120px, 100%);
  margin-right: auto;
  margin-left: auto;
}

.article-card {
  border: 1px solid #dfe5ec;
  border-radius: var(--radius);
  background: #fff;
  box-shadow: none;
}

.article-head {
  display: grid;
  gap: 18px;
  margin-bottom: 18px;
  padding: 0;
}

.article-head .eyebrow {
  margin: 0;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
}

.article-head h1 {
  margin: 0;
  font-size: 24px;
  line-height: 1.3;
}

.article-head p {
  max-width: 760px;
  margin: 0;
  color: var(--muted);
}

.article-search {
  position: relative;
  border: 1px solid #dbe2ea;
  border-radius: 8px;
  background: #fff;
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

.article-search:focus-within {
  border-color: #111827;
  box-shadow: 0 0 0 3px rgba(17, 24, 39, 0.06);
}

.article-search span {
  position: absolute;
  top: 50%;
  left: 16px;
  width: 18px;
  height: 18px;
  color: transparent;
  font-size: 0;
  transform: translateY(-50%);
  pointer-events: none;
}

.article-search span::before {
  content: "";
  position: absolute;
  top: 1px;
  left: 1px;
  width: 11px;
  height: 11px;
  border: 1.8px solid #9ca3af;
  border-radius: 50%;
}

.article-search span::after {
  content: "";
  position: absolute;
  top: 13px;
  left: 12px;
  width: 7px;
  height: 1.8px;
  border-radius: 999px;
  background: #9ca3af;
  transform: rotate(45deg);
}

.article-search input {
  width: 100%;
  height: 46px;
  min-width: 0;
  border: 0;
  padding: 0 16px 0 46px;
  background: transparent;
  color: #111827;
  font-size: 14px;
  outline: 0;
}

.article-search input::placeholder {
  color: #9ca3af;
}

.filter-panel {
  display: block;
  margin-bottom: 26px;
  padding: 0;
}

.filter-toolbar {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 10px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  padding-bottom: 2px;
  scrollbar-width: thin;
}

.filter-select {
  position: relative;
  display: inline-grid;
  grid-template-columns: auto minmax(98px, 1fr);
  align-items: center;
  flex: 0 0 auto;
  min-height: 38px;
  border: 1px solid #dfe5ec;
  border-radius: 8px;
  background: #fff;
  color: #111827;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.02);
  overflow: hidden;
}

.filter-select.wide {
  grid-template-columns: auto minmax(126px, 1fr);
}

.filter-select span {
  display: inline-flex;
  align-items: center;
  height: 100%;
  border-right: 1px solid #edf1f5;
  padding: 0 10px;
  color: #8b95a5;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.filter-select select {
  min-width: 0;
  height: 36px;
  border: 0;
  padding: 0 30px 0 10px;
  background: transparent;
  color: #334155;
  font-size: 13px;
  font-weight: 650;
  outline: 0;
  appearance: none;
}

.filter-select::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 11px;
  width: 7px;
  height: 7px;
  border-right: 1.5px solid #94a3b8;
  border-bottom: 1.5px solid #94a3b8;
  transform: translateY(-65%) rotate(45deg);
  pointer-events: none;
}

.filter-select:focus-within {
  border-color: #111827;
  box-shadow: 0 0 0 3px rgba(17, 24, 39, 0.06);
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  min-width: 0;
}

.filter-group.wide {
  flex: 0 0 auto;
}

.filter-group > span {
  flex: 0 0 auto;
  color: #9ca3af;
  font-size: 12px;
  font-weight: 700;
}

.filter-row {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
}

.filter-row.single {
  display: block;
}

.filter-row strong {
  padding-top: 6px;
  font-size: 13px;
}

.filter-pills {
  display: flex;
  flex-wrap: nowrap;
  gap: 7px;
  min-width: 0;
}

.filter-pills button {
  min-height: 34px;
  border: 1px solid #dfe5ec;
  border-radius: 8px;
  padding: 0 13px;
  background: #fff;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
  white-space: nowrap;
  transition: border-color 0.16s ease, background 0.16s ease, color 0.16s ease;
}

.filter-pills button:hover {
  border-color: #cbd5e1;
  color: #334155;
}

.filter-pills .active {
  border-color: #111827;
  background: #111827;
  color: #fff;
}

.article-results {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.article-results > .result-summary,
.article-results > [data-article-list] {
  grid-column: 1 / -1;
}

.article-results [data-article-list] {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.result-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 34px;
  color: #9ca3af;
  font-size: 13px;
}

.result-summary b {
  color: #64748b;
  font-size: 13px;
  font-weight: 700;
}

.article-card {
  display: flex;
  flex-direction: column;
  min-height: 218px;
  padding: 20px;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.article-card:hover {
  border-color: #d1d5db;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.05);
  transform: translateY(-1px);
}

.article-card h2 {
  margin: 12px 0 0;
  color: #111827;
  font-size: 17px;
  line-height: 1.4;
}

.article-card p {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.75;
}

.article-reader-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: grid;
  place-items: center;
  padding: 28px;
  background: rgba(15, 23, 42, 0.42);
}

.article-reader-modal {
  width: min(100%, 920px);
  max-height: min(88vh, 900px);
  display: flex;
}

.article-reader-card {
  width: 100%;
  max-height: min(88vh, 900px);
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr) auto;
  gap: 12px;
  border: 1px solid #dfe5ec;
  border-radius: 8px;
  padding: 24px;
  background: #fff;
  box-shadow: 0 24px 80px rgba(15, 23, 42, 0.24);
}

.article-reader-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 36px;
  gap: 14px;
  align-items: start;
}

.article-reader-head h2 {
  margin: 0;
  color: #111827;
  font-size: 24px;
  line-height: 1.35;
  letter-spacing: 0;
}

.article-reader-close {
  width: 36px;
  height: 36px;
  border: 1px solid #dfe5ec;
  border-radius: 8px;
  background: #fff;
  color: #111827;
  font-size: 22px;
  line-height: 1;
}

.article-reader-meta,
.article-reader-source {
  margin: 0;
  color: #6b7280;
  font-size: 13px;
}

.article-reader-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.article-reader-meta span {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border-radius: 8px;
  padding: 0 10px;
  background: #f4f6f8;
}

.article-reader-content {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  -webkit-overflow-scrolling: touch;
  border-top: 1px solid #eef2f6;
  border-bottom: 1px solid #eef2f6;
  padding: 18px 12px 18px 2px;
  color: #1f2937;
  font-size: 16px;
  line-height: 1.85;
}

.article-reader-content::-webkit-scrollbar {
  width: 8px;
}

.article-reader-content::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: #cbd5e1;
}

.article-reader-content::-webkit-scrollbar-track {
  background: transparent;
}

.article-reader-content p {
  margin: 0 0 16px;
}

.article-reader-content p:last-child {
  margin-bottom: 0;
}

.article-reader-content--sample {
  color: #4b5563;
}

.article-reader-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
}

.article-reader-actions a {
  color: #2563eb;
  font-weight: 700;
}

.article-reader-tip {
  color: #9a3412;
  font-size: 13px;
}

.article-meta,
.article-actions,
.return-lawyer-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.article-meta span,
.article-meta time {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 6px;
  padding: 0 9px;
  background: #f3f4f6;
  color: #64748b;
  font-size: 12px;
}

.article-actions a,
.return-lawyer-strip a {
  color: #2563eb;
  font-size: 14px;
  font-weight: 700;
}

.article-actions {
  margin-top: auto;
  padding-top: 18px;
}

.settings-page {
  background: #fff;
  overflow: hidden;
}

.settings-layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  height: 100dvh;
  min-height: 100dvh;
  overflow: hidden;
}

.settings-sidebar {
  position: sticky;
  top: 0;
  height: 100dvh;
  overflow-y: auto;
  overscroll-behavior: contain;
  border-right: 1px solid var(--line);
  padding: 44px 16px 24px;
  background: var(--bg);
}

.settings-back {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  margin-bottom: 18px;
  border-radius: var(--radius);
  padding: 0 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}

.settings-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 22px;
  font-size: 19px;
  font-weight: 750;
}

.settings-brand span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: #374151;
}

.settings-nav {
  display: grid;
  gap: 6px;
}

.settings-nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 38px;
  border-radius: var(--radius);
  padding: 0 10px;
  color: #374151;
  font-size: 14px;
  font-weight: 620;
}

.settings-nav a:hover,
.settings-nav a.active {
  background: #eef0f3;
}

.settings-nav a span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 20px;
  width: 20px;
}

.settings-content {
  width: min(980px, calc(100% - 56px));
  height: 100dvh;
  margin: 0 auto;
  padding: 58px 0 80px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.settings-section {
  margin-bottom: 38px;
}

.settings-kicker {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.settings-section h1,
.settings-section h2 {
  margin: 0 0 14px;
  color: var(--text);
  line-height: 1.35;
}

.settings-section h1 {
  font-size: 21px;
}

.settings-section h2 {
  font-size: 18px;
}

.settings-lead {
  max-width: 760px;
  margin: 0 0 18px;
  color: var(--muted);
}

.settings-card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.settings-card-grid article,
.settings-list,
.account-empty,
.account-loading {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: none;
}

.settings-card-grid article {
  min-height: 96px;
  padding: 14px;
}

.settings-logout {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  background: #fff;
  color: #374151;
  font-size: 13px;
  font-weight: 650;
}

.settings-logout:hover {
  background: #f4f5f7;
}

.settings-card-grid strong,
.settings-card-grid span {
  display: block;
}

.settings-card-grid strong,
.settings-list strong {
  margin-bottom: 6px;
  color: var(--text);
  font-size: 14px;
}

.settings-card-grid span,
.settings-list span {
  color: var(--muted);
  font-size: 13px;
}

.settings-list p,
.account-empty,
.account-loading {
  margin: 0;
  padding: 14px;
}

.settings-list p + p {
  border-top: 1px solid var(--line);
}

.settings-inline-link {
  display: inline-flex;
  margin-top: 12px;
  color: var(--text);
  font-weight: 700;
}

.account-hero,
.account-panel,
.account-stat,
.account-link-strip {
  border: 1px solid #dfe5ec;
  border-radius: var(--radius);
  background: #fff;
  box-shadow: none;
}

.account-hero {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  padding: 18px;
}

.account-avatar {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border: 1px solid #dbe2ea;
  border-radius: 18px;
  background: #f3f5f8;
  color: #111827;
  font-size: 26px;
  font-weight: 800;
}

.account-hero-main {
  min-width: 0;
}

.account-hero-main p,
.account-hero-main h1,
.account-hero-main span {
  margin: 0;
}

.account-hero-main p {
  color: #7b8492;
  font-size: 13px;
  font-weight: 650;
}

.account-hero-main h1 {
  margin-top: 2px;
  overflow: hidden;
  color: var(--text);
  font-size: 24px;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-hero-main span {
  display: block;
  margin-top: 4px;
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-hero-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  max-width: 360px;
}

.account-status-pill,
.account-action {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  border: 1px solid #dfe5ec;
  border-radius: 8px;
  padding: 0 12px;
  background: #f6f7f9;
  color: #374151;
  font-size: 13px;
  font-weight: 650;
}

.account-status-pill.muted {
  color: #7b8492;
  font-weight: 600;
}

.account-action {
  background: #fff;
}

.account-action:hover {
  background: #f4f5f7;
}

.account-action.danger {
  color: #4b5563;
}

.account-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.account-stat {
  min-height: 96px;
  padding: 18px;
}

.account-stat strong,
.account-stat span {
  display: block;
}

.account-stat strong {
  color: var(--text);
  font-size: 28px;
  line-height: 1.1;
}

.account-stat span {
  margin-top: 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}

.account-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.account-panel {
  min-height: 236px;
  overflow: hidden;
  padding: 0;
}

.account-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 52px;
  border-bottom: 1px solid var(--line);
  padding: 0 16px;
}

.account-panel h2 {
  margin: 0;
  color: var(--text);
  font-size: 16px;
  line-height: 1.35;
}

.account-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  min-height: 68px;
  padding: 12px 16px;
}

.account-row + .account-row,
.account-row + .account-empty,
.account-empty + .account-row {
  border-top: 1px solid var(--line);
}

.account-row-link:hover {
  background: #f8fafc;
}

.account-row strong,
.account-row span,
.account-row small {
  display: block;
}

.account-row strong {
  overflow: hidden;
  color: var(--text);
  font-size: 14px;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-row span,
.account-row small,
.account-muted {
  color: var(--muted);
  font-size: 13px;
}

.account-row span {
  margin-top: 3px;
}

.account-row small {
  white-space: nowrap;
}

.account-muted {
  margin: 0;
  padding: 16px;
  line-height: 1.8;
}

.account-link-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px;
}

.account-link-strip a {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 0 12px;
  background: #f6f7f9;
  color: #53657f;
  font-size: 13px;
  font-weight: 650;
}

.account-link-strip a:hover {
  border-color: #dfe5ec;
  background: #fff;
  color: var(--text);
}

@media (max-width: 820px) {
  .app-layout,
  .settings-layout {
    display: block;
  }

  .side-nav,
  .sidebar-reopen {
    display: none;
  }

  .mobile-header {
    position: sticky;
    top: 0;
    z-index: 30;
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 64px;
    border-bottom: 1px solid var(--line);
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(10px);
  }

  .mobile-back-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 38px;
    width: 38px;
    height: 38px;
    border-radius: var(--radius);
    background: #f3f4f6;
    font-size: 26px;
    font-weight: 700;
  }

  .mobile-bottom-nav {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 40;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    min-height: 72px;
    border-top: 1px solid var(--line);
    padding-bottom: env(safe-area-inset-bottom);
    background: rgba(255, 255, 255, 0.98);
  }

  .mobile-bottom-nav a {
    display: grid;
    place-items: center;
    align-content: center;
    gap: 4px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 620;
  }

  .mobile-bottom-nav strong {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: transparent;
    color: var(--muted);
  }

  .mobile-bottom-nav svg {
    width: 25px;
    height: 25px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.75;
    stroke-linecap: round;
    stroke-linejoin: round;
  }

  .mobile-bottom-nav .active {
    color: var(--text);
    font-weight: 700;
  }

  .chat-panel {
    min-height: 100dvh;
    padding-bottom: var(--bottom-nav);
  }

  .chat-topbar {
    display: none;
  }

  .chat-body {
    width: calc(100% - 28px);
    padding: 56px 0 148px;
  }

  .welcome-block {
    margin-bottom: 96px;
  }

  .welcome-block h1 {
    font-size: 24px;
  }

  .composer-wrap {
    position: fixed;
    right: 0;
    bottom: var(--bottom-nav);
    left: 0;
    z-index: 35;
    width: 100%;
    padding: 10px 14px 12px;
    border-top: 1px solid var(--line);
  }

  .home-page:not(.has-chat) .chat-panel {
    position: relative;
    display: block;
    min-height: calc(100dvh - var(--bottom-nav));
  }

  .home-page:not(.has-chat) .chat-body {
    position: absolute;
    top: calc(50% - 166px);
    left: 50%;
    width: calc(100% - 28px);
    padding: 0;
    transform: translateX(-50%);
  }

  .home-page:not(.has-chat) .welcome-block {
    margin-bottom: 18px;
  }

  .home-page:not(.has-chat) .welcome-block h1 {
    font-size: 28px;
  }

  .home-page:not(.has-chat) .composer-wrap {
    position: absolute;
    top: 50%;
    right: auto;
    bottom: auto;
    left: 50%;
    width: calc(100% - 28px);
    padding: 0;
    border-top: 0;
    transform: translate(-50%, -50%);
  }

  .home-page:not(.has-chat) .chat-input {
    min-height: 92px;
  }

  .home-page:not(.has-chat) .chat-input .tool-button {
    display: inline-flex;
    flex: 0 0 42px;
    width: 42px;
  }

  .home-page:not(.has-chat) .suggested-prompts {
    position: absolute;
    top: 220px;
    left: 0;
    width: 100%;
    margin: 0;
  }

  .home-page:not(.has-chat) .notice {
    width: calc(100% - 28px);
  }

  .chat-input {
    min-height: 70px;
    padding: 8px;
  }

  .chat-input input {
    min-height: 44px;
  }

  .chat-input .tool-button {
    display: inline-flex;
    flex: 0 0 42px;
    width: 42px;
  }

  .chat-input .send-button {
    flex: 0 0 42px;
    min-width: 42px;
    width: 42px;
  }

  .notice,
  .ai-boundary-note {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .prompt-answer-thread {
    margin: 14px 0;
  }

  .prompt-answer,
  .prompt-answer.ai,
  .prompt-answer.user,
  .process-card,
  .agent-legal-disclaimer {
    width: 100%;
    max-width: 100%;
  }

  .prompt-answer.user {
    width: auto;
    max-width: 88%;
  }

  .process-card,
  .agent-summary-preview {
    align-items: stretch;
    flex-direction: column;
  }

  .summary-preview-actions {
    grid-template-columns: 1fr;
    flex-basis: auto;
  }

  .lawyer-detail {
    min-height: 100dvh;
    padding: 0 14px calc(var(--bottom-nav) + 144px);
  }

  .lawyer-page,
  .lawyer-profile-page,
  .account-workspace {
    height: auto;
    min-height: 100dvh;
    padding: 0 14px calc(var(--bottom-nav) + 28px);
    overflow: visible;
  }

  .account-page .account-workspace {
    padding: 0 14px calc(var(--bottom-nav) + 28px);
  }

  .lawyer-list-head,
  .profile-page-head,
  .account-shell {
    margin-top: 14px;
  }

  .account-page .account-shell {
    gap: 14px;
  }

  .account-hero {
    grid-template-columns: 54px minmax(0, 1fr);
    align-items: start;
    padding: 14px;
  }

  .account-avatar {
    width: 54px;
    height: 54px;
    border-radius: 14px;
    font-size: 22px;
  }

  .account-hero-main h1 {
    font-size: 20px;
  }

  .account-hero-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
    max-width: none;
  }

  .account-stats,
  .account-grid {
    grid-template-columns: 1fr;
  }

  .account-stat {
    min-height: 82px;
    padding: 14px;
  }

  .account-stat strong {
    font-size: 24px;
  }

  .account-panel {
    min-height: auto;
  }

  .account-row {
    grid-template-columns: minmax(0, 1fr);
    gap: 4px;
  }

  .account-row small {
    white-space: normal;
  }

  .lawyer-ai-card,
  .single-profile-head,
  .digital-card-strip,
  .profile-page-title,
  .settings-account-actions {
    grid-template-columns: 1fr;
  }

  .lawyer-avatar img,
  .single-profile-head .profile-photo img,
  .profile-page-title img {
    width: 58px;
    height: 70px;
  }

  .profile-linked-actions {
    grid-template-columns: 1fr;
  }

  .card-actions {
    flex-wrap: wrap;
  }

  .lawyer-chat-thread {
    width: 100%;
    padding: 14px 0 0;
  }

  .lawyer-mini-card {
    grid-template-columns: 44px minmax(0, 1fr);
    align-items: start;
    gap: 10px;
  }

  .profile-photo.compact {
    width: 44px;
    height: 52px;
  }

  .lawyer-mini-card-main h1 {
    font-size: 17px;
  }

  .lawyer-mini-card-main small {
    max-width: 100%;
  }

  .lawyer-mini-card-actions {
    grid-column: 1 / -1;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }

  .lawyer-mini-card-actions .ghost-button,
  .lawyer-mini-card-actions .primary-small {
    width: 100%;
  }

  .lawyer-composer-card {
    right: 0;
    bottom: var(--bottom-nav);
    left: 0;
    z-index: 35;
    width: 100%;
    max-width: none;
    padding: 10px 14px 12px;
    border-top: 1px solid var(--line);
  }

  .lawyer-composer-card .chat-input {
    position: relative;
    padding-right: 76px;
  }

  .lawyer-composer-card .chat-input input {
    width: 100%;
    padding-right: 12px;
  }

  .lawyer-composer-card .send-button {
    position: static;
    width: 42px;
  }

  .article-center {
    padding: 0 14px calc(var(--bottom-nav) + 28px);
  }

  .article-head {
    margin-top: 14px;
  }

  .filter-row {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .filter-toolbar {
    width: 100%;
  }

  .filter-group {
    gap: 8px;
  }

  .article-results [data-article-list] {
    grid-template-columns: 1fr;
  }

  .article-results {
    grid-template-columns: 1fr;
  }

  .settings-workbench {
    height: auto;
    min-height: 100dvh;
    padding: 0 14px calc(var(--bottom-nav) + 28px);
  }

  .settings-board {
    grid-template-columns: 1fr;
    gap: 18px;
    width: 100%;
    padding: 14px 0 0;
  }

  .settings-panel-nav {
    position: static;
  }

  .settings-panel-nav h1 {
    margin: 0 0 14px;
    font-size: 24px;
  }

  .settings-panel-nav nav {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .settings-panel-nav a {
    flex: 0 0 auto;
    min-height: 36px;
    font-size: 14px;
    box-shadow: none !important;
  }

  .settings-detail-card {
    padding: 22px 18px;
  }

  .settings-detail-section + .settings-detail-section {
    margin-top: 34px;
    padding-top: 30px;
  }

  .settings-detail-section h2 {
    font-size: 21px;
  }

  .settings-detail-section p,
  .settings-detail-section li {
    font-size: 14px;
  }

  .settings-quick-actions {
    grid-template-columns: 1fr;
  }

  .settings-auth-form {
    grid-template-columns: 1fr;
  }

  .filter-row strong {
    padding-top: 0;
  }

  .article-head h1 {
    font-size: 22px;
  }

  .settings-sidebar {
    position: static;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding: 18px 14px;
    background: #fff;
  }

  .settings-back {
    margin-bottom: 14px;
  }

  .settings-brand {
    margin-bottom: 16px;
  }

  .settings-nav {
    display: grid;
    grid-template-columns: 1fr;
  }

  .settings-content {
    width: 100%;
    padding: 24px 16px 80px;
  }

  .settings-card-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 430px) {
  .brand small {
    display: none;
  }

  .suggested-prompts button {
    align-items: flex-start;
  }

  .suggested-prompts b {
    display: none;
  }
}
