:root {
  color-scheme: light;
  --bg: #f3f6f6;
  --paper: #fff;
  --ink: #182d31;
  --muted: #546969;
  --line: #dbe4e3;
  --soft: #f4f7f6;
  --teal: #00695f;
  --teal-soft: #ddf4eb;
  --red: #a12e42;
  --radius: 20px;
  --shadow: 0 3px 14px #213c3c08;
  font: 15px/1.55 Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background: var(--bg);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
}

button,input,textarea,select {
  font: inherit;
  color: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

button,summary {
  cursor: pointer;
}

button {
  border: 0;
  background: none;
}

:where(a,button,summary,input,select,textarea):focus-visible {
  outline: 3px solid #188780;
  outline-offset: 3px;
}

button:disabled {
  cursor: not-allowed;
  opacity: .48;
}

.hidden,[hidden] {
  display: none!important;
}

h1,h2,h3,h4,p {
  margin: 0;
}

h1,h2,h3,h4 {
  line-height: 1.25;
  letter-spacing: -.035em;
}

h1 {
  font-size: clamp(26px,3vw,40px);
}

h2 {
  font-size: clamp(25px,3vw,36px);
}

h3 {
  font-size: 19px;
}

small,.muted,.note {
  color: var(--muted);
}

.muted,.note {
  font-size: 13px;
}

.note {
  margin-top: 12px;
}

.icon {
  width: 20px;
  height: 20px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.65;
  stroke-linejoin: round;
  stroke-linecap: round;
}

.eyebrow,.nav-group,.hero-label {
  font-size: 12px;
  font-weight: 650;
  letter-spacing: .055em;
}

.eyebrow {
  color: var(--muted);
  margin-bottom: 6px;
}

.brand {
  display: inline-flex;
  gap: 11px;
  align-items: center;
  width: fit-content;
}

.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  background: #123734;
  border: 1px solid #33645d;
  border-radius: 14px;
  color: #a0f7d6;
  box-shadow: inset 0 1px 2px #a9edd844;
}

.brand-mark .icon {
  width: 30px;
  height: 30px;
  fill: currentColor;
  stroke: none;
}

.brand-type {
  font-size: 24px;
  font-weight: 810;
  letter-spacing: -.065em;
  line-height: 1.12;
}

.brand-type span {
  display: block;
  margin-top: 4px;
  font-size: 11px;
  letter-spacing: .08em;
  font-weight: 600;
  color: var(--muted);
}

