:root {
  --bg: #ffde00;
  --card: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --primary: #007bc8;
  --primary-hover: #0368a9;
  --primary-soft: #d5ecfb;
  --accent: #6d28d9;
  --accent-soft: #f5f3ff;
  --accent-border: #ddd6fe;
  --brand-yellow: #ffde00;
  --hint-bg: #fff6cf;
  --hint-border: #f3e39a;
  --hint-text: #5b4a1a;
  --border: #e2e8f0;
  --error: #b91c1c;
  --success: #15803d;
  --info: #0369a1;
  --radius: 16px;
  --radius-sm: 12px;
  --hero-icon: 122px;
  --focus-ring: rgba(0, 123, 200, 0.22);
  --select-border: #0ea5e9;
  --select-bg: #f0f9ff;
  --select-ring: rgba(14, 165, 233, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 1rem;
}

.header {
  background: #ffffff;
  border-bottom: 1px solid #e5e7eb;
}

.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 76px;
  gap: 1.25rem;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 700;
  text-decoration: none !important;
  color: var(--text);
  flex: 0 0 auto;
}

.logo__image {
  width: 44px;
  height: 44px;
  object-fit: cover;
  border-radius: 10px;
  background: var(--bg);
  flex: 0 0 auto;
}

.logo__text {
  display: flex;
  flex-direction: column;
  gap: 0.05rem;
  line-height: 1.15;
}

.logo__text strong {
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.logo__text small {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--muted);
}

.header__right {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin-left: auto;
  min-width: 0;
}

.header__nav {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  padding: 0.28rem;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  background: #fff;
}

.header__nav-link {
  color: var(--text);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 600;
  padding: 0.48rem 0.95rem;
  border-radius: 9px;
  white-space: nowrap;
  transition: background 0.15s ease, color 0.15s ease;
}

.header__nav-link:hover {
  background: #f8fafc;
}

.header__nav-link.is-active {
  background: var(--bg);
  color: var(--text);
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.04);
}

.header__divider {
  width: 1px;
  align-self: stretch;
  min-height: 34px;
  background: #e5e7eb;
  flex: 0 0 auto;
}

.header__tools {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  min-width: 0;
}

.header__status {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #22c55e;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.14);
  flex: 0 0 auto;
}

.header__shop {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-width: 0;
  max-width: 280px;
  font-size: 0.82rem;
  font-weight: 600;
  color: #334155;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 11px;
  padding: 0.42rem 0.65rem;
}

.header__shop-icon {
  width: 18px;
  height: 18px;
  border-radius: 5px;
  background: var(--bg);
  flex: 0 0 auto;
  position: relative;
}

.header__shop-icon::before {
  content: "";
  position: absolute;
  inset: 4px 5px 6px 5px;
  border: 2px solid #111827;
  border-top-width: 3px;
  border-radius: 2px 2px 1px 1px;
}

.header__shop-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.header__shop-chevron {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border-right: 2px solid #94a3b8;
  border-bottom: 2px solid #94a3b8;
  transform: rotate(45deg) translateY(-1px);
  margin-left: 0.1rem;
}

.header__icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border: 1px solid #e5e7eb;
  border-radius: 11px;
  background: #fff;
  color: #64748b;
  text-decoration: none !important;
  font: inherit;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.header__icon-btn:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
  color: #334155;
}

.header__icon-btn.is-active {
  border-color: #facc15;
  background: rgba(255, 222, 0, 0.18);
  color: #111827;
}

.header__icon-btn-svg {
  font-size: 1rem;
  line-height: 1;
}

.main {
  padding: 1.5rem 1rem;
}

.footer {
  padding: 2rem 0;
  color: var(--text);
  font-size: 1rem;
  text-align: center;
}

.footer__signature {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
}

.footer__signature img {
  width: 18px;
  height: 18px;
  object-fit: contain;
}

.help-dialog {
  width: min(620px, calc(100vw - 2rem));
  max-height: calc(100vh - 2rem);
  padding: 0;
  border: 0;
  border-radius: 18px;
  background: #fff;
  color: var(--text);
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.28);
}

.help-dialog.is-open {
  position: fixed;
  inset: 50% auto auto 50%;
  transform: translate(-50%, -50%);
  margin: 0;
  z-index: 1201;
}

.help-dialog-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  z-index: 1200;
}

.help-dialog::backdrop {
  background: rgba(15, 23, 42, 0.5);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
}

.help-dialog__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem 1.35rem;
  border-bottom: 1px solid var(--border);
  background: #fffbea;
}

.help-dialog__eyebrow {
  display: block;
  margin-bottom: 0.2rem;
  color: #a16207;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.help-dialog__head h2 {
  margin: 0;
  font-size: 1.35rem;
}

.help-dialog__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  background: #fff;
  color: #475569;
  font: inherit;
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
}

.help-dialog__steps {
  display: grid;
  gap: 0.8rem;
  margin: 0;
  padding: 1.25rem 1.5rem 1.25rem 3.25rem;
}

.help-dialog__steps li {
  padding-left: 0.25rem;
  color: #475569;
  line-height: 1.45;
}

.help-dialog__steps li::marker {
  color: #7c3aed;
  font-weight: 800;
}

.help-dialog__steps strong {
  color: #0f172a;
}

.help-dialog__support {
  margin: 0 1.35rem 1.35rem;
  padding: 1rem;
  border: 1px solid #bae6fd;
  border-radius: 12px;
  background: #f0f9ff;
}

.help-dialog__support p {
  margin: 0.3rem 0 0;
  color: #334155;
  line-height: 1.5;
}

.help-dialog__support a {
  font-weight: 700;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.06);
}

/* Shared Haskimail page hero — used across SMTP / send / logs / tags / auth */
.page-hero,
.send-page__hero,
.servers-page__hero,
.logs-page__hero,
.tag-page--hero,
.authorize-card,
.app-hero {
  padding: 1.15rem 1.25rem;
  margin-bottom: 1rem;
  border-radius: var(--radius);
}

