:root {
    color-scheme: dark;
    --bg: #07111f;
    --bg-soft: #10243d;
    --surface: rgba(8, 19, 35, 0.78);
    --surface-soft: rgba(15, 30, 52, 0.82);
    --surface-strong: rgba(7, 17, 31, 0.94);
    --text: #f6fbff;
    --muted: rgba(228, 239, 248, 0.78);
    --soft: rgba(198, 215, 232, 0.64);
    --line: rgba(162, 207, 243, 0.14);
    --line-strong: rgba(162, 207, 243, 0.24);
    --accent: #7fe0ff;
    --accent-dark: #39b7ff;
    --gold: #f2c572;
    --button-start: #0f7ff7;
    --button-end: #2dc2ff;
    --shadow: 0 26px 70px rgba(0, 0, 0, 0.32);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    background:
        radial-gradient(circle at 18% 14%, rgba(45, 194, 255, 0.16), transparent 34%),
        radial-gradient(circle at 86% 6%, rgba(242, 197, 114, 0.12), transparent 30%),
        linear-gradient(145deg, var(--bg) 0%, #081625 42%, var(--bg-soft) 100%);
    color: var(--text);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 15px;
    letter-spacing: 0;
}

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

.app-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
}

.sidebar {
    border-right: 1px solid var(--line);
    background: rgba(7, 17, 31, 0.78);
    padding: 24px;
    display: grid;
    align-content: start;
    gap: 28px;
}

.brand-block {
    display: grid;
    justify-items: center;
    min-height: 196px;
}

.brand-logo {
    width: min(196px, 100%);
    height: auto;
    display: block;
    object-fit: contain;
}

.sidebar-selected-bot {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(15, 30, 52, 0.56);
    padding: 11px 12px;
    display: grid;
    gap: 3px;
}

.sidebar-selected-bot .eyebrow {
    margin-bottom: 1px;
}

.sidebar-selected-bot strong,
.sidebar-selected-bot span {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sidebar-selected-bot strong {
    font-size: 18px;
    line-height: 1.2;
}

.sidebar-selected-bot span {
    color: var(--muted);
    font-size: 12px;
}

.sidebar-indicators {
    display: grid;
    gap: 10px;
}

.indicator-card {
    min-height: 58px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(15, 30, 52, 0.56);
    padding: 11px 12px;
    display: grid;
    align-content: center;
    gap: 2px;
}

.bot-status-indicator {
    grid-template-columns: 10px minmax(0, 1fr);
    align-items: center;
    column-gap: 9px;
    min-height: 58px;
}

.bot-status-indicator .indicator-value {
    grid-column: 2;
}

.bot-status-indicator .indicator-meta {
    grid-column: 2;
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    background: var(--soft);
    box-shadow: 0 0 0 4px rgba(198, 215, 232, 0.08);
}

.bot-status-indicator.is-online .status-dot {
    background: #4ade80;
    box-shadow: 0 0 0 4px rgba(74, 222, 128, 0.12), 0 0 18px rgba(74, 222, 128, 0.35);
}

.bot-status-indicator.is-offline .status-dot {
    background: #fb7185;
    box-shadow: 0 0 0 4px rgba(251, 113, 133, 0.1);
}

.bot-status-indicator.is-stale .status-dot {
    background: var(--gold);
    box-shadow: 0 0 0 4px rgba(242, 197, 114, 0.1);
}

.indicator-value {
    color: var(--text);
    font-size: 18px;
    line-height: 1.2;
    font-variant-numeric: tabular-nums;
}

.indicator-meta {
    color: var(--muted);
    font-size: 12px;
    font-variant-numeric: tabular-nums;
}

.bot-location-link {
    display: block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--soft);
}

.bot-location-link:hover,
.bot-location-link:focus-visible {
    color: var(--accent);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.bot-location-link[hidden] {
    display: none;
}

.brand-block strong,
.brand-block span {
    display: block;
}

.brand-block span,
.module-nav small,
.module-row span,
.task-stack span,
.login-copy {
    color: var(--muted);
}

.module-nav {
    display: grid;
    gap: 8px;
}

.module-nav a {
    border: 1px solid transparent;
    border-radius: 8px;
    padding: 12px;
    display: grid;
    gap: 4px;
}

.module-nav a.active,
.module-nav a:hover {
    border-color: var(--line-strong);
    background: var(--surface-soft);
}

.main-frame {
    min-width: 0;
    padding: 26px 32px 40px;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 24px;
}

.topbar h1,
.hero-panel h2,
.section-heading h3,
.login-panel h1 {
    margin: 0;
    letter-spacing: 0;
}

.topbar h1 {
    font-size: 30px;
}

.eyebrow {
    margin: 0 0 6px;
    color: var(--gold);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: uppercase;
}

.button {
    appearance: none;
    border: 0;
    border-radius: 8px;
    padding: 11px 16px;
    font-weight: 800;
    cursor: pointer;
}

.button.primary {
    background: linear-gradient(135deg, var(--button-start), var(--button-end));
    color: #fff;
}

.button.primary:hover {
    filter: brightness(1.08);
}

.button.ghost {
    background: var(--surface-soft);
    color: var(--text);
}

.button.secondary {
    border: 1px solid var(--line);
    background: transparent;
    color: var(--text);
}

.portal-config-button {
    min-width: 96px;
}

.home-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(320px, 0.75fr);
    gap: 18px;
}

.account-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: start;
    gap: 18px;
}

.account-wide-panel {
    grid-column: 1 / -1;
}

.hero-panel,
.panel {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.hero-panel {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(320px, 420px);
    gap: 24px;
    padding: 28px;
}

.compact-hero {
    grid-template-columns: minmax(0, 1fr) max-content;
    align-items: center;
    gap: 18px;
    padding: 20px 28px;
}

.bot-selector-hero {
    grid-template-columns: max-content max-content;
    justify-content: start;
    justify-self: start;
    width: fit-content;
    max-width: 100%;
}

.hero-copy h2 {
    font-size: 36px;
    margin-bottom: 10px;
}

.compact-hero .hero-copy h2 {
    margin: 0;
}

.hero-copy p {
    margin: 0;
    max-width: 760px;
    color: var(--muted);
    line-height: 1.55;
}

.bot-summary {
    display: flex;
    align-items: stretch;
    justify-content: flex-end;
    justify-self: end;
    width: max-content;
    gap: 10px;
    margin: 0;
}

.bot-summary div {
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 10px 12px;
    background: var(--surface-strong);
    width: max-content;
    white-space: nowrap;
}

.bot-summary dt {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.bot-summary dd {
    margin: 5px 0 0;
    font-weight: 800;
}

.account-summary {
    flex-wrap: wrap;
    max-width: min(760px, 100%);
}

.account-summary div {
    max-width: 280px;
    white-space: normal;
}

.account-summary dd {
    overflow-wrap: anywhere;
}

.home-card-label {
    color: var(--text);
}

.panel {
    padding: 18px;
}

.metric-panel {
    min-height: 0;
}

.metric-panel strong {
    display: block;
    margin: 6px 0 8px;
    font-size: 28px;
    line-height: 1.1;
}

.metric-panel span,
.muted-row span {
    color: var(--muted);
    line-height: 1.45;
}

.section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 14px;
}

.pill {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    border-radius: 999px;
    padding: 0 12px;
    background: var(--surface-soft);
    color: var(--accent);
    font-size: 12px;
    font-weight: 800;
}

.module-list,
.task-stack {
    display: grid;
    gap: 10px;
}

.module-row,
.task-stack div {
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 12px;
    background: var(--surface-strong);
}

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

.detail-grid div {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface-strong);
    padding: 12px;
}

.detail-grid dt {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.detail-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
}

.detail-label .help-tooltip {
    width: 18px;
    height: 18px;
    font-size: 11px;
}

.detail-label .help-tooltip::after {
    left: 0;
    top: calc(100% + 12px);
    width: min(300px, calc(100vw - 64px));
    transform: translateY(-4px);
}

.detail-label .help-tooltip:hover::after,
.detail-label .help-tooltip:focus-visible::after {
    transform: translateY(0);
}

.detail-grid dd {
    margin: 5px 0 0;
    font-weight: 800;
    overflow-wrap: anywhere;
}

.profile-copy-button {
    appearance: none;
    border: 0;
    background: transparent;
    color: var(--accent);
    padding: 0;
    font: inherit;
    font-weight: 800;
    text-align: left;
    cursor: pointer;
}