.login-shell {
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: radial-gradient(ellipse at 25% 30%,#e2f1e9,transparent 56%),#f1f5f4;
}

.login-frame {
  display: grid;
  grid-template-columns: 1.08fr 1fr;
  width: min(930px,100%);
  border: 1px solid var(--line);
  background: white;
  border-radius: 30px;
  box-shadow: 0 24px 100px #203b3a16;
  overflow: hidden;
}

.login-art,.hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background: radial-gradient(ellipse at 70% 55%,#225957 0%,transparent 54%),linear-gradient(110deg,#102b2c,#143a39 68%,#153230);
  color: #f2fcf8;
}

.login-art::before,.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image: linear-gradient(#92e8ce09 1px,transparent 1px),linear-gradient(90deg,#92e8ce09 1px,transparent 1px);
  background-size: 27px 27px;
  mask-image: linear-gradient(90deg,transparent,#000);
}

.login-art {
  padding: 34px;
  display: flex;
  min-height: 505px;
  flex-direction: column;
  justify-content: space-between;
}

.login-art .brand-type span,.login-art p {
  color: #b0cec4;
}

.login-art img {
  width: min(100%,410px);
  height: auto;
  align-self: center;
}

.login-art p {
  margin-top: 8px;
}

.login-card {
  padding: clamp(26px,5vw,62px);
  align-self: center;
}

.login-card .field {
  margin-top: 30px;
}

.login-submit {
  width: 100%;
  margin-top: 18px;
}

.error {
  min-height: 20px;
  margin-top: 10px;
  color: var(--red);
  font-size: 13px;
}

.app {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 216px minmax(0,1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100dvh;
  overflow: auto;
  background: #fcfdfc;
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  padding: 30px 17px 16px;
  z-index: 4;
}

.sidebar-head {
  padding: 0 10px 24px;
}

.side-controls {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.nav-group {
  margin: 20px 12px 6px;
  color: var(--muted);
  font-size: 11px;
}

.nav-group:first-child {
  margin-top: 2px;
}

.sidebar nav a,.logout {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 13px;
  min-height: 44px;
  border-radius: 11px;
  font-size: 14px;
  font-weight: 560;
  color: #415454;
}

.sidebar nav a:hover,.logout:hover {
  background: var(--soft);
}

.sidebar nav a.active {
  color: #085d51;
  background: #e1f1e9;
  font-weight: 700;
}

.logout {
  width: 100%;
  margin-top: auto;
  border-top: 1px solid var(--line);
  border-radius: 0;
  padding-top: 18px;
}

.mobile-nav {
  display: none!important;
}

main {
  width: 100%;
  min-width: 0;
  max-width: 1540px;
  margin: 0 auto;
  padding: 30px clamp(20px,3.3vw,60px) 56px;
}

.topbar,.panel-heading,.section-heading,.step-heading,.template-card-head,.editor-actions,.page-actions,.form-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.topbar {
  margin-bottom: 24px;
}

.badge,.number-pill,.state-label {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  gap: 7px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 99px;
  font-size: 12px;
  font-weight: 650;
  background: #fff;
  color: var(--muted);
}

.badge::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}

.badge.online,.state-label.waiting {
  color: #126545;
  background: #edf8ef;
  border-color: #d2e8d8;
}

.badge.offline,.state-label.review {
  color: #8a5016;
  background: #fff5df;
  border-color: #ead9b8;
}

.number-pill {
  padding: 2px 8px;
  vertical-align: middle;
  font-variant-numeric: tabular-nums;
  background: var(--soft);
}

.page {
  display: none;
}

.page.active {
  display: block;
  animation: reveal .18s ease-out;
}

@keyframes reveal {
  from {
    opacity: .55;
    transform: translateY(3px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.panel,.metric,.template-card {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  box-shadow: var(--shadow);
}

.panel {
  padding: 22px;
}

.panel-heading,.section-heading {
  margin-bottom: 16px;
}

.panel-heading .muted,.section-heading .muted {
  margin-top: 6px;
}

.hero {
  border-radius: 23px;
  display: flex;
  min-height: 210px;
  align-items: center;
  padding: 28px clamp(22px,3vw,44px);
  box-shadow: var(--shadow);
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 62%;
  overflow-wrap: anywhere;
}

.hero h3 {
  font-size: clamp(28px,3.2vw,46px);
  letter-spacing: -.055em;
  margin: 7px 0 4px;
}

.hero-label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #aff5d9;
}

#metricError {
  color: #c3dcd4;
  font-size: 14px;
}

.hero img {
  position: absolute;
  right: 2%;
  top: 50%;
  width: 42%;
  height: 103%;
  object-fit: contain;
  transform: translateY(-50%);
  z-index: -1;
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-top: 20px;
  flex-wrap: wrap;
}

.hero-btn,.hero-secondary,.text-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  font-weight: 660;
}

.hero-btn {
  background: #d4fbe8;
  color: #133e35;
  border-radius: 10px;
  padding: 9px 12px;
  min-height: 40px;
}

.hero-btn b {
  font-variant-numeric: tabular-nums;
}

.hero-secondary {
  color: #d5e9e2;
}

.hero-actions .icon,.text-link .icon {
  width: 15px;
  height: 15px;
}

.summary-title {
  margin: 24px 1px 12px;
}

.summary-title small {
  font-size: 12px;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4,minmax(0,1fr));
  gap: 12px;
}

.metric {
  padding: 18px 20px 14px;
}

.metric>div {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 13px;
  font-weight: 630;
  color: #445a59;
}

.metric strong {
  display: block;
  font-size: clamp(28px,3vw,40px);
  line-height: 1.25;
  margin-top: 8px;
  letter-spacing: -.04em;
  font-variant-numeric: tabular-nums;
}

.tile-icon {
  display: inline-grid;
  place-items: center;
  width: 33px;
  height: 33px;
  flex: none;
  border-radius: 10px;
}

.green {
  background: #e1f4eb;
  color: #197152;
}

.purple {
  background: #f0ebfb;
  color: #7556a1;
}

.blue {
  background: #e6f1fc;
  color: #366c9e;
}

.amber {
  background: #fcf0dc;
  color: #855b20;
}

.dashboard-grid,.binding-grid,.join-management-layout,.moderation-layout,.menu-layout,.auto-reply-layout {
  display: grid;
  grid-template-columns: minmax(0,1.45fr) minmax(275px,.9fr);
  gap: 16px;
  align-items: start;
}

.dashboard-grid {
  margin: 16px 0;
  align-items: stretch;
}

.quick-links,.activity-list,.reply-rule-list,.variable-list,#menuItems {
  display: grid;
  gap: 6px;
}

.quick-link {
  display: flex;
  align-items: center;
  gap: 13px;
  border-radius: 12px;
  padding: 7px 6px;
}

.quick-link:hover,.member-row.selected {
  background: var(--soft);
}

.quick-link .tile-icon {
  width: 38px;
  height: 38px;
}

.quick-link b,.quick-link small,.activity-copy b,.activity-copy small,.overview-list span,.overview-list b,.member-pick b,.member-pick small {
  display: block;
}

.quick-link b {
  font-size: 14px;
}

.quick-link small,.activity-copy small {
  font-size: 12px;
}

.quick-link>.icon {
  margin-left: auto;
  color: var(--muted);
  width: 15px;
  height: 15px;
}

.text-link {
  color: var(--teal);
  min-height: 32px;
  padding: 3px 0;
}

.activity {
  display: grid;
  grid-template-columns: 11px minmax(0,1fr) auto;
  gap: 12px;
  align-items: baseline;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}

.activity:last-child {
  border: 0;
}

.activity::before {
  content: "";
  background: #6bab91;
  border-radius: 50%;
  width: 7px;
  height: 7px;
  align-self: start;
  margin-top: 8px;
}

.activity-copy {
  min-width: 0;
}

.activity-copy b {
  font-size: 14px;
}

.activity-copy small {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.activity time {
  font-size: 11px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.overview-list,.form-grid,.template-grid,.option-grid {
  display: grid;
  grid-template-columns: repeat(2,minmax(0,1fr));
  gap: 14px;
}

.overview-list {
  grid-template-columns: repeat(4,minmax(0,1fr));
  gap: 12px;
}

.overview-list b {
  overflow-wrap: anywhere;
  font-size: 13px;
}

.overview-list span {
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 4px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  font-size: 13px;
  font-weight: 640;
  color: #2b4242;
  min-width: 0;
}

.field small {
  font-weight: 450;
  font-size: 12px;
  color: var(--muted);
}

.field+.field,.form-grid+.field {
  margin-top: 14px;
}

.form-grid>.field+.field {
  margin: 0;
}

input:not([type=checkbox]),select,textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid #bccdc8;
  border-radius: 10px;
  background: #fcfdfc;
  padding: 10px 12px;
  font-size: 14px;
  font-weight: 450;
  line-height: 1.55;
}

input:not([type=checkbox]),select {
  min-height: 44px;
}

.token-control { position: relative; }
.token-control input:not([type=checkbox]) { padding-right: 48px; }
.token-control input::-ms-reveal { display: none; }
.token-control button {
  position: absolute;
  inset: 2px 2px 2px auto;
  width: 42px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
}
.token-control button:enabled:hover { color: var(--teal); background: var(--soft); }

textarea {
  display: block;
  resize: vertical;
  min-height: 66px;
}

input::placeholder,textarea::placeholder {
  color: #637772;
}

input:disabled {
  background: var(--soft);
  color: var(--muted);
}

input[type=checkbox] {
  accent-color: var(--teal);
}

button.primary,button.ghost,button.danger,.icon-add {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 9px 15px;
  border-radius: 11px;
  line-height: 1.45;
  font-size: 14px;
  font-weight: 660;
}

.primary {
  background: var(--teal);
  color: white;
  box-shadow: 0 2px 6px #1854501a;
}

.ghost,.icon-add {
  border: 1px solid var(--line);
  background: var(--soft);
  color: #294e47;
}

.danger {
  background: #fcf0f1;
  color: var(--red);
  border: 1px solid #efd4d9;
}

button:not(:disabled):hover,.hero-btn:hover {
  filter: brightness(.96);
}

.compact {
  font-size: 12px!important;
  min-height: 36px!important;
  padding: 7px 11px!important;
}

.full {
  width: 100%;
}

.form-actions,.editor-actions {
  justify-content: flex-end;
  margin-top: 18px;
}

.page-actions {
  flex-wrap: wrap;
}

.page-actions select {
  width: auto;
}

.toggle-control {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  gap: 8px;
  white-space: nowrap;
  font-size: 12px;
  cursor: pointer;
}

.toggle-control input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.toggle-control>span {
  position: relative;
  width: 36px;
  height: 22px;
  flex: none;
  border: 1px solid #a5b5af;
  border-radius: 13px;
  background: #b5c2bc;
}

.toggle-control>span::after {
  content: "";
  display: block;
  width: 16px;
  height: 16px;
  margin: 2px;
  border-radius: 50%;
  background: white;
  box-shadow: 0 1px 3px #0002;
  transition: transform .15s;
}

.toggle-control input:checked+span {
  background: var(--teal);
  border-color: var(--teal);
}

.toggle-control input:checked+span::after {
  transform: translateX(14px);
}

.toggle-control input:focus-visible+span {
  outline: 3px solid #188780;
  outline-offset: 3px;
}

.join-management-main,.join-management-side,.moderation-side,.menu-main,.menu-side {
  display: grid;
  gap: 16px;
  min-width: 0;
}

.join-management-main .panel-heading {
  margin-bottom: 0;
}

.join-step,.info-strip,.preview-box,.option-card,.variable-chip,.reply-rule-item,.chat-preview {
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 13px;
}

.join-step {
  display: grid;
  grid-template-columns: minmax(0,1fr);
  padding: 14px;
  gap: 10px;
}

.step-index {
  color: var(--teal);
  font-size: 12px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  padding-top: 3px;
}

.step-heading,.template-card-head {
  margin-bottom: 10px;
  align-items: flex-start;
}

.step-heading small,.template-card-head small {
  display: block;
  font-size: 12px;
  margin-top: 3px;
}

.join-timeout-text,.variable-list,.compact-grid,.info-strip,.admin-skip,.tag-editor,.preview-box {
  margin-top: 14px;
}

.join-preview-line {
  display: grid;
  gap: 2px 10px;
  grid-template-columns: 7px 1fr;
  margin-top: 12px;
  font-size: 13px;
}

.preview-dot {
  width: 7px;
  height: 7px;
  background: #689e8b;
  border-radius: 50%;
  grid-row: span 2;
  margin-top: 7px;
}

.preview-dot.warning {
  background: #b57a25;
}

.info-strip,.preview-box {
  padding: 13px;
}

.info-strip b,.info-strip span {
  display: block;
  font-size: 13px;
}

.info-strip span {
  margin-top: 4px;
  color: var(--muted);
}

.variable-chip {
  display: flex;
  align-items: center;
  text-align: left;
  gap: 12px;
  padding: 9px 12px;
  font-size: 13px;
}

.variable-chip code {
  color: var(--teal);
  min-width: 85px;
}

.template-section {
  margin-top: 24px;
}

.template-card {
  padding: 16px;
}

.inline-variables,.tag-editor,.pack-option {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.inline-variables {
  margin-top: 8px;
}

.inline-variables button,.word-tag {
  color: var(--teal);
  border: 1px solid #c7e2d7;
  background: #eef7f2;
  border-radius: 8px;
  font-size: 12px;
  padding: 4px 8px;
}

.tag-editor {
  min-height: 44px;
  margin-top: 0;
}

.tag-editor:empty::before {
  content: "暂未添加词条";
  font-weight: 450;
  color: var(--muted);
}

.word-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  overflow-wrap: anywhere;
}

.word-tag button {
  border-radius: 6px;
  font-size: 17px;
  line-height: 1.25;
  color: var(--teal);
}

.packs {
  margin: 14px 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.packs summary {
  font-weight: 650;
  color: var(--teal);
  font-size: 14px;
}

.packs .muted {
  margin: 9px 0;
}

.pack-option {
  align-items: flex-start;
  display: grid;
  grid-template-columns: 16px 1fr;
  margin: 8px 0;
  font-size: 13px;
}

.pack-option small {
  display: block;
}

.option-grid {
  margin-top: 16px;
  gap: 8px;
}

.option-card {
  display: flex;
  gap: 8px;
  padding: 12px;
  align-items: flex-start;
  cursor: pointer;
}

.option-card b,.option-card small {
  display: block;
}

.option-card b {
  font-size: 13px;
}

.option-card small {
  font-size: 12px;
  margin-top: 3px;
}

.admin-skip {
  display: flex;
}

.preview-box {
  margin-bottom: 15px;
}

.preview-box span,.chat-author {
  font-size: 12px;
  color: var(--muted);
}

.preview-box p,.chat-message {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.moderation-side .field,.moderation-reply textarea {
  margin: 12px 0;
}

.moderation-reply .muted {
  margin-top: 6px;
}

.pending-panel {
  margin-bottom: 16px;
}

.pending-row,.member-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 14px;
  padding: 12px 3px;
  border-top: 1px solid var(--line);
  overflow-wrap: anywhere;
}

.pending-row small,.member-row small {
  display: block;
  font-size: 12px;
}

.pending-row b {
  font-size: 14px;
}

.pending-row time {
  font-variant-numeric: tabular-nums;
}

.member-row {
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 11px;
}

.member-pick {
  flex: 1;
  min-width: 90px;
  text-align: left;
  padding: 3px 6px;
  overflow-wrap: anywhere;
}

.member-pick small {
  color: var(--muted);
}

.row-actions {
  display: flex;
  align-items: center;
  gap: 3px;
  flex-wrap: wrap;
}

.row-actions button {
  min-height: 36px;
  padding: 5px 8px;
  color: var(--teal);
  font-size: 12px;
  border-radius: 8px;
  background: #eef4f1;
}

.row-actions button[data-action=remove] {
  color: var(--red);
}

#editDownload {
  margin-top: 14px;
}

.menu-side {
  position: sticky;
  top: 18px;
}

.segment {
  display: flex;
  background: var(--soft);
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 11px;
  gap: 2px;
}

.segment button {
  flex: 1;
  border-radius: 8px;
  padding: 7px;
  font-size: 13px;
}

.segment button[aria-pressed=true] {
  background: var(--paper);
  color: var(--teal);
  box-shadow: 0 1px 5px #17383024;
  font-weight: 700;
}

.chat-preview {
  padding: 15px;
  display: grid;
  gap: 7px;
  margin-top: 14px;
  background: #eef4f0;
}

.chat-request,.chat-message {
  padding: 9px 12px;
  font-size: 14px;
  width: fit-content;
  max-width: 100%;
  overflow-wrap: anywhere;
}

.chat-request {
  justify-self: end;
  background: #c6e9d8;
  border-radius: 12px 12px 2px 12px;
}

.chat-author {
  margin-top: 7px;
}

.chat-message {
  background: white;
  border-radius: 2px 12px 12px 12px;
}

.auto-reply-layout {
  grid-template-columns: minmax(210px,.65fr) minmax(0,1.65fr);
}

.reply-rule-list {
  margin-top: 12px;
}

.reply-rule-item {
  padding: 10px 12px;
  text-align: left;
  min-width: 0;
}

.reply-rule-item.active {
  background: var(--teal-soft);
  border-color: #a5cbbd;
}

.reply-rule-item strong {
  display: flex;
  align-items: center;
  gap: 7px;
}

.reply-rule-item i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #94a29d;
}

.reply-rule-item i.enabled {
  background: var(--teal);
}

.reply-rule-item small {
  display: block;
  overflow-wrap: anywhere;
}

.reply-editor .field {
  margin-top: 12px;
}

.form-grid.three {
  grid-template-columns: repeat(3,minmax(0,1fr));
}

.empty-editor,.empty-state {
  padding: 28px 8px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}

.empty-editor h3 {
  margin-bottom: 8px;
}

.log-panel {
  padding: 8px 18px;
}

.log-head,.log-row {
  display: grid;
  grid-template-columns: 1fr .76fr 1.4fr .7fr 1fr;
  align-items: start;
  gap: 12px;
  padding: 12px 0;
  font-size: 13px;
  overflow-wrap: anywhere;
}

.log-head {
  color: var(--muted);
  font-size: 12px;
}

.log-row {
  border-top: 1px solid var(--line);
}

.log-user small,.log-keyword small {
  display: block;
}

.log-result,.log-action {
  color: var(--teal);
}

.log-result.failed {
  color: var(--red);
}

.log-time {
  color: var(--muted);
  font-size: 12px;
}

.notice {
  padding: 13px 16px;
  border-radius: 12px;
  background: #fff4de;
  color: #734b10;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 14px;
}

.page [inert] {
  opacity: .6;
}

.toast {
  position: fixed;
  z-index: 9;
  bottom: 20px;
  left: 50%;
  transform: translate(-50%,8px);
  width: max-content;
  max-width: calc(100% - 32px);
  padding: 10px 18px;
  border-radius: 12px;
  background: #183331;
  color: #fff;
  box-shadow: 0 6px 24px #18333125;
  opacity: 0;
  pointer-events: none;
  transition: .16s;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%,0);
}