.page-hero__toolbar,
.send-page__toolbar,
.servers-page__toolbar,
.logs-page__toolbar,
.tag-page__toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.65rem;
}

.page-hero__back,
.send-page__back,
.servers-page__back,
.logs-page__back,
.tag-page__back {
  color: var(--accent);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
}

.page-hero__back:hover,
.send-page__back:hover,
.servers-page__back:hover,
.logs-page__back:hover,
.tag-page__back:hover {
  text-decoration: underline;
}

.page-hero__layout,
.send-hero,
.servers-hero,
.logs-hero,
.app-hero__main,
.tag-page__hero-main {
  display: grid;
  grid-template-columns: var(--hero-icon) minmax(0, 1fr);
  gap: 1.1rem;
  align-items: center;
}

.send-hero {
  grid-template-columns: var(--hero-icon) minmax(0, 1fr) auto;
}

.authorize-card {
  display: grid;
  grid-template-columns: minmax(160px, var(--hero-icon)) minmax(0, 1fr);
  gap: 1.1rem;
  align-items: center;
  max-width: 860px;
  margin-left: auto;
  margin-right: auto;
}

.page-hero__icon,
.send-hero__icon,
.servers-hero__icon,
.logs-hero__icon,
.app-hero__icon,
.tag-page__hero-main > img,
.authorize-card__visual img {
  width: var(--hero-icon);
  height: var(--hero-icon);
  max-width: var(--hero-icon);
  border: 0;
  border-radius: 0;
  object-fit: contain;
  background: transparent;
  justify-self: start;
  filter: drop-shadow(0 3px 6px rgba(15, 23, 42, 0.08));
}

.page-hero__content h1,
.send-hero__content h1,
.servers-hero__content h1,
.logs-hero__content h1,
.app-hero h1,
.tag-page__hero h1,
.authorize-card__content > h1 {
  margin: 0 0 0.45rem;
  font-size: 1.75rem;
  line-height: 1.1;
  letter-spacing: -0.02em;
  font-weight: 800;
}

.page-hero__content p,
.send-hero__content p,
.servers-hero__content p,
.logs-hero__content p,
.app-hero p,
.authorize-card__content > p {
  max-width: 44ch;
  margin: 0 0 0.85rem;
  font-size: 0.92rem;
}

.page-hero__hint,
.send-hero__hint,
.logs-hero__hint,
.tag-page__hint,
.servers-hero__hint {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0.9rem 0 0;
  padding: 0.44rem 0.68rem;
  border-radius: 9px;
  border: 1px solid var(--hint-border);
  background: var(--hint-bg);
  color: var(--hint-text);
  font-size: 0.84rem;
}

.page-hero__hint img,
.send-hero__hint img,
.logs-hero__hint img,
.tag-page__hint-icon,
.servers-hero__hint img {
  width: 15px;
  height: 15px;
  object-fit: contain;
  flex: 0 0 auto;
}

.page-hero__stats,
.send-hero__stats,
.servers-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  max-width: 100%;
}

.page-stat,
.send-hero__stat,
.servers-stats__item {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  min-width: 132px;
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fff;
}

.topic-badge,
.app-count,
.tag-page__accent {
  color: var(--accent);
}

.topic-badge {
  background: var(--accent-soft);
}

.tag-page__hero {
  display: block;
  margin-bottom: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.tag-page__hero-main {
  grid-template-columns: var(--hero-icon) minmax(0, 1fr);
}

.authorize-card__visual {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
  border: 0;
  background: transparent;
  padding: 0;
}

.card--narrow {
  max-width: 480px;
  margin: 0 auto;
}

.page-head {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.page-head img {
  width: 52px;
  height: 52px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #fff;
}

.card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.card__actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.card__head h1 {
  margin: 0;
  font-size: 1.35rem;
  line-height: 1.2;
}

.app-hero {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
  padding: 1rem 1.1rem;
  border-radius: 16px;
}

.app-hero--narrow {
  max-width: 760px;
  margin-left: auto;
  margin-right: auto;
}

.app-hero__main {
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr);
  align-items: center;
  gap: 1rem;
  flex: 1 1 390px;
}

.app-hero__icon {
  width: 120px;
  height: 120px;
  object-fit: contain;
  border-radius: 18px;
  background: #fff;
}

.app-hero h1 {
  margin: 0 0 0.35rem;
  font-size: 1.8rem;
  line-height: 1.1;
}

.app-hero p {
  margin: 0;
  max-width: 620px;
}

.app-section {
  margin-top: 1rem;
}

.app-section--narrow {
  max-width: 640px;
  margin-left: auto;
  margin-right: auto;
}

.app-section__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.app-section__head h2 {
  margin: 0;
  font-size: 1.15rem;
}

.authorize-card__content {
  display: flex;
  flex-direction: column;
}

.authorize-card__token {
  flex: 1;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #f8fafc;
}

.authorize-card__token h2 {
  margin: 0 0 0.4rem;
  font-size: 1.15rem;
}

.authorize-card__token p {
  margin: 0;
}

.authorize-card__form {
  margin-top: 1rem;
}

.app-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  padding: 0.25rem 0.7rem;
  font-size: 0.78rem;
  font-weight: 700;
}

.empty-state {
  display: grid;
  justify-items: center;
  gap: 0.45rem;
  padding: 1.8rem 1rem;
  text-align: center;
  border: 1px dashed #cbd5e1;
  border-radius: 14px;
  background: #f8fafc;
}

.empty-state strong {
  font-size: 1.05rem;
}

.empty-state p {
  margin: 0;
  max-width: 480px;
}

.status-card {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 0.75rem;
  padding: 0.8rem 0.9rem;
  border: 1px solid #bbf7d0;
  border-radius: 14px;
  background: #f0fdf4;
}

.status-card--success {
  margin: 0;
}

