:root {
  --ink: #17211b;
  --muted: #728078;
  --line: #e4e9e5;
  --paper: #ffffff;
  --canvas: #f4f6f2;
  --green: #176b3a;
  --green-dark: #0e4e29;
  --green-soft: #eaf6ed;
  --coral: #e76f51;
  --blue: #3878bf;
  --violet: #7357b8;
  --amber: #c8892f;
  --shadow: 0 8px 30px rgba(28, 53, 37, .055);
}

* { box-sizing: border-box; }
html { font-size: 15px; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--canvas);
  font-family: Inter, "SF Pro Display", "PingFang SC", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.app-shell { min-height: 100vh; }
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 30;
  display: flex;
  width: 248px;
  overflow: hidden;
  flex-direction: column;
  color: #eff8f1;
  background:
    radial-gradient(circle at 5% 82%, rgba(93, 172, 116, .24), transparent 28%),
    linear-gradient(160deg, #183626 0%, #10291c 60%, #0c2116 100%);
}
.brand, .sidebar-footer { flex: 0 0 auto; }
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 92px;
  padding: 0 28px;
  border-bottom: 1px solid rgba(255,255,255,.09);
}
.brand-mark {
  display: grid;
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  place-items: center;
  border-radius: 12px 12px 12px 4px;
  color: #14351f;
  background: #a9e2b8;
  font-size: 18px;
  font-weight: 900;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.5);
}
.brand strong { display: block; font-size: 13px; letter-spacing: .015em; white-space: nowrap; }
.brand small { display: block; margin-top: 3px; color: #95ab9d; font-size: 11px; letter-spacing: .08em; }
.nav { display: flex; min-height: 0; flex: 1; flex-direction: column; gap: 6px; padding: 26px 16px; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
.nav a {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 12px 14px;
  border-radius: 10px;
  color: #afc1b5;
  font-size: 14px;
  transition: .18s ease;
}
.nav-unread { min-width: 20px; height: 20px; margin-left: auto; padding: 0 6px; border-radius: 999px; color: #fff; background: #e76f51; font-size: 10px; font-style: normal; font-weight: 800; line-height: 20px; text-align: center; }
.is-hidden { display: none !important; }
.nav a:hover { color: #fff; background: rgba(255,255,255,.06); }
.nav a.active { color: #f6fff8; background: rgba(149, 219, 167, .16); box-shadow: inset 3px 0 #9edbae; }
.nav a:focus-visible, .sidebar-logout-button:focus-visible { outline: 2px solid #b8e8c4; outline-offset: 2px; }
.nav-icon { width: 22px; color: #8dba9a; font-size: 19px; text-align: center; }
.nav-label { margin: 22px 14px 5px; color: #667e6e; font-size: 10px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }
.sidebar-footer { padding: 18px; border-top: 1px solid rgba(255,255,255,.08); }
.server-status { margin: 0 7px 15px; color: #7f9888; font-size: 11px; }
.server-status i, .badge i, .legend i {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 7px;
  border-radius: 50%;
  background: #58c579;
  box-shadow: 0 0 0 4px rgba(88,197,121,.1);
}
.profile { display: flex; align-items: center; gap: 10px; }
.avatar, .user-chip {
  display: inline-grid;
  width: 34px;
  height: 34px;
  margin-right: 6px;
  place-items: center;
  border-radius: 10px;
  color: #1e5c35;
  background: #dff1e4;
  font-weight: 800;
}
.profile > a { min-width: 0; flex: 1; }
.profile strong { display: block; overflow: hidden; color: #eef7f0; font-size: 13px; text-overflow: ellipsis; }
.profile small { display: block; margin-top: 2px; color: #7f9888; font-size: 10px; }
.icon-button { padding: 6px; border: 0; color: #82998a; background: transparent; font-size: 18px; }
.sidebar-logout-button { display: inline-flex; align-items: center; gap: 5px; padding: 7px 8px; border: 1px solid rgba(255,255,255,.09); border-radius: 8px; color: #9fb2a5; background: rgba(255,255,255,.04); font-size: 9px; }
.sidebar-logout-button b { font-size: 14px; font-weight: 400; }

.main { min-height: 100vh; margin-left: 248px; }
.simple-user .main { margin-left: 0; }
.simple-user .content { max-width: 1160px; }
.topbar {
  display: flex;
  align-items: center;
  min-height: 92px;
  padding: 20px 42px;
  border-bottom: 1px solid var(--line);
  background: rgba(255,255,255,.82);
  backdrop-filter: blur(14px);
}
.topbar h1 { margin: 0 0 5px; font-size: 23px; letter-spacing: -.02em; }
.topbar p { margin: 0; color: var(--muted); font-size: 12px; }
.topbar-title { min-width: 0; }
.top-domain { margin-left: auto; padding: 8px 12px; border: 1px solid var(--line); border-radius: 8px; color: #66736c; background: #fafcf9; font: 11px ui-monospace, SFMono-Regular, Consolas, monospace; }
.user-contact-top { display: flex; min-height: 42px; align-items: center; gap: 7px; margin-left: auto; padding: 5px 6px 5px 12px; border: 1px solid #d8e8dc; border-radius: 11px; color: #7f8c84; background: #f5faf6; font-size: 10px; }
.user-contact-top > span { margin-right: 2px; white-space: nowrap; }
.user-contact-top a { display: flex; min-height: 30px; align-items: center; gap: 6px; padding: 0 10px; border: 1px solid #dbe8de; border-radius: 8px; color: #176b3a; background: #fff; transition: .16s; }
.user-contact-top a:hover { border-color: #9fc8aa; background: #edf8f0; }
.user-contact-top b { font-size: 9px; letter-spacing: .08em; }
.user-contact-top strong { font-size: 12px; font-weight: 800; letter-spacing: .015em; }
.user-contact-top .contact-chat { position: relative; color: #fff; border-color: var(--green); background: var(--green); }
.user-contact-top .contact-chat:hover { color: #fff; background: var(--green-dark); }
.contact-unread { position: absolute; top: -7px; right: -5px; display: grid; min-width: 18px; height: 18px; padding: 0 5px; place-items: center; border: 2px solid #fff; border-radius: 999px; color: #fff; background: #e76f51; font-size: 9px; font-style: normal; font-weight: 800; }
.topbar-logout { margin-left: 10px; }
.topbar-logout button { display: inline-flex; height: 34px; align-items: center; gap: 8px; padding: 0 12px; border: 1px solid #dfe5e0; border-radius: 8px; color: #58665e; background: #fff; font-size: 10px; font-weight: 700; transition: .16s; }
.topbar-logout button:hover { border-color: #e4b5aa; color: #b54d36; background: #fff7f5; }
.topbar-logout b { font-size: 14px; font-weight: 500; }
.menu-button { display: none; margin-right: 13px; padding: 7px; border: 0; background: transparent; font-size: 20px; }
.sidebar-backdrop { display: none; }
.content { width: 100%; max-width: 1480px; margin: 0 auto; padding: 34px 42px 60px; }
.flash-stack { display: grid; gap: 8px; margin-bottom: 20px; }
.flash { padding: 12px 15px; border: 1px solid #cfe4d4; border-radius: 9px; color: #256039; background: #eff8f1; font-size: 13px; }
.flash.error { border-color: #f0cbc2; color: #a54029; background: #fff3ef; }

.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; margin-bottom: 18px; }
.stat-card { position: relative; min-height: 154px; overflow: hidden; padding: 24px; border: 1px solid var(--line); border-radius: 15px; background: var(--paper); box-shadow: var(--shadow); }
.stat-card.accent { color: #f5fff7; border-color: transparent; background: linear-gradient(135deg, #1d713f, #11552d); }
.stat-label { display: block; color: var(--muted); font-size: 12px; font-weight: 700; }
.accent .stat-label { color: #bde2c8; }
.stat-card > strong { display: block; margin: 16px 0 8px; font-size: 32px; line-height: 1; letter-spacing: -.04em; }
.stat-card small { color: #95a099; font-size: 10px; }
.accent small { color: #a7cdb2; }
.stat-symbol { position: absolute; top: 22px; right: 22px; color: #8cd0a0; font-size: 25px; }
.stat-symbol.coral { color: var(--coral); }.stat-symbol.blue { color: var(--blue); }.stat-symbol.violet { color: var(--violet); }
.panel { border: 1px solid var(--line); border-radius: 15px; background: var(--paper); box-shadow: var(--shadow); }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(290px, .8fr); gap: 18px; margin-bottom: 18px; }
.monitor-panel { margin-bottom: 18px; padding: 22px 24px; }
.monitor-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; }
.monitor-grid > div { padding: 14px; border: 1px solid var(--line); border-radius: 11px; background: #f8faf7; }
.monitor-grid span, .monitor-grid small { display: block; color: #849087; font-size: 10px; }
.monitor-grid strong { display: block; margin: 8px 0 6px; font-size: 19px; color: #203027; }
.monitor-alerts { margin-top: 12px; padding: 10px 12px; border-radius: 9px; color: #9a5b12; background: #fff5df; font-size: 11px; }
.monitor-time { margin: 10px 0 0; color: #98a19b; font-size: 9px; text-align: right; }
.badge.danger { color: #b6352c; background: #fff0ed; }
.chart-panel, .quick-panel { min-height: 325px; padding: 24px; }
.panel-head { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 23px; }
.panel-head h2 { margin: 0 0 5px; font-size: 15px; }
.panel-head p { margin: 0; color: var(--muted); font-size: 11px; }
.legend { color: var(--muted); font-size: 10px; }
.legend i { width: 8px; height: 8px; background: var(--green); box-shadow: none; }
.chart { display: grid; height: 210px; grid-template-columns: repeat(14, 1fr); align-items: end; gap: 9px; padding-top: 25px; border-bottom: 1px solid var(--line); background: repeating-linear-gradient(to bottom, transparent 0, transparent 49px, #edf1ed 50px); }
.bar-column { position: relative; display: flex; height: 185px; flex-direction: column; justify-content: flex-end; align-items: center; }
.bar-column i { display: block; width: min(75%, 26px); min-height: 7px; border-radius: 6px 6px 2px 2px; background: linear-gradient(180deg, #3f9460, #1c6d3d); transition: .2s; }
.bar-column:hover i { filter: brightness(1.13); transform: translateY(-2px); }
.bar-column small { position: absolute; top: calc(100% + 9px); color: #98a19b; font-size: 9px; white-space: nowrap; }
.chart-label-sparse { visibility: hidden; }
.chart-mobile-note { display: none; }
.bar-value { margin-bottom: 5px; color: #607067; font-size: 9px; }
.quick-link { display: flex; align-items: center; gap: 12px; padding: 13px 0; border-bottom: 1px solid #edf0ed; }
.quick-link:last-child { border-bottom: 0; }
.quick-link > span:nth-child(2) { flex: 1; }
.quick-link strong { display: block; margin-bottom: 3px; font-size: 12px; }
.quick-link small { color: var(--muted); font-size: 9px; }
.quick-link b { color: #a6afa9; font-size: 20px; font-weight: 400; }
.quick-icon { display: grid; width: 38px; height: 38px; place-items: center; border-radius: 11px; font-size: 18px; }
.quick-icon.green { color: var(--green); background: var(--green-soft); }
.quick-icon.blue { color: var(--blue); background: #e9f1fa; }
.quick-icon.amber { color: var(--amber); background: #fbf2e5; }
.table-panel { overflow: hidden; }
.table-panel > .panel-head { margin: 0; padding: 22px 24px; border-bottom: 1px solid var(--line); }
.text-link, .table-action, .link-button { color: var(--green); font-size: 11px; font-weight: 700; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { padding: 13px 20px; color: #87928b; background: #f8faf7; font-size: 10px; font-weight: 700; text-align: left; white-space: nowrap; }
td { padding: 17px 20px; border-top: 1px solid #edf0ed; color: #59675f; font-size: 12px; vertical-align: middle; }
tbody tr:first-child td { border-top: 0; }
tbody tr:hover { background: #fbfcfa; }
.domain-name { display: inline-block; max-width: 100%; overflow-wrap: anywhere; color: #26342b; font: 600 12px ui-monospace, SFMono-Regular, Consolas, monospace; word-break: break-word; }
.url-text { display: block; max-width: 420px; overflow: hidden; color: #708078; font: 11px ui-monospace, SFMono-Regular, Consolas, monospace; text-overflow: ellipsis; white-space: nowrap; }
.cell-note { display: block; margin-top: 5px; color: #9aa49e; font-size: 9px; }
.user-remark { max-width: 260px; margin-left: 52px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.badge { display: inline-flex; align-items: center; padding: 5px 9px; border-radius: 999px; font-size: 9px; font-weight: 700; white-space: nowrap; }
.badge.success { color: #267345; background: #eaf6ed; }
.badge.success i { width: 5px; height: 5px; margin-right: 5px; box-shadow: none; }
.badge.warning { color: #91601b; background: #fbf1e1; }.badge.warning i { width: 5px; height: 5px; margin-right: 5px; background: #d79b42; box-shadow: none; }
.badge.muted-badge { color: #767f79; background: #eef0ee; }.badge.muted-badge i { width: 5px; height: 5px; margin-right: 5px; background: #9ba29e; box-shadow: none; }
.badge.neutral { color: #59675f; background: #eef2ef; }
.device-detail { display: inline-block; color: #53635a; font-size: 10px; font-weight: 700; line-height: 1.65; overflow-wrap: anywhere; }
.action-row { display: flex; align-items: center; gap: 11px; }
.link-button { padding: 0; border: 0; background: transparent; }
.danger-text { color: #c6563e; }
.empty { padding: 68px 20px; text-align: center; }
.empty > span { display: grid; width: 52px; height: 52px; margin: 0 auto 15px; place-items: center; border-radius: 15px; color: var(--green); background: var(--green-soft); font-size: 24px; }
.empty h3 { margin: 0 0 7px; font-size: 15px; }.empty p { margin: 0; color: var(--muted); font-size: 11px; }.empty.compact { padding: 40px; }

.page-actions { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin-bottom: 18px; }
.page-actions.right { justify-content: flex-end; }
.domain-admin-tools { display: flex; align-items: end; justify-content: space-between; gap: 18px; margin-bottom: 18px; padding: 14px 16px; }
.domain-search { min-width: 240px; flex: 1; }
.domain-search > span { display: block; margin-bottom: 6px; color: #65736b; font-size: 9px; font-weight: 800; }
.domain-search input { width: 100%; min-height: 42px; padding: 0 12px; border: 1px solid #dce2dd; border-radius: 9px; outline: 0; color: #26332b; background: #fbfcfb; font-size: 12px; }
.domain-search input:focus { border-color: #74aa84; background: #fff; box-shadow: 0 0 0 3px rgba(45,123,69,.09); }
.domain-admin-tools-meta { display: flex; align-items: center; gap: 8px; }
.domain-admin-tools-meta > span { margin-right: 4px; color: var(--muted); font-size: 10px; white-space: nowrap; }
.audit-tools { margin-bottom: 18px; }
.audit-section + .audit-section { margin-top: 18px; }
.audit-filter-empty { margin-top: 18px; }
.user-list-search { width: min(520px, 100%); }
.domain-batch-button, .domain-group-toggle { display: inline-flex; min-height: 40px; align-items: center; justify-content: center; gap: 6px; padding: 0 12px; border: 1px solid var(--line); border-radius: 9px; color: #52645a; background: #fff; font-size: 10px; font-weight: 750; transition: .15s; }
.domain-batch-button:hover, .domain-group-toggle:hover { color: var(--green); border-color: #bcd7c3; background: #f6faf7; }
.domain-group-toggle b { font-size: 13px; font-weight: 500; transition: transform .18s; }
.user-domain-group.collapsed .domain-group-toggle b { transform: rotate(180deg); }
.user-domain-group.collapsed .domain-group-body { display: none; }
.domain-filter-empty { margin-top: 18px; }
.info-strip { flex: 1; padding: 13px 15px; border: 1px solid #d8e7da; border-radius: 10px; color: #496151; background: #edf6ef; font-size: 11px; }
.info-strip span { display: inline-grid; width: 18px; height: 18px; margin-right: 8px; place-items: center; border-radius: 50%; color: white; background: var(--green); font-size: 10px; font-weight: 800; }
.button { display: inline-flex; min-height: 40px; align-items: center; justify-content: center; gap: 9px; padding: 0 17px; border: 1px solid transparent; border-radius: 9px; font-size: 12px; font-weight: 700; transition: .16s; }
.button.primary { color: #fff; background: var(--green); box-shadow: 0 6px 14px rgba(23,107,58,.16); }
.button.primary:hover { background: var(--green-dark); transform: translateY(-1px); }
.button.secondary { border-color: var(--line); color: #55635a; background: #fff; }
.button.full { width: 100%; min-height: 48px; justify-content: space-between; padding: 0 19px; }

.form-layout { display: grid; grid-template-columns: minmax(0, 720px) 270px; align-items: start; justify-content: center; gap: 20px; }
.form-card { padding: 30px; }
.form-card.narrow { max-width: 680px; margin: 0 auto; }
.form-section { display: flex; align-items: center; gap: 13px; margin-bottom: 25px; }
.form-section.second { margin-top: 35px; padding-top: 28px; border-top: 1px solid var(--line); }
.section-index { display: grid; width: 38px; height: 38px; place-items: center; border-radius: 11px; color: var(--green); background: var(--green-soft); font-size: 10px; font-weight: 900; }
.form-section h2 { margin: 0 0 3px; font-size: 15px; }.form-section p { margin: 0; color: var(--muted); font-size: 10px; }
.field { display: block; margin-bottom: 20px; }
.field > span { display: block; margin-bottom: 8px; color: #435048; font-size: 11px; font-weight: 700; }
.field input, .field textarea, .field select {
  width: 100%;
  padding: 12px 13px;
  border: 1px solid #dce2dd;
  border-radius: 9px;
  outline: 0;
  color: #26332b;
  background: #fbfcfb;
  font-size: 12px;
  transition: .15s;
}
.field textarea { line-height: 1.6; resize: vertical; }
.field input:focus, .field textarea:focus, .field select:focus { border-color: #74aa84; background: #fff; box-shadow: 0 0 0 3px rgba(45,123,69,.09); }
.field input:disabled { color: #7d8781; background: #f0f2f0; }
.field small { display: block; margin-top: 7px; color: #929d96; font-size: 9px; }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin: 20px 0; padding: 16px; border: 1px solid var(--line); border-radius: 10px; background: #fafbfa; }
.switch-row strong, .switch-row small { display: block; }.switch-row strong { margin-bottom: 4px; font-size: 11px; }.switch-row small { color: var(--muted); font-size: 9px; }
.switch-row input { width: 38px; height: 20px; accent-color: var(--green); }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 30px; padding-top: 22px; border-top: 1px solid var(--line); }
.helper-card { padding: 24px; border: 1px solid #d9e7dc; border-radius: 15px; color: #365143; background: #edf6ef; }
.helper-icon { display: grid; width: 42px; height: 42px; place-items: center; border-radius: 12px; color: white; background: var(--green); font-size: 21px; }
.helper-card h3 { margin: 18px 0 8px; font-size: 14px; }.helper-card p { margin: 0; color: #668070; font-size: 10px; line-height: 1.7; }
.dns-example { display: grid; gap: 8px; margin: 17px 0; padding: 13px; border: 1px solid #d4e4d8; border-radius: 9px; background: rgba(255,255,255,.58); }
.dns-example span { display: flex; justify-content: space-between; color: #718077; font-size: 9px; }.dns-example strong { color: #244f33; font: 600 10px ui-monospace, monospace; }
.helper-note { padding-top: 14px; border-top: 1px solid #d8e6da; }
.user-chip.large { width: 36px; height: 36px; margin-right: 10px; }
.user-cell-main { display: flex; align-items: center; }
.user-cell-main > span:last-child { min-width: 0; }
.change-cell span { display: block; max-width: 420px; overflow: hidden; color: #7b8780; font: 10px ui-monospace, monospace; text-overflow: ellipsis; white-space: nowrap; }
.change-cell span + span { margin-top: 5px; color: #356047; }
.stats-summary { display: grid; grid-template-columns: 180px minmax(0, 1fr) auto; align-items: center; gap: 18px; margin-bottom: 18px; padding: 19px 22px; border: 1px solid var(--line); border-radius: 14px; background: #fff; box-shadow: var(--shadow); }
.stats-summary span { display: block; margin-bottom: 5px; color: var(--muted); font-size: 10px; }.stats-summary strong { font-size: 22px; }
.stats-summary .target-strong { display: block; overflow: hidden; font: 600 11px ui-monospace, monospace; text-overflow: ellipsis; white-space: nowrap; }
.full-chart { min-height: 320px; margin-bottom: 18px; }.chart.thirty { grid-template-columns: repeat(30, 1fr); gap: 5px; }
.analytics-chart-panel, .analytics-table { margin-bottom: 18px; }
.analytics-chart-panel { min-height: 320px; }
.analytics-table td strong { color: #314037; }
.analytics-matrix-panel { margin-bottom: 18px; overflow: hidden; }
.analytics-matrix-head { margin: 0; padding: 20px 22px; border-bottom: 1px solid var(--line); }
.analytics-period-badge { display: inline-flex; min-height: 30px; align-items: center; padding: 0 11px; border-radius: 999px; color: var(--green); background: var(--green-soft); font-size: 10px; font-weight: 800; white-space: nowrap; }
.analytics-matrix-scroll { max-height: 620px; overflow: auto; overscroll-behavior: contain; scrollbar-color: #a8b7ac #eef2ef; }
.analytics-matrix-scroll:focus-visible { outline: 3px solid rgba(45,123,69,.18); outline-offset: -3px; }
.analytics-matrix { width: max-content; min-width: 100%; border-collapse: separate; border-spacing: 0; }
.analytics-matrix th, .analytics-matrix td { min-width: 94px; height: 58px; padding: 10px 14px; border-top: 0; border-right: 1px solid #e8ece9; border-bottom: 1px solid #e8ece9; color: #5b6860; background: #fff; font-size: 12px; text-align: center; }
.analytics-matrix thead th { position: sticky; z-index: 3; top: 0; height: 58px; color: #657169; background: #f4f7f4; }
.analytics-matrix thead th strong, .analytics-matrix thead th small { display: block; }
.analytics-matrix thead th strong { color: #3d4b42; font-size: 11px; }
.analytics-matrix thead th small { margin-top: 4px; color: #98a29b; font-size: 9px; font-weight: 600; }
.analytics-matrix tbody tr:hover td, .analytics-matrix tbody tr:hover th { background: #f8fbf8; }
.analytics-matrix .matrix-user-cell { position: sticky; z-index: 2; left: 0; min-width: 210px; max-width: 210px; text-align: left; box-shadow: 7px 0 12px rgba(30, 56, 38, .04); }
.analytics-matrix thead .matrix-user-cell { z-index: 5; background: #f4f7f4; }
.analytics-matrix .matrix-user-cell > strong { display: block; overflow: hidden; color: #223128; font: 700 12px ui-monospace, SFMono-Regular, Consolas, monospace; text-overflow: ellipsis; white-space: nowrap; }
.matrix-user-link { display: block; overflow: hidden; color: var(--green); font: 700 12px ui-monospace, SFMono-Regular, Consolas, monospace; text-overflow: ellipsis; white-space: nowrap; }
.matrix-user-link:hover { text-decoration: underline; }
.analytics-matrix .matrix-user-cell small { display: block; margin-top: 5px; overflow: hidden; color: #8c9890; font-size: 9px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.analytics-matrix td.has-visits { color: #176b3a; background: #f1f8f3; font-weight: 800; }
.analytics-matrix tfoot th, .analytics-matrix tfoot td { position: sticky; z-index: 3; bottom: 0; color: #24432f; background: #eaf3ec; font-weight: 800; }
.analytics-matrix tfoot .matrix-user-cell { z-index: 6; }
.analytics-visitor-head { align-items: flex-end; gap: 18px; }
.analytics-visitor-filter { display: flex; align-items: flex-end; gap: 8px; margin-left: auto; }
.analytics-visitor-filter label { display: grid; gap: 5px; }
.analytics-visitor-filter label > span { color: var(--muted); font-size: 9px; font-weight: 700; }
.analytics-visitor-filter select { min-width: 230px; height: 40px; padding: 0 34px 0 11px; border: 1px solid var(--line); border-radius: 9px; outline: 0; color: var(--ink); background: #fff; }
.analytics-visitor-filter select:focus { border-color: #74aa84; box-shadow: 0 0 0 3px rgba(45,123,69,.09); }
.chat-layout { display: grid; min-height: 640px; overflow: hidden; grid-template-columns: 290px minmax(0, 1fr); }
.chat-layout.user-chat { max-width: 920px; margin: 0 auto; grid-template-columns: 1fr; }
.chat-conversations { min-width: 0; border-right: 1px solid var(--line); background: #f9fbf8; }
.chat-conversations > header { min-height: 72px; padding: 18px 20px; border-bottom: 1px solid var(--line); background: #fff; }
.chat-conversations > header strong, .chat-conversations > header small { display: block; }
.chat-conversations > header strong { margin-bottom: 4px; font-size: 13px; }
.chat-conversations > header small { color: var(--muted); font-size: 9px; }
.conversation-sheet-head, .conversation-filter, .chat-mobile-back { display: none; }
#chatConversationList { max-height: 566px; overflow-y: auto; }
.conversation-item { display: flex; min-height: 68px; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid #edf0ed; transition: .15s; }
.conversation-item:hover { background: #f1f7f2; }
.conversation-item.active { background: #e9f5ec; box-shadow: inset 3px 0 #72b586; }
.conversation-avatar { display: grid; width: 38px; height: 38px; flex: 0 0 auto; place-items: center; border-radius: 11px; color: #1e5c35; background: #dff1e4; font-size: 12px; font-weight: 800; }
.conversation-copy { min-width: 0; flex: 1; }
.conversation-copy strong, .conversation-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conversation-copy strong { margin-bottom: 4px; font-size: 11px; }
.conversation-copy small { color: #8a968e; font-size: 10px; }
.conversation-copy .conversation-remark { margin: -1px 0 3px; color: #547360; font-size: 9px; }
.conversation-item > em { display: grid; min-width: 20px; height: 20px; padding: 0 6px; place-items: center; border-radius: 999px; color: #fff; background: #e76f51; font-size: 9px; font-style: normal; font-weight: 800; }
.conversation-empty { padding: 32px 16px; color: var(--muted); font-size: 10px; text-align: center; }
.chat-window { display: flex; min-width: 0; flex-direction: column; background: #fff; }
.chat-window-head { display: flex; min-height: 72px; align-items: center; justify-content: space-between; gap: 15px; padding: 15px 20px; border-bottom: 1px solid var(--line); }
.chat-window-head strong, .chat-window-head small { display: block; }
.chat-window-head strong { margin-bottom: 5px; font-size: 13px; }
.chat-window-head small { color: var(--muted); font-size: 10px; }
.chat-thread { display: flex; height: 440px; overflow-y: auto; padding: 22px; flex-direction: column; gap: 13px; background: linear-gradient(180deg, #f8faf7, #fbfcfa); scroll-behavior: smooth; }
.chat-message { display: flex; max-width: min(76%, 560px); flex-direction: column; }
.chat-message.mine { align-self: flex-end; align-items: flex-end; }
.chat-message.theirs { align-self: flex-start; align-items: flex-start; }
.chat-bubble { overflow: hidden; padding: 11px 13px; border: 1px solid #e0e6e1; border-radius: 13px 13px 13px 4px; color: #3d4b42; background: #fff; box-shadow: 0 5px 16px rgba(27,54,36,.045); }
.chat-message.mine .chat-bubble { color: #f6fff8; border-color: #267546; border-radius: 13px 13px 4px 13px; background: #237242; }
.chat-bubble p { margin: 0; font-size: 12px; line-height: 1.65; white-space: pre-wrap; word-break: break-word; }
.chat-image-link { display: block; margin: -5px -7px; }
.chat-image-link + p { margin-top: 12px; }
.chat-image-link img { display: block; width: auto; max-width: min(100%, 380px); height: auto; max-height: 360px; border-radius: 9px; object-fit: contain; }
.chat-meta { display: flex; align-items: center; gap: 7px; margin-top: 5px; color: #8a958e; font-size: 9px; }
.chat-meta small { color: #5f8b6c; font-size: 9px; }
.chat-empty, .chat-no-selection { display: grid; min-height: 100%; padding: 50px 20px; place-content: center; color: var(--muted); text-align: center; }
.chat-empty > span, .chat-no-selection > span { font-size: 30px; }
.chat-empty h3, .chat-no-selection h3 { margin: 12px 0 6px; color: var(--ink); font-size: 14px; }
.chat-empty p, .chat-no-selection p { margin: 0; font-size: 10px; }
.chat-compose { flex: 0 0 auto; padding: 14px 18px 16px; border-top: 1px solid var(--line); background: #fff; }
.chat-compose-row { display: grid; grid-template-columns: 82px minmax(0, 1fr) 78px; align-items: end; gap: 9px; }
.chat-compose textarea { width: 100%; min-height: 44px; max-height: 108px; padding: 11px 12px; overflow-y: auto; border: 1px solid #dce2dd; border-radius: 10px; outline: 0; color: var(--ink); background: #fbfcfb; font-size: 13px; line-height: 1.5; resize: none; }
.chat-compose textarea:focus { border-color: #74aa84; background: #fff; box-shadow: 0 0 0 3px rgba(45,123,69,.09); }
.chat-upload { display: flex; min-width: 0; height: 44px; align-items: center; justify-content: center; gap: 5px; border: 1px solid #dce5de; border-radius: 10px; color: var(--green); background: #f7faf7; cursor: pointer; font-size: 17px; font-weight: 800; }
.chat-upload input { position: absolute; width: 1px; height: 1px; overflow: hidden; opacity: 0; }
.chat-upload:focus-within { border-color: #74aa84; box-shadow: 0 0 0 3px rgba(45,123,69,.09); }
.chat-upload small { overflow: hidden; color: #5f7868; font-size: 10px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.chat-upload.has-file { color: #fff; border-color: var(--green); background: var(--green); }
.chat-upload.has-file small { color: #fff; }
.chat-compose-row .button { min-width: 78px; height: 44px; }
.chat-form-error:empty { display: none; }
.chat-form-error { min-height: 14px; margin: 6px 0 0; color: #bd4f38; font-size: 9px; }
.chat-connection-status {
  position: fixed;
  z-index: 70;
  top: 104px;
  right: 24px;
  display: flex;
  min-height: 40px;
  align-items: center;
  gap: 8px;
  max-width: min(420px, calc(100vw - 32px));
  padding: 8px 9px 8px 12px;
  border: 1px solid #efcf9d;
  border-radius: 11px;
  color: #76511d;
  background: #fff8e9;
  box-shadow: 0 10px 30px rgba(45, 39, 23, .12);
  font-size: 10px;
  font-weight: 700;
}
.chat-connection-status > i { width: 8px; height: 8px; flex: 0 0 auto; border-radius: 50%; background: #d79b42; box-shadow: 0 0 0 4px rgba(215,155,66,.12); }
.chat-connection-status[data-state="checking"] > i { animation: connection-pulse 1s ease-in-out infinite; }
.chat-connection-status[data-state="auth"] { color: #9b402e; border-color: #efc8be; background: #fff3ef; }
.chat-connection-status[data-state="auth"] > i { background: #d45f45; box-shadow: 0 0 0 4px rgba(212,95,69,.1); }
.chat-connection-status button { min-height: 30px; margin-left: 3px; padding: 0 10px; border: 1px solid currentColor; border-radius: 8px; color: inherit; background: rgba(255,255,255,.72); font-size: 9px; font-weight: 800; white-space: nowrap; }
.chat-connection-status button:disabled { cursor: wait; opacity: .65; }
@keyframes connection-pulse { 50% { opacity: .45; transform: scale(.8); } }
code { padding: 4px 6px; border-radius: 5px; color: #3d5748; background: #f0f4f1; font-size: 10px; }
.error-card { padding: 90px 20px; text-align: center; }.error-card > strong { display: block; color: #bad2c0; font-size: 86px; line-height: 1; }.error-card h2 { margin: 20px 0 28px; font-size: 18px; }

.domain-groups { display: grid; gap: 18px; }
.user-domain-group { overflow: hidden; }
.domain-group-head { display: flex; min-height: 88px; align-items: center; justify-content: space-between; gap: 20px; padding: 18px 22px; border-bottom: 1px solid var(--line); background: linear-gradient(90deg, #fbfdfb, #f7faf7); }
.group-user { display: flex; min-width: 0; align-items: center; gap: 12px; }
.group-avatar { width: 42px; height: 42px; margin: 0; border-radius: 13px; font-size: 14px; }
.group-user-line { display: flex; align-items: center; gap: 9px; }
.group-user-line > strong { font-size: 15px; }
.group-user p { max-width: 520px; margin: 6px 0 0; overflow: hidden; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.domain-count { padding: 4px 8px; border-radius: 999px; color: #597064; background: #edf2ee; font-size: 9px; font-weight: 700; }
.group-actions { display: flex; flex: 0 0 auto; align-items: center; gap: 16px; }
.compact-button { min-height: 34px; padding: 0 13px; font-size: 10px; }
.group-target-form { display: grid; grid-template-columns: minmax(155px, .45fr) minmax(260px, 1.55fr) auto; align-items: center; gap: 12px; padding: 14px 22px; border-bottom: 1px solid var(--line); background: #fff; }
.group-target-form label strong, .group-target-form label small { display: block; }
.group-target-form label strong { color: #435048; font-size: 10px; }
.group-target-form label small { margin-top: 4px; color: var(--muted); font-size: 9px; line-height: 1.5; }
.group-target-form input { width: 100%; min-width: 0; min-height: 42px; padding: 0 12px; border: 1px solid var(--line); border-radius: 9px; outline: 0; color: var(--ink); background: #f8faf7; font: 500 11px ui-monospace, monospace; }
.group-target-form input:focus { border-color: #74aa84; background: #fff; box-shadow: 0 0 0 3px rgba(45,123,69,.09); }
.group-target-form .button { min-height: 42px; padding: 0 14px; white-space: nowrap; }
.domain-list-head, .group-domain-row { display: grid; grid-template-columns: minmax(170px, 1.1fr) minmax(210px, 1.7fr) 105px 120px minmax(185px, .9fr); align-items: center; gap: 16px; }
.domain-list-head { padding: 10px 22px; color: #8a958e; background: #f8faf7; font-size: 9px; font-weight: 700; }
.group-domain-row { min-height: 79px; padding: 15px 22px; border-top: 1px solid #edf0ed; }
.group-domain-row:first-child { border-top: 0; }
.group-domain-row:hover { background: #fbfcfa; }
.domain-primary small { display: block; margin-top: 6px; color: #99a39d; font-size: 9px; }
.unset-target { color: #aa7a33; font-size: 10px; font-weight: 700; }
.own-domain-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.own-domain-card { padding: 22px; }
.own-domain-top { display: flex; align-items: center; gap: 11px; }
.domain-orb { display: grid; width: 38px; height: 38px; flex: 0 0 auto; place-items: center; border-radius: 11px; color: var(--green); background: var(--green-soft); font-size: 19px; }
.own-domain-top > div { min-width: 0; flex: 1; }
.own-domain-top small { display: block; margin-top: 5px; color: #99a39d; font-size: 9px; }
.inline-target-form { margin: 20px 0; }
.inline-target-form label { display: block; margin-bottom: 8px; color: #435048; font-size: 10px; font-weight: 800; }
.inline-target-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 9px; }
.inline-target-row input { min-width: 0; min-height: 43px; padding: 0 12px; border: 1px solid var(--line); border-radius: 9px; outline: 0; color: var(--ink); background: #f8faf7; font: 500 11px ui-monospace, monospace; }
.inline-target-row input:focus { border-color: #74aa84; background: #fff; box-shadow: 0 0 0 3px rgba(45,123,69,.09); }
.inline-target-row .button { min-height: 43px; padding: 0 15px; white-space: nowrap; }

.login-body { min-height: 100vh; background: #eef2ed; }
.login-shell { display: grid; min-height: 100vh; grid-template-columns: minmax(440px, .9fr) minmax(480px, 1.1fr); }
.login-intro {
  display: flex;
  padding: 54px clamp(40px, 6vw, 100px);
  flex-direction: column;
  justify-content: space-between;
  color: #f4fbf5;
  background:
    radial-gradient(circle at 80% 18%, rgba(131,207,152,.2), transparent 25%),
    radial-gradient(circle at 12% 88%, rgba(100,183,123,.15), transparent 30%),
    linear-gradient(145deg, #173a26, #0c2718 70%);
}
.login-brand { display: flex; align-items: center; gap: 12px; font-size: 18px; letter-spacing: .025em; }
.eyebrow { display: block; margin-bottom: 20px; color: #8fc49e; font-size: 10px; font-weight: 800; letter-spacing: .2em; }
.eyebrow.dark { margin-bottom: 10px; color: var(--green); }
.login-intro h1 { margin: 0 0 23px; font-size: clamp(36px, 4vw, 56px); line-height: 1.22; letter-spacing: -.045em; }
.login-intro p { max-width: 460px; margin: 0; color: #9fb4a6; font-size: 13px; line-height: 1.8; }
.login-feature { display: flex; align-items: center; gap: 14px; }
.login-feature > span { display: grid; width: 48px; height: 48px; place-items: center; border: 1px solid rgba(255,255,255,.14); border-radius: 13px; color: #a9d8b6; font-size: 13px; font-weight: 900; }
.login-feature strong, .login-feature small { display: block; }.login-feature strong { margin-bottom: 4px; font-size: 12px; }.login-feature small { color: #779080; font-size: 9px; }
.login-panel { display: grid; padding: 40px; place-items: center; background: #f5f7f3; }
.login-card { width: min(100%, 390px); padding: 40px; border: 1px solid #e1e7e1; border-radius: 20px; background: #fff; box-shadow: 0 22px 60px rgba(19,52,31,.08); }
.login-card h2 { margin: 0 0 8px; font-size: 25px; letter-spacing: -.025em; }.muted { margin: 0 0 30px; color: var(--muted); font-size: 11px; }
.login-card .field { margin-bottom: 17px; }.login-card .field input { min-height: 46px; background: #f8faf7; }
.secure-note { margin-top: 20px; color: #98a19b; font-size: 9px; text-align: center; }.secure-note i { display: inline-block; width: 6px; height: 6px; margin-right: 6px; border-radius: 50%; background: #61b77a; }
.mobile-brand { display: none; }

@media (max-width: 1180px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .dashboard-grid { grid-template-columns: 1fr; }
  .monitor-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .quick-panel { min-height: auto; }
  .domain-list-head, .group-domain-row { grid-template-columns: minmax(150px, 1fr) minmax(180px, 1.4fr) 90px 105px minmax(160px, .8fr); gap: 10px; }
}
@media (max-width: 860px) {
  .sidebar { width: min(82vw, 300px); transform: translateX(-100%); transition: transform .22s ease; box-shadow: 20px 0 60px rgba(0,0,0,.18); }
  .sidebar.open { transform: translateX(0); }
  .sidebar-backdrop { position: fixed; inset: 0; z-index: 25; display: block; border: 0; visibility: hidden; opacity: 0; background: rgba(8, 23, 14, .42); transition: opacity .2s, visibility .2s; }
  .sidebar-backdrop.open { visibility: visible; opacity: 1; }
  body.menu-open { overflow: hidden; }
  .sidebar-footer { padding-bottom: max(18px, env(safe-area-inset-bottom)); }
  .profile > a { display: flex; min-height: 44px; flex-direction: column; justify-content: center; }
  .sidebar-logout-button { min-height: 44px; }
  .main { margin-left: 0; }
  .menu-button { display: block; }
  .topbar { position: sticky; top: 0; z-index: 20; }
  .topbar, .content { padding-left: 22px; padding-right: 22px; }
  .form-layout { grid-template-columns: 1fr; }
  .login-shell { grid-template-columns: 1fr; }.login-intro { display: none; }.mobile-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 34px; font-size: 18px; }
  .domain-list-head { display: none; }
  .group-domain-row { grid-template-columns: 1fr auto; gap: 13px 18px; padding: 18px 20px; }
  .domain-target { grid-column: 1 / -1; grid-row: 2; }
  .group-domain-row > div:nth-child(3) { grid-column: 1; grid-row: 3; }
  .group-domain-row > div:nth-child(4) { grid-column: 2; grid-row: 3; }
  .group-domain-row .action-row { grid-column: 1 / -1; grid-row: 4; padding-top: 10px; border-top: 1px dashed var(--line); }
  .own-domain-grid { grid-template-columns: 1fr; }
  .chat-layout.admin-chat { grid-template-columns: 1fr; }
  .chat-conversations { border-right: 0; border-bottom: 1px solid var(--line); }
  #chatConversationList { display: flex; max-height: none; overflow-x: auto; }
  .conversation-item { width: 220px; min-width: 220px; border-right: 1px solid #edf0ed; border-bottom: 0; }
  .conversation-item.active { box-shadow: inset 0 -3px #72b586; }
}
@media (max-width: 560px) {
  html { font-size: 14px; }
  .topbar { min-height: 72px; padding: 12px 14px; }.topbar h1 { font-size: 18px; }.topbar p { max-width: 205px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }.top-domain { display: none; }
  .simple-user .topbar { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 8px; }
  .simple-user .topbar-title { min-width: 0; }
  .simple-user .topbar-logout { margin: 0; }
  .simple-user .user-contact-top { width: auto; min-height: 44px; margin: 0; padding: 0; border: 0; background: transparent; }
  .simple-user .user-contact-top a { min-width: 60px; min-height: 44px; justify-content: center; padding: 0 12px; border-radius: 10px; box-shadow: 0 5px 13px rgba(23,107,58,.14); }
  .simple-user .user-contact-top strong { font-size: 13px; }
  .simple-user .user-contact-top > span, .simple-user .user-contact-top b { display: none; }
  .menu-button { width: 44px; height: 44px; margin-right: 6px; padding: 0; flex: 0 0 44px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
  .topbar-logout { margin-left: auto; }.topbar-logout button { min-width: 68px; height: 44px; justify-content: center; }.topbar-logout button span { display: inline; }.topbar-logout b { display: none; }
  .content { padding: 18px 12px 34px; }
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 10px; }.stat-card { min-height: 135px; padding: 18px; }.stat-card > strong { font-size: 27px; }.stat-card small { display: none; }
  .dashboard-grid { gap: 12px; }.chart-panel, .quick-panel { padding: 18px; }
  .monitor-panel { padding: 18px; }.monitor-grid { grid-template-columns: 1fr 1fr; }.monitor-grid > div { padding: 12px; }
  .chart-panel { min-height: 275px; }.chart { height: 165px; gap: 4px; overflow: hidden; }.bar-column { height: 145px; }.bar-column small { font-size: 7px; transform: rotate(-45deg); transform-origin: center; }
  .page-actions { align-items: stretch; flex-direction: column; }.page-actions .button { align-self: flex-end; }
  .form-card { padding: 20px 16px; }.form-actions { position: sticky; bottom: 0; z-index: 5; margin: 24px -4px -4px; padding: 14px 4px 4px; background: linear-gradient(to bottom, rgba(255,255,255,0), #fff 25%); }.form-actions .button { min-height: 44px; flex: 1; }
  .field input, .field textarea, .field select { min-height: 46px; font-size: 16px; }
  .field textarea { min-height: 96px; }
  .switch-row { min-height: 64px; }
  .stats-summary { grid-template-columns: 1fr auto; }.stats-summary > div:nth-child(2) { grid-column: 1 / -1; grid-row: 2; }
  .full-chart { overflow: hidden; }
  .chart.thirty { min-width: 0; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 7px; }
  .chart.thirty .bar-column:nth-child(-n+23) { display: none; }
  .chart.thirty .chart-label-sparse { visibility: visible; }
  .chart-mobile-note { display: inline-flex; align-items: center; min-height: 28px; padding: 0 9px; border-radius: 999px; color: #51705d; background: #edf6ef; font-size: 9px; font-weight: 800; white-space: nowrap; }
  .analytics-matrix-panel { margin-inline: -2px; }
  .analytics-matrix-head { padding: 16px; }
  .analytics-matrix-head p { max-width: 245px; }
  .analytics-matrix-scroll { max-height: min(64dvh, 560px); }
  .analytics-matrix th, .analytics-matrix td { min-width: 88px; height: 54px; padding: 9px 10px; }
  .analytics-matrix .matrix-user-cell { min-width: 148px; max-width: 148px; }
  .analytics-visitor-head { align-items: stretch; flex-direction: column; }
  .analytics-visitor-filter { display: grid; width: 100%; margin-left: 0; grid-template-columns: 1fr 1fr; }
  .analytics-visitor-filter label { grid-column: 1 / -1; }
  .analytics-visitor-filter select { width: 100%; min-width: 0; height: 46px; font-size: 16px; }
  .analytics-visitor-filter .button { width: 100%; min-height: 44px; }
  html.chat-viewport-active,
  html.chat-viewport-active body.chat-page {
    height: var(--chat-viewport-height, 100dvh);
    min-height: 0;
    overflow: hidden;
  }
  body.chat-page { height: var(--chat-viewport-height, 100dvh); overflow: hidden; }
  .chat-page .app-shell {
    position: fixed;
    top: var(--chat-viewport-offset-top, 0px);
    left: var(--chat-viewport-offset-left, 0px);
    height: var(--chat-viewport-height, 100dvh);
    width: var(--chat-viewport-width, 100vw);
    min-height: 0;
    overflow: hidden;
  }
  .chat-page .main { height: 100%; min-height: 0; overflow: hidden; }
  .chat-page .topbar { position: relative; min-height: 66px; padding-block: 9px; }
  .chat-page .topbar p { display: none; }
  .chat-page.simple-user .topbar { grid-template-columns: minmax(0, 1fr) auto; }
  .chat-page.simple-user .topbar-title { order: initial; }
  .chat-page.simple-user .user-contact-top { display: none; }
  .chat-page.simple-user .topbar-logout { order: initial; }
  .chat-page .content { height: calc(100% - 66px); min-height: 0; padding: 8px; overflow: hidden; }
  .chat-page .flash-stack { position: fixed; z-index: 50; top: 72px; right: 10px; left: 10px; }
  .chat-layout { height: 100%; min-height: 0; border-radius: 13px; }
  .chat-layout.admin-chat.has-selection { grid-template-rows: minmax(0, 1fr); }
  .admin-chat.has-selection .chat-conversations { display: none; }
  .chat-layout.admin-chat.conversation-home { display: block; }
  .conversation-home .chat-conversations { height: 100%; min-height: 0; border: 0; background: #fff; }
  .conversation-home .chat-window { display: none; }
  .chat-conversations > header { display: none; }
  .conversation-home .conversation-sheet { display: flex; height: 100%; min-height: 0; padding: 0 10px max(10px, env(safe-area-inset-bottom)); flex-direction: column; background: #fff; }
  .conversation-sheet-head { display: flex; min-height: 62px; align-items: center; justify-content: space-between; padding: 12px 4px 9px; }
  .conversation-sheet-head strong, .conversation-sheet-head small { display: block; }
  .conversation-sheet-head strong { margin-bottom: 3px; font-size: 16px; }
  .conversation-sheet-head small { color: var(--muted); font-size: 10px; }
  .conversation-sheet-head > em, .conversation-filter button em { display: grid; min-width: 21px; height: 21px; padding: 0 6px; place-items: center; border-radius: 999px; color: #fff; background: var(--coral); font-size: 9px; font-style: normal; font-weight: 800; }
  .conversation-filter { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; padding: 0 0 10px; }
  .conversation-filter input { min-width: 0; height: 44px; padding: 0 12px; border: 1px solid #dce4de; border-radius: 10px; outline: 0; background: #f8faf8; font-size: 16px; }
  .conversation-filter input:focus { border-color: #79ae88; box-shadow: 0 0 0 3px rgba(45,123,69,.08); }
  .conversation-filter button { display: flex; height: 44px; align-items: center; gap: 6px; padding: 0 11px; border: 1px solid #dce4de; border-radius: 10px; color: #5d6d63; background: #fff; font-size: 10px; font-weight: 700; }
  .conversation-filter button.active { color: #fff; border-color: var(--green); background: var(--green); }
  #chatConversationList { display: block; min-height: 0; max-height: none; padding: 0; overflow-x: hidden; overflow-y: auto; flex: 1; background: #fff; overscroll-behavior: contain; }
  .conversation-item { width: 100%; min-width: 0; min-height: 64px; padding: 9px 8px; border-right: 0; border-bottom: 1px solid #edf0ed; border-radius: 9px; }
  .conversation-item.active { background: #e8f5eb; box-shadow: inset 3px 0 #72b586; }
  .conversation-copy .conversation-remark { margin-bottom: 2px; }
  .conversation-no-results { padding: 34px 12px; color: var(--muted); font-size: 11px; text-align: center; }
  .conversation-avatar { width: 32px; height: 32px; border-radius: 9px; }
  .conversation-copy strong { margin-bottom: 2px; font-size: 11px; }
  .conversation-copy small { font-size: 10px; }
  .chat-window { height: 100%; min-height: 0; }
  .chat-window-head { min-height: 50px; padding: 9px 12px; }
  .chat-mobile-back { display: grid; width: 44px; height: 44px; flex: 0 0 44px; place-items: center; border: 1px solid #dce6df; border-radius: 9px; color: var(--green); background: #f4faf5; font-size: 27px; line-height: 1; }
  .chat-window-head strong { margin-bottom: 2px; font-size: 12px; }
  .chat-window-head small { font-size: 9px; }
  .chat-window-head .text-link { display: inline-flex; min-height: 44px; align-items: center; padding: 7px 10px; border: 1px solid #dce6df; border-radius: 8px; background: #f7faf7; font-size: 10px; white-space: nowrap; }
  .chat-layout.user-chat .chat-window-head { background: linear-gradient(90deg, #f4faf5, #fff); }
  .chat-thread { height: auto; min-height: 0; padding: 13px 10px; flex: 1 1 auto; overscroll-behavior: contain; }
  .chat-message { max-width: 88%; }
  .chat-bubble { padding: 10px 12px; }
  .chat-bubble p { font-size: 13px; }
  .chat-empty { min-height: 100%; padding: 24px 12px; }
  .chat-compose { position: relative; z-index: 2; padding: 9px 9px max(9px, env(safe-area-inset-bottom)); box-shadow: 0 -8px 24px rgba(28,53,37,.045); }
  .chat-compose-row { grid-template-columns: 44px minmax(0, 1fr) 68px; gap: 7px; }
  .chat-compose textarea { min-height: 44px; padding: 10px 11px; font-size: 16px; }
  .chat-upload { width: 44px; font-size: 20px; }
  .chat-upload small { display: none; }
  .chat-compose-row .button { min-width: 68px; height: 44px; padding-inline: 10px; }
  .chat-form-error { margin: 6px 0 0; font-size: 10px; }
  .chat-connection-status {
    top: calc(var(--chat-viewport-offset-top, 0px) + 72px);
    right: 10px;
    left: 10px;
    max-width: none;
    justify-content: center;
  }
  .login-panel { padding: 16px; }.login-card { padding: 28px 22px; }
  .domain-admin-tools { align-items: stretch; flex-direction: column; gap: 12px; padding: 14px; }
  .domain-search { min-width: 0; }
  .domain-search input { min-height: 46px; font-size: 16px; }
  .domain-admin-tools-meta { display: grid; grid-template-columns: 1fr auto auto; gap: 7px; }
  .domain-admin-tools-meta > span { overflow: hidden; text-overflow: ellipsis; }
  .domain-batch-button, .domain-group-toggle { min-height: 44px; padding: 0 10px; }
  .domain-group-head { align-items: flex-start; flex-direction: column; }
  .group-actions { width: 100%; justify-content: flex-start; gap: 8px; flex-wrap: wrap; }
  .group-actions .text-link { display: inline-flex; min-width: 72px; min-height: 44px; align-items: center; justify-content: center; padding: 0 10px; border: 1px solid var(--line); border-radius: 9px; background: #fff; }
  .group-actions .compact-button { min-height: 44px; flex: 1; }
  .group-user-line { flex-wrap: wrap; }
  .group-user p { white-space: normal; }
  .group-target-form { grid-template-columns: 1fr; gap: 10px; padding: 15px 16px; }
  .group-target-form input { min-height: 48px; font-size: 16px; }
  .group-target-form .button { width: 100%; min-height: 46px; }
  .inline-target-row { grid-template-columns: 1fr; }
  .inline-target-row input { min-height: 48px; font-size: 16px; }
  .inline-target-row .button { min-height: 46px; }
  .button, .quick-link, .table-action, .link-button { min-height: 44px; }
  .table-action, .link-button { display: inline-flex; align-items: center; }
  .action-row { gap: 6px; flex-wrap: wrap; }
  .action-row form { display: flex; }
  .action-row .table-action, .action-row .link-button { min-width: 44px; justify-content: center; padding: 0 8px; border: 1px solid #e1e8e3; border-radius: 8px; background: #f8faf8; }
  .table-panel { overflow: visible; border: 0; background: transparent; box-shadow: none; }
  .table-panel > .panel-head { margin-bottom: 10px; border: 1px solid var(--line); border-radius: 13px; background: #fff; }
  .table-wrap { overflow: visible; }
  .table-wrap table, .table-wrap tbody { display: block; width: 100%; }
  .table-wrap thead { display: none; }
  .table-wrap tbody { display: grid; gap: 10px; }
  .table-wrap tr { display: grid; padding: 14px 16px; border: 1px solid var(--line); border-radius: 13px; background: #fff; box-shadow: var(--shadow); }
  .table-wrap td { display: grid; min-height: 38px; padding: 8px 0; grid-template-columns: 92px minmax(0, 1fr); align-items: center; gap: 10px; border: 0; border-top: 1px dashed #edf0ed; }
  .table-wrap td:first-child { border-top: 0; }
  .table-wrap td::before { content: attr(data-label); color: #8a958e; font-size: 9px; font-weight: 700; }
  .table-wrap td > * { min-width: 0; }
  .table-wrap .url-text, .table-wrap .change-cell span { max-width: 100%; white-space: normal; overflow-wrap: anywhere; }
  .table-wrap .user-remark { margin-left: 0; }
  .table-wrap .user-cell-main { grid-column: 2; }
  .table-wrap .user-cell-main .user-chip { margin-right: 10px; }
}
@media (max-width: 350px) {
  .simple-user .topbar h1 { font-size: 17px; line-height: 1.25; }
  .simple-user .topbar p { display: none; }
  .simple-user .user-contact-top a { min-width: 54px; padding-inline: 10px; }
  .chat-connection-status { justify-content: flex-start; }
  .chat-connection-status span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}

@media (max-width: 560px) {
  html.chat-keyboard-open .chat-page .topbar { min-height: 52px; padding-block: 4px; }
  html.chat-keyboard-open .chat-page .content { height: calc(100% - 52px); }
  html.chat-keyboard-open .chat-page .chat-window-head { min-height: 44px; padding-block: 5px; }
  html.chat-keyboard-open .chat-page .chat-window-head small { display: none; }
  html.chat-keyboard-open .chat-connection-status { top: calc(var(--chat-viewport-offset-top, 0px) + 58px); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
