/* =============================================================================
   DEX Portal - Websites

   All Websites (counters, status chips and one flat list of the agency's
   sites), the New website and Connect a domain panels, the Manage menu and
   Website Pricing.
   ============================================================================= */

/* -----------------------------------------------------------------------------
   Shared page furniture

   These are general enough to belong to any screen with a toolbar or a table of
   actions, and they live here only because Websites is the first screen to need
   them. Moving them to components.css the moment a second screen does.
   ----------------------------------------------------------------------------- */

/* Pushes whatever follows it to the right-hand end of the toolbar. Doubles as
   the slot the sync status sits in, so the status has somewhere to appear
   without a second element that would collapse to nothing when empty. */
.page-toolbar__spacer {
    flex: 1;
    min-width: 0;
    font-size: var(--font-size-tiny);
    color: var(--text-muted);
    text-align: right;
    padding-right: 4px;
}

/* Past an hour the copy stops being reported and starts being questioned. */
.sync-status--stale {
    color: var(--status-warning);
    font-weight: 600;
}

.data-table__actions {
    text-align: right;
    white-space: nowrap;
}

.data-table__actions-heading {
    text-align: right;
}

/* Present for screen readers, absent for everyone else. Used for the heading of
   an actions column, which needs a name without needing a label. */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}


/* -----------------------------------------------------------------------------
   The five counters

   Each one is a button, because each one is also the filter for what it counts.
   A number that cannot be acted on sends somebody hunting through the list by
   hand for the seven expired sites it just told them about.
   ----------------------------------------------------------------------------- */

.summary-counters {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 12px;
    padding: var(--content-gap-top) var(--gutter) 4px;
}

.summary-counter {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    text-align: left;
    /* The AM soft tile (17 Nov 2026), the same as the Agent Meeko page: a soft
       navy body with a hairline in the same family. No side strip; the icon
       sits in its own soft badge. */
    background: var(--am-blue-tint);
    border: 1px solid var(--am-blue-soft);
    border-radius: var(--radius-button);
    cursor: pointer;
    transition:
        border-color var(--duration-instant) var(--easing-standard),
        background   var(--duration-instant) var(--easing-standard);
}

.summary-counter:hover {
    border-color: var(--am-blue-soft-hover, var(--border-strong));
}

/* A counter that is only a number, not a filter. */
div.summary-counter,
.summary-counter[aria-disabled='true'] {
    cursor: default;
}

/* The selected counter is also the active filter, so it has to look switched
   on rather than merely hovered - otherwise the list looks broken to anyone who
   has forgotten they pressed it. */
/* No icons (Leone, 16 Oct): the number carries the colour of what it counts. */
.summary-counter--warning .summary-counter__value { color: var(--status-warning); }
.summary-counter--danger .summary-counter__value  { color: var(--status-danger); }

.summary-counter--selected,
.summary-counter--selected:hover {
    border-color: var(--am-blue);
    background: var(--am-blue-tint);
    box-shadow: inset 0 0 0 1px var(--am-blue);
}

/* Every badge is AM navy in a soft navy badge, whatever the tone the page
   asked for (17 Nov 2026): the icon says what the tile counts; a warning or
   danger tone still colours the number. */
.summary-counter__badge,
.summary-counter__badge--success,
.summary-counter__badge--info,
.summary-counter__badge--danger,
.summary-counter__badge--accent,
.summary-counter__badge--warning {
    width: 36px;
    height: 36px;
    flex: none;
    border-radius: var(--radius-button);
    display: grid;
    place-items: center;
    background: var(--am-blue-soft);
    color: var(--am-blue);
}

.summary-counter__text {
    min-width: 0;
}

/* The other counter families in Settings and the console (17 Nov 2026): the
   same AM soft tile, the shared .invoice-widget__badge (module-tiles.css) as
   the first child, badge left and the tile's own lines stacked on the right. */
:is(.logs-summary__tile, .calls-console__tile, .rm-stat, .aimport-tile, .portal-summary-tile):has(> .invoice-widget__badge) {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-content: start;
    align-items: start;
    column-gap: 12px;
    row-gap: 2px;
}

:is(.logs-summary__tile, .calls-console__tile, .rm-stat, .aimport-tile, .portal-summary-tile):has(> .invoice-widget__badge) > :not(.invoice-widget__badge) {
    grid-column: 2;
    min-width: 0;
}

.portal-summary-tile:has(> .invoice-widget__badge) {
    background: var(--am-blue-tint);
    border: 1px solid var(--am-blue-soft);
    border-radius: var(--radius-button);
}

.summary-counter__value {
    display: block;
    font-size: 22px;
    font-weight: 600;
    letter-spacing: -0.02em;
    color: var(--am-blue);
    font-variant-numeric: tabular-nums;
    line-height: 1.15;
}

.summary-counter__label {
    display: block;
    font-size: var(--font-size-tiny);
    color: var(--text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}


/* -----------------------------------------------------------------------------
   The list
   ----------------------------------------------------------------------------- */

.website-list-scroll {
    flex: 1;
    min-height: 0;
    overflow: auto;
    margin: 12px var(--gutter) var(--gutter);
    background: var(--surface-panel);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-large);
}
/* The console's list sits straight on the page, no card behind it. */
.website-list-scroll--plain { background: transparent; border: 0; border-radius: 0; }

/* Fixed layout, so the columns are decided by these widths rather than by
   whichever project happens to hold the longest domain name. Every row in the
   list is in this one table for the same reason. */
.website-table {
    table-layout: fixed;
    min-width: 900px;
}

.website-table thead th:first-child,
.website-table tbody td:first-child {
    padding-left: var(--gutter);
}

.website-table thead th:last-child,
.website-table tbody td:last-child {
    padding-right: var(--gutter);
}