.status-card__dot {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: #22c55e;
  box-shadow: 0 0 0 5px rgba(34, 197, 94, 0.12);
}

.status-card span,
.status-card small,
.status-card strong {
  display: block;
}

.status-card strong {
  margin-top: 0.1rem;
}

.status-card small {
  margin-top: 0.1rem;
  color: var(--muted);
}

.setup-list {
  display: grid;
  gap: 0.7rem;
}

.setup-list > div {
  display: grid;
  gap: 0.35rem;
  padding: 0.8rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #f8fafc;
}

.setup-list span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.setup-list code {
  overflow-wrap: anywhere;
}

.muted {
  color: var(--muted);
}

.error {
  color: var(--error);
}

.flash-list {
  list-style: none;
  padding: 0;
  margin: 0 0 1rem;
}

.flash {
  padding: 0.75rem 1rem;
  border-radius: 12px;
  margin-bottom: 0.5rem;
  border: 1px solid transparent;
}

.flash--error {
  background: #fef2f2;
  color: var(--error);
  border-color: #fecaca;
}

.flash--success {
  background: #f0fdf4;
  color: var(--success);
  border-color: #bbf7d0;
}

.flash--info {
  background: #f0f9ff;
  color: var(--info);
  border-color: #bae6fd;
}

.form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 1.25rem;
}

.form__label {
  font-weight: 600;
  font-size: 0.875rem;
}

.form__input {
  background: #fff;
  padding: 0.625rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 1rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.form__input:focus {
  outline: none;
  border-color: #7dd3fc;
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.24);
}

select.form__input {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background:
    linear-gradient(45deg, transparent 50%, #64748b 50%) calc(100% - 18px) 50% / 6px 6px no-repeat,
    linear-gradient(135deg, #64748b 50%, transparent 50%) calc(100% - 14px) 50% / 6px 6px no-repeat,
    #fff;
  padding-right: 2rem;
}

.webhooks-list {
  margin-top: 1.5rem;
}

.webhooks-list summary {
  cursor: pointer;
  margin-bottom: 0.5rem;
}

.tag-page {
  padding: 0.95rem;
}

.tag-page__preview-btn {
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  border-radius: 8px;
  padding: 0.42rem 0.62rem;
  font-size: 0.8rem;
  cursor: pointer;
}

.tag-page__accent {
  color: var(--accent);
}

.tag-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 0.9rem;
  align-items: start;
}

.tag-sidebar {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.7rem;
  position: sticky;
  top: 78px;
}

.tag-search {
  position: relative;
  margin-top: 0.5rem;
}

.tag-search .form__input {
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #fff;
  padding: 0.45rem 0.55rem;
  font-size: 0.9rem;
}

.tag-search__suggest {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 30;
  max-height: 220px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.1);
}

.tag-search__item {
  display: block;
  width: 100%;
  border: 0;
  background: #fff;
  text-align: left;
  padding: 0.5rem 0.65rem;
  cursor: pointer;
  font-size: 0.92rem;
}

.tag-search__item:hover {
  background: #eef6fc;
}

.tag-sidebar__groups {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.tag-nav-btn {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  border: 1px solid rgba(250, 204, 21, 0.55);
  border-radius: 8px;
  background: rgba(255, 222, 0, 0.18);
  padding: 0.45rem 0.55rem;
  cursor: pointer;
  font-size: 0.9rem;
  text-align: left;
}

.tag-nav-btn:hover {
  border-color: #facc15;
  background: rgba(255, 222, 0, 0.42);
}

.tag-nav-btn.is-active {
  border-color: #facc15;
  background: rgba(255, 222, 0, 0.42);
}

.tag-nav-btn__label {
  position: relative;
  padding-left: 0.55rem;
}

.tag-nav-btn__meta {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.tag-nav-btn__icon {
  width: 20px;
  height: 20px;
  object-fit: contain;
}

.tag-nav-btn__label::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.08rem;
  bottom: 0.08rem;
  width: 4px;
  border-radius: 3px;
  background: #ffde00;
}

.tag-nav-btn__count {
  min-width: 1.5rem;
  text-align: center;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.75);
  color: #0f172a;
  font-size: 0.75rem;
  padding: 0.1rem 0.35rem;
}

.tag-content__empty {
  margin: 0.2rem 0 0.8rem;
}

.tag-group {
  overflow: hidden;
  border: 1px solid #d7deea;
  border-radius: 12px;
  background: #fff;
  margin-bottom: 0.85rem;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.035);
}

.tag-group summary {
  cursor: pointer;
  padding: 0.78rem 0.95rem;
  font-weight: 700;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #f8fafc;
}

.tag-group[open] summary {
  border-bottom: 1px solid #d7deea;
}

.tag-group__subtitle {
  display: block;
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 0.1rem;
  font-weight: 500;
}

.tag-group__count {
  font-weight: 500;
  color: var(--muted);
  font-size: 0.82rem;
}

.tag-table {
  margin-top: 0;
  font-size: 0.88rem;
  table-layout: fixed;
  border-radius: 0;
}

.tag-group .table-wrap {
  overflow-x: auto;
  border: 0;
  border-radius: 0;
}

.tag-table th {
  padding: 0.62rem 0.85rem;
  background: #fff;
  color: #64748b;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
}

.tag-table th:first-child {
  width: 22%;
}

.tag-table th:nth-child(2) {
  width: 18%;
}

.tag-table th:nth-child(3) {
  width: 30%;
}

.tag-table th:nth-child(4) {
  width: 30%;
}

.tag-table td {
  padding: 0.68rem 0.85rem;
  vertical-align: middle;
}

.tag-table tbody tr:last-child td {
  border-bottom: 0;
}

.tag-table tbody tr.is-mapped {
  background: #fcfaff;
}

.tag-table tbody tr.is-mapped td:first-child {
  box-shadow: inset 3px 0 0 #7c3aed;
}