@media(max-width:1100px) {
  .app {
    grid-template-columns: 190px minmax(0,1fr);
  }
  main {
    padding-inline: 20px;
  }
  .metric {
    padding: 15px 12px;
  }
  .dashboard-grid,.binding-grid,.menu-layout,.moderation-layout,.join-management-layout {
    grid-template-columns: minmax(0,1.25fr) minmax(245px,1fr);
  }
  .join-step {
    grid-template-columns: 1fr;
  }
  .step-index {
    display: none;
  }
  .panel {
    padding: 17px;
  }
}

@media(max-width:840px) {
  .app {
    display: block;
  }
  .sidebar {
    height: auto;
    position: sticky;
    overflow: visible;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding: 9px 16px;
  }
  .sidebar-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0;
  }
  .sidebar .brand-mark {
    width: 33px;
    height: 33px;
    border-radius: 10px;
  }
  .sidebar .brand-type {
    font-size: 21px;
  }
  .sidebar .brand-type span {
    display: inline;
    margin-left: 9px;
  }
  .mobile-nav {
    display: inline-flex!important;
    min-height: 40px!important;
  }
  .side-controls {
    display: none;
  }
  .sidebar.open .side-controls {
    position: absolute;
    display: flex;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--paper);
    box-shadow: 0 14px 20px #18333122;
    border-bottom: 1px solid var(--line);
    padding: 10px 16px;
    max-height: 78dvh;
    overflow: auto;
  }
  .side-controls nav {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
  }
  .nav-group {
    display: none;
  }
  .logout {
    margin-top: 8px;
  }
  .menu-side {
    position: static;
  }
  .brand {
    gap: 7px;
  }
  .topbar {
    margin-bottom: 17px;
  }
  main {
    padding-top: 18px;
  }
  .login-art {
    min-height: 420px;
  }
}