/* -----------------------------------------------------------------------------
   Website rows
   ----------------------------------------------------------------------------- */

.website-address {
    display: block;
    font-size: var(--font-size-base);
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.website-name {
    display: block;
    font-weight: 600;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* -----------------------------------------------------------------------------
   The Manage control

   A button per row that opens Activate / Expire / Delete. The menu is fixed to
   the viewport and lives on document.body, so it floats clear of the table's
   own overflow clip and of any panel it is drawn inside; the script closes it
   the moment the row scrolls, so it never hangs where the row used to be.
   ----------------------------------------------------------------------------- */

.website-manage__trigger {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}

.website-manage__trigger .icon {
    margin-right: -2px;
}

.website-manage__menu {
    position: fixed;
    z-index: 1000;
    width: 248px;
    max-width: calc(100vw - 16px);
    padding: 6px;
    background: var(--surface-panel);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-medium);
    box-shadow: var(--shadow-dropdown);
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.website-manage__item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 9px 10px;
    background: none;
    border: 0;
    border-radius: var(--radius-small);
    text-align: left;
    cursor: pointer;
    font-family: inherit;
    color: var(--text-primary);
    transition: background var(--duration-instant) var(--easing-standard);
}

.website-manage__item:hover {
    background: var(--surface-subtle);
}

.website-manage__item-icon {
    display: flex;
    flex: none;
    color: var(--text-muted);
}

.website-manage__item-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.website-manage__item-label {
    font-size: var(--font-size-base);
    font-weight: 600;
    line-height: 1.2;
}

.website-manage__item-detail {
    font-size: var(--font-size-tiny);
    color: var(--text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Delete is the one action here that cannot be taken back, so it is the one
   action that looks it - red on hover, red icon, kept last and apart. */
.website-manage__item--danger {
    color: var(--status-danger);
}

.website-manage__item--danger .website-manage__item-icon,
.website-manage__item--danger .website-manage__item-detail {
    color: var(--status-danger);
}

.website-manage__item--danger:hover {
    background: var(--status-danger-tint);
}


/* -----------------------------------------------------------------------------
   Responsive

   Five counters across is a phone-sized card each by 900px, so they wrap rather
   than shrink. Below that the table drops the columns whose content is already
   visible in the row: the type and the plan both repeat what the name and the
   status pill have said.
   ----------------------------------------------------------------------------- */

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

@media (max-width: 900px) {
    .summary-counters {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    /* The table keeps all five columns and scrolls sideways instead of hiding
       any of them. Every column here is the answer to a different question -
       which site, whose, what kind, what state - and dropping one turns the
       list into a puzzle rather than a shorter list. */
    .website-list-scroll {
        margin-left: var(--gutter);
        margin-right: var(--gutter);
    }
}

@media (max-width: 560px) {
    /* Two a row, not one. One a row stacked five counters a whole phone
       screen deep on Websites, Domains, Call Logs and the Ads pages before
       the list began. */
    .summary-counters {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }

    .summary-counter {
        padding: 10px 12px;
        gap: 10px;
    }

    .summary-counter__badge {
        width: 30px;
        height: 30px;
    }

    .summary-counter__value {
        font-size: var(--font-size-large);
    }

    /* The sync time goes first: it is context, and context is what a phone has
       least room for. Refresh is still there to act on it. */
    .page-toolbar__spacer {
        display: none;
    }

}

/* -----------------------------------------------------------------------------
   RM-065: New website panel - client, type, add-ons and what it costs
   ----------------------------------------------------------------------------- */
.new-website__loading { padding: 24px 4px; color: var(--text-muted); font-size: var(--font-size-base); }
/* Each section of the New website panel is its own card: 5px corners, no shadow, no dividers. */
.new-website--cards { display: flex; flex-direction: column; gap: 12px; }
.new-website--cards .form-section,
.new-website--cards .form-section:first-child,
.new-website--cards .form-section:last-child {
    padding: 16px; border: 1px solid var(--border-subtle); border-radius: 5px;
    background: var(--surface-panel); box-shadow: none;
}

/* The two website types as full plan cards: everything each includes on show. */
.new-website__types { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; align-items: stretch; }
@media (max-width: 640px) { .new-website__types { grid-template-columns: 1fr; } }
.new-website__type {
    position: relative; display: grid; grid-template-columns: auto 1fr auto; grid-template-areas: "icon name price" "period period period" "blurb blurb blurb" "features features features" "addons addons addons";
    grid-template-rows: auto auto auto 1fr auto;
    gap: 6px 10px; align-content: stretch; padding: 16px; cursor: pointer;
    border: 1px solid var(--border-subtle); border-radius: 5px; background: var(--surface-panel);
    transition: border-color 0.15s ease, background 0.15s ease;
}
.new-website__type:hover { border-color: var(--accent-border); }
/* The card's pick area is one label (so a click anywhere on it chooses the plan); its add-ons sit below it. */
.new-website__type-pick { display: contents; cursor: pointer; }
.new-website__type.is-unavailable { opacity: 0.55; cursor: not-allowed; }
.new-website__type.is-unavailable .new-website__type-pick { cursor: not-allowed; }
.new-website__type-addons {
    grid-area: addons; display: flex; flex-direction: column; gap: 10px; margin-top: 12px; padding-top: 14px;
    border-top: 1px solid var(--border-subtle); cursor: default;
}
.new-website__type-addons-title { display: flex; flex-direction: column; gap: 2px; font-size: var(--font-size-tiny); font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--text-primary); }
.new-website__type-addons-title small { font-size: var(--font-size-tiny); font-weight: 500; letter-spacing: 0; text-transform: none; color: var(--text-muted); }
.new-website__addon { margin: 0; }

/* RM-065: a website's state, the same everywhere. Active is status-pill--active (green). */
.status-pill--trial   { background: var(--status-warning-tint); color: var(--status-warning); }
.status-pill--expired { background: var(--status-danger-tint); color: var(--status-danger); }
/* In the websites tables the status is a plain tag, no dot (Leone, 16 Oct). */
.website-table .status-pill::before { display: none; }
/* Type (Leone, 16 Oct): the plan's name, only for a live site. */
.website-type-name { font-size: var(--font-size-base); color: var(--text-primary); white-space: nowrap; }
.website-type-name + .website-addons { margin-top: 2px; }
.website-id { font-variant-numeric: tabular-nums; font-size: var(--font-size-small); color: var(--text-secondary); white-space: nowrap; }

/* Monthly / Yearly tabs over a price table (console card and Website Pricing). */
.website-prices__group--tabs { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.website-prices__name { font-weight: 600; white-space: nowrap; }
.website-prices__per-month { font-variant-numeric: tabular-nums; color: var(--text-muted); white-space: nowrap; }

/* Per month or per year, on each plan card. */
.new-website__type-period { grid-area: period; cursor: default; }
.new-website__type-period:empty { display: none; }
.new-website__period {
    display: flex; padding: 3px; margin: 4px 0 2px; gap: 2px;
    border: 1px solid var(--border-subtle); border-radius: 5px; background: var(--surface-subtle);
}
.new-website__period-option {
    flex: 1; padding: 6px 14px; border: 0; border-radius: 4px; background: transparent; cursor: pointer;
    font: inherit; font-size: var(--font-size-base); font-weight: 600; color: var(--text-muted);
}
.new-website__period-option.is-active { background: var(--surface-panel); color: var(--accent); box-shadow: 0 0 0 1px var(--accent-border) inset; }
.new-website__period-option:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.new-website__type input[type="radio"] { position: absolute; opacity: 0; pointer-events: none; }
.new-website__type:has(input:checked) { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.new-website__type:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.new-website__type-icon {
    grid-area: icon; display: inline-flex; width: 32px; height: 32px; align-items: center; justify-content: center;
    border-radius: 5px; background: var(--accent-tint); color: var(--accent);
}
.new-website__type:has(input:checked) .new-website__type-icon { background: var(--accent); color: var(--text-on-dark); }
.new-website__type-name { grid-area: name; align-self: center; font-weight: 700; font-size: var(--font-size-medium); }
.new-website__type-price { grid-area: price; align-self: center; font-weight: 700; font-size: var(--font-size-medium); font-variant-numeric: tabular-nums; padding-right: 26px; }
.new-website__type-price small { font-weight: 500; color: var(--text-muted); font-size: var(--font-size-tiny); }
.new-website__type-blurb { grid-area: blurb; font-size: var(--font-size-small); line-height: 1.45; color: var(--text-muted); }
.new-website__type-check {
    position: absolute; top: 14px; right: 14px; display: inline-flex; width: 18px; height: 18px; align-items: center; justify-content: center;
    border-radius: 50%; border: 1.5px solid var(--border-strong); background: var(--surface-panel); color: transparent;
}
.new-website__type:has(input:checked) .new-website__type-check { border-color: var(--accent); background: var(--accent); color: var(--text-on-dark); }

/* What a plan includes, grouped, with ticks. */
.plan-included { grid-area: features; display: block; margin-top: 8px; padding-top: 4px; }
.plan-included__group {
    display: block; margin: 14px 0 4px; font-size: var(--font-size-tiny); font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--text-primary);
}
.plan-included__group:first-child { margin-top: 0; }
.plan-included__list { display: block; }
.plan-included__row {
    display: grid; grid-template-columns: 16px 1fr auto; gap: 8px; align-items: center; padding: 7px 0; font-size: var(--font-size-small);
    border-bottom: 1px solid var(--border-subtle);
}
.plan-included__tick {
    display: inline-flex; width: 15px; height: 15px; align-items: center; justify-content: center; border-radius: 50%;
    background: var(--status-success-tint); color: var(--status-success);
}
.plan-included__name { color: var(--text-secondary); }
.plan-included__value { font-weight: 600; font-variant-numeric: tabular-nums; color: var(--text-primary); }

.new-website__client { display: flex; flex-direction: column; gap: 8px; }
.new-website__matches {
    display: flex; flex-direction: column; max-height: 240px; overflow-y: auto;
    border: 1px solid var(--border-subtle); border-radius: 5px;
}
.new-website__match {
    display: flex; justify-content: space-between; align-items: center; gap: 10px; text-align: left;
    padding: 9px 12px; border: 0; border-bottom: 1px solid var(--border-subtle); background: transparent;
    font: inherit; font-size: var(--font-size-base); cursor: pointer; color: var(--text-primary);
}
.new-website__match:last-child { border-bottom: 0; }
.new-website__matches:empty { display: none; }
.new-website__match:hover, .new-website__match:focus-visible { background: var(--accent-tint); outline: none; }
.new-website__match small { color: var(--text-muted); font-size: var(--font-size-tiny); white-space: nowrap; }
.new-website__empty { padding: 12px; font-size: var(--font-size-small); color: var(--text-muted); }
.new-website__switch { align-self: flex-start; display: inline-flex; gap: 6px; align-items: center; }
.new-website__chosen {
    display: flex; align-items: center; gap: 10px; padding: 10px 12px;
    border: 1px solid var(--accent-border); border-radius: 5px; background: var(--accent-tint);
}
.new-website__chosen-icon { color: var(--accent); display: inline-flex; }
.new-website__chosen-name { flex: 1; font-weight: 600; font-size: var(--font-size-base); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.new-website__summary { border: 1px solid var(--border-subtle); border-radius: 5px; padding: 6px 14px 12px; }
.new-website__line {
    display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; font-size: var(--font-size-base);
    border-bottom: 1px dashed var(--border-subtle); font-variant-numeric: tabular-nums;
}
.new-website__line--total { border-bottom: 0; font-weight: 700; font-size: var(--font-size-base); }
.new-website__note { margin: 6px 0 0; font-size: var(--font-size-small); line-height: 1.5; color: var(--text-muted); }
.new-website__terms {
    display: flex; gap: 8px; align-items: flex-start; margin-top: 10px; padding: 10px 12px;
    border: 1px solid var(--border-subtle); border-radius: 5px; background: var(--surface-subtle);
    font-size: var(--font-size-small); line-height: 1.5; color: var(--text-secondary);
}
.new-website__terms-icon { display: inline-flex; color: var(--accent); margin-top: 1px; }

@media (max-width: 640px) {
    .new-website__types { grid-template-columns: minmax(0, 1fr); }
}

/* -----------------------------------------------------------------------------
   RM-065: the agency's own websites, one flat list
   ----------------------------------------------------------------------------- */
/* Website, Client, Type, Project ID, Website ID, Status, Charge, Manage, actions. */
.website-table--agency .website-address { font-size: var(--font-size-tiny); color: var(--text-muted); margin-top: 2px; }
.website-client { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-primary); }
.website-addons, .website-status-detail {
    display: block; margin-top: 3px; font-size: var(--font-size-tiny); color: var(--text-muted);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.website-price { font-weight: 600; font-variant-numeric: tabular-nums; }
.website-table--agency .data-table__numeric { text-align: right; }
.website-row--focused td { background: var(--accent-tint); }

/* -----------------------------------------------------------------------------
   RM-065: Website Metrics on the console organisation, and the overview
   ----------------------------------------------------------------------------- */
.agency-sites__tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 4px 0 16px; }
.agency-sites__tile {
    display: flex; flex-direction: column; gap: 3px; padding: 12px 14px;
    border: 1px solid var(--border-subtle); border-radius: 5px; background: var(--surface-panel);
}
.agency-sites__label { font-size: var(--font-size-tiny); font-weight: 600; letter-spacing: 0.03em; text-transform: uppercase; color: var(--text-muted); }
.agency-sites__value { font-size: var(--font-size-large); line-height: 1.2; font-variant-numeric: tabular-nums; color: var(--text-primary); }
.agency-sites__note { font-size: var(--font-size-small); color: var(--text-muted); }
.agency-sites__tile--accent { background: var(--accent-tint); border-color: var(--accent-border); }
.agency-sites__tile--accent .agency-sites__value { color: var(--accent); }
.agency-sites__tile--success .agency-sites__value { color: var(--status-success); }
.agency-sites__tile--danger { border-color: var(--status-danger); }
.agency-sites__tile--danger .agency-sites__value { color: var(--status-danger); }
.agency-sites__tile--warning { border-color: var(--status-warning); }
.agency-sites__tile--warning .agency-sites__value { color: var(--status-warning); }
.website-overview__tiles .agency-sites__note { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.agency-sites__owed { margin: 0 0 16px; }
.agency-sites__heading { margin-top: 16px; }
/* RM-065: Website Pricing (Websites > Settings) */
.website-pricing [data-pricing-body] { padding: var(--content-gap-top) var(--gutter) var(--gutter); max-width: 980px; overflow-y: auto; }
.website-pricing__table { table-layout: fixed; }
.website-pricing__table th:nth-child(1), .website-pricing__table td:nth-child(1) { width: 34%; }
.website-pricing__table th:nth-child(2), .website-pricing__table td:nth-child(2) { width: 22%; }
.website-pricing__table th:nth-child(3), .website-pricing__table td:nth-child(3) { width: 24%; }
.website-pricing__table td:nth-child(3) .website-prices__money { max-width: 150px; }
.website-pricing__markup { margin: 0 0 18px; padding: 14px; border: 1px solid var(--border-subtle); border-radius: 5px; background: var(--accent-tint); }
.website-pricing__markup-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 6px; }
/* Mark-up: the AM notched field, with its % on the same line. */
.website-pricing__markup-field { flex: 0 0 240px; margin: 0; }
.kudio-field .website-prices__money { height: 28px; gap: 4px; }
.kudio-field .website-prices__money .kudio-field__control.form-field__control { width: 100%; height: 28px; }
.website-pricing__table td:nth-child(2) { color: var(--text-muted); font-variant-numeric: tabular-nums; }
.website-pricing__muted { color: var(--text-muted); }
.website-pricing__loss { color: var(--status-danger); font-weight: 600; }
.website-pricing__readonly { margin: 14px 0 0; font-size: var(--font-size-base); color: var(--text-muted); }
.website-prices__apply { display: grid; gap: 8px; margin: 16px 0 4px; padding: 12px 14px; border: 1px solid var(--border-subtle); border-radius: 5px; }
.website-prices__apply legend { padding: 0 4px; font-size: var(--font-size-small); font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.03em; }
.website-prices__apply label { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; font-size: var(--font-size-base); }
.website-prices__apply input { margin-top: 3px; accent-color: var(--accent); }
.website-prices__apply .form-field__hint { display: block; margin-top: 2px; }
/* A table cell stays a table cell: a flex cell leaves the row and covers its neighbour. */
.agency-sites__actions { text-align: right; white-space: nowrap; }
.agency-sites__actions > * { vertical-align: middle; }
.agency-sites__actions > * + * { margin-left: 6px; }
.agency-sites__hint { margin: 0 0 12px; font-size: var(--font-size-base); color: var(--text-muted); }
.agency-sites__emails-form {
    display: grid; grid-template-columns: minmax(160px, 2fr) minmax(140px, 1.4fr) minmax(120px, 1fr) auto;
    gap: 10px; align-items: end; margin: 0 0 14px; padding: 12px 14px;
    border: 1px solid var(--border-subtle); border-radius: 5px; background: var(--surface-subtle);
}
.agency-sites__emails-form .form-field { margin: 0; }
@media (max-width: 720px) { .agency-sites__emails-form { grid-template-columns: 1fr; } }
.website-overview__tiles { grid-template-columns: repeat(6, minmax(0, 1fr)); margin-top: 16px; }
/* Website, Agency, Client, Type, Project ID, Website ID, Status, Price, Simvoly cost, Edit. */
.website-table--overview { table-layout: fixed; width: 100%; }
.website-table--overview .website-name, .website-table--overview .website-address { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 1100px) { .website-overview__tiles { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); } }
.agency-sites__sub { display: block; margin-top: 2px; font-size: var(--font-size-tiny); color: var(--text-muted); }
.agency-sites__switch { display: inline-flex; gap: 4px; padding: 3px; border-radius: 5px; background: var(--surface-subtle); }
.agency-sites__switch button {
    border: 0; background: transparent; padding: 6px 12px; border-radius: 5px; font: inherit; font-size: var(--font-size-base);
    cursor: pointer; color: var(--text-secondary);
}
.agency-sites__switch button[aria-pressed="true"] { background: var(--surface-panel); color: var(--accent); font-weight: 600; box-shadow: inset 0 0 0 1px var(--border-default); }
@media (max-width: 760px) { .agency-sites__tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* The Manage trigger keeps its chevron sized to the small button. */
.am-btn.website-manage__trigger .icon { width: 13px; height: 13px; }
/* The dialog's buttons sit level with each other. */
.system-dialog__actions .am-btn { min-width: 84px; }

/* Manage and Web Builder sit side by side in one cell (16 Oct). */
.website-row-actions { display: flex; align-items: center; gap: 8px; flex-wrap: nowrap; }

/* Column widths follow the column, not its position, so moving a column with
   the gear keeps its width (16 Oct). Manage and the console's editor stay last. */
.website-table--agency th[data-col="website"] { width: 13%; }
.website-table--agency th[data-col="domain"] { width: 12%; }
.website-table--agency th[data-col="client"] { width: 11%; }
.website-table--agency th[data-col="project_id"] { width: 8%; }
.website-table--agency th[data-col="website_id"] { width: 8%; }
.website-table--agency th[data-col="type"] { width: 8%; }
.website-table--agency th[data-col="status"] { width: 12%; }
.website-table--agency th[data-col="charge"] { width: 9%; }
/* Manage and Web Builder side by side need a fixed width; a percentage cut
   Web Builder off at the right edge on a laptop. The other columns share the
   rest in their proportions. */
.website-table--agency th.website-manage-heading { width: 248px; }
/* Nine columns with the shared 18px cell padding left the identifiers about
   forty pixels to print seven digits in. Tighter cells, and below the width
   that holds them all the list scrolls sideways in its card instead of
   cutting every value short. */
.website-table--agency { min-width: 1080px; }
.website-table--agency th:not(:first-child):not(:last-child),
.website-table--agency td:not(:first-child):not(:last-child) { padding-left: 12px; padding-right: 12px; }

/* A fixed layout gives every column its share and no more, so a long
   heading, identifier, plan name or yearly price is cut short inside its own
   cell rather than printed across the next one. */
.website-table thead th { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.website-id, .website-type-name, .website-price {
    display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.website-table--overview th[data-col="website"] { width: 14%; }
.website-table--overview th[data-col="domain"] { width: 12%; }
.website-table--overview th[data-col="agency"] { width: 9%; }
.website-table--overview th[data-col="client"] { width: 8%; }
.website-table--overview th[data-col="project_id"] { width: 7%; }
.website-table--overview th[data-col="website_id"] { width: 7%; }
.website-table--overview th[data-col="type"] { width: 7%; }
.website-table--overview th[data-col="status"] { width: 9%; }
.website-table--overview th[data-col="price"] { width: 6%; }
.website-table--overview th[data-col="cost"] { width: 8%; }
.website-table--overview th:last-child { width: 13%; }

/* Toolbar: the title on the left, search, Refresh and New website on the right. */
.website-toolbar__title { margin: 0; white-space: nowrap; }
.website-toolbar .filter-field { width: 300px; flex: 0 1 300px; }

/* How old the copied list is, beside the title it describes. The list is a
   copy of the website builder's (CLAUDE.md, data layer), so its age is always
   on show, phones included: it is what tells somebody to press Refresh. */
.website-sync-status {
    flex: 0 1 auto;
    min-width: 0;
    font-size: var(--font-size-tiny);
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.website-sync-status:empty { display: none; }

@media (max-width: 560px) {
    /* The title and its sync time share the first row, the search takes the
       next, and Refresh and New website split the last for thumb reach. */
    .website-toolbar .website-toolbar__title { flex: 0 0 auto; }
    .website-toolbar .website-sync-status { flex: 1 1 0; text-align: right; }
    .website-toolbar > .am-btn { flex: 1 0 auto; justify-content: center; }
}

/* Status chips under the tiles: All, Active, Trial, Expired (button kit). */
.website-chips { display: flex; flex-wrap: wrap; gap: 8px; padding: 14px var(--gutter) 2px; }
/* The connected domain: blue, opens the live site in a new tab. */
.website-domain { color: var(--accent); font-weight: 500; text-decoration: none; overflow-wrap: anywhere; }
.website-domain:hover { text-decoration: underline; text-underline-offset: 3px; }
.website-domain--none { color: var(--text-muted); font-weight: 400; }
.website-overview__summary .website-overview__tiles { padding: 0 var(--gutter); }

/* AM Dark Navy on the New website panel and Website Pricing (Leone, 16 Oct):
   the accent these screens were drawn with becomes the navy, so every pick,
   tick, toggle and focus ring follows. */
.new-website, .website-pricing {
    --accent: var(--am-blue);
    --accent-border: var(--am-blue-soft-hover);
    --accent-tint: var(--am-blue-tint);
}
/* The Business and eCommerce cards on a soft background. */
.new-website__type { background: var(--am-blue-tint); border-color: var(--border-default); }
.new-website__type:hover { border-color: var(--border-strong); }
.new-website__type:has(input:checked) { background: var(--am-blue-tint); }
.new-website__type .plan-included__row { border-bottom-color: var(--border-default); }
.new-website__type-icon { background: var(--am-blue-soft); }
.new-website__type .new-website__period { background: var(--surface-panel); border-color: var(--border-default); }
.new-website__type .new-website__period-option.is-active { background: var(--am-blue); color: var(--text-on-dark); box-shadow: none; }

/* Website Pricing: the full width, and Monthly / Yearly as the app's own tabs. */
.website-pricing [data-pricing-body] { max-width: none; }
.record-tabs.website-pricing__tabs { margin: 0 0 14px; padding: 0; }

@media (max-width: 560px) {
    /* The price inputs are sized down for the table (platform-logs.css), which
       outranks the shared 16px phone rule; iOS would zoom the page on focus. */
    .website-pricing .website-prices .form-field__control,
    .website-pricing #pricingMarkup { font-size: 16px; }
    .website-pricing__markup-field { flex: 1 1 100%; }
    /* The margin is the two prices beside it subtracted, so on a phone it
       goes, and the price the agency types in comes back on screen instead
       of sitting past the right edge of a sideways-scrolling table. */
    .website-pricing .website-pricing__table { min-width: 0; }
    .website-pricing__table th:nth-child(4),
    .website-pricing__table td:nth-child(4) { display: none; }
    .website-pricing__table th:nth-child(1), .website-pricing__table td:nth-child(1) { width: 36%; }
    .website-pricing__table th:nth-child(2), .website-pricing__table td:nth-child(2) { width: 26%; }
    .website-pricing__table th:nth-child(3), .website-pricing__table td:nth-child(3) { width: 38%; }
    .website-pricing__table .website-prices__money .form-field__control { width: 100%; min-width: 0; }
    .website-pricing__markup-row > .am-btn { flex: 1 0 auto; justify-content: center; }
}

/* Connect a domain (RM-041 step 10), in AM Dark Navy. */
.connect-domain { --accent: var(--am-blue); --accent-tint: var(--am-blue-tint); --accent-border: var(--am-blue-soft-hover); display: flex; flex-direction: column; gap: 16px; }
.connect-domain__choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; }
.connect-domain__choice {
    display: flex; align-items: flex-start; gap: 10px; padding: 14px; text-align: left;
    border: 1px solid var(--border-default); border-radius: var(--radius-medium); background: var(--surface-panel); font: inherit; color: var(--text-primary); cursor: pointer;
}
.connect-domain__choice .icon { flex: 0 0 auto; margin-top: 1px; color: var(--am-blue); opacity: 0.6; }
.connect-domain__choice:hover { border-color: var(--border-strong); }
.connect-domain__choice--on { border-color: var(--am-blue); box-shadow: inset 0 0 0 1px var(--am-blue); background: var(--am-blue-tint); }
.connect-domain__choice--on .icon { opacity: 1; }
.connect-domain__choice:focus-visible { outline: none; box-shadow: var(--am-focus); }
.connect-domain__choice-text { display: flex; flex-direction: column; gap: 2px; }
.connect-domain__choice-text strong { font-size: var(--font-size-base); font-weight: 600; }
.connect-domain__choice-text small { font-size: var(--font-size-small); color: var(--text-muted); }
/* The chosen way in, ruled off from the choices above it rather than boxed:
   the panel is already the card (CLAUDE.md, one white sheet). */
.connect-domain__section { display: flex; flex-direction: column; gap: 12px; padding-top: 16px; border-top: var(--divider-width) solid var(--divider-colour); }
.connect-domain__note, .connect-domain__muted { margin: 0; font-size: var(--font-size-base); line-height: 1.5; color: var(--text-muted); }
.connect-domain__go { align-self: flex-start; }
.connect-domain__done { display: flex; gap: 12px; padding: 14px 16px; border-radius: 5px; background: var(--status-success-tint); }
.connect-domain__done-icon { color: var(--status-success); }
.connect-domain__done strong { display: block; font-size: var(--font-size-base); color: var(--text-primary); }
.connect-domain__done p { margin: 4px 0 0; font-size: var(--font-size-base); color: var(--text-muted); }
.connect-domain__records { border: 1px solid var(--border-default); border-radius: 5px; overflow: hidden; }
.connect-domain__record { display: grid; grid-template-columns: 70px 70px minmax(0, 1fr) 120px 40px; align-items: center; gap: 10px; padding: 10px 12px; border-top: 1px solid var(--border-subtle); font-size: var(--font-size-base); }
.connect-domain__record:first-child { border-top: 0; }
.connect-domain__record--head { background: var(--surface-subtle); font-size: var(--font-size-tiny); font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--text-muted); }
.connect-domain__record code { font-family: var(--font-monospace); font-size: var(--font-size-small); overflow-wrap: anywhere; }
.connect-domain__type { justify-self: start; padding: 2px 8px; border-radius: 4px; background: var(--am-blue-soft); font-size: var(--font-size-tiny); font-weight: 600; color: var(--am-blue-ink); }
.connect-domain__state { font-size: var(--font-size-small); font-weight: 600; }
.connect-domain__state--wait { color: var(--text-muted); font-weight: 500; }
.connect-domain__state--ok { color: var(--status-success); }
.connect-domain__state--bad { color: var(--status-warning); }
@media (max-width: 560px) {
    .connect-domain__record { grid-template-columns: 60px minmax(0, 1fr) 36px; }
    .connect-domain__record > :nth-child(3), .connect-domain__record > :nth-child(4) { grid-column: 2; }
    .connect-domain__record--head { display: none; }
    .connect-domain__go { align-self: stretch; justify-content: center; }
}

/* =============================================================================
   RM-124: websites linked to organisations, contacts and projects
   ============================================================================= */

/* The "+N" after an owner in All Websites: more links than the one named. */
.website-client__more { margin-left: 4px; font-size: var(--font-size-tiny); font-weight: 600; color: var(--text-muted); }

/* ---- A record's Websites list (organisation form, record Websites tabs) ----- */
.website-record-links { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.website-record-links__header { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.website-record-links__title { font-size: var(--font-size-small); font-weight: 600; color: var(--text-secondary); }
.website-record-links__list { display: flex; flex-direction: column; margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--border-subtle); }
.website-record-links__row { display: flex; align-items: flex-start; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--border-subtle); min-width: 0; }
.website-record-links__glyph { flex: 0 0 auto; margin-top: 1px; color: var(--text-muted); }
.website-record-links__main { display: flex; flex-direction: column; gap: 2px; flex: 1 1 auto; min-width: 0; }
.website-record-links__name { font-size: var(--font-size-base); font-weight: 600; color: var(--text-primary); overflow-wrap: anywhere; }
.website-record-links__address { font-size: var(--font-size-small); color: var(--text-muted); overflow-wrap: anywhere; }
.website-record-links__identifiers { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 2px; }
.website-record-links__identifier { display: inline-flex; align-items: center; gap: 4px; font-size: var(--font-size-tiny); color: var(--text-muted); }
.website-record-links__identifier code { font-family: var(--font-monospace); font-size: var(--font-size-small); color: var(--text-primary); }
.website-record-links__copy,
.website-record-links__unlink {
    display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto;
    padding: 3px; border: 1px solid transparent; border-radius: var(--radius-small);
    background: none; color: var(--text-muted); cursor: pointer;
    transition: background var(--duration-instant) var(--easing-standard), color var(--duration-instant) var(--easing-standard);
}
.website-record-links__copy:hover { background: var(--surface-subtle); color: var(--text-primary); }
.website-record-links__unlink { padding: 6px; }
.website-record-links__unlink:hover { background: var(--status-danger-tint); color: var(--status-danger); }
.website-record-links__copy:focus-visible,
.website-record-links__unlink:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.website-record-links__empty { padding: 10px 0; font-size: var(--font-size-small); color: var(--text-muted); border-bottom: 1px solid var(--border-subtle); }
.website-record-links__error,
.website-picker__error,
.website-link-panel__error { margin: 0; font-size: var(--font-size-small); color: var(--status-danger); }
.website-record-links__inline-picker { padding-top: 10px; border-top: var(--divider-width) solid var(--divider-colour); }

/* ---- The website picker (beside a record, or inside its list) -------------- */
.website-picker { display: flex; flex-direction: column; gap: 10px; }
.website-picker__note { margin: 0; font-size: var(--font-size-small); line-height: 1.5; color: var(--text-muted); }
.website-picker__results { display: flex; flex-direction: column; border-top: 1px solid var(--border-subtle); }
.website-picker__empty { margin: 0; padding: 12px 0; font-size: var(--font-size-small); color: var(--text-muted); }
.website-picker__cancel { align-self: flex-start; }

.website-picker__result,
.website-link-panel__result {
    display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 6px;
    border: 0; border-bottom: 1px solid var(--border-subtle); background: none;
    font: inherit; text-align: left; color: var(--text-primary); cursor: pointer;
    transition: background var(--duration-instant) var(--easing-standard);
}
.website-picker__result:hover,
.website-link-panel__result:hover { background: var(--accent-tint); }
.website-picker__result:focus-visible,
.website-link-panel__result:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.website-picker__result:disabled,
.website-link-panel__result:disabled { opacity: 0.6; cursor: progress; }
.website-picker__result-glyph { flex: 0 0 auto; color: var(--text-muted); }
.website-picker__result-text,
.website-link-panel__result-text { display: flex; flex-direction: column; gap: 2px; flex: 1 1 auto; min-width: 0; }
.website-picker__result-name,
.website-link-panel__result-name { font-size: var(--font-size-base); font-weight: 600; overflow-wrap: anywhere; }
.website-picker__result-detail,
.website-link-panel__result-detail { font-size: var(--font-size-small); color: var(--text-muted); overflow-wrap: anywhere; }
.website-picker__result-action,
.website-link-panel__result-action { display: inline-flex; align-items: center; gap: 4px; flex: 0 0 auto; font-size: var(--font-size-small); font-weight: 600; color: var(--accent); }

/* ---- Link website (Manage > Link) ------------------------------------------ */
/* One white sheet, sections ruled off rather than boxed (CLAUDE.md section 3). */
.website-link-panel { display: flex; flex-direction: column; }
.website-link-panel__section { display: flex; flex-direction: column; gap: 10px; padding: 18px 0; border-top: var(--divider-width) solid var(--divider-colour); }
.website-link-panel__section:first-child { padding-top: 0; border-top: 0; }
.website-link-panel__heading { display: flex; align-items: flex-start; gap: 10px; }
.website-link-panel__badge {
    display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto;
    width: 30px; height: 30px; border-radius: var(--radius-medium); background: var(--accent-tint); color: var(--accent);
}
.website-link-panel__heading-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.website-link-panel__title { margin: 0; font-size: var(--font-size-medium); font-weight: 600; color: var(--text-primary); }
.website-link-panel__description,
.website-link-panel__muted { margin: 0; font-size: var(--font-size-small); color: var(--text-muted); }
.website-link-panel__links { display: flex; flex-direction: column; margin: 0; padding: 0; list-style: none; }
.website-link-panel__links > .website-link-panel__muted { padding: 4px 0; }
/* A column: the row itself, then the Make owner confirm under it when open. */
.website-link-panel__link { display: flex; flex-direction: column; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--border-subtle); min-width: 0; }
.website-link-panel__link:first-child { border-top: 1px solid var(--border-subtle); }
.website-link-panel__link-text { display: flex; flex-direction: column; gap: 1px; flex: 1 1 auto; min-width: 0; }
.website-link-panel__link-name { font-size: var(--font-size-base); font-weight: 500; color: var(--text-primary); overflow-wrap: anywhere; }
.website-link-panel__link-detail { font-size: var(--font-size-tiny); color: var(--text-muted); }
.website-link-panel__remove {
    display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto;
    padding: 6px; border: 1px solid transparent; border-radius: var(--radius-small);
    background: none; color: var(--text-muted); cursor: pointer;
}
.website-link-panel__remove:hover { background: var(--status-danger-tint); color: var(--status-danger); }
.website-link-panel__remove:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.website-link-panel__search { position: relative; }
.website-link-panel__search-icon { position: absolute; top: 50%; left: 10px; transform: translateY(-50%); display: inline-flex; color: var(--text-muted); pointer-events: none; }
.website-link-panel__search .website-link-panel__search-input { width: 100%; padding-left: 32px; }
.website-link-panel__results { display: flex; flex-direction: column; }

/* ---- A project's Website tab ----------------------------------------------- */
.project-website-link { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; margin-bottom: 12px; }
.project-website-link__note { margin: 0; flex: 1 1 240px; font-size: var(--font-size-base); color: var(--text-muted); }
.project-website-link__actions { display: flex; flex-wrap: wrap; gap: 8px; margin-left: auto; }
.project-website-link + .website-record-links__error { margin-bottom: 12px; }

@media (max-width: 560px) {
    .website-picker__result-action > span,
    .website-link-panel__result-action > span { display: none; }
    .project-website-link__actions { width: 100%; margin-left: 0; }
    .project-website-link__actions > .am-btn { flex: 1 1 0; justify-content: center; }
}

/* ---- Make owner (RM-124) --------------------------------------------------- */
/* The owner is billed for the site and is the account the builder opens as. */
.website-owner-badge {
    display: inline-flex; align-items: center; margin-left: 6px; padding: 1px 7px;
    border-radius: var(--radius-pill); background: var(--accent-tint); color: var(--accent);
    font-size: var(--font-size-tiny); font-weight: 600; line-height: 1.5; vertical-align: middle; white-space: nowrap;
}
.website-link-panel__title > span:first-child { overflow-wrap: anywhere; }
.website-link-panel__link-row { display: flex; align-items: center; gap: 10px; min-width: 0; }
.website-link-panel__make-owner { flex: 0 0 auto; }
.website-link-panel__confirm {
    display: flex; flex-direction: column; gap: 8px; padding: 10px 12px;
    border-radius: var(--radius-medium); background: var(--surface-subtle);
}
.website-link-panel__confirm-text { margin: 0; font-size: var(--font-size-small); line-height: 1.5; color: var(--text-primary); }
.website-link-panel__confirm-actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* A record's Websites tab: the links list on top, the table under it. */
.client-websites-tab__links .website-record-links { margin-top: 0; }
.client-websites-tab__table:not(:empty) { margin-top: 18px; }

@media (max-width: 560px) {
    .website-link-panel__link-row { flex-wrap: wrap; }
    .website-link-panel__make-owner { order: 3; flex: 1 1 100%; justify-content: center; }
    .website-link-panel__confirm-actions > .am-btn { flex: 1 1 0; justify-content: center; }
}

/* -----------------------------------------------------------------------------
   The status table on an organisation, contact or project (3 Nov 2026)
   The module's table, sitting straight on the panel's sheet: a panel is
   already a card, so no second card around it. Manage and Web Builder keep a
   fixed width, so they are never pushed past the panel's edge; below the width
   that holds every column the table scrolls inside its own box.
   ----------------------------------------------------------------------------- */
.website-list-scroll--record {
    flex: none;
    margin: 0;
    background: transparent;
    border: 0;
    border-radius: 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.website-table--record { min-width: 640px; width: 100%; }
.website-table--record thead th:first-child,
.website-table--record tbody td:first-child { padding-left: 0; }
.website-table--record thead th:last-child,
.website-table--record tbody td:last-child { padding-right: 0; }
.website-table--record th:not(:first-child):not(:last-child),
.website-table--record td:not(:first-child):not(:last-child) { padding-left: 12px; padding-right: 12px; }
.website-table--record th[data-col="website"] { width: 28%; }
.website-table--record th[data-col="domain"] { width: 22%; }
.website-table--record th[data-col="status"] { width: 18%; }
.website-table--record th[data-col="renews"] { width: 14%; }
.website-table--record th.website-manage-heading { width: 232px; }
.website-table--record .website-address { font-size: var(--font-size-tiny); color: var(--text-muted); margin-top: 2px; }
.website-table--record .website-row-actions { justify-content: flex-end; }
.website-table--record th.website-manage-heading { text-align: right; }
