:root {
    --bg: #f4f6f8;
    --surface: #ffffff;
    --surface-soft: #f9fafb;
    --line: #e5e9ef;
    --text: #111827;
    --muted: #6b7280;
    --muted-2: #94a3b8;
    --accent: #0f766e;
    --accent-strong: #115e59;
    --accent-soft: #dff5f1;
    --danger: #dc2626;
    --warning: #d97706;
    --success: #059669;
    --radius: 16px;
    --shadow: 0 20px 55px rgba(27, 59, 57, 0.09);
    --sidebar-width: 252px;
}

* {
    box-sizing: border-box;
}

body {
    min-height: 100vh;
    margin: 0;
    background:
        linear-gradient(180deg, rgba(255,255,255,0.92), rgba(244,246,248,0.98)),
        radial-gradient(circle at 10% -10%, rgba(15,118,110,0.12), transparent 32%);
    color: var(--text);
    font-family: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
    font-size: 15px;
}

body:not(.login-page) {
    padding-left: var(--sidebar-width);
}

.app-sidebar {
    position: fixed;
    z-index: 1040;
    inset: 14px auto 14px 14px;
    width: calc(var(--sidebar-width) - 14px);
    display: flex;
    flex-direction: column;
    border: 1px solid rgba(255,255,255,.85);
    border-radius: 22px;
    background: rgba(255,255,255,.82);
    backdrop-filter: blur(24px) saturate(135%);
    box-shadow: 0 24px 70px rgba(32,65,62,.13);
    overflow: hidden;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 82px;
    padding: 18px;
    color: var(--text);
    font-size: 16px;
    font-weight: 850;
    letter-spacing: -.03em;
}