.tag-table__tag {
  width: auto;
}

.tag-table__label {
  color: #475569;
  font-size: 0.86rem;
  font-weight: 500;
}

.tag-table select.form__input {
  width: 100%;
  min-height: 40px;
  border-color: #cbd5e1;
  background-color: #fff;
}

.tag-chip__code,
.tag-chip__text {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  border: 1px solid #ddd6fe;
  background: #f5f3ff;
  color: #5b21b6;
  line-height: 1;
  font-weight: 600;
}

.tag-chip__code {
  font-size: 0.72rem;
  padding: 0.14rem 0.34rem;
  margin-right: 0.35rem;
}

.tag-chip__text {
  font-size: 0.8rem;
  padding: 0.14rem 0.42rem;
}

.tag-page__footer {
  margin-top: 0.5rem;
  border-top: 1px solid var(--border);
  padding-top: 0.7rem;
  display: flex;
  justify-content: flex-end;
  gap: 0.7rem;
  align-items: center;
}

.tag-page__status {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
  color: #64748b;
  font-size: 0.82rem;
}

.tag-page__status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #22c55e;
}

.tag-form__actions {
  display: flex;
  justify-content: flex-end;
  width: 100%;
  margin-top: 0;
  gap: 0.45rem;
}

.tag-page__cancel-btn {
  border: 1px solid var(--border);
  background: #fff;
  color: #1f2937;
  border-radius: 8px;
  padding: 0.6rem 0.9rem;
  font-size: 0.9rem;
  cursor: pointer;
}

.table__mono {
  font-size: 0.8125rem;
  word-break: break-all;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.625rem 1rem;
  border-radius: 10px;
  font-size: 0.9375rem;
  font-weight: 600;
  text-decoration: none;
  border: none;
  cursor: pointer;
  text-align: center;
  transition: background 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:focus-visible,
.header__nav-link:focus-visible,
.header__icon-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--focus-ring);
}

.btn--primary {
  background: var(--primary);
  color: #fff;
}

.btn--primary:hover {
  background: var(--primary-hover);
}

.btn--ghost {
  background: #fff;
  color: var(--text);
  border: 1px solid var(--border);
}

.btn--ghost:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
}

.btn--danger {
  background: #fff;
  color: var(--error);
  border: 1px solid #fecaca;
}

.btn--danger:hover {
  background: #fef2f2;
}

.table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
  font-size: 0.9375rem;
  border-radius: 12px;
  overflow: hidden;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 14px;
}

.table-wrap .table {
  min-width: 680px;
  margin-top: 0;
}

.table-wrap--logs .table {
  min-width: 920px;
}

.table th,
.table td {
  padding: 0.7rem 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.table tbody tr:hover {
  background: #f8fafc;
}

.table-actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.table-actions form {
  margin: 0;
}

.table__json {
  margin: 0;
  max-width: 420px;
  max-height: 180px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 0.8125rem;
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.5rem;
}

.table th {
  font-size: 0.8125rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--muted);
  background: #f8fafc;
}

.badge {
  display: inline-block;
  padding: 0.18rem 0.6rem;
  border-radius: 999px;
  font-size: 0.75rem;
  text-transform: capitalize;
  background: #e2e8f0;
  color: #334155;
}

code {
  font-size: 0.875em;
  background: #f1f5f9;
  padding: 0.125rem 0.375rem;
  border-radius: 4px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.rule-builder {
  margin-top: 0;
}

.rule-builder__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.9rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}

.rule-builder__head strong,
.rule-builder__head span {
  display: block;
}

.rule-builder__head strong {
  margin-bottom: 0.16rem;
  font-size: 1rem;
}

.rule-builder__head span {
  color: var(--muted);
  font-size: 0.82rem;
}

.rule-builder__row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: end;
  gap: 0.75rem;
}

.rule-builder__from {
  display: flex;
  flex-direction: column;
  min-width: 0;
  gap: 0.32rem;
}

.rule-builder__from .form__input {
  width: 100%;
  min-height: 45px;
}

.rule-builder__field-label,
.picker__label {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 700;
}

.picker {
  position: relative;
  min-width: 0;
}

.picker__btn {
  position: relative;
  width: 100%;
  min-height: 68px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 0.26rem;
  overflow: hidden;
  border: 1px solid #cbd5e1;
  border-radius: 11px;
  background: #fff;
  color: var(--text);
  padding: 0.6rem 2.15rem 0.6rem 0.75rem;
  text-align: left;
  white-space: normal;
  box-shadow: none;
}

.picker__btn:hover {
  transform: none;
  border-color: #38bdf8;
  background: var(--select-bg);
}

.picker__btn.has-value {
  border-color: var(--select-border);
  background: var(--select-bg);
  box-shadow: 0 0 0 3px var(--select-ring);
}

.picker__btn.has-value .picker__label {
  color: #0284c7;
}

.picker__btn:disabled {
  border-color: #e2e8f0;
  background: #f8fafc;
  opacity: 0.72;
  cursor: not-allowed;
}

.picker__value {
  display: block;
  max-width: 100%;
  overflow: hidden;
  color: #64748b;
  font-size: 0.88rem;
  font-weight: 600;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.picker__btn.has-value .picker__value {
  color: #1e293b;
}

.picker__chevron {
  position: absolute;
  top: 50%;
  right: 0.8rem;
  width: 8px;
  height: 8px;
  border-right: 2px solid #94a3b8;
  border-bottom: 2px solid #94a3b8;
  transform: translateY(-70%) rotate(45deg);
}

.picker__menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  z-index: 20;
  width: 220px;
  min-width: 100%;
  max-height: 240px;
  overflow-y: auto;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.12);
  padding: 0.25rem;
}

.picker__item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.5rem 0.75rem;
  border: none;
  background: transparent;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.9375rem;
}

.picker__item:hover {
  background: #f1f5f9;
}