.profile-copy-button:hover,
.profile-copy-button:focus-visible {
    color: var(--text);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.profile-copy-button:focus-visible {
    outline: 2px solid rgba(127, 224, 255, 0.5);
    outline-offset: 3px;
    border-radius: 4px;
}

.profile-copy-button.is-copied::after {
    content: "Copied";
    display: inline-flex;
    margin-left: 8px;
    color: #4ade80;
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
}

.account-avatar-details {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.muted-row {
    opacity: 0.78;
}

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

.selector-grid {
    display: grid;
    gap: 18px;
}

.compact-hero {
    grid-column: auto;
}

.bot-card-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    align-items: start;
    gap: 14px;
}

.bot-card {
    display: grid;
    gap: 10px;
    align-content: space-between;
    min-height: 0;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: var(--shadow);
    padding: 14px;
}

.bot-card.selected {
    border-color: rgba(127, 224, 255, 0.52);
    background: linear-gradient(180deg, rgba(15, 30, 52, 0.92), rgba(8, 19, 35, 0.82));
}

.bot-card.service-inactive {
    border-color: rgba(251, 113, 133, 0.38);
    opacity: 0.84;
}

.bot-service-label {
    color: #4ade80;
}

.service-inactive .bot-service-label {
    color: #fb7185;
}

.bot-card-head,
.bot-actions {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}

.bot-card h3 {
    margin: 0 0 5px;
    font-size: 22px;
    line-height: 1.1;
}

.bot-card-head span,
.bot-meta dt {
    color: var(--muted);
}

.bot-card-head .pill {
    color: var(--accent);
}

.bot-runtime-pill.online {
    background: rgba(74, 222, 128, 0.12);
    color: #86efac;
}

.bot-runtime-pill.offline {
    background: rgba(251, 113, 133, 0.1);
    color: #fda4af;
}

.bot-profile-image {
    position: relative;
    display: grid;
    place-items: center;
    justify-self: center;
    width: 108px;
    height: 108px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 999px;
    background:
        linear-gradient(135deg, rgba(127, 224, 255, 0.12), rgba(15, 30, 52, 0.74)),
        var(--surface-strong);
    box-shadow: 0 14px 32px rgba(0, 0, 0, 0.28);
}

.bot-profile-image img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    object-position: center 32%;
}

.bot-profile-placeholder {
    width: 100%;
    height: 100%;
    border: 1px solid rgba(127, 224, 255, 0.34);
    border-radius: 999px;
    display: grid;
    place-items: center;
    background: rgba(127, 224, 255, 0.1);
    color: var(--accent);
    font-size: 24px;
    font-weight: 900;
}

.bot-profile-image.is-loading::after {
    content: "";
    position: absolute;
    inset: auto 20px 20px;
    height: 2px;
    border-radius: 999px;
    background: linear-gradient(90deg, transparent, var(--accent), transparent);
    opacity: 0.7;
}

.bot-meta {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
    margin: 0;
}

.bot-meta > div {
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 8px 10px;
    background: var(--surface-strong);
}

.bot-meta dt {
    font-size: 12px;
    line-height: 1.2;
}

.bot-meta dd {
    margin: 3px 0 0;
    font-weight: 800;
    font-size: 14px;
    line-height: 1.25;
    overflow-wrap: anywhere;
}

.bot-setup-note {
    display: grid;
    gap: 4px;
    border: 1px solid rgba(251, 191, 36, 0.24);
    border-radius: 8px;
    padding: 8px 10px;
    background: rgba(251, 191, 36, 0.06);
    color: var(--muted);
    font-size: 12px;
    line-height: 1.35;
}

.bot-setup-note strong {
    color: #fde68a;
    text-transform: capitalize;
}

.bot-actions form {
    margin: 0;
}

.bot-actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: stretch;
    gap: 7px;
}

.bot-card .button {
    width: 100%;
    padding: 9px 10px;
    text-align: center;
    white-space: nowrap;
}

.bot-action-button {
    border: 1px solid var(--line);
    background: #10243d;
    color: var(--text);
}

.bot-action-button:hover,
.bot-action-button:focus-visible {
    border-color: transparent;
    background: linear-gradient(135deg, var(--button-start), var(--button-end));
    color: #fff;
    filter: brightness(1.08);
}

.bot-action-button:disabled,
.bot-action-button:disabled:hover,
.bot-action-button:disabled:focus-visible {
    border-color: rgba(162, 207, 243, 0.08);
    background: rgba(15, 30, 52, 0.42);
    color: rgba(228, 239, 248, 0.42);
    cursor: not-allowed;
    filter: none;
}

.bot-renew-form {
    grid-column: 1 / -1;
}

.bot-renew-button {
    border-color: rgba(127, 224, 255, 0.34);
}

.bot-renew-summary {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.bot-renew-summary > div {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(7, 17, 31, 0.72);
    padding: 10px 12px;
}

.bot-renew-summary span,
.bot-renew-summary strong {
    display: block;
}

.bot-renew-summary span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.bot-renew-summary strong {
    margin-top: 3px;
    overflow-wrap: anywhere;
}

.bot-remove-form {
    grid-column: 1 / -1;
}

.bot-remove-button {
    border-color: rgba(251, 113, 133, 0.28);
    color: #fecdd3;
}

.bot-remove-button:hover,
.bot-remove-button:focus-visible {
    border-color: rgba(251, 113, 133, 0.64);
    background: rgba(127, 29, 29, 0.56);
    color: #fff;
}

.bot-action-note {
    grid-column: span 2;
    display: grid;
    place-items: center;
    cursor: default;
}

.add-bot-card {
    width: 100%;
    appearance: none;
    cursor: pointer;
    font: inherit;
    align-content: center;
    align-items: center;
    justify-items: center;
    place-items: center;
    justify-content: center;
    gap: 12px;
    text-align: center;
    color: var(--text);
    border-style: dashed;
    background: rgba(15, 30, 52, 0.36);
}

.add-bot-card:hover,
.add-bot-card:focus-visible {
    border-color: rgba(127, 224, 255, 0.56);
    background: rgba(15, 30, 52, 0.68);
}

.add-bot-plus {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 62px;
    height: 62px;
    border: 1px solid var(--line-strong);
    border-radius: 999px;
    background: var(--surface-strong);
    color: var(--accent);
    font-size: 44px;
    line-height: 0.9;
    font-weight: 400;
    padding-bottom: 4px;
}

.add-bot-card strong,
.add-bot-card small {
    display: block;
}

.add-bot-card small {
    margin-top: 6px;
    color: var(--muted);
    line-height: 1.35;
}

.modal-dialog {
    width: min(680px, calc(100vw - 32px));
    border: 1px solid var(--line-strong);
    border-radius: 8px;
    padding: 0;
    color: var(--text);
    background: transparent;
    box-shadow: var(--shadow);
}

.modal-dialog::backdrop {
    background: rgba(2, 8, 16, 0.72);
    backdrop-filter: blur(4px);
}

.modal-card {
    border-radius: 8px;
    background: var(--surface-strong);
    padding: 22px;
}

.modal-head,
.modal-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.modal-head {
    margin-bottom: 18px;
}

.modal-head h3 {
    margin: 0;
    font-size: 24px;
}

.icon-button {
    width: 36px;
    height: 36px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface-soft);
    color: var(--text);
    cursor: pointer;
    font-size: 22px;
    line-height: 1;
}

.bot-create-form,
.bot-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.bot-add-form {
    grid-template-columns: 1fr;
}

.bot-create-form label {
    display: grid;
    gap: 8px;
    color: var(--muted);
    font-weight: 700;
}

.bot-profile-form label {
    display: grid;
    gap: 8px;
    color: var(--muted);
    font-weight: 700;
}

.field-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.help-tooltip {
    position: relative;
    display: inline-grid;
    place-items: center;
    flex: 0 0 auto;
    width: 22px;
    height: 22px;
    border: 1px solid rgba(127, 224, 255, 0.86);
    border-radius: 999px;
    color: #04111f;
    background: var(--accent);
    box-shadow: 0 0 0 3px rgba(127, 224, 255, 0.12);
    font-size: 13px;
    font-weight: 900;
    line-height: 1;
    cursor: help;
    user-select: none;
}

.help-tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    left: 50%;
    top: calc(100% + 16px);
    z-index: 20;
    width: min(320px, calc(100vw - 64px));
    transform: translateX(-50%) translateY(-4px);
    border: 1px solid rgba(127, 224, 255, 0.28);
    border-radius: 8px;
    background: rgba(7, 17, 31, 0.98);
    box-shadow: 0 18px 45px rgba(0, 0, 0, 0.36);
    color: var(--text);
    padding: 10px 12px;
    font-size: 12px;
    font-weight: 650;
    line-height: 1.45;
    opacity: 0;
    pointer-events: none;
    text-align: left;
    white-space: normal;
    overflow-wrap: anywhere;
    transition: opacity 140ms ease, transform 140ms ease;
}

