:root {
    --brand: #337ab7;
    --brand-hover: #23527c;
    --text: #333;
    --muted: #777;
    --border: #e7e7e7;
    --soft: #f8f8f8;
    --container: 1170px;
}

* { box-sizing: border-box; }
html { min-height: 100%; }
body {
    margin: 0;
    min-height: 100%;
    background: #fff;
    color: var(--text);
    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
    font-size: 14px;
    line-height: 1.42857143;
}
a { color: var(--brand); text-decoration: none; }
a:hover, a:focus { color: var(--brand-hover); text-decoration: underline; }
img { max-width: 100%; height: auto; vertical-align: middle; }
button, input, textarea { font: inherit; }
code, pre { font-family: Menlo, Monaco, Consolas, "Courier New", monospace; }
.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 15px; }
.clearfix::after { content: ""; display: table; clear: both; }

/* Header: intentionally close to the current classic Notify24 layout. */
.site-header {
    min-height: 52px;
    margin-bottom: 0;
    border: 1px solid transparent;
    border-width: 0 0 1px;
    border-color: #e7e7e7;
    background: #f8f8f8;
}
.header-inner { min-height: 50px; display: flex; align-items: center; }
.brand {
    display: block;
    flex: 0 0 auto;
    margin-right: 26px;
    color: #777;
    font-size: 20px;
    font-weight: 400;
    line-height: 20px;
    padding: 15px 0;
}
.brand:hover, .brand:focus { color: #5e5e5e; text-decoration: none; }
.brand-mark { display: none; }
.brand-name, .brand-name span { color: inherit; font-size: inherit; font-weight: inherit; }
.main-nav { display: flex; align-items: stretch; }
.main-nav a {
    display: block;
    color: #777;
    line-height: 20px;
    padding: 15px 15px;
}
.main-nav a:hover, .main-nav a:focus { color: #333; background: transparent; text-decoration: none; }
.main-nav a.is-active { color: #555; background: #e7e7e7; }
.header-actions { display: none; }
.nav-toggle {
    display: none;
    margin-left: auto;
    padding: 9px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: transparent;
}
.nav-toggle span:not(.sr-only) { display: block; width: 22px; height: 2px; margin: 4px 0; border-radius: 1px; background: #888; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

/* Home hero */
.hero { padding: 46px 0 30px; overflow: hidden; background: #fff; }
.hero-grid { display: flex; align-items: center; gap: 40px; min-height: 465px; }
.hero-copy { flex: 1 1 50%; padding-bottom: 25px; }
.hero h1 {
    margin: 20px 0 10px;
    color: #333;
    font-size: 42px;
    line-height: 1.1;
    font-weight: 400;
}
.hero-lead { margin: 0 0 24px; color: #555; font-size: 21px; font-weight: 300; line-height: 1.4; }
.hero-login { max-width: 470px; margin-top: 26px; }
.login-row { display: flex; gap: 8px; align-items: flex-start; }
.form-control {
    display: block;
    width: 100%;
    height: 34px;
    padding: 6px 12px;
    color: #555;
    font-size: 14px;
    line-height: 1.42857143;
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-shadow: inset 0 1px 1px rgba(0,0,0,.075);
    transition: border-color .15s ease-in-out, box-shadow .15s ease-in-out;
}
textarea.form-control { height: auto; min-height: 120px; resize: vertical; }
.form-control:focus { border-color: #66afe9; outline: 0; box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(102,175,233,.6); }
.btn {
    display: inline-block;
    margin-bottom: 0;
    padding: 6px 12px;
    color: #333;
    font-size: 14px;
    font-weight: 400;
    line-height: 1.42857143;
    text-align: center;
    white-space: nowrap;
    vertical-align: middle;
    cursor: pointer;
    user-select: none;
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 4px;
}
.btn:hover, .btn:focus { color: #333; text-decoration: none; background: #e6e6e6; border-color: #adadad; }
.btn-primary { color: #fff; background: var(--brand); border-color: #2e6da4; }
.btn-primary:hover, .btn-primary:focus { color: #fff; background: #286090; border-color: #204d74; }
.login-row .form-control { min-width: 0; flex: 1 1 0; }
.hero-login-links { margin-top: 9px; font-size: 13px; }
.hero-login-links a + a::before { content: " · "; color: #aaa; margin: 0 5px 0 2px; }
.hero-visual { flex: 1 1 50%; text-align: center; }
.hero-phone { width: min(100%, 500px); margin: 0 auto; }

/* Sections */
.section { padding: 48px 0; }
.section + .section { border-top: 1px solid #f0f0f0; }
.section-heading { margin: 0 0 38px; text-align: center; }
.section-heading h2 { margin: 20px 0 10px; font-size: 30px; font-weight: 300; line-height: 1.1; }
.section-heading p { max-width: 720px; margin: 0 auto; color: var(--muted); }
.feature-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 30px; }
.feature-item { text-align: center; }
.feature-item img { display: block; width: 100%; max-width: 300px; aspect-ratio: 3 / 2; object-fit: cover; margin: 0 auto 18px; }
.feature-item h4 { margin: 10px 0 10px; font-size: 18px; font-weight: 500; line-height: 1.1; }
.feature-item p { margin: 0 0 10px; color: #555; }
.content-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 60px; }
.content-block h2 { margin: 20px 0 20px; font-size: 30px; font-weight: 300; }
.current-list { margin: 0; padding-left: 21px; }
.current-list li { margin-bottom: 10px; }
.faq-item { margin-bottom: 22px; }
.faq-item h4 { margin: 0 0 8px; font-size: 18px; font-weight: 500; }
.faq-item p { margin: 0; color: #555; }

/* Generic inner pages */
.page-wrap { padding: 32px 0 55px; }
.page-wrap h1 { margin: 20px 0 28px; font-size: 36px; font-weight: 400; line-height: 1.1; }
.page-wrap h3 { margin: 28px 0 12px; font-size: 24px; font-weight: 400; }
.page-wrap h4 { margin: 24px 0 10px; font-size: 18px; font-weight: 500; }
.page-wrap p { margin: 0 0 10px; }
.page-wrap ul { margin-top: 0; margin-bottom: 10px; }
.lead { margin-bottom: 20px !important; font-size: 21px; font-weight: 300; line-height: 1.4; }
.inner-feature-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px 30px; }
.inner-feature { text-align: center; }
.inner-feature img { width: 100%; max-width: 300px; aspect-ratio: 3 / 2; object-fit: cover; margin-bottom: 12px; }
.inner-feature h4 { margin-top: 10px; }
.example-list article { margin-bottom: 31px; }
.example-list article h4 { margin-bottom: 10px; }

/* Docs and tables: keep the same simple, uncarded feel. */
.api-links { margin: 0 0 22px; padding-left: 20px; }
.api-links li { margin-bottom: 6px; }
.table-responsive { min-height: .01%; overflow-x: auto; margin: 18px 0; }
table { width: 100%; max-width: 100%; border-spacing: 0; border-collapse: collapse; }
th, td { padding: 8px; line-height: 1.42857143; vertical-align: top; border-top: 1px solid #ddd; text-align: left; }
thead th { vertical-align: bottom; border-bottom: 2px solid #ddd; }
code { padding: 2px 4px; color: #c7254e; background: #f9f2f4; border-radius: 4px; font-size: 90%; }
pre {
    display: block;
    margin: 0 0 10px;
    padding: 9.5px;
    overflow: auto;
    color: #333;
    font-size: 13px;
    line-height: 1.42857143;
    word-break: break-all;
    word-wrap: break-word;
    background: #f5f5f5;
    border: 1px solid #ccc;
    border-radius: 4px;
}
pre code { padding: 0; color: inherit; background: transparent; border-radius: 0; font-size: inherit; }
.alert { margin: 20px 0; padding: 15px; border: 1px solid transparent; border-radius: 4px; }
.alert-info { color: #31708f; background: #d9edf7; border-color: #bce8f1; }

/* Forms / future account screens */
.form-box { width: min(100%, 520px); }
.form-group { margin-bottom: 15px; }
.form-group label { display: inline-block; max-width: 100%; margin-bottom: 5px; font-weight: 700; }
.checkbox { margin: 10px 0; }
.future-note { color: #777; font-size: 13px; }

/* Footer */
.site-footer { margin-top: 20px; padding: 24px 0; border-top: 1px solid #eee; color: #777; background: #fff; }
.footer-simple { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.footer-links-inline { display: flex; gap: 18px; flex-wrap: wrap; }
.footer-links-inline a { color: #777; }
.footer-links-inline a:hover { color: #333; }

/* Compatibility with first draft classes, so unfinished/future pages still render cleanly. */
.page-hero, .page-hero.compact { padding: 30px 0 0; background: #fff; }
.page-hero h1 { margin: 20px 0 10px; font-size: 36px; font-weight: 400; }
.page-hero p { color: #777; }
.eyebrow { display: none; }
.button { display: inline-block; padding: 6px 12px; border: 1px solid #ccc; border-radius: 4px; background: #fff; color: #333; font-weight: 400; }
.button:hover { text-decoration: none; background: #e6e6e6; }
.button-primary { color: #fff; background: var(--brand); border-color: #2e6da4; }
.button-primary:hover { color: #fff; background: #286090; }
.button-full { width: 100%; }
.auth-shell, .cabinet-shell, .contact-shell { padding: 35px 15px 55px; }
.auth-card, .contact-card, .cabinet-card { width: min(100%, 560px); padding: 0; border: 0; box-shadow: none; }
.auth-card h1, .contact-card h1, .cabinet-card h1 { font-weight: 400; }
.input-group { margin-bottom: 15px; }
.input-group label { display: block; margin-bottom: 5px; font-weight: 700; }
.input-group input, .input-group textarea { display: block; width: 100%; padding: 6px 12px; border: 1px solid #ccc; border-radius: 4px; }

@media (max-width: 991px) {
    .container { max-width: 970px; }
    .hero { padding-top: 28px; }
    .hero-grid { min-height: 0; gap: 20px; }
    .hero h1 { font-size: 36px; }
    .hero-lead { font-size: 19px; }
    .feature-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .inner-feature-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 767px) {
    .container { max-width: none; }
    .site-header { min-height: 51px; }
    .header-inner { display: flex; flex-wrap: wrap; }
    .brand { padding-left: 0; }
    .nav-toggle { display: block; }
    .main-nav { display: none; flex: 0 0 calc(100% + 30px); width: calc(100% + 30px); margin: 0 -15px; border-top: 1px solid #e7e7e7; }
    .main-nav.is-open { display: block; }
    .main-nav a { padding: 10px 15px; }
    .main-nav a.is-active { background: #e7e7e7; }
    .hero-grid { display: block; }
    .hero-copy { padding-bottom: 5px; }
    .hero h1 { margin-top: 10px; font-size: 34px; }
    .hero-lead { font-size: 18px; }
    .login-row { display: block; }
    .login-row .form-control { margin-bottom: 8px; }
    .hero-visual { margin-top: 25px; }
    .hero-phone { width: min(100%, 450px); }
    .section { padding: 38px 0; }
    .feature-grid, .inner-feature-grid, .content-columns { grid-template-columns: 1fr; }
    .feature-grid { gap: 36px; }
    .content-columns { gap: 15px; }
    .inner-feature-grid { gap: 34px; }
    .footer-simple { display: block; }
    .footer-links-inline { margin-top: 10px; }
}

/* PHP 8 application additions */
.flash-stack { padding-top: 18px; }
.alert-success { color:#3c763d; background:#dff0d8; border-color:#d6e9c6; }
.alert-danger { color:#a94442; background:#f2dede; border-color:#ebccd1; }
.btn-danger { color:#fff; background:#d9534f; border-color:#d43f3a; }
.btn-danger:hover,.btn-danger:focus { color:#fff; background:#c9302c; border-color:#ac2925; }
.nav-logout { display:flex; align-items:stretch; }
.nav-logout button { border:0; background:transparent; color:#777; padding:15px; font:inherit; cursor:pointer; }
.nav-logout button:hover { color:#333; }
.cabinet-section { margin:35px 0 50px; }
.cabinet-section h3 { border-bottom:1px solid #eee; padding-bottom:10px; }
.actions-cell form { display:inline-block; margin:2px; }
.status-ok { color:#3c763d; font-weight:600; }
.status-bad { color:#a94442; font-weight:600; }
.inline-form { display:flex; gap:8px; align-items:center; flex-wrap:wrap; max-width:950px; }
.inline-form .form-control { width:220px; }
.inline-form .form-control.wide { width:440px; max-width:100%; }
.recipient-edit { display:flex; gap:6px; align-items:center; min-width:390px; }
.recipient-edit .form-control { height:32px; }
.recipient-edit .form-control.small { width:90px; }
.group-list { max-width:700px; margin:0 0 15px; }
.group-row { display:flex; justify-content:space-between; align-items:center; gap:15px; border-bottom:1px solid #eee; padding:8px 0; }
.api-key-value { word-break:break-all; }
@media (max-width:767px) {
    .nav-logout { display:block; }
    .nav-logout button { width:100%; text-align:left; padding:10px 15px; }
    .inline-form,.recipient-edit { display:block; min-width:0; }
    .inline-form .form-control,.inline-form .form-control.wide,.recipient-edit .form-control,.recipient-edit .form-control.small { width:100%; margin-bottom:7px; }
}
.checkbox-inline { display:inline-flex; align-items:center; gap:4px; margin:3px 8px 3px 0; font-weight:400; }
.checkbox-inline input { margin:0; }
.recipient-groups { display:flex; flex-wrap:wrap; align-items:center; min-width:280px; }
.future-note { color:#777; font-size:13px; margin-top:7px; }
@media (max-width:767px) {
    .recipient-groups { min-width:0; margin-bottom:7px; }
}

/* Cabinet v2.3: split navigation and clearer Telegram workflow. */
.cabinet-page { padding-top: 26px; }
.cabinet-heading { display:flex; align-items:flex-start; justify-content:space-between; gap:20px; }
.cabinet-heading h1 { margin-bottom:6px; }
.cabinet-user-line { margin:0 0 22px; color:var(--muted); font-size:15px; }
.cabinet-layout { display:grid; grid-template-columns:210px minmax(0,1fr); gap:34px; align-items:start; }
.cabinet-sidebar { border:1px solid var(--border); border-radius:4px; overflow:hidden; background:#fff; }
.cabinet-sidebar a { display:block; padding:11px 13px; color:#555; border-bottom:1px solid var(--border); }
.cabinet-sidebar a:last-child { border-bottom:0; }
.cabinet-sidebar a:hover { text-decoration:none; background:#f8f8f8; color:#333; }
.cabinet-sidebar a.is-active { background:#f0f0f0; color:#333; font-weight:600; border-left:3px solid var(--brand); padding-left:10px; }
.cabinet-main { min-width:0; }
.cabinet-main h2 { margin:0 0 10px; font-size:24px; font-weight:400; }
.cabinet-main h3 { margin:0 0 8px; font-size:18px; font-weight:500; }
.cabinet-intro { margin-bottom:24px; padding-bottom:18px; border-bottom:1px solid #eee; }
.cabinet-intro p { max-width:850px; color:#555; }
.cabinet-panel { margin:24px 0; padding:20px; border:1px solid var(--border); border-radius:4px; background:#fff; }
.cabinet-panel > h2:first-child { margin-top:0; }
.panel-heading { display:flex; align-items:flex-start; justify-content:space-between; gap:15px; margin-bottom:10px; }
.panel-heading h2 { margin:0; }
.panel-actions { display:flex; justify-content:flex-end; margin:0 0 18px; }
.muted { color:var(--muted); }
.status-neutral { color:#777; font-weight:600; }
.btn-small { padding:3px 8px; font-size:12px; }
.form-control-number { width:100px !important; }
.empty-state { margin:20px 0; padding:24px; color:#777; text-align:center; border:1px dashed #ccc; border-radius:4px; background:#fafafa; }

.stat-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:14px; margin:0 0 24px; }
.stat-box { display:block; padding:18px; border:1px solid var(--border); border-radius:4px; color:#333; background:#fff; }
.stat-box:hover { text-decoration:none; border-color:#c8c8c8; color:#333; }
.stat-box strong { display:block; margin-bottom:3px; font-size:28px; font-weight:400; }
.stat-box span { color:var(--muted); }
.steps-list { margin:10px 0 0; padding-left:22px; }
.steps-list li { margin:7px 0; }
.cabinet-two-columns { display:grid; grid-template-columns:1fr 1fr; gap:20px; }
.cabinet-two-columns .cabinet-panel { margin-top:0; }
.compact-list { border-top:1px solid #eee; }
.compact-row { display:flex; justify-content:space-between; gap:15px; padding:11px 0; border-bottom:1px solid #eee; }
.compact-meta { flex:0 0 auto; text-align:right; }
.compact-meta code { word-break:break-all; }

.bot-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:18px; margin-bottom:28px; }
.bot-card { padding:20px; border:1px solid var(--border); border-radius:4px; background:#fff; }
.bot-card-head { display:flex; align-items:flex-start; justify-content:space-between; gap:18px; padding-bottom:14px; border-bottom:1px solid #eee; }
.bot-card-head h3 { margin-bottom:4px; font-size:20px; }
.bot-meta { margin:15px 0; }
.bot-meta > div { margin:8px 0; }
.bot-meta dt { color:#777; font-size:12px; font-weight:400; }
.bot-meta dd { margin:2px 0 0; word-break:break-word; }
.bot-actions { display:flex; flex-wrap:wrap; gap:7px; }
.bot-actions form { margin:0; }
.tech-details { margin-top:14px; color:#777; }
.tech-details summary { cursor:pointer; }

.howto-box { margin:0 0 24px; padding:18px 20px; border-left:4px solid var(--brand); background:#f8f8f8; }
.howto-box h3 { margin-top:0; }
.destination-list { display:grid; gap:14px; }
.destination-card { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:18px; padding:18px; border:1px solid var(--border); border-radius:4px; background:#fff; }
.destination-card.is-disabled { opacity:.72; background:#fafafa; }
.destination-title-row { display:flex; align-items:flex-start; justify-content:space-between; gap:15px; }
.destination-title-row h3 { margin:4px 0 2px; font-size:19px; }
.type-badge { display:inline-block; padding:2px 6px; border:1px solid #ccc; border-radius:3px; color:#666; font-size:12px; background:#fafafa; }
.chat-id-line { display:flex; flex-wrap:wrap; align-items:center; gap:7px; margin:13px 0; }
.chat-id-line code { padding:3px 5px; background:#f7f7f7; border:1px solid #eee; border-radius:3px; word-break:break-all; }
.destination-meta { display:flex; flex-wrap:wrap; gap:7px 16px; color:#777; font-size:13px; }
.destination-actions { display:flex; align-items:flex-start; flex-wrap:wrap; justify-content:flex-end; gap:6px; max-width:270px; }
.destination-actions form { margin:0; }
.destination-actions details { position:relative; }
.destination-actions details > summary { list-style:none; }
.destination-actions details > summary::-webkit-details-marker { display:none; }
.destination-edit-form { min-width:330px; margin-top:8px; padding:14px; border:1px solid #ddd; border-radius:4px; background:#fff; box-shadow:0 3px 12px rgba(0,0,0,.08); }
.destination-edit-form label { display:block; margin-bottom:10px; }
.destination-edit-form fieldset { margin:10px 0; padding:10px; border:1px solid #ddd; }
.destination-edit-form legend { padding:0 5px; font-size:13px; }
.manual-add-panel > summary { cursor:pointer; font-weight:600; }

.group-cards { display:grid; gap:12px; }
.group-card { display:flex; align-items:center; justify-content:space-between; gap:20px; padding:18px; border:1px solid var(--border); border-radius:4px; }
.group-card h3 { margin-bottom:4px; }
.group-card p { margin:3px 0; }
.inline-action { display:inline-block; margin-left:5px; }
.clean-table th { background:#fafafa; }
.clean-table th,.clean-table td { vertical-align:top; }

@media (max-width: 991px) {
    .cabinet-layout { grid-template-columns:1fr; gap:20px; }
    .cabinet-sidebar { display:flex; overflow-x:auto; white-space:nowrap; }
    .cabinet-sidebar a { border-bottom:0; border-right:1px solid var(--border); }
    .cabinet-sidebar a.is-active { border-left:0; border-bottom:3px solid var(--brand); padding-left:13px; }
    .stat-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
    .bot-grid,.cabinet-two-columns { grid-template-columns:1fr; }
}
@media (max-width: 767px) {
    .cabinet-page { padding-top:15px; }
    .cabinet-heading h1 { font-size:30px; }
    .stat-grid { grid-template-columns:1fr 1fr; }
    .destination-card { grid-template-columns:1fr; }
    .destination-actions { justify-content:flex-start; max-width:none; }
    .destination-edit-form { min-width:0; width:min(100%,330px); }
    .group-card { display:block; }
    .group-card > div:last-child { margin-top:12px; }
}

/* v2.3.1 — compact test send/examples inside Telegram destinations */
.destination-test-details { margin-top:14px; border-top:1px solid #eee; padding-top:11px; }
.destination-test-details > summary { cursor:pointer; color:#337ab7; font-weight:600; }
.destination-test-box { margin-top:12px; padding:14px; border:1px solid #e5e5e5; border-radius:4px; background:#fafafa; }
.destination-test-box h4 { margin:0 0 5px; font-size:15px; }
.destination-test-form { display:flex; gap:8px; align-items:center; margin:10px 0 16px; }
.destination-test-form .form-control { flex:1 1 auto; }
.destination-test-form .btn { flex:0 0 auto; }
.api-example-block { margin-top:12px; }
.api-example-heading { display:flex; align-items:center; justify-content:space-between; gap:10px; margin-bottom:5px; }
.api-example-block pre { max-height:260px; margin:0; padding:12px; overflow:auto; white-space:pre; }
.api-key-note { margin:10px 0 0; }
@media (max-width: 767px) {
    .destination-test-form { display:block; }
    .destination-test-form .btn { margin-top:8px; }
}

/* v2.3.2 — bot/recipient relationship and filters */
.bot-recipient-overview { display:grid; grid-template-columns:repeat(auto-fit,minmax(210px,1fr)); gap:10px; margin:0 0 16px; }
.bot-recipient-summary { display:flex; flex-direction:column; gap:3px; padding:12px 14px; border:1px solid var(--border); border-radius:4px; background:#fff; text-decoration:none; color:inherit; }
.bot-recipient-summary:hover, .bot-recipient-summary.is-selected { border-color:#777; background:#fafafa; }
.bot-recipient-summary-title { font-weight:700; }
.bot-recipient-summary-meta, .bot-recipient-summary-count { font-size:12px; color:#777; }
.cabinet-filter-bar { display:grid; grid-template-columns:minmax(180px,1.3fr) repeat(3,minmax(140px,1fr)) minmax(220px,1.5fr) auto; gap:10px; align-items:end; padding:14px; margin:0 0 8px; border:1px solid var(--border); background:#fafafa; border-radius:4px; }
.cabinet-filter-bar label { display:grid; gap:5px; margin:0; }
.cabinet-filter-bar label > span { font-size:12px; font-weight:600; color:#666; }
.cabinet-filter-actions { display:flex; gap:6px; align-items:center; }
.filter-result-line { margin:0 0 16px; color:#666; font-size:13px; }
.destination-bot-card { display:flex; justify-content:space-between; gap:16px; align-items:center; padding:12px 14px; margin:10px 0; border-left:4px solid #555; background:#f7f7f7; }
.destination-bot-label { display:block; margin-bottom:3px; font-size:11px; text-transform:uppercase; letter-spacing:.04em; color:#777; }
.destination-bot-card strong { display:block; font-size:16px; }
.destination-bot-meta { display:flex; flex-wrap:wrap; gap:7px 12px; margin-top:3px; color:#666; font-size:12px; }
.association-badge { flex:0 0 auto; display:inline-flex; align-items:center; padding:5px 8px; border-radius:3px; font-size:11px; font-weight:700; white-space:nowrap; border:1px solid #bbb; background:#fff; }
.association-badge.is-confirmed { border-color:#6d8f6d; }
.association-badge.is-legacy { border-color:#b59a66; }
.legacy-association-note { margin:8px 0 12px; padding:9px 11px; border:1px solid #dccca9; background:#fffaf0; color:#665a40; font-size:12px; line-height:1.45; }
@media (max-width:1100px) {
    .cabinet-filter-bar { grid-template-columns:repeat(2,minmax(180px,1fr)); }
    .cabinet-filter-search { grid-column:span 2; }
}
@media (max-width:640px) {
    .cabinet-filter-bar { grid-template-columns:1fr; }
    .cabinet-filter-search { grid-column:auto; }
    .destination-bot-card { align-items:flex-start; flex-direction:column; }
}

/* v2.4 — compact recipient table, bot tabs, dedicated group workspace. */
.sr-only { position:absolute!important; width:1px!important; height:1px!important; padding:0!important; margin:-1px!important; overflow:hidden!important; clip:rect(0,0,0,0)!important; white-space:nowrap!important; border:0!important; }
.text-warning { color:#9a6b16; }
.text-success { color:#3c763d; }
.cabinet-intro-row { display:flex; justify-content:space-between; align-items:flex-start; gap:24px; }
.cabinet-intro-row > div:first-child { min-width:0; }
.compact-help { position:relative; flex:0 0 auto; }
.compact-help > summary, .manual-add-inline > summary, .groups-list-head details > summary, .group-settings-menu > summary { list-style:none; cursor:pointer; }
.compact-help > summary::-webkit-details-marker, .manual-add-inline > summary::-webkit-details-marker, .groups-list-head details > summary::-webkit-details-marker, .group-settings-menu > summary::-webkit-details-marker { display:none; }
.compact-help-popover, .manual-add-popover, .popover-form { position:absolute; z-index:20; right:0; top:calc(100% + 7px); width:min(430px,calc(100vw - 30px)); padding:16px; border:1px solid #d9d9d9; border-radius:5px; background:#fff; box-shadow:0 8px 26px rgba(0,0,0,.12); }
.compact-help-popover ol { margin:10px 0 12px; padding-left:20px; }
.compact-help-popover li { margin:7px 0; }

.bot-filter-tabs { display:flex; gap:6px; overflow-x:auto; padding:0 0 10px; margin:0 0 8px; scrollbar-width:thin; }
.bot-filter-tabs a { flex:0 0 auto; display:flex; align-items:center; gap:9px; min-height:40px; padding:8px 12px; border:1px solid #d9d9d9; border-radius:5px; color:#555; background:#fff; text-decoration:none; white-space:nowrap; }
.bot-filter-tabs a:hover { border-color:#aaa; color:#333; }
.bot-filter-tabs a.is-active { border-color:#337ab7; color:#245580; background:#f2f8fc; box-shadow:inset 0 -2px 0 #337ab7; }
.bot-filter-tabs a.is-warning { border-color:#dccca9; }
.bot-filter-tabs a.is-warning.is-active { background:#fffaf0; border-color:#b59a66; box-shadow:inset 0 -2px 0 #b59a66; color:#765b25; }
.bot-filter-tabs strong { min-width:22px; padding:1px 6px; border-radius:10px; text-align:center; background:#f0f0f0; color:#555; font-size:12px; }
.bot-filter-tabs .is-active strong { background:#fff; }

.chat-filter-bar { display:grid; grid-template-columns:minmax(260px,1fr) 160px 160px auto auto; gap:8px; align-items:center; padding:12px; border:1px solid #e2e2e2; border-radius:5px; background:#fafafa; }
.chat-filter-bar label { margin:0; }
.chat-filter-bar .form-control { width:100%; }
.list-toolbar { display:flex; justify-content:space-between; align-items:center; gap:14px; margin:10px 0 14px; color:#666; font-size:13px; }
.manual-add-inline { position:relative; }
.manual-add-popover { width:min(500px,calc(100vw - 30px)); }
.manual-add-popover label { display:block; margin-bottom:10px; }
.manual-add-popover fieldset { margin:10px 0; padding:10px; border:1px solid #ddd; }
.manual-add-popover legend { padding:0 5px; font-size:13px; }

.cabinet-data-table-wrap { margin:0 0 28px; border:1px solid #e1e1e1; border-radius:5px; background:#fff; overflow-x:auto; }
.cabinet-data-table { margin-bottom:0; min-width:930px; }
.cabinet-data-table th { padding:10px 11px; color:#666; font-size:12px; font-weight:600; white-space:nowrap; border-bottom:1px solid #ddd!important; }
.cabinet-data-table td { padding:11px; vertical-align:middle!important; border-top:1px solid #eee!important; }
.cabinet-data-table tbody tr:hover { background:#fbfbfb; }
.cabinet-data-table tr.is-muted-row { opacity:.62; }
.table-primary-link { color:#333; font-weight:600; }
.table-primary-link:hover { color:#23527c; }
.table-subline { margin-top:2px; color:#888; font-size:11px; }
.unassigned-bot-link { color:#8a651c; font-weight:600; }
.table-tags { display:flex; flex-wrap:wrap; gap:4px; max-width:210px; }
.table-tags span, .tag { display:inline-block; padding:2px 6px; border:1px solid #ddd; border-radius:10px; background:#fafafa; color:#666; font-size:11px; }
.status-dot { display:inline-block; width:7px; height:7px; margin-right:6px; border-radius:50%; background:#999; vertical-align:1px; }
.status-dot.is-active { background:#5cb85c; }
.status-dot.is-disabled { background:#aaa; }
.table-action-cell { width:1%; white-space:nowrap; text-align:right; }
.table-action-cell form { margin:0; }

.chat-detail-panel { margin:0 0 18px; padding:20px; border:1px solid #cfddea; border-radius:6px; background:#f8fbfd; box-shadow:0 3px 12px rgba(0,0,0,.035); }
.chat-detail-head { display:flex; align-items:flex-start; justify-content:space-between; gap:20px; padding-bottom:14px; border-bottom:1px solid #dce6ee; }
.chat-detail-head h3 { margin:5px 0 2px; font-size:22px; }
.chat-detail-grid { display:grid; grid-template-columns:1fr 1fr; gap:24px; padding:16px 0; }
.detail-label { display:block; margin:0 0 5px; color:#777; font-size:11px; font-weight:600; text-transform:uppercase; letter-spacing:.04em; }
.association-pill { display:inline-block; margin-top:7px; padding:3px 7px; border:1px solid #c8c8c8; border-radius:3px; background:#fff; color:#666; font-size:11px; }
.association-pill.is-confirmed { border-color:#9bc59b; color:#3c763d; background:#f7fff7; }
.copy-line { display:flex; align-items:center; gap:7px; margin-bottom:14px; }
.copy-line code { padding:4px 6px; border:1px solid #ddd; border-radius:3px; background:#fff; word-break:break-all; }
.tag-list { display:flex; flex-wrap:wrap; gap:5px; }
.assign-bot-form { display:flex; gap:8px; max-width:580px; margin:10px 0 7px; }
.assign-bot-form .form-control { flex:1; }
.chat-detail-actions-grid { display:grid; grid-template-columns:1fr 1fr; gap:18px; }
.chat-detail-section { padding:16px; border:1px solid #dfe6eb; border-radius:5px; background:#fff; }
.chat-detail-section h4, .group-section h4 { margin:0 0 10px; font-size:17px; font-weight:600; }
.chat-detail-section label { display:block; margin-bottom:10px; }
.chat-detail-section fieldset { margin:12px 0; padding:10px; border:1px solid #ddd; }
.chat-detail-section legend { padding:0 5px; font-size:12px; }
.inline-danger-actions { display:flex; gap:7px; margin-top:12px; }
.inline-danger-actions form { margin:0; }
.test-send-compact { display:grid; grid-template-columns:1fr auto; gap:8px; }
.api-code-details { margin-top:12px; }
.api-code-details > summary { cursor:pointer; color:#337ab7; font-weight:600; }
.tech-grid { display:flex; flex-wrap:wrap; gap:8px 18px; padding:10px 0 0; font-size:12px; }

.group-explainer { display:grid; grid-template-columns:repeat(3,1fr); gap:10px; margin:0 0 18px; }
.group-explainer > div { padding:13px 14px; border:1px solid #e1e1e1; border-radius:5px; background:#fafafa; }
.group-explainer strong { display:block; margin-bottom:3px; font-size:13px; }
.group-explainer span { color:#777; font-size:12px; }
.groups-workspace { display:grid; grid-template-columns:235px minmax(0,1fr); gap:18px; align-items:start; }
.groups-list-panel, .group-detail-panel { border:1px solid #ddd; border-radius:6px; background:#fff; }
.groups-list-panel { position:sticky; top:16px; }
.groups-list-head { position:relative; display:flex; justify-content:space-between; align-items:center; gap:10px; padding:12px; border-bottom:1px solid #e5e5e5; }
.groups-list-head details { position:relative; }
.groups-list-head .popover-form { width:310px; }
.popover-form label { display:block; margin-bottom:10px; }
.popover-form form + form { margin-top:12px; padding-top:12px; border-top:1px solid #eee; }
.groups-list-nav a { display:flex; justify-content:space-between; align-items:center; gap:10px; padding:11px 12px; border-bottom:1px solid #eee; color:#444; text-decoration:none; }
.groups-list-nav a:last-child { border-bottom:0; }
.groups-list-nav a:hover { background:#fafafa; }
.groups-list-nav a.is-active { color:#23527c; background:#f2f8fc; box-shadow:inset 3px 0 0 #337ab7; }
.groups-list-nav span { min-width:0; overflow:hidden; text-overflow:ellipsis; }
.groups-list-nav small { display:block; margin-top:2px; color:#999; font-size:10px; }
.groups-list-nav strong { min-width:24px; padding:2px 6px; border-radius:10px; background:#f1f1f1; text-align:center; font-size:11px; }
.group-detail-panel { min-width:0; padding:20px; }
.group-detail-header { position:relative; display:flex; justify-content:space-between; align-items:flex-start; gap:18px; padding-bottom:16px; border-bottom:1px solid #eee; }
.group-detail-header h3 { margin:3px 0 4px; font-size:24px; }
.group-settings-menu { position:relative; flex:0 0 auto; }
.group-settings-menu .popover-form { width:340px; }
.group-section { padding:20px 0; border-bottom:1px solid #eee; }
.group-section:last-child { border-bottom:0; padding-bottom:0; }
.section-title-row { display:flex; justify-content:space-between; align-items:flex-start; gap:16px; margin-bottom:12px; }
.section-title-row h4 { margin-bottom:3px; }
.section-title-row p { margin:0; }
.group-bot-coverage { display:grid; grid-template-columns:repeat(auto-fit,minmax(180px,1fr)); gap:8px; }
.group-bot-coverage > div { padding:11px 12px; border:1px solid #ddd; border-radius:4px; background:#fafafa; }
.group-bot-coverage strong { display:block; }
.group-bot-coverage span { display:block; color:#888; font-size:11px; }
.group-bot-coverage b { display:block; margin-top:5px; color:#555; font-size:12px; }
.group-legacy-note { margin-top:10px; }
.group-members-table { min-width:720px; }
.group-add-filter { display:grid; grid-template-columns:minmax(220px,1fr) 190px auto auto; gap:8px; margin-bottom:10px; }
.recipient-picker { max-height:360px; margin:0 0 10px; overflow:auto; border:1px solid #ddd; border-radius:4px; }
.recipient-picker-row { display:grid!important; grid-template-columns:auto minmax(0,1fr) 190px; gap:10px; align-items:center; margin:0!important; padding:9px 10px; border-bottom:1px solid #eee; cursor:pointer; font-weight:400!important; }
.recipient-picker-row:last-child { border-bottom:0; }
.recipient-picker-row:hover { background:#fafafa; }
.recipient-picker-main strong { display:block; }
.recipient-picker-main small { display:block; margin-top:2px; color:#888; font-size:11px; }
.recipient-picker-bot { color:#666; font-size:12px; text-align:right; }
.group-test-form { display:grid; grid-template-columns:220px minmax(220px,1fr) auto; gap:8px; margin-bottom:12px; }
.telegram-events-filter { grid-template-columns:180px 190px minmax(240px,1fr) auto auto; }

@media (max-width: 1100px) {
    .chat-filter-bar { grid-template-columns:minmax(240px,1fr) 150px 150px auto; }
    .chat-filter-bar > a.btn { grid-column:auto; }
    .groups-workspace { grid-template-columns:205px minmax(0,1fr); }
    .chat-detail-actions-grid { grid-template-columns:1fr; }
}
@media (max-width: 900px) {
    .groups-workspace { grid-template-columns:1fr; }
    .groups-list-panel { position:static; }
    .groups-list-nav { display:flex; overflow-x:auto; }
    .groups-list-nav a { min-width:170px; border-right:1px solid #eee; border-bottom:0; }
    .group-explainer { grid-template-columns:1fr; }
    .chat-detail-grid { grid-template-columns:1fr; }
    .telegram-events-filter { grid-template-columns:1fr 1fr; }
}
@media (max-width: 700px) {
    .cabinet-intro-row { display:block; }
    .compact-help { margin-top:10px; }
    .compact-help-popover { left:0; right:auto; }
    .chat-filter-bar, .telegram-events-filter { grid-template-columns:1fr; }
    .list-toolbar { align-items:flex-start; flex-direction:column; }
    .manual-add-popover { left:0; right:auto; }
    .assign-bot-form, .test-send-compact, .group-test-form, .group-add-filter { display:block; }
    .assign-bot-form .form-control, .test-send-compact .form-control, .group-test-form .form-control, .group-add-filter .form-control { margin-bottom:8px; }
    .chat-detail-panel, .group-detail-panel { padding:15px; }
    .chat-detail-actions-grid { grid-template-columns:1fr; }
    .recipient-picker-row { grid-template-columns:auto minmax(0,1fr); }
    .recipient-picker-bot { grid-column:2; text-align:left; }
    .group-detail-header { display:block; }
    .group-settings-menu { margin-top:10px; }
    .group-settings-menu .popover-form { left:0; right:auto; }
}
.section-lead { margin:0; max-width:900px; color:#555; font-size:14px; line-height:1.55; }

/* v2.4.1 — responsive cabinet. No horizontal scrollers in everyday cabinet pages. */
.cabinet-main,
.cabinet-main * { min-width:0; }
.cabinet-main code { overflow-wrap:anywhere; word-break:break-word; }

/* Bot selector wraps instead of becoming a horizontal scrollbar. */
.bot-filter-tabs {
    flex-wrap:wrap;
    overflow:visible;
    padding-bottom:4px;
}
.bot-filter-tabs a {
    flex:0 1 auto;
    max-width:100%;
    white-space:normal;
}
.bot-filter-tabs a span { overflow-wrap:anywhere; }

/* Filters size themselves from available width. */
.chat-filter-bar {
    grid-template-columns:minmax(190px,2fr) repeat(2,minmax(130px,1fr)) auto auto;
}
.telegram-events-filter {
    grid-template-columns:minmax(150px,1fr) minmax(160px,1fr) minmax(190px,2fr) auto auto;
}

/* Generic responsive record list used by chats, group members and Telegram events. */
.responsive-record-list {
    display:grid;
    gap:8px;
    margin:0 0 28px;
}
.responsive-record {
    display:grid;
    align-items:center;
    gap:10px 14px;
    padding:13px 14px;
    border:1px solid #e1e1e1;
    border-radius:6px;
    background:#fff;
}
.responsive-record:hover { border-color:#cfcfcf; background:#fcfcfc; }
.responsive-record.is-muted-row { opacity:.65; }
.record-main { min-width:0; }
.record-title { color:#333; font-weight:600; overflow-wrap:anywhere; }
.record-meta-line { display:flex; flex-wrap:wrap; align-items:center; gap:6px 9px; margin-top:4px; color:#777; font-size:12px; }
.record-field { min-width:0; }
.record-field > small { display:block; margin-top:2px; color:#888; font-size:11px; }
.record-label { display:block; margin-bottom:3px; color:#999; font-size:10px; font-weight:600; line-height:1.2; text-transform:uppercase; letter-spacing:.035em; }
.record-field code { display:inline-block; max-width:100%; }
.record-actions { display:flex; justify-content:flex-end; align-items:center; gap:6px; flex-wrap:wrap; }
.record-actions form { margin:0; }
.record-tags { display:flex; flex-wrap:wrap; gap:4px; }
.record-tags span { display:inline-block; padding:2px 6px; border:1px solid #ddd; border-radius:10px; background:#fafafa; color:#666; font-size:11px; }
.empty-group-label { color:#999; font-size:12px; }

.chat-record {
    grid-template-columns:minmax(155px,1.25fr) minmax(135px,1fr) minmax(115px,.85fr) minmax(130px,1fr) minmax(105px,.7fr) auto;
}
.chat-record .record-main { grid-column:auto; }
.chat-record .record-status small { white-space:normal; }

.telegram-event-record {
    grid-template-columns:minmax(145px,1.25fr) minmax(135px,1fr) minmax(95px,.75fr) minmax(90px,.7fr) minmax(115px,.85fr) minmax(90px,.7fr) minmax(125px,.9fr);
    align-items:start;
}

/* Group workspace uses responsive cards instead of wide tables. */
.group-bot-coverage > a {
    display:block;
    padding:11px 12px;
    border:1px solid #ddd;
    border-radius:4px;
    background:#fafafa;
    color:#444;
    text-decoration:none;
}
.group-bot-coverage > a:hover { border-color:#aaa; background:#fff; text-decoration:none; }
.group-bot-coverage > a.is-active { border-color:#337ab7; background:#f2f8fc; }
.group-bot-coverage > a strong,
.group-bot-coverage > a span,
.group-bot-coverage > a b { display:block; }
.group-bot-coverage > a span { color:#888; font-size:11px; }
.group-bot-coverage > a b { margin-top:5px; color:#555; font-size:12px; }
.group-member-record {
    grid-template-columns:minmax(155px,1.2fr) minmax(90px,.65fr) minmax(150px,1fr) minmax(115px,.8fr) auto;
}
.group-member-actions { justify-content:flex-end; }

/* The picker also wraps long bot/chat values cleanly. */
.recipient-picker-row { min-width:0; }
.recipient-picker-main,
.recipient-picker-bot { min-width:0; overflow-wrap:anywhere; }

/* Medium desktop / tablet: cabinet content is already narrow because of the sidebar. */
@media (max-width:1199px) {
    .groups-workspace { grid-template-columns:1fr; }
    .groups-list-panel { position:static; }
    .groups-list-nav { display:flex; flex-wrap:wrap; gap:6px; padding:8px; }
    .groups-list-nav a { flex:1 1 170px; border:1px solid #eee; border-radius:4px; }
    .groups-list-nav a.is-active { box-shadow:inset 0 -3px 0 #337ab7; }

    .chat-record {
        grid-template-columns:minmax(160px,1.3fr) minmax(140px,1fr) minmax(120px,.9fr) minmax(120px,1fr) auto;
    }
    .chat-record .record-groups { grid-column:1 / 4; }
    .chat-record .record-status { grid-column:4; }
    .chat-record .record-actions { grid-column:5; grid-row:1 / span 2; }

    .telegram-event-record {
        grid-template-columns:repeat(3,minmax(0,1fr));
    }
    .telegram-event-record .record-main { grid-column:1 / 2; }

    .group-member-record {
        grid-template-columns:minmax(160px,1.2fr) minmax(100px,.7fr) minmax(150px,1fr) minmax(120px,.8fr);
    }
    .group-member-actions { grid-column:1 / -1; justify-content:flex-start; padding-top:4px; }
}

@media (max-width:991px) {
    /* Existing cabinet navigation used overflow-x:auto. Wrap it instead. */
    .cabinet-sidebar {
        display:flex;
        flex-wrap:wrap;
        overflow:visible;
        white-space:normal;
    }
    .cabinet-sidebar a {
        flex:1 1 150px;
        border-right:1px solid var(--border);
        border-bottom:1px solid var(--border);
    }
    .cabinet-sidebar a.is-active {
        border-bottom:3px solid var(--brand);
    }

    .chat-filter-bar,
    .telegram-events-filter {
        grid-template-columns:repeat(2,minmax(0,1fr));
    }
    .chat-search-field,
    .telegram-events-filter input[type="search"] { grid-column:1 / -1; }

    .chat-record {
        grid-template-columns:repeat(2,minmax(0,1fr));
        align-items:start;
    }
    .chat-record .record-main { grid-column:1 / -1; }
    .chat-record .record-groups,
    .chat-record .record-status,
    .chat-record .record-actions { grid-column:auto; grid-row:auto; }
    .chat-record .record-actions { justify-content:flex-start; align-self:end; }

    .telegram-event-record { grid-template-columns:repeat(2,minmax(0,1fr)); }
    .telegram-event-record .record-main { grid-column:1 / -1; }

    .group-member-record { grid-template-columns:repeat(2,minmax(0,1fr)); }
    .group-member-record .record-main { grid-column:1 / -1; }
    .group-member-actions { grid-column:1 / -1; }

    .group-add-filter { grid-template-columns:1fr 1fr; }
    .group-test-form { grid-template-columns:1fr; }
    .chat-detail-actions-grid,
    .chat-detail-grid { grid-template-columns:1fr; }
}

@media (max-width:640px) {
    .cabinet-intro-row,
    .list-toolbar,
    .section-title-row,
    .group-detail-header,
    .chat-detail-head { display:block; }
    .compact-help,
    .manual-add-inline { margin-top:10px; }
    .list-toolbar > * + * { margin-top:8px; }

    .chat-filter-bar,
    .telegram-events-filter,
    .group-add-filter { grid-template-columns:1fr; }
    .chat-search-field,
    .telegram-events-filter input[type="search"] { grid-column:auto; }
    .chat-filter-bar .btn,
    .telegram-events-filter .btn,
    .group-add-filter .btn { width:100%; }

    .bot-filter-tabs { display:grid; grid-template-columns:1fr; }
    .bot-filter-tabs a { width:100%; justify-content:space-between; }

    .responsive-record,
    .chat-record,
    .telegram-event-record,
    .group-member-record { grid-template-columns:1fr; }
    .chat-record .record-main,
    .chat-record .record-groups,
    .chat-record .record-status,
    .chat-record .record-actions,
    .telegram-event-record .record-main,
    .group-member-record .record-main,
    .group-member-actions { grid-column:auto; }
    .record-actions,
    .group-member-actions { justify-content:flex-start; }
    .record-actions .btn,
    .group-member-actions .btn { width:100%; }
    .group-member-actions form { width:100%; }
    .group-member-actions form .btn { width:100%; }

    .groups-list-nav { display:grid; grid-template-columns:1fr; }
    .groups-list-nav a { width:100%; }
    .group-detail-panel { padding:14px; }
    .group-bot-coverage { grid-template-columns:1fr; }

    .copy-line { align-items:stretch; flex-direction:column; }
    .copy-line .btn { align-self:flex-start; }
    .inline-danger-actions { flex-direction:column; }
    .inline-danger-actions form,
    .inline-danger-actions .btn { width:100%; }
    .test-send-compact { grid-template-columns:1fr; }
    .test-send-compact .btn { width:100%; }

    .compact-help-popover,
    .manual-add-popover,
    .popover-form,
    .group-settings-menu .popover-form,
    .groups-list-head .popover-form {
        position:fixed;
        left:12px;
        right:12px;
        top:72px;
        width:auto;
        max-height:calc(100vh - 90px);
        overflow:auto;
    }
}

/* v2.4.2 — brand assets, metadata release and safer responsive group controls. */
.brand {
    display:flex;
    align-items:center;
    gap:8px;
    padding:10px 0;
}
.brand-mark {
    display:block;
    flex:0 0 30px;
    width:30px;
    height:30px;
    object-fit:contain;
}
.brand-name { line-height:30px; }

/* Allow section headings/actions to wrap before controls leave the card. */
.section-title-row,
.group-detail-header,
.groups-list-head {
    flex-wrap:wrap;
}
.section-title-row > *,
.group-detail-header > *,
.groups-list-head > * { min-width:0; }

/* Group member actions always get their own row. This prevents the two action
   buttons from being squeezed into a narrow fifth grid column. */
.group-member-record {
    grid-template-columns:minmax(155px,1.25fr) minmax(90px,.65fr) minmax(150px,1fr) minmax(115px,.8fr);
    align-items:start;
}
.group-member-actions {
    grid-column:1 / -1;
    display:flex;
    justify-content:flex-end;
    align-items:center;
    flex-wrap:wrap;
    gap:7px;
    padding-top:9px;
    border-top:1px dashed #eee;
}
.group-member-actions form { margin:0; }
.group-member-actions .btn {
    max-width:100%;
    white-space:normal;
}

/* Test/API controls use flex-wrap rather than a rigid grid, so the submit
   button moves to the next line instead of being clipped by the panel. */
.group-test-form {
    display:flex;
    flex-wrap:wrap;
    align-items:stretch;
    gap:8px;
}
.group-test-form .form-control { width:auto; }
.group-test-form select.form-control { flex:1 1 190px; }
.group-test-form input.form-control { flex:2 1 260px; }
.group-test-form .btn { flex:0 1 auto; white-space:normal; }

/* The left group selector is useful on large monitors, but in a cabinet with
   its own sidebar it makes the detail card too narrow at common laptop widths. */
@media (max-width: 1350px) {
    .groups-workspace { grid-template-columns:1fr; }
    .groups-list-panel { position:static; }
    .groups-list-nav {
        display:flex;
        flex-wrap:wrap;
        gap:6px;
        padding:8px;
    }
    .groups-list-nav a {
        flex:1 1 180px;
        min-width:0;
        border:1px solid #eee;
        border-radius:4px;
    }
    .groups-list-nav a.is-active { box-shadow:inset 0 -3px 0 #337ab7; }
}

@media (max-width: 900px) {
    .group-member-record { grid-template-columns:repeat(2,minmax(0,1fr)); }
    .group-member-record .record-main { grid-column:1 / -1; }
    .group-member-actions { grid-column:1 / -1; justify-content:flex-start; }
}

@media (max-width: 640px) {
    .brand { margin-right:14px; }
    .brand-mark { flex-basis:28px; width:28px; height:28px; }
    .brand-name { line-height:28px; }

    .group-member-record { grid-template-columns:1fr; }
    .group-member-record .record-main,
    .group-member-actions { grid-column:auto; }
    .group-member-actions { display:grid; grid-template-columns:1fr; }
    .group-member-actions .btn,
    .group-member-actions form,
    .group-member-actions form .btn { width:100%; }

    .group-test-form { display:grid; grid-template-columns:1fr; }
    .group-test-form .form-control,
    .group-test-form .btn { width:100%; }
}