.picker__empty {
  padding: 0.5rem 0.75rem;
  color: var(--muted);
  font-size: 0.875rem;
}

.rule-builder__submit {
  min-height: 45px;
  align-self: end;
}

.saved-preview {
  margin-bottom: 1rem;
  padding: 0.95rem;
}

.saved-preview h2,
.rules-list h2 {
  font-size: 1rem;
  margin: 0 0 0.75rem;
}

.saved-preview__json {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem;
  overflow-x: auto;
  font-size: 0.8125rem;
  margin: 0;
}

.rules-list {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.send-page__hero,
.send-filter,
.send-rule-card {
  margin-bottom: 1.05rem;
}

.send-page__hero {
  padding: 1.15rem 1.25rem;
}

.send-page__toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.55rem;
}

.send-page__back,
.send-page__preview {
  color: var(--primary);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
}

.send-page__preview {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.4rem 0.7rem;
  background: #fff;
}

.send-hero {
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr) auto;
  gap: 1.1rem;
  align-items: center;
}

.send-hero__icon {
  width: 122px;
  height: 122px;
  border: 0;
  border-radius: 0;
  object-fit: contain;
  background: transparent;
  filter: none;
}

.send-hero__content h1 {
  margin: 0 0 0.45rem;
  font-size: 1.75rem;
  line-height: 1.1;
}

.send-hero__content p {
  max-width: 38ch;
  margin: 0 0 0.85rem;
  font-size: 0.92rem;
}

.send-hero__create {
  border: 0;
  border-radius: 9px;
  background: var(--primary);
  color: #fff;
  font-weight: 700;
  padding: 0.68rem 1.2rem;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08);
  transition: background 0.15s ease, transform 0.15s ease;
}

.send-hero__create:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
}

.send-hero__stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  max-width: 100%;
}

.send-hero__stat {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  min-width: 132px;
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.send-hero__stat:hover {
  border-color: #94a3b8;
  background: #f8fafc;
}

.send-hero__stat.is-active {
  border-color: var(--select-border);
  background: var(--select-bg);
  box-shadow: 0 0 0 3px var(--select-ring);
}

.send-hero__stat:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.24);
}

.send-hero__stat-icon {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  border-radius: 0;
  background: transparent;
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1;
}

.send-hero__stat-icon--green {
  color: #15803d;
}

.send-hero__stat-icon--muted {
  color: #64748b;
}

.send-hero__stat strong {
  font-size: 1.15rem;
  line-height: 1;
}

.send-hero__stat > span:last-child {
  font-size: 0.78rem;
  color: var(--muted);
}

.send-hero__hint {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0.9rem 0 0;
  padding: 0.44rem 0.68rem;
  border-radius: 9px;
  border: 1px solid #f3e39a;
  background: #fff6cf;
  color: #5b4a1a;
  font-size: 0.84rem;
}

.send-hero__hint img {
  width: 15px;
  height: 15px;
  object-fit: contain;
}

.send-rule-create {
  margin-bottom: 1rem;
}

.send-filter {
  display: grid;
  grid-template-columns: minmax(210px, 1fr) repeat(3, minmax(145px, 0.72fr)) auto;
  gap: 0.75rem;
  align-items: center;
  padding: 1rem;
}

.send-filter__search {
  min-width: 0;
}

.send-filter .form__input {
  min-height: 42px;
  font-size: 0.88rem;
}

.send-filter__count {
  white-space: nowrap;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  padding: 0.62rem 0.8rem;
  font-size: 0.86rem;
  font-weight: 700;
  text-align: center;
}

.send-rules {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.send-rule-card {
  position: relative;
  display: grid;
  grid-template-columns: 80px minmax(0, 1fr) auto;
  gap: 1rem;
  align-items: center;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1rem 1.1rem;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.035);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.send-rule-card:hover {
  border-color: #bfdbfe;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.08);
  transform: translateY(-1px);
}

.send-rule-card[hidden] {
  display: none;
}

.send-rule-card--inactive {
  border-color: #cbd5e1;
  background: #fbfcfe;
  box-shadow: none;
}

.send-rule-card--tags-missing {
  border-color: #fcd34d;
}

.send-rule-card__tags-alert {
  margin: 0 0 0.85rem;
  padding: 0.55rem 0.75rem;
  border-radius: 10px;
  background: #fffbeb;
  color: #92400e;
  font-size: 0.86rem;
  line-height: 1.35;
}

.send-rule-card__tags-alert a {
  color: #b45309;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.send-rule-card__tags--needed {
  border-color: #f59e0b !important;
  color: #b45309 !important;
  background: #fffbeb !important;
}

.send-rule-card__visual {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
}

.send-rule-card__status {
  border-radius: 999px;
  background: #ecfdf5;
  color: #15803d;
  font-size: 0.74rem;
  font-weight: 700;
  padding: 0.25rem 0.55rem;
  line-height: 1;
}

.send-rule-card__status--inactive {
  background: #f1f5f9;
  color: #64748b;
}

.send-rule-card__icon {
  width: 72px;
  height: 72px;
  margin-top: 0;
  border-radius: 0;
  object-fit: contain;
  background: transparent;
  padding: 0;
  align-self: center;
  justify-self: center;
}

.topic-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  padding: 0.22rem 0.62rem;
  font-size: 0.76rem;
  font-weight: 700;
}

.send-rule-card__main h2 {
  margin: 0.1rem 0 0.32rem;
  font-size: 1.08rem;
}

.send-rule-card__main .topic-badge {
  margin-bottom: 0.9rem;
}

.send-rule-card__meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(120px, 1fr));
  gap: 0.7rem;
}

.send-rule-card__meta > div {
  border-left: 1px solid var(--border);
  padding-left: 0.75rem;
}

.send-rule-card__meta > div:first-child {
  border-left: 0;
  padding-left: 0;
}

.send-rule-card__meta-label {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--muted);
  font-size: 0.76rem;
  margin-bottom: 0.24rem;
  min-height: 32px;
}