.help-tooltip:hover::after,
.help-tooltip:focus-visible::after {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.help-tooltip:focus-visible {
    outline: 2px solid rgba(127, 224, 255, 0.5);
    outline-offset: 2px;
}

.bot-form-grid > label:nth-child(odd) .help-tooltip::after {
    left: -10px;
    transform: translateY(-4px);
}

.bot-form-grid > label:nth-child(odd) .help-tooltip:hover::after,
.bot-form-grid > label:nth-child(odd) .help-tooltip:focus-visible::after {
    transform: translateY(0);
}

.bot-form-grid > label:nth-child(even) .help-tooltip::after {
    right: -10px;
    left: auto;
    transform: translateY(-4px);
}

.bot-form-grid > label:nth-child(even) .help-tooltip:hover::after,
.bot-form-grid > label:nth-child(even) .help-tooltip:focus-visible::after {
    transform: translateY(0);
}

.bot-create-form input,
.bot-create-form select,
.bot-profile-form input,
.bot-profile-form select,
.bot-profile-form textarea {
    width: 100%;
    min-height: 46px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 11px 12px;
    color: var(--text);
    background: rgba(7, 17, 31, 0.95);
    font: inherit;
}

.bot-profile-form textarea {
    min-height: 120px;
    resize: vertical;
}

.bot-profile-form input[readonly] {
    color: var(--muted);
    background: rgba(7, 17, 31, 0.54);
    cursor: default;
}

.button:disabled {
    opacity: 0.56;
    cursor: not-allowed;
}

.profile-media-block {
    display: grid;
    grid-template-columns: 168px minmax(0, 1fr);
    gap: 14px;
    align-items: stretch;
}

.profile-image-panel,
.profile-text-panel {
    display: grid;
    align-content: start;
    gap: 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(7, 17, 31, 0.72);
    padding: 12px;
    color: var(--muted);
    font-weight: 800;
}

.profile-text-panel {
    grid-template-rows: auto minmax(150px, 1fr);
    min-height: 204px;
}

.profile-text-panel textarea {
    height: 100%;
    min-height: 150px;
}

.profile-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid var(--line);
}

.profile-save-button {
    min-width: 150px;
}

.profile-image-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}

.profile-image-actions .button {
    width: 100%;
    padding: 9px 10px;
}

.profile-image-remove-button {
    color: #fecdd3;
}

.profile-image-remove-button:hover,
.profile-image-remove-button:focus-visible {
    border-color: rgba(251, 113, 133, 0.64);
    background: rgba(127, 29, 29, 0.52);
    color: #fff;
}

.profile-image-preview {
    display: grid;
    place-items: center;
    width: 96px;
    height: 96px;
    justify-self: center;
    border: 1px solid rgba(127, 224, 255, 0.36);
    border-radius: 999px;
    overflow: hidden;
    background: rgba(127, 224, 255, 0.11);
    color: var(--accent);
}

.profile-image-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-image-preview strong {
    font-size: 24px;
}

.bot-control-console {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(360px, 0.65fr);
    gap: 14px;
    align-items: start;
}

.bot-control-location-card,
.bot-control-card,
.bot-control-human-card {
    display: grid;
    gap: 14px;
}

.bot-control-location-card.is-stale {
    border-color: rgba(255, 209, 102, 0.38);
}

.bot-control-human-card {
    grid-column: 1 / -1;
}

.bot-control-side-stack {
    display: grid;
    gap: 14px;
}

.bot-control-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
}

.bot-control-card-head h3 {
    margin: 2px 0 3px;
    color: var(--text);
    font-size: clamp(22px, 2vw, 30px);
    line-height: 1.08;
}

.bot-control-card-head span {
    display: block;
    color: var(--muted);
    font-weight: 760;
}

.bot-control-card-head form {
    flex: 0 0 auto;
    margin: 0;
}

.bot-control-info-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin: 0;
}

.bot-control-info-grid div {
    min-height: 64px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface-strong);
    padding: 12px;
}

.bot-control-info-grid dt {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.bot-control-info-grid dd {
    margin: 6px 0 0;
    font-weight: 820;
    overflow-wrap: anywhere;
}

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

.bot-control-actions form {
    margin: 0;
}

.bot-action-button.is-active {
    border-color: rgba(127, 224, 255, 0.6);
    background: rgba(127, 224, 255, 0.12);
    color: var(--accent);
    box-shadow: inset 0 0 0 1px rgba(127, 224, 255, 0.12);
}

.bot-action-button.is-loading {
    opacity: 0.72;
}

.bot-control-pay-form {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(120px, 0.6fr);
    gap: 10px;
}

.bot-control-submit {
    grid-column: 1 / -1;
    width: 100%;
}

.human-read-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 10px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.human-read-list li {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface-strong);
    padding: 12px;
    color: var(--text);
    font-weight: 760;
    overflow-wrap: anywhere;
}

.human-read-list span {
    color: var(--muted);
}

.avatar-control-console {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    align-items: stretch;
}

.avatar-control-card {
    display: grid;
    gap: 13px;
    align-content: start;
    min-width: 0;
    min-height: 324px;
}

.avatar-last-action-card {
    grid-column: 1 / -1;
    min-height: 0;
}

.avatar-control-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.avatar-control-card-head h3 {
    margin: 0;
    color: var(--text);
    font-size: 18px;
    line-height: 1.1;
}

.avatar-control-card-head span {
    display: block;
    color: var(--muted);
    font-weight: 760;
}

.avatar-control-card-head .pill {
    display: inline-flex;
    flex: 0 0 auto;
}

.avatar-control-card-head .pill[hidden],
.avatar-control-card-head .pill.is-auto-hidden {
    display: none;
}

.avatar-movement-pad {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    padding: 9px;
    border: 1px solid rgba(127, 224, 255, 0.12);
    border-radius: 8px;
    background: rgba(7, 17, 31, 0.38);
}

.avatar-movement-pad form,
.avatar-mode-actions form,
	.avatar-posture-actions form,
	.avatar-object-actions form,
	.avatar-animation-actions form,
	.avatar-cancel-timer-form,
	.avatar-home-now-form {
	    margin: 0;
	}

.avatar-move-button {
    width: 100%;
    min-height: 38px;
    padding: 8px 7px;
    touch-action: none;
    user-select: none;
}

.avatar-move-button.primary-move {
    border-color: rgba(127, 224, 255, 0.5);
}

.avatar-move-button.stop-move {
    border-color: rgba(251, 113, 133, 0.45);
}

.avatar-move-button.is-pressed {
    border-color: transparent;
    background: linear-gradient(135deg, var(--button-start), var(--button-end));
    color: #fff;
    filter: brightness(1.08);
}

.avatar-object-actions,
.avatar-animation-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
    gap: 8px;
}

.avatar-mode-actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.avatar-posture-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.avatar-mode-actions .button,
.avatar-posture-actions .button,
.avatar-timer-grid .button,
.avatar-object-actions .button,
.avatar-animation-actions .button {
    min-height: 36px;
    padding: 8px 10px;
}

.avatar-timer-card .avatar-control-form {
    gap: 7px;
}

.avatar-timer-countdown {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border: 1px solid rgba(127, 224, 255, 0.14);
    border-radius: 8px;
    padding: 9px 11px;
    background: rgba(7, 17, 31, 0.48);
}

.avatar-timer-countdown strong {
    color: var(--accent);
    font-size: 22px;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

.avatar-timer-countdown span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 760;
    text-align: right;
    overflow-wrap: anywhere;
}

.avatar-control-form,
.avatar-object-form,
.avatar-animation-form {
    display: grid;
    gap: 10px;
}

.avatar-field {
    display: grid;
    gap: 7px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.avatar-field span {
    line-height: 1.2;
}

.avatar-field input,
.avatar-field select {
    width: 100%;
    min-height: 42px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 10px 12px;
    color: var(--text);
    background: rgba(7, 17, 31, 0.96);
    font: inherit;
    font-weight: 760;
}

.avatar-field select {
    cursor: pointer;
}

.avatar-field input::placeholder {
    color: rgba(178, 203, 219, 0.48);
}

.avatar-field input:focus,
.avatar-field select:focus {
    outline: 2px solid rgba(127, 224, 255, 0.42);
    outline-offset: 2px;
    border-color: rgba(127, 224, 255, 0.48);
}

.avatar-timer-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}

.avatar-teleport-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.avatar-teleport-actions form {
    margin: 0;
}

.avatar-teleport-actions .button,
.avatar-landmark-chip button {
    width: 100%;
    min-height: 36px;
    padding: 8px 10px;
}

.avatar-landmark-count {
    white-space: nowrap;
}

.avatar-landmark-hint {
    margin: 0;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.4;
}

.avatar-landmark-favorites {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    min-width: 0;
}

