/* ============================================================
   SchedulePosts — base stylesheet
   ============================================================ */
:root {
    /* --- Background palette (derived from background.webp) ---
       Left-to-right the three zones step from dark to light:
       rail (darkest) -> panel (intermediate) -> content (lightest). */
    --surface:    #ffffff;   /* cards & content surfaces       */
    --content-bg: #fefdf9;   /* content column (right) — lightest   */
    --panel-bg:   #f4efe4;   /* section panel (column 2) — intermediate */
    --rail-bg:    #ece5d7;   /* icon rail (column 1, left) — darkest */
    --soft:       #f1ebdf;   /* soft fills / hover             */
    --line:       #ece3d2;   /* hairlines on light             */
    --bg:         #2a2114;   /* warm dark (dark sections)      */

    /* --- Accent: amber (Amber Sand) --- */
    --primary:     #d97706;
    --primary-d:   #b45f04;
    --accent:      #d97706;
    --brand-dark:  #7c4a08;
    --mint:        #fbecca;   /* active menu item background */
    --mint-strong: #f8e0ab;   /* active rail icon background */

    /* --- Text --- */
    --ink:       #322a1c;
    --muted:     #7c7159;
    --danger:    #e3514c;

    --radius:    14px;
    --shadow:    0 10px 30px rgba(30, 35, 60, .07);
    --shadow-lg: 0 24px 60px rgba(30, 35, 60, .14);
    --maxw:      1120px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    color: var(--ink);
    background: var(--surface);
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

.container { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
.muted { color: var(--muted); }
.small { font-size: 0.9375rem; }
.center { text-align: center; }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center;
    gap: .5rem;
    padding: .65rem 1.15rem;
    border-radius: 10px;
    border: 1px solid transparent;
    font-weight: 600; font-size: .95rem;
    cursor: pointer;
    transition: transform .05s ease, background .15s ease, box-shadow .15s ease;
    text-decoration: none;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--primary); color: #fff; }
.btn--primary:hover { background: var(--primary-d); color: #fff; }
.btn--ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn--ghost:hover { background: var(--soft); color: var(--ink); }
.btn--danger { background: var(--danger); color: #fff; }
.btn--danger:hover { background: #c8413c; color: #fff; }
.btn--lg { padding: .85rem 1.5rem; font-size: 1.05rem; }
.btn--sm { padding: .4rem .7rem; font-size: 0.9375rem; }
.btn--block { width: 100%; }

/* ---------- Brand ---------- */
.brand { display: inline-flex; align-items: center; gap: .5rem; font-size: 1.2rem; font-weight: 700; color: var(--ink); }
.brand:hover { text-decoration: none; }
.brand--center { justify-content: center; margin-bottom: 1rem; }
.brand__mark { font-size: 1.2rem; color: var(--primary); }
.brand__name strong { color: var(--primary); }

/* ---------- Pills / badges / alerts ---------- */
.pill {
    display: inline-block; padding: .3rem .8rem; border-radius: 999px;
    background: rgba(217,119,6,.1); color: var(--primary);
    font-size: 0.9375rem; font-weight: 600; letter-spacing: .02em;
}
.badge { display: inline-block; padding: .2rem .55rem; border-radius: 6px; font-size: 0.9375rem; font-weight: 600; }
.badge--role { background: rgba(217,119,6,.12); color: var(--primary); text-transform: capitalize; }
.badge--ok { background: rgba(22,184,166,.15); color: #0c8a7c; }
.badge--muted { background: var(--soft); color: var(--muted); }
.badge--error { background: #fdecec; color: #b3322d; }
.badge--warn { background: #fbeccd; color: #9c5403; }

/* Framework log dump */
.logdump { margin: 0; padding: 14px 16px; background: #1b1f2a; color: #e6e8ef; border-radius: 12px; overflow-x: auto; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.9375rem; line-height: 1.5; white-space: pre-wrap; word-break: break-word; }

/* Framework log viewer (parsed) */
.logfilter { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: .4rem 0 1.1rem; }
.logchip { display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--line); background: var(--surface); color: var(--muted); border-radius: 999px; padding: .35rem .8rem; font-size: 0.9375rem; font-weight: 700; cursor: pointer; transition: background .12s, color .12s, border-color .12s; }
.logchip:hover { background: var(--soft); color: var(--ink); }
.logchip.is-active { background: var(--ink); color: #fff; border-color: var(--ink); }
.logchip--error.is-active { background: var(--danger); border-color: var(--danger); }
.logchip--warning.is-active { background: #d97706; border-color: #d97706; }
.logchip__count { background: rgba(0,0,0,.08); border-radius: 999px; padding: 0 .45rem; font-size: 0.9375rem; font-weight: 700; }
.logchip.is-active .logchip__count { background: rgba(255,255,255,.25); }
.logsearch { margin-left: auto; min-width: 200px; padding: .45rem .7rem; border: 1px solid var(--line); border-radius: 9px; font-size: 0.9375rem; background: #fff; color: var(--ink); }
.logsearch:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(217,119,6,.15); }

.loglist { display: flex; flex-direction: column; gap: 8px; }
.logentry { border: 1px solid var(--line); border-left: 4px solid var(--muted); border-radius: 10px; padding: 10px 14px; background: var(--surface); }
.logentry--error { border-left-color: var(--danger); }
.logentry--warning { border-left-color: #d97706; }
.logentry--info { border-left-color: #0c8a7c; }
.logentry__head { display: flex; align-items: center; gap: 10px; }
.logentry__time { color: var(--muted); font-size: 0.9375rem; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.logentry__msg { margin-top: 5px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.9375rem; line-height: 1.45; word-break: break-word; }
.logentry__trace { margin-top: 6px; }
.logentry__trace summary { cursor: pointer; color: var(--primary-d); font-size: 0.9375rem; font-weight: 600; list-style: none; }
.logentry__trace summary i { transition: transform .12s; }
.logentry__trace[open] summary i { transform: rotate(90deg); }
.logentry__trace pre { margin: 8px 0 0; padding: 12px 14px; background: #1b1f2a; color: #e6e8ef; border-radius: 8px; overflow-x: auto; font-size: 0.9375rem; line-height: 1.5; white-space: pre-wrap; word-break: break-word; }

.alert { padding: .8rem 1rem; border-radius: 10px; margin-bottom: 1rem; font-size: 0.9375rem; }
.alert ul { margin: 0; padding-left: 1.1rem; }
.alert--error { background: #fdecec; color: #b3322d; border: 1px solid #f6c9c7; }
.alert--success { background: #e8f8f4; color: #0c8a7c; border: 1px solid #bfe9e1; }

/* ============================================================
   Public marketing site
   ============================================================ */
.site-header { border-bottom: 1px solid var(--line); position: sticky; top: 0; background: rgba(255,255,255,.9); backdrop-filter: blur(8px); z-index: 10; }
.site-header__inner { display: flex; align-items: center; justify-content: space-between; height: 68px; }
.site-nav { display: flex; align-items: center; gap: 1.4rem; }
.site-nav a { color: var(--ink); font-weight: 500; }

.hero { background: radial-gradient(1200px 500px at 80% -10%, rgba(217,119,6,.18), transparent), var(--soft); padding: 5rem 0 5.5rem; }
.hero__inner { display: grid; grid-template-columns: 1.1fr .9fr; gap: 3rem; align-items: center; }
.hero h1 { font-size: 3rem; line-height: 1.08; margin: 1rem 0; letter-spacing: -.02em; }
.lead { font-size: 1.2rem; color: var(--muted); max-width: 34ch; }
.hero__cta { display: flex; gap: .8rem; margin: 1.6rem 0 .8rem; flex-wrap: wrap; }

.hero__art { position: relative; min-height: 280px; }
.card-float {
    position: absolute; background: var(--surface); border: 1px solid var(--line);
    border-radius: 12px; padding: .9rem 1.1rem; box-shadow: var(--shadow);
    font-weight: 600; font-size: .95rem;
}
.card-float i { color: var(--primary); margin-right: .35rem; }
.card-float--1 { top: 10%; left: 0; }
.card-float--2 { top: 45%; right: 0; }
.card-float--3 { bottom: 5%; left: 18%; }

.section { padding: 4.5rem 0; }
.section--alt { background: var(--soft); }
.section__title { font-size: 2.1rem; text-align: center; margin: 0 0 .4rem; letter-spacing: -.02em; }
.section__subtitle { text-align: center; color: var(--muted); font-size: 1.1rem; margin: 0 auto 2.6rem; max-width: 46ch; }

.grid { display: grid; gap: 1.5rem; }
.grid--2 { grid-template-columns: repeat(2, 1fr); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--4 { grid-template-columns: repeat(4, 1fr); }

.feature { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.8rem; box-shadow: var(--shadow); }
.feature__icon { font-size: 1.6rem; color: var(--primary); }
.feature h3 { margin: .8rem 0 .4rem; }
.feature p { color: var(--muted); margin: 0; }

/* ---------- Pricing ---------- */
.plan { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 2rem 1.6rem; box-shadow: var(--shadow); display: flex; flex-direction: column; }
.plan--featured { border-color: var(--primary); box-shadow: var(--shadow-lg); transform: translateY(-6px); }
.plan__badge { position: absolute; top: -.8rem; left: 50%; transform: translateX(-50%); background: var(--primary); color: #fff; padding: .25rem .8rem; border-radius: 999px; font-size: 0.9375rem; font-weight: 600; }
.plan__name { margin: 0 0 .25rem; font-size: 1.3rem; }
.plan__tagline { color: var(--muted); margin: 0 0 1rem; min-height: 2.6em; }
.plan__price { font-size: 2.6rem; font-weight: 800; margin: 0 0 1.2rem; }
.plan__currency { font-size: 1.4rem; vertical-align: super; }
.plan__period { font-size: .95rem; font-weight: 500; color: var(--muted); }
.plan__features { list-style: none; padding: 0; margin: 0 0 1.6rem; flex: 1; }
.plan__features li { padding: .45rem 0 .45rem 1.6rem; position: relative; border-top: 1px solid var(--line); }
.plan__features li::before { content: "✓"; position: absolute; left: 0; color: var(--accent); font-weight: 700; }

.cta-band { background: var(--bg); color: #fff; padding: 3.5rem 0; }
.cta-band__inner { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; flex-wrap: wrap; }
.cta-band h2 { margin: 0; font-size: 1.8rem; }

.site-footer { border-top: 1px solid var(--line); padding: 1.8rem 0; }
.site-footer__inner { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; color: var(--muted); font-size: 0.9375rem; }

/* ============================================================
   Auth
   ============================================================ */
.auth-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: radial-gradient(900px 500px at 50% -20%, rgba(217,119,6,.2), transparent), var(--soft); padding: 2rem; }
.auth-card { width: 100%; max-width: 400px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 2.2rem; box-shadow: var(--shadow-lg); }
.auth-card__title { text-align: center; font-size: 1.4rem; margin: 0 0 1.4rem; }
.auth-card__foot { text-align: center; margin-top: 1.2rem; }

/* ---------- Forms ---------- */
.field { margin-bottom: 1.1rem; }
.field label { display: block; font-weight: 600; font-size: 0.9375rem; margin-bottom: .4rem; }
.field input, .field select, .field textarea {
    width: 100%; padding: .6rem .8rem; border: 1px solid var(--line); border-radius: 10px;
    font-size: .98rem; line-height: 1.4; background: #fff; color: var(--ink); font-family: inherit;
}
.field textarea { resize: vertical; line-height: 1.5; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(217,119,6,.15); }

/* Normalize native selects so their height matches the inputs (custom chevron) */
.field select {
    -webkit-appearance: none; -moz-appearance: none; appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7787' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right .75rem center;
    padding-right: 2.1rem;
}
.form-actions { display: flex; justify-content: flex-end; gap: .7rem; margin-top: 1.5rem; }
.inline-form { display: inline; }

/* ============================================================
   App (authenticated)
   ============================================================ */
.app { display: flex; min-height: 100vh; background: var(--content-bg); }

/* ---------- Two-column navigation (icon rail + panel) ---------- */
.navside { display: flex; flex-shrink: 0; height: 100vh; position: sticky; top: 0; }

/* Column 1 — icon rail */
.rail {
    width: 68px; background: var(--rail-bg); color: var(--muted);
    border-right: 1px solid var(--line);
    display: flex; flex-direction: column; align-items: center;
    padding: 14px 0; gap: 8px;
    overflow: visible; /* allow hover labels to escape the rail */
}
.rail__brand {
    width: 40px; height: 40px; border-radius: 11px; margin-bottom: 6px;
    display: grid; place-items: center; font-size: 1.3rem;
    background: var(--primary); color: #fff; text-decoration: none;
}
.rail__brand:hover { text-decoration: none; }
.rail__group { display: flex; flex-direction: column; gap: 8px; }
.rail__divider { width: 28px; height: 1px; background: var(--line); margin: 4px 0; }
.rail__spacer { flex: 1; }
.rail__btn {
    position: relative;
    width: 44px; height: 44px; border: 0; border-radius: 12px; cursor: pointer;
    background: transparent; color: var(--muted); text-decoration: none;
    display: grid; place-items: center; transition: background .15s, color .15s;
}
.rail__btn-icon { display: grid; place-items: center; }
.rail__btn-icon i { font-size: 19px; line-height: 1; }
.rail__btn:hover { background: var(--soft); color: var(--ink); text-decoration: none; }
.rail__btn.is-active { background: var(--mint-strong); color: var(--primary-d); }

/* CSS hover label (no HTML title tooltip) — appears to the right of the icon */
.rail__btn-label {
    position: absolute; left: calc(100% + 10px); top: 50%; transform: translateY(-50%) translateX(-4px);
    white-space: nowrap; background: var(--bg); color: #fff;
    padding: .35rem .6rem; border-radius: 8px; font-size: 0.9375rem; font-weight: 600;
    box-shadow: 0 6px 18px rgba(16, 42, 32, .28);
    opacity: 0; visibility: hidden; pointer-events: none;
    transition: opacity .12s ease, transform .12s ease; z-index: 60;
}
.rail__btn-label::before {
    content: ""; position: absolute; right: 100%; top: 50%; transform: translateY(-50%);
    border: 5px solid transparent; border-right-color: var(--bg);
}
.rail__btn:hover .rail__btn-label,
.rail__btn:focus-visible .rail__btn-label {
    opacity: 1; visibility: visible; transform: translateY(-50%) translateX(0);
}

/* Column 2 — section panel */
.panel {
    width: 248px; background: var(--panel-bg); border-right: 1px solid var(--line);
    padding: 18px 14px; overflow-y: auto;
}
.panel__view { display: none; }
.panel__view.is-active { display: block; }
.panel__title { font-size: 1.25rem; font-weight: 800; margin: 4px 6px 18px; letter-spacing: -.01em; }
.panel__section { font-size: 0.9375rem; font-weight: 700; letter-spacing: .08em; color: var(--muted); margin: 16px 6px 6px; }
.panel__nav { display: flex; flex-direction: column; gap: 2px; }

.menu-link {
    display: flex; align-items: center; gap: 11px;
    padding: .55rem .7rem; border-radius: 10px; color: var(--ink); font-weight: 500; font-size: .95rem;
}
.menu-link:hover { background: var(--soft); text-decoration: none; }
.menu-link.is-current { background: var(--mint); color: var(--primary-d); font-weight: 600; }
.menu-link__icon { display: inline-grid; place-items: center; color: var(--muted); flex-shrink: 0; width: 20px; }
.menu-link.is-current .menu-link__icon { color: var(--primary); }
.menu-link__icon i { font-size: 15px; line-height: 1; }
.menu-link__label { flex: 1; }
.menu-link__tag {
    font-size: 0.9375rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em;
    background: var(--soft); color: var(--muted); padding: .12rem .4rem; border-radius: 999px;
}
.menu-link.is-soon { color: var(--muted); cursor: default; }
.menu-link.is-soon:hover { background: transparent; }

.app__main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar { height: 64px; background: var(--surface); border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; padding: 0 1.8rem; }
.topbar__title { font-size: 1.2rem; margin: 0; }
/* User dropdown (native <details>) */
.usermenu { position: relative; }
.usermenu__trigger {
    list-style: none; cursor: pointer; user-select: none;
    display: flex; align-items: center; gap: .55rem;
    padding: .4rem .65rem; border-radius: 10px; font-weight: 600;
}
.usermenu__trigger::-webkit-details-marker { display: none; }
.usermenu__trigger::marker { content: ""; }
.usermenu__trigger:hover { background: var(--soft); }
.usermenu__caret { font-size: 0.9375rem; color: var(--muted); transition: transform .15s ease; }
.usermenu[open] .usermenu__caret { transform: rotate(180deg); }
.usermenu__panel {
    position: absolute; right: 0; top: calc(100% + 6px); min-width: 210px;
    background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
    box-shadow: var(--shadow-lg); padding: 6px; z-index: 50;
}
.usermenu__head {
    display: flex; flex-direction: column; align-items: flex-start; gap: 6px;
    padding: 8px 10px 10px; margin-bottom: 6px; border-bottom: 1px solid var(--line);
}
.usermenu__email { font-size: 0.9375rem; color: var(--muted); }
.usermenu__item {
    display: flex; align-items: center; gap: 10px;
    padding: .55rem .7rem; border-radius: 8px;
    color: var(--ink); font-weight: 500; font-size: 0.9375rem; text-decoration: none;
}
.usermenu__item:hover { background: var(--soft); text-decoration: none; }
.usermenu__item i { width: 18px; text-align: center; color: var(--muted); }

.content { padding: 1.8rem; display: flex; flex-direction: column; gap: 1.5rem; }

.panel-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.5rem; box-shadow: var(--shadow); }
.panel-card--narrow { max-width: 560px; }
/* Cards stacked inside a single form (the content gap doesn't reach them). */
form .panel-card + .panel-card { margin-top: 28px; }
.placeholder { text-align: center; padding: 3rem 1.5rem; display: flex; flex-direction: column; align-items: center; gap: .55rem; }
.placeholder__icon { width: 64px; height: 64px; border-radius: 16px; display: grid; place-items: center; background: var(--mint); color: var(--primary); font-size: 1.6rem; margin-bottom: .4rem; }
.placeholder h2 { margin: 0; }
.placeholder p { margin: 0; max-width: 46ch; }

/* Card header with actions (e.g. chart + filter) */
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.card-head__title { margin: 0 0 .15rem; }

/* Segmented filter control */
.segmented { display: inline-flex; background: var(--soft); border: 1px solid var(--line); border-radius: 10px; padding: 3px; gap: 2px; }
.segmented__btn { padding: .35rem .7rem; border-radius: 8px; font-size: 0.9375rem; font-weight: 600; color: var(--muted); text-decoration: none; }
.segmented__btn:hover { color: var(--ink); text-decoration: none; }
.segmented__btn.is-active { background: var(--surface); color: var(--primary-d); box-shadow: var(--shadow); }

/* Chart */
.chart-wrap { position: relative; height: 280px; }
.chart-wrap--sm { height: 240px; }

/* KPI auto-fit grid */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1rem; }

/* Ranked bar lists (referers, pages) */
.rank-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 11px; }
.rank-item__row { display: flex; justify-content: space-between; gap: 10px; font-size: 0.9375rem; margin-bottom: 4px; }
.rank-item__label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink); }
.rank-item__val { font-weight: 700; color: var(--muted); flex-shrink: 0; font-variant-numeric: tabular-nums; }
.rank-item__track { height: 7px; background: var(--soft); border-radius: 999px; overflow: hidden; }
.rank-item__bar { display: block; height: 100%; background: var(--primary); border-radius: 999px; }

/* Section divider heading (e.g. Bots) */
.section-head { display: flex; align-items: center; gap: 9px; margin: .4rem 0 -.2rem; font-size: 1.15rem; }
.section-head i { color: var(--primary); }

/* Bot name + category badges in the top-bots list */
.bot-name { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 6px; min-width: 0; }
.bot-name .badge { text-transform: none; }

/* Plans feature matrix */
.plans-matrix th, .plans-matrix td { vertical-align: middle; }
.plans-matrix__plan { text-align: center; font-size: .95rem; color: var(--ink); }
.plans-matrix__feature { font-weight: 600; white-space: nowrap; }
.plans-matrix__feature.is-sub { font-weight: 500; color: var(--muted); padding-left: 1.8rem; }
.plans-matrix__feature.is-sub::before { content: "\21B3"; margin-right: .4rem; color: var(--muted); }
.plans-matrix__cell { text-align: center; }
.plans-matrix__input { width: 84px; text-align: center; padding: .45rem .4rem; border: 1px solid var(--line); border-radius: 8px; font-size: 0.9375rem; background: #fff; color: var(--ink); }
.plans-matrix__input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(217,119,6,.15); }
.plans-matrix__input.is-zero { background: #fdecec; border-color: #f3b9b6; color: #b3322d; }

/* Plan column headers (name + price + highlight) */
.plans-matrix th.plan-col, .plans-matrix td.plans-matrix__cell { text-align: center; }
.plan-col { vertical-align: top; padding-bottom: 1rem; }
.plan-col.is-featured, .plans-matrix__cell.is-featured { background: #fef6e0; }
.plan-col.is-featured { border-top: 3px solid #d97706; border-radius: 12px 12px 0 0; }
.plan-col__name { display: flex; align-items: center; justify-content: center; gap: 6px; font-weight: 800; font-size: 1.02rem; color: var(--ink); }
.plan-col__name .badge { padding: .12rem .4rem; }
.plan-col__price { display: flex; align-items: center; justify-content: center; gap: 4px; margin: .5rem 0 .35rem; }
.plan-col__cur { color: var(--muted); font-weight: 600; }
.plan-col__price input { width: 74px; text-align: center; padding: .38rem .4rem; border: 1px solid var(--line); border-radius: 8px; font-size: 0.9375rem; font-weight: 700; }
.plan-col__price input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(217,119,6,.15); }
.plan-col__per { color: var(--muted); font-size: 0.9375rem; }
.plan-col__hl { display: inline-flex; align-items: center; gap: 7px; font-size: 0.9375rem; font-weight: 600; color: var(--muted); cursor: pointer; }
.plan-col__hl input[type="radio"] { width: 20px; height: 20px; accent-color: var(--primary); cursor: pointer; margin: 0; }

/* Settings forms — use the full width with a 2-column field grid */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem 1.6rem; }
.form-grid .field--full { grid-column: 1 / -1; }
@media (max-width: 720px) { .form-grid { grid-template-columns: 1fr; } }
.check { display: flex; align-items: center; gap: .7rem; font-size: 0.9375rem; font-weight: 500; cursor: pointer; }
.check input[type="checkbox"] {
    appearance: auto; width: 22px; height: 22px; min-width: 22px;
    accent-color: var(--primary); flex-shrink: 0; margin: 0; cursor: pointer;
}
.steps ul { margin: .4rem 0 0; padding-left: 1.1rem; }
.steps ul li { margin: .2rem 0; }

/* ---- Registration wizard ------------------------------------------------ */
.reg-steps { display: flex; gap: .5rem; justify-content: center; list-style: none; padding: 0; margin: 0 0 1.8rem; flex-wrap: wrap; }
.reg-step { display: flex; align-items: center; gap: .5rem; color: var(--muted); font-size: 0.9375rem; font-weight: 600; padding: .35rem .9rem; border-radius: 999px; background: var(--panel-bg); }
.reg-step__num { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--line); color: var(--ink); font-size: 0.8125rem; }
.reg-step.is-active { color: #fff; background: var(--primary); }
.reg-step.is-active .reg-step__num { background: rgba(255,255,255,.3); color: #fff; }
.reg-step.is-done { color: var(--primary); }
.reg-step.is-done .reg-step__num { background: var(--primary); color: #fff; }

.reg-plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 1.2rem; margin: 1.5rem 0; align-items: start; }

.reg-verify { max-width: 560px; margin: 0 auto; text-align: center; }
.reg-verify__lead { font-size: 0.9375rem; margin: 0 0 1.2rem; }
.reg-verify__lead i { color: var(--primary); }
.reg-verify__row { display: flex; gap: .7rem; justify-content: center; flex-wrap: wrap; margin-bottom: 1rem; }
.reg-verify__code { width: 180px; text-align: center; letter-spacing: .4em; font-size: 1.4rem; font-weight: 700; padding: .6rem .8rem; border: 1px solid var(--line); border-radius: var(--radius); }
.reg-verify__code:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(217,119,6,.15); }

.reg-summary { display: flex; justify-content: space-between; align-items: baseline; padding-bottom: 1rem; border-bottom: 1px solid var(--line); font-size: 1.05rem; }
.reg-summary__price { font-weight: 800; font-size: 1.3rem; }

.pay-methods { display: flex; flex-direction: column; gap: .7rem; margin: .8rem 0 0; }
.pay-method { display: block; border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.1rem; cursor: pointer; transition: border-color .15s, background .15s; }
.pay-method:has(input:checked) { border-color: var(--primary); background: var(--mint); }
.pay-method input[type="radio"] { width: 20px; height: 20px; accent-color: var(--primary); vertical-align: middle; margin-right: .2rem; }
.pay-method__body { display: inline-flex; align-items: center; gap: .7rem; font-size: 0.9375rem; font-weight: 600; }
.pay-method__body i { font-size: 1.3rem; color: var(--primary); }

.captcha-row { display: flex; align-items: center; gap: .7rem; flex-wrap: wrap; }
.captcha-img { border: 1px solid var(--line); border-radius: 8px; display: block; background: #fcf9f0; }
.captcha-input { flex: 1 1 180px; }

.copy-row { display: flex; gap: 8px; align-items: stretch; }
.copy-row__input { flex: 1; padding: .6rem .8rem; border: 1px solid var(--line); border-radius: 10px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.9375rem; background: var(--soft); color: var(--ink); }

.steps { margin: 0; padding-left: 1.2rem; display: flex; flex-direction: column; gap: .55rem; }
.steps li { line-height: 1.5; }

code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.9375rem; background: var(--soft); border: 1px solid var(--line); border-radius: 6px; padding: .08rem .35rem; }
.table code { background: transparent; border: 0; padding: 0; font-size: 0.9375rem; }
.legend-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 2px; vertical-align: middle; }
.legend-dot--humans { background: var(--primary); }
.legend-dot--robots { background: #8a94a6; }
.panel-card h2 { margin-top: 0; }

.stat { display: flex; flex-direction: column; gap: .2rem; }
.stat__icon { font-size: 1.4rem; color: var(--primary); }
.stat__value { font-size: 2rem; font-weight: 800; }
.stat__label { color: var(--muted); font-size: 0.9375rem; }

/* Threshold-coloured stat boxes */
.stat--warn { background: #fef6e0; border-color: #f3d98a; }
.stat--warn .stat__icon { color: #b45f04; }
.stat--danger { background: #fdecec; border-color: #f3b9b6; }
.stat--danger .stat__icon, .stat--danger .stat__value { color: #b3322d; }
.stat__action { margin-top: .55rem; }
.stat__link { background: transparent; border: 0; padding: 0; cursor: pointer; font: inherit; font-size: 0.9375rem; font-weight: 700; color: var(--primary-d); display: inline-flex; align-items: center; gap: 6px; }
.stat__link:hover { text-decoration: underline; }
.stat--warn .stat__link { color: #b45f04; }
.stat--danger .stat__link { color: #b3322d; }

.page-actions { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }

/* ---------- Table ---------- */
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { text-align: left; padding: .8rem .6rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table th { font-size: 0.9375rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.table tbody tr:last-child td { border-bottom: none; }
.table th.table__actions, .table td.table__actions { text-align: right; white-space: nowrap; }
.table__actions .btn { margin-left: .4rem; }

/* Sortable column headers */
.sort-link { color: inherit; text-decoration: none; cursor: pointer; white-space: nowrap; }
.sort-link:hover { color: var(--ink); text-decoration: none; }
.sort-link.is-sorted { color: var(--primary-d); }
.table .nowrap { white-space: nowrap; }
.table .truncate { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.table .truncate-sm { max-width: 170px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.table-scroll { overflow-x: auto; }

/* Pager (CodeIgniter default pager) */
.pager-wrap { margin-top: 1.2rem; }
.pager-wrap nav ul, .pager-wrap ul.pagination,
.crud-footer__pager nav ul, .crud-footer__pager ul.pagination {
    list-style: none; display: flex; flex-wrap: wrap; gap: 4px; padding: 0; margin: 0;
}
.pager-wrap li a, .pager-wrap li.active span, .pager-wrap li span,
.crud-footer__pager li a, .crud-footer__pager li.active span, .crud-footer__pager li span {
    display: inline-block; padding: .4rem .7rem; border: 1px solid var(--line);
    border-radius: 8px; color: var(--ink); text-decoration: none; font-size: 0.9375rem; font-weight: 600;
}
.pager-wrap li a:hover, .crud-footer__pager li a:hover { background: var(--soft); text-decoration: none; }
.pager-wrap li.active span, .crud-footer__pager li.active span { background: var(--primary); color: #fff; border-color: var(--primary); }
.pager-wrap li.disabled span, .crud-footer__pager li.disabled span { color: var(--muted); opacity: .6; }

/* CRUD list footer: info (left) · pager (center) · per-page (right) */
.crud-footer { display: flex; align-items: center; gap: 1rem; margin-top: 1.2rem; flex-wrap: wrap; }
.crud-footer__info { flex: 1 1 0; color: var(--muted); font-size: 0.9375rem; min-width: 140px; }
.crud-footer__pager { flex: 0 0 auto; }
.crud-footer__perpage { flex: 1 1 0; display: flex; align-items: center; justify-content: flex-end; gap: 6px; min-width: 140px; }
.perpage__opt { display: inline-block; padding: .3rem .6rem; border: 1px solid var(--line); border-radius: 8px; font-size: 0.9375rem; font-weight: 600; color: var(--muted); text-decoration: none; }
.perpage__opt:hover { background: var(--soft); color: var(--ink); text-decoration: none; }
.perpage__opt.is-active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* CRUD search bar */
.search-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 1.1rem; }
.search-bar input, .search-bar select { padding: .5rem .65rem; border: 1px solid var(--line); border-radius: 9px; font-size: 0.9375rem; line-height: 1.4; background: #fff; color: var(--ink); font-family: inherit; }
.search-bar input[type="text"] { width: 132px; }
.search-bar input.js-date { width: 140px; }
.search-bar select {
    -webkit-appearance: none; -moz-appearance: none; appearance: none;
    padding-right: 1.9rem;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7787' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right .6rem center;
}
.search-bar input:focus, .search-bar select:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(217, 119, 6, .15); }

/* Definition list (log detail) */
.detail { display: grid; grid-template-columns: 130px 1fr; gap: .55rem 1rem; margin: 0; }
.detail dt { color: var(--muted); font-weight: 600; font-size: 0.9375rem; }
.detail dd { margin: 0; word-break: break-word; }
.detail__ua { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.9375rem; }

/* User agent breakdown */
.ua-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin: .4rem 0 1rem; }
.ua-item { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--soft); }
.ua-item__icon { width: 38px; height: 38px; flex-shrink: 0; display: grid; place-items: center; border-radius: 10px; background: var(--surface); color: var(--primary); font-size: 1.1rem; }
.ua-item__meta { display: flex; flex-direction: column; min-width: 0; }
.ua-item__label { font-size: 0.9375rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.ua-item__value { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ua-raw { margin: 0; padding: 10px 12px; background: var(--soft); border: 1px solid var(--line); border-radius: 10px; word-break: break-all; color: var(--muted); }

/* ---------- Responsive ---------- */
@media (max-width: 880px) {
    .hero__inner { grid-template-columns: 1fr; }
    .hero__art { display: none; }
    .grid--2, .grid--3, .grid--4 { grid-template-columns: 1fr; }
    .plan--featured { transform: none; }
    .navside { height: auto; position: relative; }
    .panel { width: 200px; }
}