.send-rule-card__meta-icon {
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  object-fit: contain;
  object-position: center;
  background: transparent;
}

.send-rule-card__meta strong {
  display: block;
  font-size: 0.84rem;
  color: #0f172a;
  font-weight: 600;
}

.send-rule-card__actions {
  align-self: stretch;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.55rem;
  width: 190px;
  padding-left: 1rem;
  border-left: 1px solid var(--border);
}

.send-rule-card__actions .btn {
  width: 100%;
  min-height: 40px;
  border-radius: 10px;
  padding: 0.58rem 0.85rem;
  font-size: 0.86rem;
  justify-content: center;
}

.send-rule-card__toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  min-height: 40px;
}

.send-rule-card__toggle-label {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.send-rule-toggle {
  margin: 0;
}

.send-rule-toggle__btn {
  min-height: 24px;
  border: 0;
  border-radius: 0;
  background: transparent;
  display: inline-flex;
  align-items: center;
  padding: 2px;
  cursor: pointer;
  font-family: inherit;
  transition: opacity 0.15s ease, box-shadow 0.15s ease;
}

.send-rule-toggle__track {
  width: 36px;
  height: 20px;
  border-radius: 999px;
  background: #cbd5e1;
  display: inline-flex;
  align-items: center;
  padding: 2px;
  transition: background 0.15s ease;
}

.send-rule-toggle__thumb {
  width: 16px;
  height: 16px;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.2);
  transform: translateX(0);
  transition: transform 0.15s ease;
}

.send-rule-toggle__btn.is-on .send-rule-toggle__track {
  background: var(--accent);
}

.send-rule-toggle__btn.is-on .send-rule-toggle__thumb {
  transform: translateX(16px);
}

.send-rule-toggle__btn:hover {
  opacity: 0.82;
}

.send-rule-toggle__btn:focus-visible,
.send-rule-card__delete:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.24);
}

.send-rule-card__delete-form {
  margin: 0;
}

.send-rule-card__delete {
  width: 100%;
  min-height: 38px;
  border: 1px solid #fecaca;
  border-radius: 10px;
  background: #fff;
  color: #b91c1c;
  padding: 0.52rem 0.85rem;
  cursor: pointer;
  font: inherit;
  font-size: 0.84rem;
  font-weight: 700;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.send-rule-card__delete:hover {
  border-color: #fca5a5;
  background: #fef2f2;
}

.send-rules__footer {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--muted);
  text-align: center;
  padding: 0.7rem;
  font-size: 0.85rem;
}

.logs-page__hero {
  padding: 1.15rem 1.25rem;
  margin-bottom: 1rem;
}

.logs-page__toolbar {
  margin-bottom: 0.55rem;
}

.logs-page__back {
  color: var(--primary);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
}

.logs-hero {
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr);
  gap: 1.1rem;
  align-items: center;
}

.logs-hero__icon {
  width: 122px;
  height: 122px;
  border-radius: 0;
  object-fit: contain;
  background: transparent;
}

.logs-hero__content h1 {
  margin: 0 0 0.45rem;
  font-size: 1.75rem;
  line-height: 1.1;
}

.logs-hero__content p {
  max-width: 42ch;
  margin: 0;
  font-size: 0.92rem;
}

.logs-hero__hint {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0.9rem 0 0;
  padding: 0.44rem 0.68rem;
  border-radius: 9px;
  border: 1px solid #f3e39a;
  background: #fff6cf;
  color: #5b4a1a;
  font-size: 0.84rem;
}

.logs-hero__hint img {
  width: 15px;
  height: 15px;
  object-fit: contain;
}

.logs-filter {
  display: grid;
  grid-template-columns: minmax(220px, 1.2fr) repeat(3, minmax(140px, 0.75fr)) auto;
  gap: 0.75rem;
  align-items: center;
  padding: 1rem;
  margin-bottom: 1rem;
}

.logs-filter__search {
  min-width: 0;
}

.logs-filter .form__input {
  min-height: 42px;
  font-size: 0.88rem;
}

.logs-filter__export {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  color: #334155;
  font-size: 0.86rem;
  font-weight: 600;
  padding: 0.62rem 0.95rem;
  cursor: pointer;
  white-space: nowrap;
}

.logs-filter__export:hover {
  background: #f8fafc;
}

.logs-layout {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
}

.logs-timeline {
  position: sticky;
  top: 88px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 0.75rem;
  max-height: calc(100vh - 110px);
  overflow: auto;
}

.logs-timeline__group {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin: 0.35rem 0 0.45rem;
}

.logs-timeline__item {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.55rem;
  align-items: start;
  width: 100%;
  border: 1px solid transparent;
  border-left: 3px solid transparent;
  border-radius: 10px;
  background: #fff;
  padding: 0.55rem 0.6rem;
  text-align: left;
  cursor: pointer;
  margin-bottom: 0.35rem;
}

.logs-timeline__item:hover {
  background: #f8fafc;
}

.logs-timeline__item.is-active {
  background: #f5f3ff;
  border-color: #ddd6fe;
  border-left-color: #7c3aed;
}

.logs-timeline__item.is-collapsed {
  display: none;
}

.logs-timeline__item[hidden] {
  display: none;
}

.logs-timeline__status {
  width: 18px;
  height: 18px;
  border-radius: 999px;
  margin-top: 0.15rem;
  flex: 0 0 auto;
}

.logs-timeline__status--success {
  background: #dcfce7;
  box-shadow: inset 0 0 0 2px #22c55e;
}

.logs-timeline__status--error {
  background: #fee2e2;
  box-shadow: inset 0 0 0 2px #ef4444;
}

.logs-timeline__meta {
  display: grid;
  gap: 0.08rem;
  min-width: 0;
}

.logs-timeline__meta strong {
  font-size: 0.82rem;
}

.logs-timeline__meta span {
  font-size: 0.8rem;
  color: #334155;
}