.sidebar-brand small, .sidebar-user small {
    display: block;
    margin-top: 2px;
    color: var(--muted-2);
    font-size: 10px;
    font-weight: 750;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.sidebar-nav {
    flex: 1;
    padding: 4px 12px 16px;
    overflow-y: auto;
}

.sidebar-label {
    display: block;
    padding: 17px 10px 7px;
    color: #9aa7b6;
    font-size: 10px;
    font-weight: 850;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.sidebar-nav a {
    position: relative;
    display: flex;
    align-items: center;
    gap: 11px;
    min-height: 44px;
    margin: 3px 0;
    padding: 0 12px;
    border-radius: 12px;
    color: #52606f;
    font-weight: 720;
    transition: .2s ease;
}

.sidebar-nav a i { width: 20px; color: #8492a3; font-size: 16px; }
.sidebar-nav a:hover { color: var(--accent-strong); background: rgba(223,245,241,.6); transform: translateX(2px); }
.sidebar-nav a.active { color: #fff; background: var(--accent); box-shadow: 0 10px 25px rgba(15,118,110,.2); }
.sidebar-nav a.active i { color: #fff; }

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 9px;
    margin: 10px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: rgba(248,250,252,.86);
}

.sidebar-user > span:nth-child(2), .user-trigger span:nth-child(2) { min-width: 0; flex: 1; }
.sidebar-user strong { display: block; color: var(--text); font-size: 13px; }
.sidebar-user > a { color: var(--muted); padding: 7px; border-radius: 9px; }
.sidebar-user > a:hover { color: var(--danger); background: #fee2e2; }
.avatar { display: grid; flex: 0 0 34px; height: 34px; place-items: center; border-radius: 11px; color: #fff; background: var(--accent); font-size: 13px; font-weight: 850; }
.user-trigger { display: flex; min-width: 0; flex: 1; align-items: center; gap: 9px; padding: 0; border: 0; background: none; text-align: left; }

.mobile-menu-button {
    position: fixed;
    z-index: 1035;
    top: 14px;
    left: 14px;
    display: none;
    width: 44px;
    height: 44px;
    place-items: center;
    border: 1px solid rgba(229,231,235,.9);
    border-radius: 13px;
    background: rgba(255,255,255,.9);
    box-shadow: 0 10px 30px rgba(15,23,42,.1);
    backdrop-filter: blur(18px);
}
.mobile-menu-button svg { width: 20px; height: 20px; fill: var(--text); }
.sidebar-overlay { position: fixed; z-index: 1038; inset: 0; visibility: hidden; background: rgba(15,23,42,.3); opacity: 0; backdrop-filter: blur(3px); transition: .25s ease; }

body:not(.login-page) > .container,
body:not(.login-page) > main.container,
body:not(.login-page) > .footer .container {
    max-width: 1440px;
    padding-left: 28px;
    padding-right: 28px;
}

.metric-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.metric-card { min-height: 136px; padding: 20px; border-radius: 18px; background: rgba(255,255,255,.84); box-shadow: 0 14px 36px rgba(31,65,61,.05); }
.metric-card:hover { border-color: rgba(15,118,110,.3); transform: translateY(-2px); }
.panel, .card, .data-panel, .filter-bar { border-radius: 18px !important; box-shadow: 0 16px 42px rgba(31,65,61,.055) !important; }
.page-title { font-size: clamp(28px, 3vw, 38px); }
.page-hero { padding-top: 34px; }
.status-warning, .status-danger, .status-disabled { display:inline-flex; padding:4px 8px; border-radius:999px; font-size:12px; font-weight:800; }
.status-warning { color:#9a6700; background:#fff3cd; }.status-danger,.status-disabled { color:#b42318; background:#fee4e2; }
.quota-value { font-size: 18px; font-weight: 850; letter-spacing: -.03em; }
.notice-card { display:flex; gap:12px; align-items:flex-start; padding:16px; margin-bottom:16px; border:1px solid #f5d08a; border-radius:16px; color:#795600; background:#fffaf0; }
.result-list { max-height: 360px; overflow:auto; border:1px solid var(--line); border-radius:14px; background:#f8fafc; }
.result-item { display:flex; justify-content:space-between; align-items:center; gap:12px; padding:12px 14px; border-bottom:1px solid var(--line); }.result-item:last-child{border:0}
.toast-stack { position:fixed; z-index:2000; right:20px; top:20px; display:grid; gap:10px; }
.app-toast { display:flex; gap:10px; align-items:center; min-width:220px; padding:13px 15px; border:1px solid var(--line); border-radius:13px; background:#fff; box-shadow:var(--shadow); opacity:0; transform:translateY(-8px); transition:.22s ease; font-weight:750; }
.app-toast.show { opacity:1; transform:none; }.app-toast.success i{color:var(--success)}
.is-loading { color:transparent !important; pointer-events:none; position:relative; }.is-loading::after{content:"";position:absolute;inset:50% auto auto 50%;width:17px;height:17px;margin:-8px;border:2px solid rgba(255,255,255,.5);border-top-color:#fff;border-radius:50%;animation:spin .7s linear infinite}@keyframes spin{to{transform:rotate(360deg)}}
.alert { transition:.3s ease; }.alert-fade{opacity:0;transform:translateY(-5px)}
.modal.fade .modal-dialog { transform:translateY(14px) scale(.985); transition:.22s ease; }.modal.show .modal-dialog{transform:none}.modal-content{border-radius:20px}
.form-label { color:#344054; font-size:13px; font-weight:780; }.form-control,.form-select{min-height:46px;border-radius:12px}.btn{min-height:42px;padding:9px 14px;border-radius:11px}.btn-sm{min-height:34px;padding:6px 9px}

@media (max-width: 1200px) { .metric-grid { grid-template-columns: repeat(3, minmax(0,1fr)); } }
@media (max-width: 991.98px) {
    body:not(.login-page) { padding-left: 0; padding-top: 54px; }
    .mobile-menu-button { display:grid; }
    .app-sidebar { inset: 10px auto 10px 10px; width:min(292px, calc(100vw - 28px)); transform:translateX(calc(-100% - 20px)); transition:transform .28s cubic-bezier(.2,.8,.2,1); }
    body.sidebar-open .app-sidebar { transform:none; }
    body.sidebar-open .sidebar-overlay { visibility:visible; opacity:1; }
    body:not(.login-page) > .container, body:not(.login-page) > main.container { padding-left:16px; padding-right:16px; }
}
@media (max-width: 767.98px) {
    .metric-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap:10px; }
    .metric-card { min-height:118px; padding:15px; }.metric-value{font-size:28px}
    .filter-grid,.filter-grid.agent-filter,.filter-grid.logs-filter{grid-template-columns:1fr}
    .page-hero{padding-top:24px}.page-title{font-size:29px}.page-subtitle{font-size:14px}
    .data-table{min-width:900px}.btn{min-height:44px}
}

.dylib-generate-card {
    position: relative;
    display: grid;
    grid-template-columns: 190px minmax(0, 1fr);
    gap: 34px;
    align-items: center;
    min-height: 350px;
    padding: 38px;
    border: 1px solid rgba(15,118,110,.18);
    border-radius: 24px;
    background: linear-gradient(145deg, rgba(255,255,255,.96), rgba(238,249,247,.92));
    box-shadow: 0 25px 70px rgba(31,65,61,.1);
    overflow: hidden;
}
.dylib-generate-card::after { content:""; position:absolute; width:260px; height:260px; right:-100px; top:-120px; border-radius:50%; background:rgba(15,118,110,.08); filter:blur(4px); }
.dylib-orb { position:relative; display:grid; width:160px; height:160px; place-items:center; border:1px solid rgba(15,118,110,.16); border-radius:42px; color:#fff; background:var(--accent); box-shadow:0 25px 50px rgba(15,118,110,.24); }
.dylib-orb::before { content:""; position:absolute; inset:12px; border:1px solid rgba(255,255,255,.3); border-radius:32px; }
.dylib-orb i { font-size:60px; }
.dylib-device-orb svg {
    position: relative;
    z-index: 1;
    width: 82px;
    height: 82px;
    fill: currentColor;
}
.dylib-copy { position:relative; z-index:1; max-width:720px; }
.dylib-copy h2 { margin:14px 0 8px; font-size:clamp(28px,4vw,44px); letter-spacing:-.045em; font-weight:880; }
.dylib-copy p { max-width:62ch; color:var(--muted); line-height:1.75; }
.dylib-binding { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; margin:22px 0; }
.dylib-binding div { padding:13px 15px; border:1px solid var(--line); border-radius:13px; background:rgba(255,255,255,.75); }
.dylib-binding span,.dylib-binding strong { display:block; }.dylib-binding span{color:var(--muted);font-size:12px}.dylib-binding strong{margin-top:4px;font-size:14px}
.agent-release-timeline .release-actions .btn-danger,.agent-release-timeline .release-actions .btn-outline-danger{display:none!important}
@media(max-width:767.98px){.dylib-generate-card{grid-template-columns:1fr;padding:22px;gap:20px}.dylib-orb{width:92px;height:92px;border-radius:26px}.dylib-orb::before{border-radius:19px}.dylib-orb i{font-size:36px}.dylib-binding{grid-template-columns:1fr}}

a {
    text-decoration: none;
}

.app-shell,
.container {
    max-width: 1180px;
}

.navbar.app-navbar {
    background: rgba(255, 255, 255, 0.88) !important;
    border-bottom: 1px solid rgba(226, 232, 240, 0.9);
    backdrop-filter: blur(18px);
    box-shadow: none;
}

.navbar.app-navbar .navbar-brand {
    color: var(--text);
    font-weight: 800;
    letter-spacing: -0.02em;
}

.brand-mark {
    display: inline-flex;
    width: 32px;
    height: 32px;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: var(--accent);
    color: #fff;
    margin-right: 8px;
    box-shadow: 0 10px 22px rgba(15, 118, 110, 0.22);
}

.navbar.app-navbar .nav-link {
    color: #475569;
    border-radius: 999px;
    padding: 8px 12px;
    margin: 0 2px;
    font-weight: 650;
}

.navbar.app-navbar .nav-link:hover,
.navbar.app-navbar .nav-link.active {
    color: var(--accent-strong);
    background: var(--accent-soft);
}

.navbar-toggler {
    border: 1px solid var(--line);
}

.navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%2817, 24, 39, 0.78%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

.page-hero {
    display: flex;
    justify-content: space-between;
    gap: 24px;
    align-items: flex-end;
    padding: 30px 0 22px;
}

.page-kicker {
    color: var(--accent);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    margin-bottom: 8px;
}

.page-title {
    margin: 0;
    font-size: clamp(28px, 4vw, 42px);
    line-height: 1.08;
    letter-spacing: -0.03em;
    font-weight: 850;
}

.page-subtitle {
    color: var(--muted);
    margin: 10px 0 0;
    max-width: 62ch;
    line-height: 1.7;
}

.panel,
.card {
    border: 1px solid var(--line) !important;
    border-radius: var(--radius) !important;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: none !important;
    overflow: hidden;
}

.panel-header,
.card-header {
    background: var(--surface) !important;
    color: var(--text) !important;
    border-bottom: 1px solid var(--line) !important;
    padding: 16px 18px;
}

.panel-header h5,
.card-header h5 {
    margin: 0;
    font-size: 15px;
    font-weight: 800;
    letter-spacing: -0.01em;
}

.panel-body,
.card-body {
    padding: 18px;
}

.metric-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.metric-card {
    position: relative;
    min-height: 128px;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: linear-gradient(180deg, #fff, #f9fafb);
}

.metric-card::after {
    content: "";
    position: absolute;
    inset: auto 16px 16px auto;
    width: 34px;
    height: 4px;
    border-radius: 99px;
    background: var(--accent);
    opacity: 0.24;
}

.metric-label {
    color: var(--muted);
    font-size: 13px;
    font-weight: 750;
}

.metric-value {
    margin-top: 12px;
    font-size: 34px;
    line-height: 1;
    letter-spacing: -0.04em;
    font-weight: 850;
}

.metric-note {
    color: var(--muted-2);
    margin-top: 10px;
    font-size: 13px;
}

.table {
    margin: 0;
    color: var(--text);
}

.table thead th {
    background: var(--surface-soft);
    color: #64748b;
    border-bottom: 1px solid var(--line);
    font-size: 12px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    font-weight: 800;
    padding: 13px 14px;
}

.table tbody td {
    padding: 14px;
    vertical-align: middle;
    border-color: var(--line);
}

.table-hover tbody tr:hover {
    background: #f8fbfa;
}

.btn {
    border-radius: 10px;
    font-weight: 750;
    letter-spacing: -0.01em;
}

.btn-primary {
    background: var(--accent);
    border-color: var(--accent);
}

.btn-primary:hover,
.btn-primary:focus {
    background: var(--accent-strong);
    border-color: var(--accent-strong);
}

.btn-generate {
    background: var(--accent) !important;
    border-color: var(--accent) !important;
    box-shadow: none !important;
}

.btn-outline-primary {
    color: var(--accent);
    border-color: rgba(15, 118, 110, 0.34);
}

.btn-outline-primary:hover {
    background: var(--accent);
    border-color: var(--accent);
}

.btn-info {
    color: #fff;
    background: #2563eb;
    border-color: #2563eb;
}

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

.btn-danger,
.btn-delete {
    color: #fff;
    background: var(--danger);
    border-color: var(--danger);
}

.btn-light {
    background: #f8fafc;
    border-color: var(--line);
}

.form-control,
.form-select {
    min-height: 42px;
    border-radius: 10px;
    border-color: var(--line);
    color: var(--text);
}

.form-control:focus,
.form-select:focus {
    border-color: rgba(15, 118, 110, 0.55);
    box-shadow: 0 0 0 0.22rem rgba(15, 118, 110, 0.12);
}

.input-group-text {
    border-color: var(--line);
    background: var(--surface-soft);
    color: var(--muted);
}

.badge {
    border-radius: 999px;
    padding: 6px 10px;
    font-weight: 800;
}

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

.alert {
    border-radius: var(--radius);
    border: 1px solid var(--line);
}

.modal-content {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.modal-header,
.modal-footer {
    border-color: var(--line);
    background: var(--surface-soft);
}

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

.app-mode-option input {
    display: none;
}

.app-mode-option label,
.choice-card {
    display: block;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    cursor: pointer;
    background: #fff;
}

.app-mode-option input:checked + label,
.choice-card.active {
    border-color: rgba(15, 118, 110, 0.55);
    background: var(--accent-soft);
    color: var(--accent-strong);
}

.kami-type-input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.kami-type-card {
    display: block;
    cursor: pointer;
    height: 100%;
    transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
    border: 1px solid var(--line);
    border-radius: 18px;
    user-select: none;
}

.kami-type-card:hover {
    transform: translateY(-2px);
}

.kami-type-input:checked + .kami-type-card {
    border-color: rgba(15, 143, 131, 0.55);
    background: rgba(15, 143, 131, 0.08);
    box-shadow: 0 12px 28px rgba(15, 143, 131, 0.12);
}

.kami-icon {
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px;
    border-radius: 12px;
    background: var(--accent-soft);
    color: var(--accent-strong);
}

.kami-code,
.code-pill {
    display: inline-block;
    max-width: 100%;
    padding: 6px 9px;
    border-radius: 8px;
    background: #f1f5f9;
    color: #0f172a;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
    font-weight: 800;
    word-break: break-all;
}

.kami-card {
    height: 100%;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
}

.kami-header {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: flex-start;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--line);
    margin-bottom: 12px;
}

.kami-info-row {
    display: flex;
    gap: 12px;
    margin-bottom: 9px;
    color: var(--muted);
    font-size: 14px;
}

.kami-label {
    min-width: 76px;
    color: #94a3b8;
}

.kami-value {
    color: #334155;
    word-break: break-word;
}

.kami-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 14px;
}

.btn-copy,
.btn-delete {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    padding: 8px 10px;
    border-radius: 10px;
    border: 1px solid;
    font-size: 13px;
    font-weight: 800;
}

.btn-copy {
    color: var(--accent-strong);
    background: var(--accent-soft);
    border-color: rgba(15, 118, 110, 0.2);
}

.status-active,
.status-inactive {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 4px 8px;
    font-size: 12px;
    font-weight: 800;
}

.status-active {
    color: #047857;
    background: #d1fae5;
}

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

.flowline {
    position: relative;
    display: grid;
    gap: 12px;
}

.flow-item {
    position: relative;
    display: grid;
    grid-template-columns: 36px 1fr;
    gap: 12px;
    align-items: start;
}

.flow-dot {
    width: 36px;
    height: 36px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--accent);
    color: #fff;
    font-weight: 850;
    box-shadow: 0 10px 20px rgba(15,118,110,0.18);
}

.flow-card {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 14px;
    background: #fff;
}

.flow-title {
    margin: 0;
    font-weight: 850;
}

.flow-meta {
    color: var(--muted);
    font-size: 13px;
    margin-top: 5px;
}

.update-detail {
    white-space: pre-wrap;
    color: #475569;
    line-height: 1.65;
}

.empty-state {
    padding: 54px 20px;
    text-align: center;
    color: var(--muted);
}

.footer {
    color: var(--muted);
    background: transparent !important;
    border-top: 1px solid var(--line);
    margin-top: 44px;
}

.login-page {
    min-height: 100dvh;
    display: grid;
    place-items: center;
    padding: 24px;
}

.login-container {
    width: min(100%, 430px);
}

.login-card {
    border: 1px solid var(--line);
    border-radius: 18px;
    background: rgba(255,255,255,0.94);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.login-header {
    padding: 28px;
    border-bottom: 1px solid var(--line);
    background: linear-gradient(180deg, #fff, #f8fafc);
}

.login-header h4 {
    margin: 0;
    font-size: 28px;
    letter-spacing: -0.04em;
    font-weight: 850;
}

.login-header p {
    margin: 8px 0 0;
    color: var(--muted);
}

.login-body {
    padding: 28px;
}

.user-type-selector {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    padding: 5px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--surface-soft);
}

.user-type-selector input {
    display: none;
}

.user-type-selector label {
    text-align: center;
    padding: 10px;
    border-radius: 10px;
    color: var(--muted);
    cursor: pointer;
    font-weight: 800;
}

.user-type-selector input:checked + label {
    background: #fff;
    color: var(--accent-strong);
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
}

.remember-me {
    display: flex;
    align-items: center;
    gap: 8px;
}

.remember-me label {
    color: var(--muted);
    cursor: pointer;
}

@media (max-width: 768px) {
    .page-hero {
        display: block;
    }

    .metric-grid {
        grid-template-columns: 1fr;
    }

    .navbar.app-navbar .nav-link {
        border-radius: 10px;
    }

    .table-actions {
        white-space: nowrap;
    }
}

/* Premium data-console polish */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background-image: linear-gradient(rgba(15, 23, 42, 0.025) 1px, transparent 1px), linear-gradient(90deg, rgba(15, 23, 42, 0.025) 1px, transparent 1px);
    background-size: 28px 28px;
    mask-image: linear-gradient(to bottom, rgba(0,0,0,.7), transparent 48%);
}

.app-shell {
    position: relative;
    z-index: 1;
}

.page-hero.compact {
    padding: 26px 0 16px;
}

.count-badge {
    display: inline-flex;
    align-items: center;
    min-height: 36px;
    padding: 0 14px;
    border-radius: 999px;
    color: #0f766e;
    background: #dff5f1;
    border: 1px solid rgba(15,118,110,.18);
    font-weight: 850;
    white-space: nowrap;
}

.btn {
    transition: transform .18s ease, box-shadow .18s ease, background .18s ease, border-color .18s ease;
}

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

.btn:active {
    transform: translateY(0);
}

.btn-accent {
    background: linear-gradient(135deg, #0f766e, #0ea5a4) !important;
    border-color: #0f766e !important;
    box-shadow: 0 12px 24px rgba(15,118,110,.18) !important;
}

.btn-soft {
    color: #0f766e;
    background: #e6fffb;
    border-color: rgba(15,118,110,.18);
}

.btn-soft:hover {
    color: #fff;
    background: #0f766e;
}

.filter-bar {
    padding: 14px;
    margin-bottom: 14px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: rgba(255,255,255,.82);
    box-shadow: 0 16px 35px rgba(15,23,42,.05);
}

.filter-grid {
    display: grid;
    grid-template-columns: minmax(260px, 1.5fr) 1fr 1fr 1fr auto;
    gap: 10px;
}

.filter-grid.agent-filter,
.filter-grid.logs-filter {
    grid-template-columns: minmax(260px, 1.5fr) 1fr 1fr auto;
}

.toolbar-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}

.data-panel {
    border: 1px solid var(--line);
    border-radius: 16px;
    background: rgba(255,255,255,.94);
    overflow: hidden;
}

.data-table-wrap {
    width: 100%;
    overflow-x: auto;
}

.data-table {
    min-width: 980px;
}

.data-table thead th {
    padding: 12px 14px;
    background: #f8fafc;
    color: #64748b;
    border-bottom: 1px solid var(--line);
    font-size: 12px;
}

.data-table tbody td {
    padding: 10px 14px;
    color: #334155;
    font-size: 14px;
    border-bottom: 1px solid #edf2f7;
}

.data-table tbody tr:hover {
    background: #f6fbfa;
}

.udid-cell {
    max-width: 260px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.actions-cell {
    white-space: nowrap;
}

.type-pill,
.agent-tag {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 4px 9px;
    border-radius: 8px;
    font-weight: 850;
    font-size: 12px;
    border: 1px solid transparent;
}

.type-blue { color: #1d4ed8; background: #dbeafe; border-color: #bfdbfe; }
.type-green { color: #047857; background: #d1fae5; border-color: #a7f3d0; }
.type-amber { color: #b45309; background: #fef3c7; border-color: #fde68a; }
.type-rose { color: #be123c; background: #ffe4e6; border-color: #fecdd3; }
.type-info { color: #0369a1; background: #e0f2fe; border-color: #bae6fd; }
.type-slate { color: #475569; background: #f1f5f9; border-color: #e2e8f0; }

.agent-tag {
    color: #0f766e;
    background: #dff5f1;
    border-color: rgba(15,118,110,.2);
}

.agent-blue { color: #1d4ed8; background: #dbeafe; border-color: #bfdbfe; }
.agent-green { color: #047857; background: #d1fae5; border-color: #a7f3d0; }
.agent-amber { color: #b45309; background: #fef3c7; border-color: #fde68a; }
.agent-rose { color: #be123c; background: #ffe4e6; border-color: #fecdd3; }
.agent-violet { color: #6d28d9; background: #ede9fe; border-color: #ddd6fe; }
.agent-cyan { color: #0e7490; background: #cffafe; border-color: #a5f3fc; }

.update-upload {
    display: grid;
    grid-template-columns: 1fr minmax(320px, 680px);
    align-items: center;
    gap: 26px;
    margin: 26px 0 22px;
    padding: 28px;
    border: 1px solid var(--line);
    border-radius: 20px;
    background: linear-gradient(135deg, #ffffff, #f2fbf8);
    box-shadow: 0 22px 46px rgba(15,23,42,.07);
}

.update-upload h1 {
    margin: 0;
    font-size: 24px;
    font-weight: 900;
    letter-spacing: -.03em;
}

.update-upload p {
    margin: 8px 0 0;
    color: var(--muted);
    line-height: 1.7;
}

.update-upload-form {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 12px;
}

.update-timeline {
    position: relative;
    padding-left: 28px;
    margin-bottom: 24px;
}

.update-timeline::before {
    content: "";
    position: absolute;
    left: 8px;
    top: 14px;
    bottom: 18px;
    width: 2px;
    background: linear-gradient(#0f766e, #e2e8f0);
}

.release-item {
    position: relative;
    display: grid;
    grid-template-columns: 20px 1fr;
    gap: 12px;
    margin-bottom: 14px;
}

.release-node {
    width: 14px;
    height: 14px;
    margin-top: 24px;
    border: 3px solid #0f766e;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 0 0 6px #e6fffb;
}

.release-card {
    padding: 20px 22px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 14px 32px rgba(15,23,42,.05);
}

.release-head {
    display: flex;
    justify-content: space-between;
    gap: 16px;
}

.release-head h2 {
    margin: 0;
    font-size: 20px;
    font-weight: 900;
    letter-spacing: -.02em;
}

.release-head h2 span {
    color: #4b5563;
    margin-left: 6px;
}

.release-head p {
    margin: 6px 0 0;
    color: #8b95a1;
    font-weight: 650;
}

.release-actions {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.release-summary {
    margin-top: 14px;
    color: #475569;
    line-height: 1.7;
}

.release-features {
    margin: 12px 0 0;
    padding-left: 20px;
    color: #1f2937;
    line-height: 1.75;
}

.release-files {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px dashed var(--line);
}

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

.login-hero {
    background:
        radial-gradient(circle at 10% 0%, rgba(14,165,164,.18), transparent 38%),
        linear-gradient(135deg, #ffffff, #f4fbf8);
}

.build-hero {
    align-items: center;
}

.build-status-card {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 260px;
    padding: 16px 18px;
    border: 1px solid rgba(15, 118, 110, .16);
    border-radius: 16px;
    background:
        linear-gradient(135deg, rgba(255,255,255,.96), rgba(239,253,248,.94)),
        radial-gradient(circle at 100% 0%, rgba(37,99,235,.16), transparent 38%);
}

.build-status-card strong {
    display: block;
    font-weight: 900;
    letter-spacing: -.02em;
}

.build-status-card p {
    margin: 3px 0 0;
    color: var(--muted);
    font-size: 13px;
}

.status-dot {
    width: 12px;
    height: 12px;
    flex: 0 0 auto;
    border-radius: 999px;
    box-shadow: 0 0 0 6px rgba(15, 118, 110, .1);
}

.status-ok {
    background: #10b981;
}

.status-warn {
    background: #f59e0b;
    box-shadow: 0 0 0 6px rgba(245, 158, 11, .14);
}

.build-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(300px, .65fr);
    gap: 18px;
    align-items: start;
    margin-bottom: 22px;
}

.build-panel {
    border-radius: 18px !important;
}

.build-form .form-label {
    color: #475569;
    font-size: 13px;
    font-weight: 850;
}

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

.build-preview div {
    padding: 13px 14px;
    border: 1px solid #dbeafe;
    border-radius: 12px;
    background: linear-gradient(135deg, #eff6ff, #f8fafc);
}

.build-preview span {
    display: block;
    color: #64748b;
    font-size: 12px;
    font-weight: 850;
}

.build-preview strong {
    display: block;
    margin-top: 5px;
    color: #1e3a8a;
    font-size: 13px;
    line-height: 1.5;
}

.readonly-field[readonly] {
    color: #334155;
    background: #f8fafc;
    border-color: #dbe3ef;
    cursor: default;
}

.template-form {
    display: grid;
    gap: 12px;
}

.template-drop {
    padding: 18px;
    border: 1px dashed rgba(37, 99, 235, .32);
    border-radius: 16px;
    background: linear-gradient(180deg, #ffffff, #f5f9ff);
}

.template-drop i {
    display: inline-flex;
    width: 42px;
    height: 42px;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
    border-radius: 12px;
    color: #1d4ed8;
    background: #dbeafe;
    font-size: 20px;
}

.template-drop strong {
    display: block;
    font-weight: 900;
}

.template-drop p,
.build-note p {
    color: var(--muted);
    line-height: 1.65;
    margin: 7px 0 12px;
    font-size: 13px;
}

.build-note {
    margin-top: 16px;
    padding: 14px;
    border: 1px solid #fde68a;
    border-radius: 14px;
    background: #fffbeb;
}

.build-note strong {
    color: #92400e;
    font-weight: 900;
}

.build-note p {
    margin-bottom: 0;
    color: #78350f;
}

.package-history {
    margin-bottom: 24px;
}

.package-table .code-pill {
    color: #1d4ed8;
    background: #eff6ff;
}

.package-service {
    color: #0f172a;
    font-weight: 850;
}

.package-service + small {
    display: block;
    color: #94a3b8;
    margin-top: 3px;
    word-break: break-all;
}

.debug-decoded,
.debug-extra {
    max-width: 520px;
    color: #64748b;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
    font-size: 12px;
    line-height: 1.5;
    white-space: normal;
    word-break: break-all;
}

.debug-extra {
    margin-top: 6px;
    color: #94a3b8;
}

@media (max-width: 900px) {
    .filter-grid,
    .filter-grid.agent-filter,
    .filter-grid.logs-filter,
    .update-upload,
    .update-upload-form {
        grid-template-columns: 1fr;
    }

    .data-table {
        min-width: 0;
    }

    .data-table thead {
        display: none;
    }

    .data-table,
    .data-table tbody,
    .data-table tr,
    .data-table td {
        display: block;
        width: 100%;
    }

    .data-table tr {
        padding: 10px 12px;
        border-bottom: 1px solid var(--line);
    }

    .data-table tbody td {
        display: grid;
        grid-template-columns: 88px 1fr;
        gap: 10px;
        padding: 7px 0;
        border: 0;
        font-size: 13px;
    }

    .data-table tbody td::before {
        content: attr(data-label);
        color: #94a3b8;
        font-weight: 800;
    }

    .actions-cell {
        text-align: left !important;
    }

    .udid-cell {
        max-width: none;
        white-space: normal;
    }

    .release-head {
        display: block;
    }

    .release-actions {
        justify-content: flex-start;
        margin-top: 12px;
    }

    .build-grid,
    .build-preview {
        grid-template-columns: 1fr;
    }

    .build-status-card {
        width: 100%;
    }

    .page-hero.build-hero {
        align-items: flex-start;
    }
}

/* restrained commercial UI polish - 2026-06-09 */
body {
    background: #f6f7f9;
    color: #111827;
}

.app-sidebar {
    border-color: #e7ebf0;
    background: #ffffff;
    backdrop-filter: none;
    box-shadow: 0 18px 44px rgba(16, 24, 40, .06);
}

.sidebar-brand {
    min-height: 76px;
}

.sidebar-nav a {
    color: #536170;
    font-weight: 680;
    transform: none !important;
}

.sidebar-nav a:hover {
    color: var(--accent-strong);
    background: #f2f7f6;
}

.sidebar-nav a.active {
    color: var(--accent-strong);
    background: #e9f5f3;
    box-shadow: inset 0 0 0 1px rgba(15, 118, 110, .12);
}

.sidebar-nav a.active i {
    color: var(--accent-strong);
}

.sidebar-user,
.mobile-menu-button {
    background: #fafbfc;
    box-shadow: none;
}

.page-hero {
    align-items: flex-end;
    gap: 18px;
    padding-top: 30px;
    margin-bottom: 18px;
}

.page-kicker,
.section-eyebrow {
    color: #708090;
    font-size: 11px;
    font-weight: 760;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.page-title {
    margin-top: 6px;
    font-size: clamp(25px, 2.5vw, 33px);
    font-weight: 760;
    letter-spacing: -.035em;
}

.page-subtitle {
    margin-top: 8px;
    color: #667085;
    font-size: 14px;
    line-height: 1.65;
}

.panel,
.card,
.data-panel,
.filter-bar,
.generator-panel {
    border: 1px solid #e5e9ef !important;
    background: #ffffff !important;
    box-shadow: 0 10px 28px rgba(16, 24, 40, .035) !important;
}

.metric-card {
    border: 1px solid #e5e9ef;
    background: #ffffff;
    box-shadow: 0 8px 24px rgba(16, 24, 40, .035) !important;
}

.metric-card::after {
    display: none;
}

.metric-card:hover {
    border-color: #d7dee8;
    transform: translateY(-1px);
}

.metric-label {
    font-weight: 680;
}

.metric-value {
    font-size: 31px;
    font-weight: 760;
}

.btn {
    min-height: 38px;
    padding: 7px 12px;
    border-radius: 10px;
    font-weight: 680;
    letter-spacing: 0;
    box-shadow: none !important;
}

.btn:hover {
    transform: none;
}

.btn-primary,
.btn-generate,
.btn-accent {
    color: #ffffff !important;
    background: var(--accent) !important;
    border-color: var(--accent) !important;
}

.btn-primary:hover,
.btn-primary:focus,
.btn-generate:hover,
.btn-accent:hover {
    background: var(--accent-strong) !important;
    border-color: var(--accent-strong) !important;
}

.btn-light,
.btn-soft,
.btn-outline-primary {
    color: #344054;
    background: #ffffff;
    border-color: #d7dee8;
}

.btn-light:hover,
.btn-soft:hover,
.btn-outline-primary:hover {
    color: var(--accent-strong);
    background: #f4faf8;
    border-color: rgba(15, 118, 110, .26);
}

.btn-danger,
.btn-delete {
    background: #dc2626;
    border-color: #dc2626;
}

.form-label {
    margin-bottom: 7px;
    color: #344054;
    font-size: 13px;
    font-weight: 680;
}

.form-control,
.form-select {
    min-height: 42px;
    border-color: #d7dee8;
    border-radius: 10px;
    color: #111827;
    background-color: #ffffff;
}

.form-control:focus,
.form-select:focus {
    border-color: rgba(15, 118, 110, .45);
    box-shadow: 0 0 0 4px rgba(15, 118, 110, .08);
}

.data-table thead th,
.table thead th {
    background: #fafbfc;
    color: #778394;
    font-size: 12px;
    font-weight: 680;
    letter-spacing: .02em;
}

.data-table tbody td,
.table tbody td {
    color: #344054;
}

.data-table tbody tr:hover,
.table-hover tbody tr:hover {
    background: #fbfdfc;
}

.type-blue,
.agent-blue,
.type-info,
.agent-cyan { color: #175cd3; background: #eff6ff; border-color: #dbeafe; }
.type-green,
.agent-green,
.status-active { color: #067647; background: #ecfdf3; border-color: #dcfae6; }
.type-amber,
.agent-amber,
.status-warning { color: #b54708; background: #fffaeb; border-color: #fedf89; }
.type-rose,
.agent-rose,
.status-danger,
.status-disabled { color: #b42318; background: #fef3f2; border-color: #fee4e2; }
.type-slate,
.status-inactive { color: #475467; background: #f2f4f7; border-color: #eaecf0; }

.notice-card {
    margin-bottom: 14px;
    border-radius: 14px;
    background: #ffffff;
    box-shadow: none;
}

.notice-card i {
    margin-top: 1px;
}

.notice-success {
    color: #067647;
    border-color: #abefc6;
    background: #f6fef9;
}

.notice-warning {
    color: #b54708;
    border-color: #fedf89;
    background: #fffcf5;
}

.notice-danger {
    color: #b42318;
    border-color: #fecdca;
    background: #fffbfa;
}

.generator-hero .btn {
    white-space: nowrap;
}

.generator-grid {
    display: grid;
    grid-template-columns: minmax(0, .95fr) minmax(340px, .8fr);
    gap: 16px;
    align-items: start;
    margin-bottom: 28px;
}

.agent-generator-grid {
    grid-template-columns: minmax(0, .82fr) minmax(340px, .9fr);
}

.generator-panel {
    border-radius: 18px !important;
    overflow: hidden;
}

.generator-panel-head {
    display: flex;
    min-height: 72px;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 18px 20px;
    border-bottom: 1px solid #edf0f4;
}

.generator-panel-head h2 {
    margin: 3px 0 0;
    font-size: 18px;
    font-weight: 740;
    letter-spacing: -.02em;
}

.generator-form {
    display: grid;
    gap: 18px;
    padding: 20px;
}

.form-group {
    min-width: 0;
}

.field-help,
.form-footnote {
    margin-top: 7px;
    color: #7b8794;
    font-size: 12px;
    line-height: 1.5;
}

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

.generator-type-card {
    display: flex;
    min-height: 76px;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    padding: 12px;
    border-radius: 13px;
    background: #ffffff;
    text-align: left;
    box-shadow: none !important;
}

.generator-type-card:hover {
    transform: none;
    border-color: #cfd7e2;
    background: #fbfcfd;
}

.generator-type-card span {
    color: #111827;
    font-size: 14px;
    font-weight: 720;
}

.generator-type-card small {
    color: #7b8794;
    font-size: 12px;
}

.kami-type-input:checked + .generator-type-card {
    border-color: rgba(15, 118, 110, .42);
    background: #f2faf8;
    box-shadow: inset 0 0 0 1px rgba(15, 118, 110, .1) !important;
}

.kami-type-input:checked + .generator-type-card span {
    color: var(--accent-strong);
}

.kami-type-input:disabled + .generator-type-card {
    cursor: not-allowed;
    opacity: .56;
}

.generator-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    padding-top: 2px;
}

.scope-card {
    margin: 20px 20px 0;
    padding: 14px 15px;
    border: 1px solid #e5e9ef;
    border-radius: 14px;
    background: #fafbfc;
}

.scope-card span {
    display: block;
    color: #7b8794;
    font-size: 12px;
}

.scope-card strong {
    display: block;
    margin-top: 3px;
    color: #111827;
    font-size: 15px;
    font-weight: 740;
}

.scope-card p {
    margin: 7px 0 0;
    color: #667085;
    font-size: 13px;
    line-height: 1.55;
}

.quota-chip {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-height: 42px;
    padding: 0 14px;
    border: 1px solid #d7dee8;
    border-radius: 999px;
    color: #667085;
    background: #ffffff;
    white-space: nowrap;
}

.quota-chip span {
    font-size: 12px;
}

.quota-chip strong {
    color: var(--accent-strong);
    font-size: 20px;
    font-weight: 760;
}

.generator-result-panel {
    min-height: 430px;
}

.generated-list {
    display: grid;
    gap: 0;
    max-height: 520px;
    overflow: auto;
}

.generated-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid #edf0f4;
}

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

.generated-row:hover {
    background: #fbfdfc;
}

.kami-code,
.code-pill {
    color: #263238;
    background: #f3f6f8;
    font-weight: 680;
}

.result-empty {
    display: grid;
    min-height: 336px;
    place-items: center;
    align-content: center;
    padding: 28px;
    color: #7b8794;
    text-align: center;
}

.result-empty i {
    display: grid;
    width: 46px;
    height: 46px;
    place-items: center;
    margin-bottom: 12px;
    border: 1px solid #e5e9ef;
    border-radius: 14px;
    color: #667085;
    background: #fafbfc;
    font-size: 20px;
}

.result-empty strong {
    color: #344054;
    font-weight: 720;
}

.result-empty p {
    max-width: 260px;
    margin: 7px 0 0;
    font-size: 13px;
    line-height: 1.6;
}

body::before {
    display: none;
}

.update-upload {
    grid-template-columns: minmax(0, .85fr) minmax(320px, .9fr);
    gap: 20px;
    margin: 30px 0 16px;
    padding: 22px;
    border-radius: 18px;
    background: #ffffff;
    box-shadow: 0 10px 28px rgba(16, 24, 40, .035);
}

.update-upload h1 {
    font-size: 22px;
    font-weight: 760;
}

.update-upload p {
    max-width: 640px;
    color: #667085;
    font-size: 14px;
    line-height: 1.65;
}

.update-upload code {
    color: #0f766e;
    background: #f2f7f6;
    border-radius: 6px;
    padding: 2px 5px;
}

.update-upload-form {
    align-items: center;
    gap: 10px;
}

.update-timeline {
    padding-left: 0;
}

.update-timeline::before {
    display: none;
}

.release-item {
    grid-template-columns: 1fr;
    margin-bottom: 12px;
}

.release-node {
    display: none;
}

.release-card {
    padding: 18px 20px;
    border-radius: 16px;
    box-shadow: 0 8px 22px rgba(16, 24, 40, .035);
}

.release-head {
    align-items: flex-start;
}

.release-head h2 {
    font-size: 19px;
    font-weight: 740;
}

.release-head h2 span {
    margin-left: 8px;
    color: #475467;
    font-weight: 680;
}

.release-head p {
    color: #8a95a5;
    font-size: 13px;
    font-weight: 620;
}

.release-summary {
    color: #475467;
    font-size: 14px;
}

.release-features {
    color: #344054;
    font-size: 14px;
}

.release-actions .badge,
.badge.bg-primary {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 0 10px;
    border-radius: 999px;
    color: #067647 !important;
    background: #ecfdf3 !important;
    font-size: 12px;
    font-weight: 680;
}

.release-actions .btn {
    min-height: 32px;
    padding: 5px 10px;
}

.release-actions .btn-outline-danger {
    color: #b42318;
    background: #ffffff;
    border-color: #fecdca;
}

.release-actions .btn-outline-danger:hover {
    color: #b42318;
    background: #fffbfa;
}

.release-files {
    border-top-color: #edf0f4;
}

.brand-mark svg,
.agent-avatar-icon svg,
.inline-svg {
    width: 18px;
    height: 18px;
    display: block;
    fill: currentColor;
}

.brand-mark svg {
    width: 22px;
    height: 22px;
}

.agent-avatar-icon {
    color: #0f766e;
    background: #e9f5f3;
}

.agent-avatar-icon img {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: inherit;
    object-fit: cover;
}

.auth-tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
    margin: 0 0 22px;
    padding: 5px;
    list-style: none;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #f8fafc;
}

.auth-tabs button {
    width: 100%;
    min-height: 38px;
    border: 0;
    border-radius: 10px;
    color: #667085;
    background: transparent;
    font-size: 14px;
    font-weight: 760;
    transition: .18s ease;
}

.auth-tabs button:hover {
    color: var(--accent-strong);
    background: rgba(15, 118, 110, .07);
}

.auth-tabs button.active {
    color: var(--text);
    background: #ffffff;
    box-shadow: 0 8px 20px rgba(15, 23, 42, .06);
}

.code-copy {
    border: 0;
    cursor: pointer;
    text-align: left;
}

.code-copy:hover {
    color: var(--accent-strong);
    background: #e9f5f3;
}

.actions-cell .btn,
.actions-cell form .btn {
    min-width: 32px;
    min-height: 32px;
    padding: 5px 8px;
}

.actions-cell form {
    vertical-align: middle;
}

.membership-status {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1px;
    overflow: hidden;
}

.membership-status > div {
    padding: 18px 20px;
    background: #fff;
}

.membership-status span,
.pricing-card .section-eyebrow {
    display: block;
    color: #7b8794;
    font-size: 12px;
}

.membership-status strong {
    display: block;
    margin-top: 6px;
    color: #111827;
    font-size: 20px;
    font-weight: 760;
}

.pricing-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

.pricing-card {
    display: flex;
    min-height: 292px;
    flex-direction: column;
    justify-content: space-between;
    gap: 18px;
    padding: 20px;
    border: 1px solid #e5e9ef;
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 8px 22px rgba(16, 24, 40, .035);
}

.pricing-card.featured {
    border-color: rgba(15, 118, 110, .28);
    box-shadow: inset 0 0 0 1px rgba(15, 118, 110, .08), 0 10px 28px rgba(16, 24, 40, .04);
}

.pricing-card h2 {
    margin: 6px 0 8px;
    font-size: 20px;
    font-weight: 760;
}

.pricing-card p {
    margin: 0;
    color: #667085;
    font-size: 13px;
    line-height: 1.65;
}

.plan-points {
    display: grid;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.plan-points li {
    position: relative;
    padding-left: 15px;
    color: #667085;
    font-size: 13px;
    line-height: 1.6;
}

.plan-points li::before {
    content: "";
    position: absolute;
    left: 0;
    top: .72em;
    width: 5px;
    height: 5px;
    border-radius: 999px;
    background: rgba(15, 118, 110, .55);
}

.price strong {
    font-size: 30px;
    line-height: 1;
    letter-spacing: -.04em;
}

.price span {
    color: #7b8794;
}

@media (max-width: 1100px) {
    .type-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .pricing-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 900px) {
    .page-hero {
        align-items: flex-start;
    }

    .data-table {
        min-width: 860px;
    }

    .data-table thead {
        display: table-header-group;
    }

    .data-table,
    .data-table tbody {
        display: table;
        width: 100%;
        border-collapse: collapse;
    }

    .data-table tbody {
        display: table-row-group;
    }

    .data-table tr {
        display: table-row;
        padding: 0;
        border-bottom: 0;
    }

    .data-table td,
    .data-table tbody td {
        display: table-cell;
        width: auto;
        padding: 12px 14px;
        border-bottom: 1px solid #edf0f4;
    }

    .data-table tbody td::before {
        content: none;
    }

    .generator-grid,
    .agent-generator-grid {
        grid-template-columns: 1fr;
    }

    .generator-result-panel {
        min-height: 320px;
    }

    .kami-list-panel .data-table {
        min-width: 0;
    }

    .kami-list-panel .data-table thead {
        display: none;
    }

    .kami-list-panel .data-table,
    .kami-list-panel .data-table tbody,
    .kami-list-panel .data-table tr,
    .kami-list-panel .data-table td {
        display: block;
        width: 100%;
    }

    .kami-list-panel .data-table tbody {
        padding: 10px;
        background: #f6f7f9;
    }

    .kami-list-panel .data-table tr {
        margin-bottom: 10px;
        padding: 14px;
        border: 1px solid #e5e9ef;
        border-radius: 16px;
        background: #fff;
        box-shadow: 0 6px 18px rgba(16, 24, 40, .03);
    }

    .kami-list-panel .data-table tbody td {
        display: flex;
        width: 100%;
        align-items: center;
        justify-content: space-between;
        gap: 14px;
        padding: 8px 0;
        border: 0;
        text-align: right !important;
    }

    .kami-list-panel .data-table tbody td::before {
        content: attr(data-label);
        color: #8a95a5;
        font-size: 12px;
        font-weight: 680;
        text-align: left;
    }

    .kami-list-panel .data-table tbody td:first-child {
        display: block;
        padding-top: 0;
        text-align: left !important;
    }

    .kami-list-panel .data-table tbody td:first-child::before {
        display: block;
        margin-bottom: 6px;
    }

    .kami-list-panel .actions-cell {
        justify-content: flex-end !important;
        padding-top: 12px !important;
        border-top: 1px solid #edf0f4 !important;
    }

    .kami-list-panel .actions-cell::before {
        content: none !important;
    }

    .kami-list-panel .actions-cell .btn {
        min-width: 40px;
        min-height: 38px;
    }

    .membership-status {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 560px) {
    .page-hero {
        gap: 12px;
    }

    .generator-panel-head,
    .generated-row,
    .generator-actions {
        align-items: stretch;
    }

    .generator-panel-head {
        flex-direction: column;
    }

    .type-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .generator-form,
    .generator-panel-head {
        padding-left: 16px;
        padding-right: 16px;
    }

    .generated-row {
        flex-direction: column;
    }

    .generated-row .btn,
    .generator-actions .btn {
        width: 100%;
    }

    .update-upload,
    .update-upload-form {
        grid-template-columns: 1fr;
    }

    .pricing-grid {
        grid-template-columns: 1fr;
    }

    .toolbar-row .btn,
    .page-hero .btn {
        width: 100%;
        justify-content: center;
    }
}