.avatar-landmark-favorites-title {
    flex: 1 0 100%;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.avatar-landmark-chip {
    display: inline-grid;
    grid-template-columns: minmax(0, 1fr) 30px;
    align-items: center;
    overflow: hidden;
    max-width: 100%;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(7, 17, 31, 0.54);
}

.avatar-landmark-chip form {
    margin: 0;
}

.avatar-landmark-chip button {
    border: 0;
    border-radius: 0;
    background: transparent;
    color: var(--text);
    font-weight: 800;
    text-align: left;
    cursor: pointer;
}

.avatar-landmark-chip form button {
    min-height: 34px;
    padding: 0;
    color: var(--muted);
    text-align: center;
}

.avatar-landmark-chip button:hover,
.avatar-landmark-chip button:focus-visible {
    background: rgba(127, 224, 255, 0.08);
    color: var(--accent);
}

.avatar-cancel-timer-form,
.avatar-home-now-form {
    grid-column: 1 / -1;
}

.avatar-control-submit,
.avatar-cancel-timer-form .button,
.avatar-home-now-form .button,
.avatar-mode-actions .button,
.avatar-posture-actions .button,
.avatar-object-actions .button,
.avatar-animation-actions .button {
    width: 100%;
}

.avatar-control-card-head .pill.online {
    background: rgba(74, 222, 128, 0.12);
    color: #86efac;
}

.avatar-control-card-head .pill.offline {
    background: rgba(251, 113, 133, 0.1);
    color: #fda4af;
}

.avatar-object-form {
    grid-template-columns: minmax(0, 1fr) 110px;
    align-items: end;
}

.avatar-minimap-card {
    gap: 10px;
}

.avatar-minimap-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    min-width: 0;
}

.avatar-minimap-head strong,
.avatar-minimap-head span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.avatar-minimap-head strong {
    color: var(--text);
    font-size: 13px;
}

.avatar-minimap-head span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 760;
    font-variant-numeric: tabular-nums;
}

.avatar-minimap-modes {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.avatar-minimap-modes .button {
    min-height: 34px;
    padding: 7px 9px;
}

.avatar-minimap-modes .button.is-active {
    border-color: transparent;
    background: linear-gradient(135deg, var(--button-start), var(--button-end));
    color: #fff;
}

.avatar-minimap-frame {
    position: relative;
    justify-self: center;
    width: min(100%, 220px);
    aspect-ratio: 1 / 1;
    overflow: hidden;
    border: 1px solid rgba(127, 224, 255, 0.18);
    border-radius: 8px;
    background:
        linear-gradient(135deg, rgba(7, 17, 31, 0.96), rgba(13, 34, 49, 0.9)),
        repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.07) 0 1px, transparent 1px 25%),
        repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.07) 0 1px, transparent 1px 25%);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05);
}

.avatar-minimap-frame img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.88;
    transform-origin: 0 0;
    transition: transform 180ms ease;
    will-change: transform;
}

.avatar-minimap-frame::before,
.avatar-minimap-frame::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.avatar-minimap-frame::before {
    z-index: 1;
    background:
        linear-gradient(rgba(255, 255, 255, 0.18) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.18) 1px, transparent 1px);
    background-size: 50% 50%;
    opacity: 0.42;
}

.avatar-minimap-frame::after {
    z-index: 1;
    background: radial-gradient(circle at 50% 50%, transparent 44%, rgba(7, 17, 31, 0.28) 100%);
}

.avatar-minimap-zoom-controls {
    position: absolute;
    right: 8px;
    bottom: 8px;
    z-index: 4;
    display: grid;
    gap: 6px;
}

.avatar-minimap-zoom-controls button {
    width: 30px;
    height: 30px;
    min-height: 0;
    border: 1px solid rgba(127, 224, 255, 0.42);
    border-radius: 8px;
    background: rgba(9, 25, 43, 0.9);
    color: var(--accent);
    font: inherit;
    font-size: 18px;
    font-weight: 900;
    line-height: 1;
    cursor: pointer;
}

.avatar-minimap-zoom-controls button:disabled {
    cursor: default;
    opacity: 0.45;
}

.avatar-minimap-cardinal {
    position: absolute;
    z-index: 3;
    color: #f8fbff;
    font-size: 10px;
    font-weight: 900;
    line-height: 1;
    pointer-events: none;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.7);
}

.avatar-minimap-cardinal.n {
    top: 7px;
    left: 50%;
    transform: translateX(-50%);
}

.avatar-minimap-cardinal.s {
    bottom: 7px;
    left: 50%;
    transform: translateX(-50%);
}

.avatar-minimap-cardinal.e {
    top: 50%;
    right: 8px;
    transform: translateY(-50%);
}

.avatar-minimap-cardinal.w {
    top: 50%;
    left: 8px;
    transform: translateY(-50%);
}

.avatar-minimap-marker {
    position: absolute;
    z-index: 4;
    left: 50%;
    top: 50%;
    width: 18px;
    height: 18px;
    border: 2px solid #f8fbff;
    border-radius: 999px;
    background: var(--accent);
    box-shadow: 0 2px 9px rgba(0, 0, 0, 0.55);
    transform: translate(-50%, -50%) rotate(0deg);
    transform-origin: center;
    transition: left 180ms ease, top 180ms ease, transform 180ms ease;
}

.avatar-minimap-marker::before {
    content: "";
    position: absolute;
    top: -10px;
    left: 50%;
    width: 0;
    height: 0;
    border-right: 5px solid transparent;
    border-bottom: 10px solid var(--accent);
    border-left: 5px solid transparent;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.45));
    transform: translateX(-50%);
}

.avatar-minimap-status {
    min-height: 18px;
    margin: 0;
    color: var(--muted);
    font-size: 12px;
    font-weight: 760;
    line-height: 1.35;
}

.avatar-minimap-status.is-error {
    color: #fda4af;
}

.avatar-minimap-status.is-ok {
    color: #86efac;
}

.avatar-landmark-dialog {
    width: min(820px, calc(100vw - 32px));
}

.avatar-landmark-list {
    display: grid;
    align-content: start;
    gap: 8px;
    max-height: 460px;
    overflow: auto;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(7, 17, 31, 0.42);
    padding: 10px;
}

.avatar-object-picker-actions,
.avatar-animation-picker-actions {
    display: grid;
    gap: 8px;
    align-items: center;
    margin-bottom: 10px;
}

.avatar-object-picker-actions {
    grid-template-columns: 110px 110px minmax(0, 1fr);
}

.avatar-animation-picker-actions {
    grid-template-columns: 128px minmax(0, 1fr);
}