.logs-timeline__meta small {
  font-size: 0.72rem;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.logs-timeline__more {
  width: 100%;
  border: 1px dashed #cbd5e1;
  border-radius: 10px;
  background: #f8fafc;
  color: #475569;
  padding: 0.55rem;
  font-size: 0.82rem;
  cursor: pointer;
  margin-top: 0.35rem;
}

.logs-feed {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.log-card {
  background: #fff;
  border: 1px solid var(--border);
  border-left-width: 4px;
  border-radius: 14px;
  padding: 1rem 1.05rem;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.035);
}

.log-card--success {
  border-left-color: #22c55e;
}

.log-card--error {
  border-left-color: #ef4444;
}

.log-card[hidden] {
  display: none;
}

.log-card__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
}

.log-card__badges {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.log-card__status {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border-radius: 999px;
  padding: 0.22rem 0.62rem;
  font-size: 0.76rem;
  font-weight: 700;
}

.log-card__status--success {
  background: #ecfdf5;
  color: #15803d;
}

.log-card__status--error {
  background: #fef2f2;
  color: #b91c1c;
}

.log-card__actions {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.log-card__action {
  border: 1px solid var(--border);
  border-radius: 9px;
  background: #fff;
  color: #334155;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.45rem 0.7rem;
  cursor: pointer;
}

.log-card__action:hover {
  background: #f8fafc;
}

.log-card__menu {
  position: relative;
}

.log-card__menu summary {
  list-style: none;
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 9px;
  cursor: pointer;
  background: #fff;
}

.log-card__menu summary::-webkit-details-marker {
  display: none;
}

.log-card__menu summary::marker {
  content: "";
}

.log-card__menu-items {
  position: absolute;
  right: 0;
  top: calc(100% + 0.35rem);
  z-index: 20;
  min-width: 150px;
  padding: 0.35rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.12);
}

.log-card__menu-items button {
  display: block;
  width: 100%;
  border: 0;
  background: transparent;
  text-align: left;
  border-radius: 7px;
  padding: 0.48rem 0.6rem;
  cursor: pointer;
  color: #334155;
}

.log-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem 1rem;
  color: var(--muted);
  font-size: 0.82rem;
  margin-bottom: 0.85rem;
}

.log-card__meta strong {
  color: #0f172a;
}

.log-card__error-text {
  color: #b91c1c;
}

.log-card__panels {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

.log-code {
  border: 1px solid #1f2937;
  border-radius: 12px;
  overflow: hidden;
  background: #111827;
}

.log-code__head {
  padding: 0.55rem 0.75rem;
  font-size: 0.78rem;
  font-weight: 700;
  color: #e5e7eb;
  background: #0f172a;
  border-bottom: 1px solid #1f2937;
}

.log-code__body {
  margin: 0;
  padding: 0.75rem;
  max-height: 150px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 0.75rem;
  line-height: 1.45;
  color: #e5e7eb;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.log-code__body.is-expanded {
  max-height: none;
}

.log-code__expand {
  display: block;
  width: 100%;
  border: 0;
  border-top: 1px solid #1f2937;
  background: #0f172a;
  color: #60a5fa;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.55rem 0.75rem;
  cursor: pointer;
  text-align: left;
}

.log-card__footer {
  display: flex;
  justify-content: flex-end;
  margin-top: 0.85rem;
}

.log-card__more {
  border: 0;
  background: transparent;
  color: var(--primary);
  font-size: 0.84rem;
  font-weight: 700;
  cursor: pointer;
  padding: 0;
}

.servers-page__hero {
  padding: 1.15rem 1.25rem;
  margin-bottom: 1rem;
}

.servers-page__toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.servers-page__back {
  color: var(--primary);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
}

.servers-page__token {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  white-space: nowrap;
}

.servers-page__token-form {
  display: inline;
  margin: 0;
}

.servers-hero {
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr);
  gap: 1.1rem;
  align-items: start;
}

.servers-hero__icon {
  width: 122px;
  height: 122px;
  border-radius: 0;
  object-fit: contain;
  background: transparent;
}

.servers-hero__content h1 {
  margin: 0 0 0.45rem;
  font-size: 1.75rem;
  line-height: 1.1;
}

.servers-hero__content p {
  max-width: 42ch;
  margin: 0 0 0.9rem;
  font-size: 0.92rem;
}

.servers-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  max-width: 100%;
}

.servers-stats__item {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
}

.servers-stats__icon {
  width: 32px;
  height: 32px;
  border-radius: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  font-weight: 700;
  background: transparent;
  flex: 0 0 auto;
}

.servers-stats__icon img {
  width: 32px;
  height: 32px;
  object-fit: contain;
  background: transparent;
}

.servers-stats__icon--purple,
.servers-stats__icon--violet {
  color: var(--accent);
}

.servers-stats__icon--green {
  color: #15803d;
}

.servers-stats__icon--blue {
  color: var(--accent);
}

.servers-stats__item strong {
  font-size: 1.15rem;
  line-height: 1;
}

.servers-stats__item > span:last-child {
  font-size: 0.78rem;
  color: var(--muted);
}

.servers-section {
  padding: 1.1rem 1.15rem;
}

.servers-section__head h2 {
  margin: 0 0 0.85rem;
  font-size: 1.15rem;
}

.servers-filter {
  display: grid;
  grid-template-columns: minmax(220px, 1.2fr) repeat(3, minmax(130px, 0.75fr)) auto;
  gap: 0.75rem;
  align-items: center;
  margin-bottom: 0.85rem;
}

.servers-filter__search {
  min-width: 0;
}

.servers-filter .form__input {
  min-height: 42px;
  font-size: 0.88rem;
}

.servers-filter__count {
  white-space: nowrap;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  padding: 0.62rem 0.8rem;
  font-size: 0.86rem;
  font-weight: 700;
  text-align: center;
}

.servers-list {
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
}