@media(max-width:700px) {
  .dashboard-grid,.binding-grid,.menu-layout,.moderation-layout,.join-management-layout,.auto-reply-layout {
    grid-template-columns: minmax(0,1fr);
  }
  .metric-grid,.overview-list {
    grid-template-columns: repeat(2,minmax(0,1fr));
  }
  .dashboard-grid {
    gap: 12px;
  }
  .metric {
    padding: 12px 14px;
  }
  .metric strong {
    font-size: 29px;
  }
  .metric .tile-icon {
    width: 27px;
    height: 27px;
  }
  .summary-title {
    margin-top: 20px;
  }
  .hero {
    min-height: 186px;
  }
  .hero-content {
    max-width: 67%;
  }
  .hero img {
    right: -9%;
    width: 57%;
    height: 95%;
  }
  .hero-actions {
    gap: 9px;
  }
  .login-frame {
    grid-template-columns: 1fr;
    max-width: 460px;
  }
  .login-art {
    min-height: 155px;
    padding: 22px;
  }
  .login-art img {
    position: absolute;
    right: -4%;
    width: 45%;
    height: 96%;
    top: 2%;
    object-fit: contain;
    z-index: -1;
  }
  .login-art .brand-type span {
    display: none;
  }
  .login-art h1 {
    font-size: 24px;
  }
  .login-art p {
    font-size: 12px;
  }
  .login-card {
    padding: 25px;
  }
  .log-head {
    display: none;
  }
  .log-row {
    grid-template-columns: 1fr auto;
  }
  .log-keyword {
    grid-column: 1/-1;
  }
  .log-time {
    text-align: right;
  }
  .log-row:first-child {
    border: 0;
  }
}