.avatar-object-picker-actions span,
.avatar-animation-picker-actions span,
.avatar-object-count,
.avatar-animation-count,
.avatar-landmark-count {
    min-width: 0;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.avatar-object-picker-actions span,
.avatar-animation-picker-actions span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.avatar-object-dialog,
.avatar-script-dialog,
.avatar-animation-dialog {
    width: min(820px, calc(100vw - 32px));
}

.avatar-object-list,
.avatar-script-dialog-list,
.avatar-animation-list {
    display: grid;
    gap: 8px;
    max-height: min(58vh, 560px);
    overflow: auto;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(7, 17, 31, 0.42);
    padding: 10px;
}

.avatar-script-dialog-card {
    display: grid;
    gap: 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(7, 17, 31, 0.72);
    padding: 12px;
}

.avatar-script-dialog-title {
    display: flex;
    justify-content: space-between;
    gap: 12px;
}

.avatar-script-dialog-title strong,
.avatar-script-dialog-title small {
    display: block;
}

.avatar-script-dialog-title small,
.avatar-script-dialog-meta,
.avatar-script-dialog-message {
    color: var(--muted);
    font-size: 12px;
    line-height: 1.4;
}

.avatar-script-dialog-message {
    color: var(--text);
    white-space: pre-wrap;
}

.avatar-script-dialog-buttons,
.avatar-script-dialog-text {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.avatar-script-dialog-buttons .button {
    flex: 1 1 128px;
}

.avatar-script-dialog-text {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 120px;
}

.avatar-script-dialog-text input {
    min-width: 0;
}

.avatar-script-dialog-count {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.avatar-landmark-row,
.avatar-nearby-object-row,
.avatar-inventory-animation-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 118px 96px;
    gap: 8px;
    align-items: stretch;
}

.avatar-nearby-object-row,
.avatar-inventory-animation-row {
    grid-template-columns: minmax(0, 1fr) auto;
}

.avatar-landmark-row > button,
.avatar-nearby-object-row > button,
.avatar-inventory-animation-row > button {
    display: grid;
    gap: 3px;
    min-width: 0;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(7, 17, 31, 0.72);
    color: var(--text);
    padding: 9px 11px;
    text-align: left;
    cursor: pointer;
}

.avatar-landmark-row > button:hover,
.avatar-landmark-row > button:focus-visible,
.avatar-nearby-object-row > button:hover,
.avatar-nearby-object-row > button:focus-visible,
.avatar-inventory-animation-row > button:hover,
.avatar-inventory-animation-row > button:focus-visible {
    border-color: rgba(127, 224, 255, 0.46);
    background: rgba(127, 224, 255, 0.08);
}

.avatar-landmark-row strong,
.avatar-landmark-row small,
.avatar-nearby-object-row strong,
.avatar-nearby-object-row small,
.avatar-inventory-animation-row strong,
.avatar-inventory-animation-row small {
    display: block;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.avatar-landmark-row small,
.avatar-nearby-object-row small,
.avatar-inventory-animation-row small {
    color: var(--muted);
    font-size: 12px;
}

.avatar-landmark-row form {
    display: grid;
    margin: 0;
}

.avatar-landmark-row .button {
    width: 100%;
}

.avatar-object-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-content: center;
    align-items: center;
    justify-content: flex-end;
    min-width: 132px;
}

.avatar-object-badges span {
    border: 1px solid rgba(87, 218, 255, 0.34);
    border-radius: 999px;
    background: rgba(87, 218, 255, 0.09);
    color: var(--accent);
    font-size: 11px;
    font-weight: 900;
    line-height: 1;
    padding: 6px 8px;
    white-space: nowrap;
}

.avatar-object-form .avatar-object-actions {
    grid-column: 1 / -1;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.inline-link {
    color: var(--accent);
    font-weight: 800;
    overflow-wrap: anywhere;
    text-decoration: none;
}

.inline-link:hover,
.inline-link:focus-visible {
    color: var(--text);
    text-decoration: underline;
}

.profile-image-dialog {
    width: min(880px, calc(100vw - 32px));
}

.profile-image-search {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    margin-bottom: 14px;
}

.profile-image-search input {
    width: 100%;
    min-height: 44px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 10px 12px;
    color: var(--text);
    background: rgba(7, 17, 31, 0.95);
    font: inherit;
}

.profile-image-picker-body {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) 240px;
    gap: 14px;
    min-height: 320px;
    margin-bottom: 18px;
}

.profile-image-results {
    display: grid;
    align-content: start;
    gap: 8px;
    max-height: 420px;
    overflow: auto;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(7, 17, 31, 0.42);
    padding: 10px;
}

.profile-image-result {
    display: grid;
    grid-template-columns: 58px minmax(0, 1fr);
    gap: 10px;
    align-items: center;
    width: 100%;
    border: 1px solid transparent;
    border-radius: 8px;
    background: transparent;
    color: var(--text);
    padding: 8px;
    text-align: left;
    cursor: pointer;
}

.profile-image-result:hover,
.profile-image-result.is-selected {
    border-color: rgba(127, 224, 255, 0.46);
    background: rgba(127, 224, 255, 0.08);
}

.profile-image-result-thumb {
    width: 58px;
    height: 58px;
    border-radius: 8px;
    overflow: hidden;
    background: rgba(127, 224, 255, 0.1);
}

.profile-image-result-thumb img,
.profile-image-choice-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-image-result-text {
    min-width: 0;
}

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

.profile-image-result-text small {
    color: var(--muted);
    font-size: 12px;
}

.profile-image-choice {
    display: grid;
    align-content: start;
    gap: 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(7, 17, 31, 0.72);
    padding: 12px;
}

.profile-image-choice-preview {
    display: grid;
    place-items: center;
    aspect-ratio: 1;
    border: 1px solid rgba(127, 224, 255, 0.28);
    border-radius: 8px;
    overflow: hidden;
    color: var(--muted);
    background: rgba(127, 224, 255, 0.08);
}

.profile-image-choice small {
    color: var(--muted);
    overflow-wrap: anywhere;
}

.bot-credit-strip {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border: 1px solid rgba(127, 224, 255, 0.22);
    border-radius: 8px;
    background: rgba(45, 194, 255, 0.08);
    padding: 10px 12px;
}

.bot-credit-strip span,
.form-note {
    color: var(--muted);
}

.bot-credit-strip strong {
    color: var(--accent);
}

.bot-source-options {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.bot-source-card {
    position: relative;
    display: block;
    cursor: pointer;
}

.bot-source-card input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.bot-source-card span {
    min-height: 104px;
    display: grid;
    align-content: start;
    gap: 7px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(7, 17, 31, 0.72);
    padding: 13px;
}

.bot-source-card input:checked + span {
    border-color: rgba(127, 224, 255, 0.58);
    background: linear-gradient(180deg, rgba(15, 30, 52, 0.96), rgba(8, 19, 35, 0.88));
    box-shadow: inset 0 0 0 1px rgba(127, 224, 255, 0.12);
}

.bot-source-card strong,
.bot-source-card small {
    display: block;
}

.bot-source-card small {
    color: var(--muted);
    line-height: 1.4;
}

.bot-source-panel {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(7, 17, 31, 0.58);
    padding: 14px;
}

.bot-source-panel[hidden] {
    display: none;
}

.bot-confirmation-toggle {
    margin-top: 2px;
}

.bot-create-form .bot-confirmation-toggle input {
    min-height: 0;
}

.service-hire-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) max-content minmax(110px, 140px);
    align-items: end;
    gap: 12px;
}

.bot-price-card {
    min-width: 150px;
    min-height: 46px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface-strong);
    padding: 9px 12px;
}

.bot-price-card span,
.bot-price-card strong {
    display: block;
}

.bot-price-card span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.bot-price-card strong {
    margin-top: 3px;
    color: var(--accent);
}

.form-note {
    margin: 8px 0 0;
    line-height: 1.45;
}

.wide-field,
.modal-actions {
    grid-column: 1 / -1;
}

.portal-settings-dialog {
    width: min(560px, calc(100vw - 32px));
}

.portal-settings-form {
    display: grid;
    gap: 18px;
}

.setting-toggle {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(7, 17, 31, 0.72);
    padding: 14px;
    cursor: pointer;
}

.setting-toggle input {
    width: 22px;
    height: 22px;
    accent-color: var(--accent-dark);
}

.setting-toggle strong {
    display: block;
}

.setting-toggle strong.field-label {
    display: inline-flex;
}

.choice-card {
    min-height: 280px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 24px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: var(--shadow);
    padding: 24px;
}

.choice-card.selected {
    border-color: var(--line-strong);
    background: linear-gradient(180deg, rgba(15, 30, 52, 0.92), rgba(8, 19, 35, 0.82));
}

.choice-card h2 {
    margin: 0 0 10px;
    font-size: 28px;
}

.choice-card p {
    margin: 0;
    color: var(--muted);
    line-height: 1.55;
}

.module-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
}

.module-row strong,
.task-stack strong {
    display: block;
    margin-bottom: 4px;
}

.login-body {
    display: grid;
    place-items: center;
    padding: 24px;
}

.login-shell {
    width: min(520px, 100%);
}

.auth-shell-wide {
    width: min(920px, 100%);
}

.login-panel {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
    padding: 28px;
}

.auth-panel-wide {
    padding: 26px;
}

.login-panel h1 {
    font-size: 34px;
}

.auth-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin-top: 22px;
}

.auth-card {
    margin-top: 0;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(7, 17, 31, 0.62);
    padding: 16px;
}

.auth-card h2 {
    margin: 0;
    font-size: 18px;
}

.login-form {
    display: grid;
    gap: 14px;
    margin-top: 22px;
}

.login-form label {
    display: grid;
    gap: 8px;
    color: var(--muted);
    font-weight: 700;
}

.login-form input {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 12px;
    color: var(--text);
    background: var(--surface-strong);
    font: inherit;
}

.login-action-stack {
    display: grid;
    gap: 10px;
}

.login-action-stack .button {
    width: 100%;
}