.servers-list__head,
.server-row {
  display: grid;
  grid-template-columns: minmax(220px, 1.6fr) 0.8fr 0.7fr 0.7fr 0.7fr;
  gap: 0.75rem;
  align-items: center;
  padding: 0.75rem 0.9rem;
}

.servers-list__head {
  background: #f8fafc;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  border-bottom: 1px solid var(--border);
}

.server-row {
  border-bottom: 1px solid var(--border);
  background: #fff;
}

.server-row:last-child {
  border-bottom: 0;
}

.server-row[hidden] {
  display: none;
}

.server-row__main {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}

.server-row__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  background: transparent;
}

.server-row__icon img {
  width: 48px;
  height: 48px;
  object-fit: contain;
  background: transparent;
}

.server-row__info {
  min-width: 0;
}

.server-row__title {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.server-row__title strong {
  font-size: 0.92rem;
}

.server-row__status {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  border-radius: 999px;
  padding: 0.16rem 0.5rem;
  font-size: 0.72rem;
  font-weight: 700;
}

.server-row__status--active {
  background: #ecfdf5;
  color: #15803d;
}

.server-row__status--active::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: #22c55e;
}

.server-row__status--inactive {
  background: #f1f5f9;
  color: #64748b;
}

.server-row__meta {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
  margin-top: 0.15rem;
  color: var(--muted);
  font-size: 0.78rem;
}

.server-row__tag {
  border-radius: 999px;
  background: #f1f5f9;
  color: #475569;
  padding: 0.12rem 0.45rem;
  font-size: 0.72rem;
  font-weight: 600;
}

.server-row__cell {
  font-size: 0.84rem;
}

.server-row__label {
  display: none;
  color: var(--muted);
  font-size: 0.72rem;
  margin-bottom: 0.15rem;
}

.server-color {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.18rem 0.55rem;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: capitalize;
}

.server-color--green { background: #ecfdf5; color: #15803d; }
.server-color--yellow { background: #fef9c3; color: #a16207; }
.server-color--blue { background: #eff6ff; color: #1d4ed8; }
.server-color--red { background: #fee2e2; color: #b91c1c; }
.server-color--purple { background: #f5f3ff; color: #7c3aed; }
.server-color--orange { background: #ffedd5; color: #c2410c; }
.server-color--gray { background: #f1f5f9; color: #475569; }

.servers-section__hint {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
  margin-top: 0.85rem;
  padding: 0.7rem 0.85rem;
  border-radius: 12px;
  border: 1px solid var(--hint-border);
  background: var(--hint-bg);
  color: var(--hint-text);
  font-size: 0.84rem;
}

.servers-section__hint img {
  width: 15px;
  height: 15px;
  object-fit: contain;
}

.servers-section__hint a {
  margin-left: auto;
  font-weight: 700;
  text-decoration: none;
  color: var(--accent);
}

/* Preserve detail in page artwork and avoid thumbnail-style cropping. */
.app-hero__icon,
.authorize-card__visual img,
.logs-hero__icon,
.servers-hero__icon {
  object-fit: contain;
  object-position: center;
  image-rendering: auto;
  background: transparent;
  border-radius: 0;
  filter: drop-shadow(0 3px 6px rgba(15, 23, 42, 0.1));
}

@media (max-width: 920px) {
  .rule-builder__row {
    grid-template-columns: 1fr;
  }

  .header__inner {
    min-height: auto;
    align-items: flex-start;
    flex-direction: column;
    padding-top: 0.85rem;
    padding-bottom: 0.85rem;
  }

  .header__right {
    width: 100%;
    margin-left: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
  }

  .header__nav {
    width: 100%;
    justify-content: space-between;
    overflow-x: auto;
  }

  .header__divider {
    display: none;
  }

  .header__tools {
    width: 100%;
    flex-wrap: wrap;
  }

  .header__shop {
    flex: 1 1 180px;
    max-width: none;
  }

  .main {
    padding-top: 1.5rem;
  }

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

  .authorize-card__visual {
    min-height: 0;
    margin-bottom: 0.25rem;
  }

  .authorize-card__visual img {
    max-width: 160px;
  }

  .tag-layout {
    grid-template-columns: 1fr;
  }

  .tag-sidebar {
    position: static;
  }

  .tag-page__hero {
    grid-template-columns: 1fr;
  }

  .tag-page__hero-main {
    grid-template-columns: 1fr;
  }

  .tag-page__hint {
    white-space: normal;
  }

  .tag-page__footer {
    justify-content: flex-end;
  }

  .app-hero,
  .app-hero__main,
  .page-hero__layout,
  .send-hero,
  .send-filter,
  .logs-hero,
  .logs-filter,
  .logs-layout,
  .log-card__panels,
  .servers-hero,
  .servers-filter,
  .servers-stats,
  .servers-list__head,
  .server-row {
    grid-template-columns: 1fr;
  }

  .servers-list__head {
    display: none;
  }

  .server-row {
    gap: 0.55rem;
    padding: 0.85rem;
  }

  .server-row__cell {
    display: grid;
  }

  .server-row__label {
    display: block;
  }

  .servers-section__hint a {
    margin-left: 0;
  }

  .send-hero,
  .send-filter,
  .send-rule-card,
  .send-rule-card__meta {
    grid-template-columns: 1fr;
  }

  .logs-timeline {
    position: static;
    max-height: none;
  }

  .app-hero {
    align-items: flex-start;
    flex-direction: column;
    flex-wrap: wrap;
  }

  .app-hero__icon {
    width: 112px;
    height: 112px;
  }

  .send-rule-card__actions {
    width: 100%;
    padding-top: 0.85rem;
    padding-left: 0;
    border-top: 1px solid var(--border);
    border-left: 0;
  }

  .send-rule-card__actions .btn {
    width: 100%;
  }

  .send-rule-card__meta > div {
    border-left: 0;
    padding-left: 0;
  }
}