@media(max-width:480px) {
  main {
    padding: 17px 12px 36px;
  }
  .panel {
    padding: 15px;
  }
  .hero {
    padding: 20px 16px;
  }
  .hero-content {
    max-width: 75%;
  }
  .hero img {
    top: 43%;
    right: -16%;
    width: 62%;
  }
  .hero h3 {
    font-size: 29px;
  }
  .hero-label {
    font-size: 11px;
  }
  .hero-actions {
    margin-top: 14px;
  }
  .hero-btn {
    min-height: 36px;
  }
  .hero-actions a {
    font-size: 12px;
  }
  .login-shell {
    padding: 15px;
  }
  .form-grid,.form-grid.three,.template-grid {
    grid-template-columns: minmax(0,1fr);
  }
  .panel-heading,.section-heading,.step-heading {
    flex-wrap: wrap;
    gap: 8px;
  }
  .activity {
    grid-template-columns: 8px minmax(0,1fr);
  }
  .activity time {
    grid-column: 2;
  }
  .summary-title small {
    font-size: 11px;
  }
  .option-grid {
    grid-template-columns: minmax(0,1fr);
  }
  .row-actions button,.inline-variables button {
    min-height: 40px;
  }
  .page-actions button,.page-actions select {
    flex: 1;
  }
  input:not([type=checkbox]),textarea,select {
    font-size: 16px;
  }
  .pending-row>div {
    flex: 1 1 45%;
  }
  .log-panel {
    padding: 6px 12px;
  }
  .compact {
    min-height: 40px!important;
  }
}

@media(prefers-reduced-motion:reduce) {
  *,*::after,*::before {
    animation: none!important;
    transition: none!important;
  }
}