.login-link-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.field-label-row {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.help-tip {
    position: relative;
    display: inline-grid;
    place-items: center;
    width: 20px;
    height: 20px;
    border: 1px solid rgba(127, 224, 255, 0.86);
    border-radius: 999px;
    color: #04111f;
    background: var(--accent);
    box-shadow: 0 0 0 3px rgba(127, 224, 255, 0.12);
    font-size: 12px;
    font-weight: 900;
    line-height: 1;
    cursor: help;
}

.help-tip::after {
    content: attr(data-tooltip);
    position: absolute;
    left: 50%;
    top: calc(100% + 16px);
    z-index: 20;
    width: min(330px, calc(100vw - 64px));
    transform: translateX(-50%) translateY(-4px);
    border: 1px solid rgba(127, 224, 255, 0.28);
    border-radius: 8px;
    background: rgba(7, 17, 31, 0.98);
    box-shadow: 0 18px 45px rgba(0, 0, 0, 0.36);
    color: var(--text);
    padding: 10px 12px;
    font-size: 12px;
    font-weight: 650;
    line-height: 1.45;
    opacity: 0;
    pointer-events: none;
    text-align: left;
    white-space: normal;
    overflow-wrap: anywhere;
    transition: opacity 140ms ease, transform 140ms ease;
}

.help-tip:hover::after,
.help-tip:focus-visible::after {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.turnstile-block {
    min-height: 65px;
    display: grid;
    align-items: center;
}

.auth-links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 16px;
    margin-top: 18px;
    color: var(--muted);
    font-weight: 750;
}

.auth-links a:hover,
.auth-links a:focus-visible {
    color: var(--accent);
}

.skip-password-form {
    margin-top: 12px;
}

.alert {
    border: 1px solid rgba(255, 182, 200, 0.3);
    border-radius: 8px;
    background: rgba(255, 80, 120, 0.1);
    color: #ffb6c8;
    padding: 11px 12px;
    font-weight: 700;
    transition: opacity 180ms ease, transform 180ms ease;
}

.alert.is-dismissing {
    opacity: 0;
    transform: translateY(-4px);
}

.main-frame > .alert {
    margin-bottom: 18px;
}

.alert.success {
    border-color: rgba(127, 224, 255, 0.3);
    background: rgba(45, 194, 255, 0.1);
    color: #b8f0ff;
}

.alert.warning {
    border-color: rgba(251, 191, 36, 0.34);
    background: rgba(251, 191, 36, 0.1);
    color: #fde68a;
}

.messages-console {
    display: grid;
    grid-template-columns: minmax(230px, 290px) minmax(0, 1fr);
    gap: 14px;
    align-items: stretch;
    height: clamp(560px, calc(100vh - 190px), 760px);
    min-height: 560px;
}

.messages-sidebar-panel,
.messages-main-panel {
    min-height: 0;
}

.messages-sidebar-panel {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    gap: 12px;
}

.messages-sidebar-head,
.messages-thread-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.messages-sidebar-head h3,
.messages-thread-head h3 {
    margin: 0;
    color: var(--text);
    font-size: 18px;
    line-height: 1.1;
}

.messages-active-identity {
    display: grid;
    gap: 5px;
    min-width: 0;
}

.messages-active-identity h3 a {
    color: inherit;
    text-decoration: none;
}

.messages-active-identity h3 a[href]:hover,
.messages-active-identity h3 a[href]:focus-visible {
    color: var(--accent);
    text-decoration: underline;
    text-underline-offset: 4px;
}

.messages-copy-value[hidden],
.messages-active-status-line[hidden],
.messages-history-button[hidden] {
    display: none !important;
}

.messages-active-status-line {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 7px;
}

.messages-friendship-pill,
.messages-presence-pill {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    border: 1px solid rgba(127, 224, 255, 0.14);
    border-radius: 999px;
    background: rgba(127, 224, 255, 0.08);
    color: var(--muted);
    font-size: 11px;
    font-weight: 850;
    line-height: 1;
    padding: 5px 9px;
}

.messages-friendship-pill.is-friend,
.messages-presence-pill.is-online {
    border-color: rgba(75, 226, 139, 0.28);
    background: rgba(75, 226, 139, 0.12);
    color: #8cf7bd;
}

.messages-friendship-pill.is-former_friend {
    border-color: rgba(251, 191, 36, 0.3);
    background: rgba(251, 191, 36, 0.12);
    color: #fde68a;
}

.messages-presence-pill.is-offline {
    border-color: rgba(255, 118, 150, 0.3);
    background: rgba(255, 118, 150, 0.12);
    color: #ff9db6;
}

.messages-sidebar-head span,
.messages-thread-head span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 750;
}

.messages-thread-head .messages-friendship-pill,
.messages-thread-head .messages-presence-pill {
    font-size: 11px;
    font-weight: 850;
}

.messages-thread-head .messages-friendship-pill.is-friend,
.messages-thread-head .messages-presence-pill.is-online {
    color: #8cf7bd;
}

.messages-thread-head .messages-friendship-pill.is-former_friend {
    color: #fde68a;
}

.messages-thread-head .messages-presence-pill.is-offline {
    color: #ff9db6;
}

.messages-conversation-list {
    display: grid;
    align-content: start;
    gap: 8px;
    min-height: 0;
    overflow: auto;
    padding-right: 2px;
}

.messages-conversation-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: stretch;
    width: 100%;
    min-height: 58px;
    border: 1px solid rgba(127, 224, 255, 0.08);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.035);
    overflow: hidden;
}

.messages-conversation-row:hover,
.messages-conversation-row:focus-within {
    border-color: rgba(127, 224, 255, 0.34);
    background: rgba(127, 224, 255, 0.08);
}

.messages-conversation-row.is-active {
    border-color: rgba(127, 224, 255, 0.74);
    background: rgba(45, 194, 255, 0.15);
}

.messages-conversation-tab {
    display: grid;
    gap: 4px;
    min-width: 0;
    border: 0;
    background: transparent;
    color: var(--text);
    padding: 10px 11px;
    text-align: left;
    cursor: pointer;
}

.messages-conversation-tab:hover,
.messages-conversation-tab:focus-visible {
    outline: none;
}

.messages-conversation-tab strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.messages-conversation-tab span {
    overflow: hidden;
    color: var(--muted);
    font-size: 12px;
    font-weight: 650;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.messages-conversation-actions {
    display: grid;
    grid-template-rows: 1fr 1fr;
    align-items: stretch;
    min-width: 54px;
    border-left: 1px solid rgba(127, 224, 255, 0.1);
}

.messages-auto-reply-toggle,
.messages-active-auto-reply {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
    cursor: pointer;
    user-select: none;
}

.messages-auto-reply-toggle {
    padding: 5px 7px;
}

.messages-auto-reply-toggle input,
.messages-active-auto-reply input {
    width: 13px;
    height: 13px;
    margin: 0;
    accent-color: var(--accent);
}

.messages-close-button {
    border: 0;
    border-top: 1px solid rgba(127, 224, 255, 0.1);
    background: transparent;
    color: var(--muted);
    font: inherit;
    font-size: 18px;
    font-weight: 800;
    line-height: 1;
    cursor: pointer;
}

.messages-close-button:hover,
.messages-close-button:focus-visible {
    background: rgba(255, 118, 150, 0.14);
    color: #ff9db6;
    outline: none;
}

.messages-open-form {
    display: grid;
    gap: 8px;
}

.messages-sidebar-tools {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.messages-main-panel {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    gap: 12px;
}

.messages-thread-log {
    min-height: 0;
    overflow: auto;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(2, 8, 16, 0.22);
    padding: 10px;
    user-select: text;
}

.messages-thread-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 8px;
}

.messages-thread-actions .bot-action-button {
    width: auto;
    min-width: 88px;
    min-height: 34px;
    padding-inline: 14px;
}

.messages-thread-actions .bot-summary {
    white-space: nowrap;
}

.messages-active-auto-reply {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    min-height: 24px;
    border: 1px solid rgba(127, 224, 255, 0.12);
    border-radius: 999px;
    background: rgba(127, 224, 255, 0.08);
    padding: 3px 9px;
    white-space: nowrap;
}

.messages-active-auto-reply[hidden] {
    display: none !important;
}

.messages-history-button[hidden],
.messages-thread-close[hidden] {
    display: none !important;
}

.messages-offer-tp[hidden],
.messages-friend-request[hidden] {
    display: none !important;
}

.messages-history-panel {
    display: grid;
    gap: 18px;
}

.messages-history-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    border-bottom: 1px solid rgba(127, 224, 255, 0.12);
    padding-bottom: 14px;
}

.messages-history-title {
    display: grid;
    gap: 7px;
    min-width: 0;
}

.messages-history-title h2 {
    margin: 0;
    color: var(--text);
    font-size: 24px;
    line-height: 1.1;
}

.messages-history-title h2 a {
    color: inherit;
    text-decoration: none;
}

.messages-history-title h2 a:hover,
.messages-history-title h2 a:focus-visible {
    color: var(--accent);
    outline: none;
    text-decoration: underline;
    text-underline-offset: 4px;
}

.messages-history-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}

.messages-history-actions form {
    margin: 0;
}

.messages-history-log {
    display: grid;
    align-content: start;
    max-height: calc(100vh - 265px);
    min-height: 420px;
    overflow: auto;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(2, 8, 16, 0.22);
    user-select: text;
}

.messages-history-line {
    display: grid;
    grid-template-columns: auto auto minmax(0, 1fr);
    gap: 8px;
    align-items: start;
    border-bottom: 1px solid rgba(127, 224, 255, 0.12);
    padding: 11px 12px;
    color: var(--text);
}

.messages-history-line:last-child {
    border-bottom: 0;
}

.messages-history-time {
    color: var(--accent);
    font-size: 12px;
    font-weight: 850;
    white-space: nowrap;
}

.messages-history-line strong {
    color: var(--text);
    white-space: nowrap;
}

.messages-history-line p {
    margin: 0;
    color: var(--text);
    line-height: 1.45;
    overflow-wrap: anywhere;
}

.messages-thread-item {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 4px 8px;
    border-bottom: 1px solid rgba(127, 224, 255, 0.12);
    padding: 11px 8px;
    color: var(--text);
}

.messages-thread-item:last-child {
    border-bottom: 0;
}

.messages-thread-item.is-out strong {
    color: #d8f7ff;
}

.messages-thread-item.is-system {
    border: 1px solid rgba(127, 224, 255, 0.22);
    border-radius: 8px;
    background: rgba(45, 194, 255, 0.08);
    margin-bottom: 8px;
}

.messages-thread-time {
    color: var(--accent);
    font-size: 12px;
    font-weight: 650;
}

.messages-thread-item p {
    grid-column: 1 / -1;
    margin: 0;
    color: var(--text);
    line-height: 1.52;
    overflow-wrap: anywhere;
    white-space: normal;
}

.messages-thread-action-row,
.messages-thread-action-status {
    grid-column: 1 / -1;
}

.messages-thread-action-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 3px;
}

.messages-tp-button {
    min-height: 34px;
    padding: 7px 14px;
}

.messages-thread-action-status {
    display: inline-flex;
    width: fit-content;
    border: 1px solid rgba(127, 224, 255, 0.18);
    border-radius: 999px;
    background: rgba(127, 224, 255, 0.08);
    color: var(--accent);
    padding: 4px 9px;
    font-size: 12px;
    font-weight: 800;
    text-transform: capitalize;
}

.messages-thread-item a {
    color: var(--accent);
    text-decoration: none;
}

.messages-thread-item a:hover,
.messages-thread-item a:focus-visible {
    text-decoration: underline;
}

.messages-empty {
    margin: 0;
    color: var(--muted);
    font-weight: 700;
}

.messages-compose-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    align-items: end;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(2, 8, 16, 0.32);
    padding: 10px;
}

.messages-channel-controls {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: minmax(90px, 130px) minmax(0, 1fr);
    gap: 10px;
    align-items: end;
}

.messages-channel-controls[hidden] {
    display: none !important;
}

.messages-chat-type {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.messages-textarea-wrap {
    display: grid;
    position: relative;
    min-width: 0;
    width: 100%;
}

.messages-textarea-wrap textarea {
    display: block;
    width: 100%;
    min-height: 76px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(7, 17, 31, 0.96);
    color: var(--text);
    padding: 12px 13px;
    font: inherit;
    font-weight: 700;
    line-height: 1.45;
    resize: vertical;
}

.messages-textarea-wrap textarea::placeholder {
    color: rgba(178, 203, 219, 0.58);
}

.messages-textarea-wrap textarea:focus {
    outline: 2px solid rgba(127, 224, 255, 0.42);
    outline-offset: 2px;
    border-color: rgba(127, 224, 255, 0.48);
}

.messages-mention-menu {
    position: absolute;
    z-index: 80;
    width: min(360px, 100%);
    max-height: 240px;
    overflow: auto;
    border: 1px solid rgba(127, 224, 255, 0.28);
    border-radius: 8px;
    background: rgba(7, 17, 31, 0.98);
    box-shadow: 0 18px 42px rgba(0, 0, 0, 0.34);
    padding: 6px;
}

.messages-mention-menu[hidden] {
    display: none !important;
}

.messages-mention-option {
    display: grid;
    width: 100%;
    gap: 2px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--text);
    padding: 8px 10px;
    text-align: left;
    font: inherit;
    cursor: pointer;
}

.messages-mention-option strong,
.messages-mention-option span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.messages-mention-option strong {
    font-size: 13px;
    font-weight: 900;
}

.messages-mention-option span {
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
}

.messages-mention-option:hover,
.messages-mention-option:focus-visible,
.messages-mention-option.is-active {
    outline: none;
    background: rgba(127, 224, 255, 0.18);
}

.messages-mention-option.is-active strong {
    color: var(--accent);
}

.messages-send-button {
    min-width: 112px;
    min-height: 76px;
}

.social-overview-panel {
    display: flex;
    align-items: stretch;
    gap: 14px;
    width: fit-content;
    max-width: 100%;
}

.social-section-title {
    display: grid;
    align-content: center;
    color: var(--text);
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 0;
    text-transform: uppercase;
    white-space: nowrap;
}

.social-summary-strip {
    display: flex;
    align-items: stretch;
    flex-wrap: wrap;
    gap: 10px;
}

.social-summary-card,
.social-mini-grid > div {
    display: grid;
    gap: 4px;
    min-width: max-content;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface-strong);
    padding: 10px 12px;
}

.social-summary-card span,
.social-mini-grid span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.social-summary-card strong,
.social-mini-grid strong {
    color: var(--text);
    font-size: 16px;
    overflow-wrap: anywhere;
}

.social-refresh-form {
    display: grid;
    align-items: stretch;
    margin: 0;
}

.social-console {
    display: grid;
    grid-template-columns: repeat(4, minmax(240px, 1fr));
    gap: 14px;
    align-items: stretch;
}

.social-card {
    display: grid;
    gap: 14px;
    align-content: start;
    min-width: 0;
    min-height: 360px;
}

.social-card-wide {
    grid-column: span 2;
}

.social-card-tall {
    grid-column: span 2;
}

.social-card-head,
.social-avatar-line,
.social-item-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.social-card-head h3 {
    margin: 0;
    color: var(--text);
    font-size: 18px;
    line-height: 1.1;
}

.social-card-head form,
.social-item-row form,
.social-row-actions form,
.social-policy-form,
.social-action-row,
.social-friend-row {
    margin: 0;
}

.social-list {
    display: grid;
    align-content: start;
    gap: 8px;
    max-height: 430px;
    overflow: auto;
    padding-right: 2px;
}

.social-friend-list {
    max-height: 560px;
}

.social-friend-search {
    width: 100%;
}

.social-friend-search input {
    width: 100%;
}

.social-friend-no-results {
    border: 1px solid rgba(127, 224, 255, 0.1);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.035);
    margin: 0;
    padding: 12px;
}

.social-removed-list {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.social-friend-row,
.social-item-row {
    min-width: 0;
    border: 1px solid rgba(127, 224, 255, 0.1);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.035);
    padding: 10px;
}

.social-friend-row {
    display: grid;
    gap: 8px;
}

.social-friend-row[hidden],
.social-friend-no-results[hidden] {
    display: none !important;
}

.social-item-row > div,
.social-avatar-line {
    min-width: 0;
}

.social-avatar-line strong,
.social-friend-name,
.social-item-row strong {
    overflow: hidden;
    color: var(--text);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.social-item-row span,
.social-meta,
.social-empty {
    color: var(--muted);
    font-size: 12px;
    font-weight: 650;
    overflow-wrap: anywhere;
}

.social-copy-value {
    position: relative;
    width: fit-content;
    max-width: 100%;
    appearance: none;
    border: 0;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    font: inherit;
    font-size: 12px;
    font-weight: 650;
    line-height: 1.35;
    overflow-wrap: anywhere;
    padding: 0;
    text-align: left;
}

.social-copy-value:hover,
.social-copy-value:focus-visible {
    color: var(--accent);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.social-copy-value:focus-visible {
    border-radius: 4px;
    outline: 2px solid rgba(127, 224, 255, 0.5);
    outline-offset: 3px;
}

.social-copy-value.is-copied::after {
    position: absolute;
    left: calc(100% + 8px);
    top: 50%;
    z-index: 5;
    border: 1px solid rgba(127, 224, 255, 0.2);
    border-radius: 999px;
    background: rgba(8, 23, 38, 0.96);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.24);
    color: var(--accent);
    content: "Copied";
    font-size: 11px;
    font-weight: 850;
    line-height: 1;
    padding: 5px 8px;
    pointer-events: none;
    transform: translateY(-50%);
    white-space: nowrap;
}

.learning-overview-panel {
    display: flex;
    align-items: stretch;
    gap: 14px;
    width: fit-content;
    max-width: 100%;
}

.learning-section-title {
    display: grid;
    align-content: center;
    color: var(--text);
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 0;
    text-transform: uppercase;
    white-space: nowrap;
}

.learning-summary-strip {
    display: flex;
    align-items: stretch;
    flex-wrap: wrap;
    gap: 10px;
}

.learning-summary-card {
    display: grid;
    gap: 4px;
    min-width: max-content;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface-strong);
    padding: 10px 12px;
}

.learning-summary-card span,
.learning-muted-line {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.learning-summary-card strong {
    color: var(--text);
    font-size: 16px;
}

.learning-console {
    display: grid;
    grid-template-columns: repeat(4, minmax(240px, 1fr));
    gap: 14px;
    align-items: start;
}

.learning-card {
    display: grid;
    gap: 14px;
    min-width: 0;
}

.learning-card-wide {
    grid-column: span 2;
}

.learning-card-head,
.learning-item-head,
.learning-row-actions,
.learning-inline-form,
.learning-check-grid {
    display: flex;
    align-items: center;
    gap: 12px;
}

.learning-card-head,
.learning-item-head {
    justify-content: space-between;
}

.learning-card-head h3 {
    margin: 0;
    color: var(--text);
    font-size: 18px;
    line-height: 1.1;
}

.learning-settings-form,
.learning-add-rule-form,
.learning-teach-form,
.learning-card-head form,
.learning-item-head form,
.learning-row-actions form {
    margin: 0;
}

.learning-settings-form,
.learning-add-rule-form,
.learning-teach-form,
.learning-list {
    display: grid;
    gap: 10px;
}

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

.learning-check-grid {
    flex-wrap: wrap;
}

.learning-inline-form {
    justify-content: flex-end;
    flex-wrap: wrap;
}

.learning-inline-form .avatar-field {
    min-width: 110px;
}

.learning-list {
    max-height: 560px;
    overflow: auto;
    padding-right: 2px;
}

.learning-pending-list {
    max-height: 680px;
}

.learning-ignored-list {
    max-height: 370px;
}

.learning-item {
    display: grid;
    gap: 10px;
    min-width: 0;
    border: 1px solid rgba(127, 224, 255, 0.1);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.035);
    padding: 10px;
}

.learning-item-head > div {
    min-width: 0;
}

.learning-item-head strong {
    display: block;
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.learning-item-head span,
.learning-answer-preview {
    color: var(--muted);
    font-size: 12px;
    font-weight: 650;
    overflow-wrap: anywhere;
}

.learning-answer-preview {
    margin: 0;
    line-height: 1.45;
}

.learning-row-actions {
    justify-content: flex-end;
    flex-wrap: wrap;
}

.learning-pager {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.learning-pager-button {
    min-width: 96px;
    text-decoration: none;
}

.learning-pager-button.is-disabled {
    opacity: 0.45;
    pointer-events: none;
}

.social-friend-controls,
.social-form-grid,
.social-mini-grid,
.social-dual-list {
    display: grid;
    gap: 8px;
}

.social-friend-controls {
    grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
}

.social-form-grid,
.social-mini-grid,
.social-dual-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.social-friend-controls select,
.social-policy-form textarea {
    width: 100%;
}

.social-check-row {
    display: flex;
    align-items: center;
    gap: 9px;
    color: var(--text);
    font-size: 13px;
    font-weight: 750;
}

.social-check-row input {
    width: 18px;
    height: 18px;
    margin: 0;
    accent-color: var(--accent);
}

.social-policy-form {
    display: grid;
    gap: 10px;
}

.social-policy-form textarea {
    min-height: 96px;
    resize: vertical;
}

.social-action-row,
.social-row-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.social-action-row .button,
.social-row-actions .button,
.social-friend-controls .button {
    min-height: 36px;
    padding: 8px 11px;
}

.group-invites-hero .section-heading {
    align-items: center;
}

.inline-stats {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
}

.inline-stats span {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(7, 18, 32, 0.72);
    color: var(--text);
    font-size: 12px;
    font-weight: 800;
    padding: 8px 10px;
}

.group-invites-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    align-items: stretch;
}

.group-invites-grid > .panel {
    display: flex;
    flex-direction: column;
    min-height: 360px;
}

.compact-form {
    display: grid;
    gap: 10px;
}

.compact-form label {
    display: grid;
    gap: 6px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.compact-form input,
.compact-form textarea {
    width: 100%;
}

.compact-form textarea {
    min-height: 86px;
    resize: vertical;
}

.inline-check {
    display: flex !important;
    align-items: center;
    gap: 10px;
    color: var(--text) !important;
}

.inline-check input,
.nearby-row input {
    width: 18px;
    height: 18px;
    margin: 0;
    accent-color: var(--accent);
}

.group-list,
.nearby-list,
.notice-list {
    display: grid;
    gap: 8px;
    margin-top: 12px;
    overflow: auto;
}

.group-list,
.nearby-list {
    max-height: 320px;
}

.notice-list {
    max-height: 260px;
}

.group-row,
.nearby-row {
    display: grid;
    align-items: center;
    gap: 8px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(7, 18, 32, 0.72);
    padding: 10px;
}

.group-row {
    grid-template-columns: minmax(0, 1fr) auto auto;
}

.nearby-row {
    grid-template-columns: auto minmax(0, 1fr) auto;
}

.group-row strong,
.nearby-row strong {
    display: block;
    overflow: hidden;
    color: var(--text);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.group-row span,
.nearby-row small {
    display: block;
    overflow: hidden;
    color: var(--muted);
    font-size: 11px;
    font-style: normal;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.nearby-row em {
    border-radius: 999px;
    background: rgba(127, 224, 255, 0.12);
    color: var(--accent);
    font-size: 11px;
    font-style: normal;
    font-weight: 800;
    padding: 5px 8px;
}

.social-subsection {
    display: grid;
    gap: 8px;
    border-top: 1px solid rgba(127, 224, 255, 0.1);
    padding-top: 12px;
}

.social-subsection h4,
.social-dual-list h4 {
    margin: 0;
    color: var(--text);
    font-size: 15px;
}

.social-dual-list h4 span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

@media (max-width: 1500px) {
    .social-console {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .social-card-wide,
    .social-card-tall {
        grid-column: span 1;
    }
}

.pill.warning {
    border-color: rgba(251, 191, 36, 0.32);
    background: rgba(251, 191, 36, 0.1);
    color: #fde68a;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    clip-path: inset(50%);
}

@media (max-width: 1200px) {
    .account-avatar-details {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 900px) {
    .app-shell,
    .home-grid,
    .account-grid,
    .detail-grid,
    .hero-panel,
    .choice-grid,
    .bot-card-grid,
    .auth-grid,
    .bot-create-form,
    .bot-form-grid,
    .bot-source-options,
    .bot-control-console,
    .bot-control-info-grid,
    .bot-control-actions,
    .bot-control-pay-form,
    .avatar-control-console,
    .avatar-command-stack,
    .avatar-teleport-form,
    .avatar-teleport-actions,
    .avatar-landmark-row,
    .avatar-nearby-object-row,
    .avatar-inventory-animation-row,
    .avatar-object-picker-actions,
    .avatar-animation-picker-actions,
    .avatar-timer-grid,
    .avatar-object-form,
    .avatar-script-dialog-text,
    .avatar-animation-form,
    .profile-media-block,
    .profile-image-picker-body,
    .messages-console,
    .messages-compose-form,
    .messages-channel-controls,
    .social-console,
    .social-friend-controls,
    .social-form-grid,
    .social-mini-grid,
    .social-dual-list,
    .group-invites-grid,
    .service-hire-grid {
        grid-template-columns: 1fr;
    }

    .messages-console {
        height: auto;
    }

    .messages-main-panel {
        min-height: 620px;
    }

    .avatar-movement-card,
    .avatar-object-card,
    .avatar-last-action-card {
        grid-column: auto;
        grid-row: auto;
    }

    .avatar-object-badges {
        justify-content: flex-start;
        min-width: 0;
    }

    .sidebar {
        border-right: 0;
        border-bottom: 1px solid var(--line);
    }

    .topbar,
    .module-row,
    .bot-card-head,
    .bot-control-card-head,
    .avatar-control-card-head,
    .modal-head,
    .modal-actions,
    .profile-actions,
    .messages-history-head {
        align-items: stretch;
        flex-direction: column;
    }

    .bot-control-card-head form,
    .bot-control-card-head .button {
        width: 100%;
    }

    .profile-save-button {
        width: 100%;
    }

    .compact-hero {
        align-items: start;
    }

    .bot-selector-hero {
        width: 100%;
    }

    .compact-hero .bot-summary {
        justify-self: start;
        flex-wrap: wrap;
        width: auto;
    }
}

@media (max-width: 520px) {
    .bot-meta {
        grid-template-columns: 1fr;
    }
}

@media (min-width: 901px) and (max-width: 1280px) {
    .bot-card-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
