/* Operator-only styles. Colors, type, buttons, inputs, bars, cards, notices and
   errors live in static/4thco/base.css, which loads first on every page. */

/* Operators work on laptops too, so give the column a little more room. */
.page{
    max-width:560px;
}

.page-intro{
    color:rgba(var(--text-rgb),0.8);
}

/* Forms stack like the shopper flow: full-width fields with even spacing. */
form{
    width:100%;
    display:flex;
    flex-direction:column;
    gap:16px;
}

/* Submits are "continue" actions, which are blue on the shopper side. */
.page button[type="submit"]{
    background:var(--blue);
    color:var(--bg);
}

.btn-note{
    font-size:0.875rem;
    color:rgba(var(--text-rgb),0.7);
    margin-top:-8px;
}

/* Plan terms and locations are tappable slate cards; the picked one turns blue. */
.option-list{
    width:100%;
    display:flex;
    flex-direction:column;
    gap:12px;
}

.plan-option,
.location-option,
.check-option{
    width:100%;
    display:flex;
    align-items:center;
    gap:16px;
    padding:16px;
    text-align:left;
    background:var(--brand-slate);
    border:1px solid var(--text);
    cursor:pointer;
}

.plan-option:has(input:checked),
.location-option:has(input:checked),
.check-option:has(input:checked){
    border-color:var(--blue);
    box-shadow:inset 0 0 12px rgba(var(--blue-rgb),0.35);
}

.plan-option-text{
    display:flex;
    flex-direction:column;
    gap:2px;
}

.plan-term{
    font-weight:600;
}

.plan-price{
    font-size:0.875rem;
    color:var(--blue);
}

.plan-current{
    width:100%;
    padding:16px;
    text-align:center;
    background:var(--brand-slate);
    border:1px solid var(--blue);
}

.location-count{
    width:100%;
    text-align:center;
}

/* Number box sized like the shopper cart qty box, centered since it sits alone. */
#locationCount{
    width:100px;
    align-self:center;
    text-align:center;
    color:var(--blue);
    border-color:var(--blue);
}

#locationNames{
    width:100%;
    display:flex;
    flex-direction:column;
    gap:12px;
}

.location-name-row{
    display:flex;
    align-items:center;
    gap:12px;
}

.location-num{
    width:36px;
    flex-shrink:0;
    font-weight:600;
    color:var(--blue);
    text-align:left;
}

/* First-payment summary reads like the shopper receipt totals. */
.charge-summary{
    width:100%;
    max-width:none;
    display:flex;
    flex-direction:column;
    gap:6px;
    margin-top:24px;
    text-align:center;
    font-size:0.9rem;
}

#summaryTotal{
    border-top:1px solid rgba(var(--text-rgb),0.2);
    margin-top:6px;
    padding-top:10px;
    font-size:1.05rem;
    color:var(--blue);
}

/* Service picker: each service is a full-width slate card. */
.service-list{
    list-style:none;
    width:100%;
    display:flex;
    flex-direction:column;
    gap:16px;
}

.service-list a{
    width:100%;
    max-width:none;
    display:flex;
    flex-direction:column;
    gap:4px;
    text-decoration:none;
    color:var(--text);
    font-size:1.1rem;
    font-weight:600;
}

.service-list a:hover{
    border-color:var(--blue);
}

.service-lapsed{
    font-size:0.875rem;
    font-weight:500;
    color:var(--red);
}

/* Bottom bar nav: text links where the shopper side has icons. */
.bar-link{
    color:var(--text);
    font-size:0.875rem;
    font-weight:600;
    text-decoration:none;
    text-align:center;
    padding:8px;
}

.bar-link-red{
    color:var(--red);
}

/* Pages without a bottom bar don't need room reserved for one. */
.page:not(:has(~ .bottom-bar)){
    padding-bottom:24px;
}

/* Dashboard pages use the full screen width instead of the narrow form column. */
.page.page-wide{
    max-width:none;
}

/* Two large tiles. Desktop: half the screen wide each, side by side, and half the height
   between the navbar and bottom bar so the whole dashboard fits without scrolling.
   Phones: stacked full width and square. */
.dash-tiles{
    width:100%;
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:24px;
}

.page .dash-tile{
    height:calc((100dvh - var(--navbar-height,72px) - clamp(60px,10vh,100px)) * 0.5);
    border:1px solid var(--text);
    background:transparent;
    display:flex;
    flex-direction:column;
    align-items:center;
    justify-content:center;
    gap:16px;
    color:var(--text);
    text-decoration:none;
    transition:border-color 0.15s,box-shadow 0.15s;
}

.page a.dash-tile:hover{
    border-color:var(--blue);
    box-shadow:inset 0 0 16px rgba(var(--blue-rgb),0.35);
}

.dash-tile img{
    width:30%;
    max-width:140px;
    height:auto;
}

.dash-tile-label{
    font-size:1.25rem;
    font-weight:600;
}

@media (max-width:700px){
    .dash-tiles{
        grid-template-columns:1fr;
    }

    .page .dash-tile{
        height:auto;
        aspect-ratio:1 / 1;
    }
}

/* Dashboard alert bar: edge to edge directly under the navbar, red like the shopper
   stop/back buttons, and as tall as its text needs. Must be the first thing in the page. */
.alert-bar{
    width:calc(100% + 48px);
    margin:-24px -24px 0;
    padding:16px 24px;
    background:var(--red);
    color:var(--bg);
    text-align:center;
    display:flex;
    flex-direction:column;
    gap:4px;
}

.page .alert-bar a{
    color:var(--bg);
    font-weight:600;
}

/* Item Management: one line per item that never grows past the screen. Long names and
   UPCs are cut off with "..." until the box is tapped, which jumps the cursor to the end.
   The bottom padding clears the bottom bar plus the fixed Add Item button above it. */
.page.page-items{
    max-width:800px;
    padding-bottom:calc(clamp(60px,10vh,100px) + 52px + 16px + 48px);
}

#itemList{
    width:100%;
    display:flex;
    flex-direction:column;
    gap:8px;
}

.item-head,
.item-line{
    width:100%;
    display:flex;
    align-items:center;
    gap:8px;
}

.item-head{
    white-space:nowrap;
    font-size:0.75rem;
    font-weight:600;
    color:rgba(var(--text-rgb),0.7);
    text-transform:uppercase;
}

.item-head .item-col-name,
.item-head .item-col-upc{
    text-align:left;
    padding-left:12px;
}

.item-line{
    padding:8px;
    background:var(--brand-slate);
    border:1px solid var(--text);
}

.item-head{
    padding:0 9px;
}

.item-col-check{
    width:48px;
    flex-shrink:0;
    display:flex;
    justify-content:center;
}

/* Name takes what's left; UPC gets a fixed share so every line lines up. */
.item-col-name{
    flex:1;
    min-width:0;
}

.item-col-upc{
    width:32%;
    max-width:180px;
    flex-shrink:0;
}

.item-line input[type="text"]{
    height:40px;
    padding:0 12px;
    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
}

.item-line input.input-error{
    border-color:var(--red);
}

/* Inactive items stay editable but read as switched off. */
.item-line.item-off input[type="text"]{
    color:rgba(var(--text-rgb),0.5);
}

/* Brief blue glow on the line a search result jumps to. */
.item-line.item-found{
    animation:itemFound 1.6s ease-out;
}

@keyframes itemFound{
    0%,40%{
        border-color:var(--blue);
        box-shadow:inset 0 0 12px rgba(var(--blue-rgb),0.6);
    }
    100%{
        border-color:var(--text);
        box-shadow:none;
    }
}

/* Add Item sits fixed just above the bottom bar, as wide as the page column. The bar
   behind it fades from clear to the page color so lines scroll away under it. */
#addItemBar{
    position:fixed;
    left:0;
    bottom:clamp(60px,10vh,100px);
    width:100%;
    padding:48px 24px 16px;
    background:linear-gradient(to bottom,rgba(var(--bg-rgb),0),var(--bg) 48px);
    z-index:400;
    pointer-events:none;
}

/* Outlined like other optional buttons, over a solid page-color backing so the list
   scrolling under it never shows through. */
.page a#addItemBtn{
    display:flex;
    max-width:752px;
    margin:0 auto;
    background-color:var(--bg);
    pointer-events:auto;
}

.page a#addItemBtn:hover{
    background:linear-gradient(rgba(var(--blue-rgb),0.12),rgba(var(--blue-rgb),0.12)),var(--bg);
}

.page a#addItemBtn:active{
    background:linear-gradient(rgba(var(--blue-rgb),0.25),rgba(var(--blue-rgb),0.25)),var(--bg);
}

@media (max-width:480px){
    .item-head,
    .item-line{
        gap:6px;
    }

    .item-col-check{
        width:40px;
    }

    .item-head{
        font-size:0.625rem;
    }

    .item-line input[type="text"]{
        padding:0 8px;
    }

    .item-head .item-col-name,
    .item-head .item-col-upc{
        padding-left:8px;
    }
}

/* Add Item form: labels sit above their boxes, left aligned like the item list. */
#addItemForm .field label,
.field-note{
    text-align:left;
}

.field-note{
    font-size:0.75rem;
    color:rgba(var(--text-rgb),0.7);
}

/* Save in the bottom bar: a blue button sized to its word, beside the back arrow. */
/* Save: 4th Co. Light Grey While Nothing Has Changed, Brand Blue Once There's Something to Save */
.bottom-bar button.bar-save{
    width:auto;
    min-height:44px;
    padding:0 40px;
    background:var(--text);
    color:var(--bg);
    transition:background 0.2s;
}

.bottom-bar button.bar-save.has-changes{
    background:var(--blue);
}

/* Location page: a little wider than the form column so the inventory tile reads as a
   tile, with the detail boxes left aligned like Add Item. */
.page.page-location{
    max-width:800px;
}

/* Full-width version of the dashboard tiles, a quarter of the space between the bars.
   Arrow beside the label instead of above it, so it fits the shorter height. */
.page .dash-tile.dash-tile-wide{
    width:100%;
    height:calc((100dvh - var(--navbar-height,72px) - clamp(60px,10vh,100px)) * 0.25);
    min-height:110px;
    flex-direction:row;
    gap:24px;
    padding:0 24px;
}

.dash-tile.dash-tile-wide img{
    width:auto;
    height:45%;
    max-width:none;
}

.location-fields{
    width:100%;
    display:flex;
    flex-direction:column;
    gap:16px;
}

.location-fields label,
.location-fields .field-note{
    text-align:left;
}

.location-fields input.input-error{
    border-color:var(--red);
}

/* Leave-without-saving confirm (built by unsaved.js): the shopper side's confirm box, blue to
   stay, red to leave. */
#confirmModal{
    display:none;
    position:fixed;
    inset:0;
    background:rgba(var(--bg-rgb),0.7);
    align-items:center;
    justify-content:center;
    padding:24px;
    z-index:1600;
}

#confirmModal.active{
    display:flex;
}

#confirmModalInner{
    background:var(--bg);
    border:1px solid var(--text);
    box-shadow:0 24px 36px -6px rgba(var(--brand-slate-rgb),0.6);
    padding:32px;
    width:100%;
    max-width:360px;
    text-align:center;
    display:flex;
    flex-direction:column;
    align-items:center;
    gap:16px;
}

#confirmText{
    font-size:1.1rem;
    font-weight:600;
}

#leaveStay{
    background:var(--blue);
    color:var(--bg);
}

#leaveGo{
    background:var(--red);
    color:var(--bg);
}

/* Location Inventory: item names left of a center line, this location's price right of it
   on the same row. Rows not sold here are just an empty box. */
#inventoryList{
    position:relative;
    width:100%;
    display:flex;
    flex-direction:column;
    gap:8px;
}

/* The center line: one unbroken line down the whole list, header to last row, through the
   gaps between rows. Every row splits into two equal halves, so it always sits on the split. */
#inventoryList:has(.inv-line)::before{
    content:"";
    position:absolute;
    top:0;
    bottom:0;
    left:50%;
    width:1px;
    background:var(--text);
    pointer-events:none;
}

.inv-head,
.inv-line{
    width:100%;
    display:grid;
    grid-template-columns:1fr 1fr;
    align-items:center;
}

.inv-head{
    font-size:0.75rem;
    font-weight:600;
    color:rgba(var(--text-rgb),0.7);
    text-transform:uppercase;
    padding:0 9px;
}

.inv-line{
    padding:8px 8px;
    background:var(--brand-slate);
    border:1px solid var(--text);
}

.inv-name{
    min-width:0;
    padding-right:12px;
    text-align:left;
    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
}

.inv-fields{
    display:flex;
    gap:8px;
    padding-left:12px;
    align-items:center;
}

.inv-col{
    flex:1;
    min-width:0;
    text-align:left;
}

.inv-head .inv-col{
    padding-left:12px;
}

.inv-line input[type="text"]{
    height:40px;
    padding:0 12px;
}

.inv-line input.input-error{
    border-color:var(--red);
    box-shadow:inset 0 0 8px rgba(var(--red-rgb),0.45);
}

/* Items sold here get the blue edge, like a picked option. */
/* Sold vs not sold, readable at a glance. Sold here: blue-tinted row with a solid blue edge
   and a thick blue bar on the left. Not sold here: no fill, faint dashed edge, dimmed name.
   An unsaved change gets a dashed blue edge until Save (red if it will stop selling). */
.inv-line{
    background:transparent;
    border:1px dashed rgba(var(--text-rgb),0.35);
}

.inv-line .inv-name-text{
    color:rgba(var(--text-rgb),0.65);
}

.inv-line.inv-selling{
    background:rgba(var(--blue-rgb),0.12);
    border:1px solid var(--blue);
    box-shadow:inset 5px 0 0 var(--blue);
    padding-left:13px;
}

.inv-line.inv-selling .inv-name-text{
    color:var(--text);
    font-weight:600;
}

.inv-line.inv-selling input[type="text"]{
    border-color:var(--blue);
    color:var(--blue);
    font-weight:600;
}

.inv-line.inv-pending{
    border:1px dashed var(--blue);
}

.inv-line.inv-stopping{
    border:1px dashed var(--red);
    box-shadow:inset 5px 0 0 var(--red);
}

/* Small status line under a name with an unsaved change. Empty otherwise. */
.inv-status:empty{
    display:none;
}

.inv-status{
    display:block;
    white-space:normal;
    margin-top:2px;
    font-size:0.6875rem;
    font-weight:600;
    text-transform:uppercase;
    letter-spacing:0.04em;
    color:rgba(var(--text-rgb),0.45);
}

.inv-line.inv-pending .inv-status{
    color:var(--blue);
}

.inv-line.inv-stopping .inv-status{
    color:var(--red);
}

/* Section labels: "Sold at This Location" in blue, "Not Sold at This Location" muted, each with
   a small note saying why (has a price / no price). They sit over the center line. */
.inv-group{
    position:relative;
    z-index:1;
    background:var(--bg);
    margin-top:12px;
    padding:4px 0;
    font-size:0.8125rem;
    font-weight:700;
    text-transform:uppercase;
    letter-spacing:0.06em;
    text-align:left;
    color:rgba(var(--text-rgb),0.55);
}

.inv-group-sold{
    color:var(--blue);
}

.inv-group-note{
    display:block;
    margin-top:1px;
    font-size:0.6875rem;
    font-weight:600;
    letter-spacing:0.04em;
    text-transform:none;
    color:rgba(var(--text-rgb),0.55);
}

/* Empty price box: "Not sold" in the box itself, a little fainter than other placeholders. */
.inv-line input[type="text"]::placeholder{
    color:rgba(var(--text-rgb),0.4);
    font-style:italic;
}

/* Key at the top of the inventory page. Each sample uses the same look as a row in the list:
   blue box for sold (has a price), faint dashed box for not sold (no price). */
.inv-key{
    width:100%;
    display:flex;
    flex-direction:column;
    gap:8px;
    padding:12px;
    border:1px solid rgba(var(--text-rgb),0.35);
    text-align:left;
    font-size:0.875rem;
}

.inv-key-row{
    display:flex;
    align-items:center;
    gap:12px;
}

.inv-key-swatch{
    flex:0 0 84px;
    height:32px;
    display:flex;
    align-items:center;
    padding:0 10px;
    border:1px dashed rgba(var(--text-rgb),0.35);
    color:rgba(var(--text-rgb),0.4);
    font-style:italic;
    font-size:0.8125rem;
}

.inv-key-sold .inv-key-swatch{
    background:rgba(var(--blue-rgb),0.12);
    border:1px solid var(--blue);
    box-shadow:inset 4px 0 0 var(--blue);
    padding-left:14px;
    color:var(--blue);
    font-style:normal;
    font-weight:600;
}

.inv-key-sold strong{
    color:var(--blue);
}

.inv-key-help{
    margin:2px 0 0;
    font-size:0.8125rem;
    color:rgba(var(--text-rgb),0.7);
}

.inv-line.item-off .inv-name-text{
    color:rgba(var(--text-rgb),0.45);
}

/* Name on its own line, cut off with "..." if long. Inactive items add a second line:
   the label and a small button to that item in Item Management. */
.inv-name-text{
    display:block;
    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
}

.inv-name:has(.inv-inactive){
    white-space:normal;
}

.inv-inactive{
    display:flex;
    flex-wrap:wrap;
    align-items:center;
    gap:4px 8px;
    margin-top:4px;
    font-size:0.75rem;
    color:var(--red);
}

.page a.inv-manage{
    padding:3px 9px;
    font-size:0.75rem;
    font-weight:600;
}

/* Success line on the page itself, the blue twin of the red .error line. */
.saved-note{
    color:var(--blue);
    font-size:0.875rem;
}

@media (max-width:480px){
    .inv-name{
        padding-right:8px;
        font-size:0.875rem;
    }

    .inv-fields{
        gap:6px;
        padding-left:8px;
    }

    .inv-line input[type="text"]{
        padding:0 8px;
    }

    .inv-head .inv-col{
        padding-left:8px;
    }
}

/* Button with a small picture before its word (Get QR Code). */
.page a.btn-with-icon{
    gap:12px;
}

.btn-icon{
    height:28px;
    width:auto;
    max-width:none;
}

/* Optional actions off the page's main path (Get QR Code, Manage Item, Add Item, Open My Stripe
   Dashboard): blue outline instead of a solid fill — solid fill is only for core actions like Save. Glows on hover like the dashboard tiles, and darkens
   slightly while pressed. */
.page a.btn-outline,
.page a.inv-manage{
    background:transparent;
    border:1px solid var(--blue);
    color:var(--blue);
    text-decoration:none;
    transition:background 0.15s,box-shadow 0.15s,transform 0.05s;
}

.page a.btn-outline:hover,
.page a.inv-manage:hover{
    background:rgba(var(--blue-rgb),0.12);
    box-shadow:inset 0 0 16px rgba(var(--blue-rgb),0.35);
}

.page a.btn-outline:active,
.page a.inv-manage:active{
    background:rgba(var(--blue-rgb),0.25);
    transform:scale(0.98);
}

.page a.btn-outline:focus-visible,
.page a.inv-manage:focus-visible{
    outline:2px solid var(--blue);
    outline-offset:2px;
}

/* Locations and Selling: the location icon sits right before the name, centered together,
   sized and spaced like the QR icon on Get QR Code. */
.service-list a.location-card{
    flex-direction:row;
    align-items:center;
    justify-content:center;
    gap:12px;
}

.location-card-icon{
    height:28px;
    width:auto;
    max-width:none;
    flex-shrink:0;
}

/* Transactions: a little wider than other pages so the three totals and the rows have room. */
.page.page-transactions{
    max-width:720px;
}

/* Three totals in one row on every screen. The amount starts big; the page script shrinks
   it until it fits, so long totals never spill out of the box. */
.tx-stats{
    width:100%;
    display:grid;
    grid-template-columns:repeat(3,minmax(0,1fr));
    gap:8px;
}

.tx-stat{
    min-width:0;
    display:flex;
    flex-direction:column;
    gap:4px;
    padding:12px 8px;
    background:var(--brand-slate);
    border:1px solid var(--text);
}

.tx-stat-label{
    font-size:0.6875rem;
    font-weight:600;
    text-transform:uppercase;
    letter-spacing:0.04em;
    line-height:1.3;
    color:rgba(var(--text-rgb),0.7);
}

.tx-stat-amount{
    display:block;
    overflow:hidden;
    white-space:nowrap;
    font-size:clamp(1.125rem,4.5vw,1.75rem);
    font-weight:700;
    line-height:1.2;
    color:var(--blue);
}

/* Filters: small dropdowns side by side, outlined like the text boxes. */
.page form.tx-filters{
    flex-direction:row;
    gap:8px;
}

.tx-filters select{
    flex:1;
    min-width:0;
    height:40px;
    padding:0 8px;
    font-family:inherit;
    font-size:0.875rem;
    color:var(--text);
    background:var(--bg);
    border:1px solid rgba(var(--text-rgb),0.5);
    border-radius:0;
}

.tx-filters select:focus{
    outline:none;
    border-color:var(--blue);
}

/* One line per payment: when and what on the left, amount, then a small Details button. */
.tx-list{
    width:100%;
    display:flex;
    flex-direction:column;
}

.tx-row{
    display:flex;
    align-items:center;
    gap:12px;
    padding:10px 4px;
    border-bottom:1px solid rgba(var(--text-rgb),0.2);
    text-align:left;
}

.tx-row:first-child{
    border-top:1px solid rgba(var(--text-rgb),0.2);
}

.tx-info{
    flex:1;
    min-width:0;
    display:flex;
    flex-direction:column;
}

.tx-when{
    font-size:0.75rem;
    color:rgba(var(--text-rgb),0.6);
}

.tx-items{
    font-size:0.9375rem;
    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
}

.tx-amount{
    flex-shrink:0;
    font-weight:600;
}

.page a.tx-details{
    flex-shrink:0;
    padding:6px 10px;
    font-size:0.8125rem;
    font-weight:600;
    text-decoration:none;
    color:var(--blue);
    border:1px solid var(--blue);
}

.page a.tx-details:hover{
    background:rgba(var(--blue-rgb),0.12);
}

.tx-pages{
    width:100%;
    display:flex;
    justify-content:space-between;
    align-items:center;
    font-size:0.875rem;
}

/* Phones: location gets its own line so its names aren't cut off; period and sort share the next. */
@media (max-width:480px){
    .page form.tx-filters{
        flex-wrap:wrap;
    }

    .tx-filters select[name="location"]{
        flex-basis:100%;
    }
}

/* Small line under the totals saying which clock the times use. */
.tx-zone{
    margin-top:-8px;
    font-size:0.75rem;
    color:rgba(var(--text-rgb),0.6);
}

/* Refund note under the totals: operators settle refunds with shoppers themselves. */
.tx-refund-note{
    margin:4px 0 16px;
    padding:10px 12px;
    border-left:3px solid var(--blue);
    background:rgba(var(--text-rgb),0.06);
    font-size:0.8rem;
    line-height:1.45;
    text-align:left;
}

/* Outline buttons whose words wrap to two lines on phones get breathing room above and below. */
.page a.btn-outline{
    padding-top:8px;
    padding-bottom:8px;
}

/* Locations page: clear gap between the Manage Subscription note and the location cards below. */
.manage-sub-note{
    margin-bottom:24px;
}

/* Locations page: Add Location and Manage Subscription side by side, stacked on phones. */
.location-actions{
    width:100%;
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:12px;
}

@media (max-width:480px){
    .location-actions{
        grid-template-columns:1fr;
    }
}

/* A button that can't be used right now — the reason is written beside it. */
.btn-disabled{
    width:100%;
    min-height:52px;
    display:flex;
    align-items:center;
    justify-content:center;
    padding:0 16px;
    font-weight:600;
    border:1px solid rgba(var(--text-rgb),0.4);
    color:rgba(var(--text-rgb),0.5);
    cursor:not-allowed;
}

/* Closed stores: grey card with a Closed tag, and Reopen Store right under it. */
.service-list li.location-closed{
    display:flex;
    flex-direction:column;
    gap:8px;
}

.service-list li.location-closed a.location-card{
    opacity:0.5;
    filter:grayscale(1);
}

.location-closed-tag{
    font-size:0.75rem;
    font-weight:600;
    text-transform:uppercase;
    letter-spacing:0.05em;
}

/* A closed store's own pages are muted, and say so above the fields. */
.page.location-is-closed .location-fields,
.page.location-is-closed .dash-tile{
    opacity:0.6;
}

.location-closed-note{
    color:var(--red);
    font-size:0.875rem;
}

/* Close Store: a stop action off the main path — red outline instead of blue. */
.page a.btn-outline-red{
    border-color:var(--red);
    color:var(--red);
}

.page a.btn-outline-red:hover{
    background:rgba(var(--red-rgb),0.12);
    box-shadow:inset 0 0 16px rgba(var(--red-rgb),0.35);
}

/* Confirm Close Store — red like the shopper stop buttons. */
.page button.btn-danger[type="submit"]{
    background:var(--red);
}

/* End Subscription: the refund rules in plain sentences under the amount. */
.refund-explainer{
    width:100%;
    display:flex;
    flex-direction:column;
    gap:8px;
    font-size:0.875rem;
    color:rgba(var(--text-rgb),0.8);
}

/* Lapsed page: the "Subscription Has Ended" heading in blue so it stands out. */
.page h1.ended-title{
    color:var(--blue);
}

/* Payment setup: room above the "Contact 4th Co." line for managing the subscription. */
.manage-sub-help{
    margin-top:24px;
}

/* Dashboard Tour — the Screen Dims and Can't Be Clicked, One Tile at a Time Is Lit Above the Dim, and a
   Glass Tip Card Floats Next to It With a Pulsing Arrow Pointing at It. The Red X Moves to the Next Tile. */
html.tour-on,html.tour-on body{
    overflow:hidden;
}

.tour-shade{
    position:fixed;
    inset:0;
    z-index:2000;
    background:rgba(var(--bg-rgb),0.72);
    opacity:0;
    transition:opacity 0.3s ease;
}

.tour-shade.on{
    opacity:1;
}

/* Lit Tile: Above the Dim, Not Clickable, Blue Edge, Breathing Glow and a Drawn Underline Under the Label */
.page .dash-tile.tour-lit{
    position:relative;
    z-index:2001;
    pointer-events:none;
    border-color:var(--blue);
    background:var(--bg);
    animation:tourPulse 2.4s ease-in-out infinite;
}

.dash-tile .dash-tile-label{
    position:relative;
}

.dash-tile .dash-tile-label::after{
    content:"";
    position:absolute;
    left:0;
    right:0;
    bottom:-6px;
    height:1px;
    background:var(--blue);
    box-shadow:0 0 8px rgba(var(--blue-rgb),0.8);
    transform:scaleX(0);
    transition:transform 0.5s ease 0.2s;
}

.dash-tile.tour-lit .dash-tile-label::after{
    transform:scaleX(1);
}

@keyframes tourPulse{
    0%,100%{ box-shadow:inset 0 0 10px rgba(var(--blue-rgb),0.15),0 0 0 rgba(var(--blue-rgb),0); }
    50%{ box-shadow:inset 0 0 26px rgba(var(--blue-rgb),0.4),0 0 30px rgba(var(--blue-rgb),0.35); }
}

/* Tip Card: Semi-Transparent Glass in the Brand Shape (Rounded Top-Left, Cut Bottom-Right), 1px Blue Edge */
.tour-card{
    position:fixed;
    z-index:2002;
    width:min(380px,calc(100vw - 32px));
    padding:18px 18px 20px 20px;
    display:flex;
    align-items:flex-start;
    gap:14px;
    text-align:left;
    background:rgba(var(--brand-slate-rgb),0.55);
    -webkit-backdrop-filter:blur(14px) saturate(1.2);
    backdrop-filter:blur(14px) saturate(1.2);
    border:1px solid rgba(var(--blue-rgb),0.7);
    border-radius:14px 0 0 0;
    clip-path:polygon(0 0,100% 0,100% calc(100% - 16px),calc(100% - 16px) 100%,0 100%);
    box-shadow:0 20px 50px rgba(0,0,0,0.45);
    opacity:0;
    transform:translateY(var(--rise,8px));
    transition:opacity 0.3s ease,transform 0.3s ease;
}

.tour-card.on{
    opacity:1;
    transform:none;
}

/* The 1px Edge Across the Cut Corner */
.tour-card::after{
    content:"";
    position:absolute;
    right:-4px;
    bottom:7px;
    width:23px;
    height:1px;
    background:rgba(var(--blue-rgb),0.7);
    transform:rotate(-45deg);
}

.tour-card-body{
    flex:1;
    min-width:0;
}

.tour-step{
    display:block;
    font-size:0.8125rem;
    font-weight:600;
    letter-spacing:0.04em;
    color:var(--blue);
    margin-bottom:6px;
}

.tour-text{
    font-size:1.0625rem;
    line-height:1.5;
    color:var(--text);
}

/* Red X — the Only Thing on Screen That Takes a Click During the Tour */
.page .tour-x,.tour-x{
    flex:none;
    width:44px;
    height:44px;
    min-height:44px;
    display:grid;
    place-items:center;
    padding:0;
    background:var(--red);
    color:var(--bg);
    border:0;
    border-radius:10px 0 0 0;
    clip-path:polygon(0 0,100% 0,100% calc(100% - 8px),calc(100% - 8px) 100%,0 100%);
    cursor:pointer;
}

.tour-x svg{
    width:16px;
    height:16px;
}

.tour-x:hover{
    filter:brightness(1.08);
}

.tour-x:focus{
    outline:none;
}

/* Clip-Path Cuts Off Outlines, So Keyboard Focus Shows as an Inner Ring */
.tour-x:focus-visible{
    box-shadow:inset 0 0 0 2px var(--bg);
}

/* Pulsing Arrow — Sits Between the Card and the Tile, Points at the Tile and Nudges Toward It */
.tour-arrow{
    position:fixed;
    z-index:2002;
    width:28px;
    height:28px;
    margin-left:-14px;
    color:var(--blue);
    filter:drop-shadow(0 0 6px rgba(var(--blue-rgb),0.9));
    opacity:0;
    transition:opacity 0.3s ease;
    pointer-events:none;
}

.tour-arrow.on{
    opacity:1;
    animation:tourNudge 1.2s ease-in-out infinite;
}

.tour-arrow.down svg{
    transform:rotate(180deg);
}

@keyframes tourNudge{
    0%,100%{ translate:0 0; opacity:1; }
    50%{ translate:0 var(--nudge,-8px); opacity:0.55; }
}

/* Phones: Text Uses the Card's Full Width, and the Red X Becomes a Wide Bar Along the Bottom */
@media (max-width:700px){
    .tour-card{
        flex-direction:column;
        align-items:stretch;
        gap:14px;
        padding:18px 18px 18px 18px;
    }

    .page .tour-x,.tour-x{
        width:100%;
        height:48px;
        min-height:48px;
    }

    .tour-x svg{
        width:18px;
        height:18px;
    }
}

@media (prefers-reduced-motion:reduce){
    .page .dash-tile.tour-lit,.tour-arrow.on{ animation:none; }
    .page .dash-tile.tour-lit{ box-shadow:inset 0 0 20px rgba(var(--blue-rgb),0.3),0 0 24px rgba(var(--blue-rgb),0.3); }
    .tour-card,.tour-shade,.dash-tile .dash-tile-label::after{ transition:none; }
}

/* Navbar Help Button — Top Right on Every Service Page, Level With the Logo. The 4th Co. Shape (Rounded
   Top-Left, Cut Bottom-Right) Drawn as Two Layers So the Edge Is an Even 1px All the Way Round,
   Including Along the Cut: ::before Is the Blue Edge, ::after the Fill Set 1px Inside It. */
.navbar .nav-help{
    position:absolute;
    top:12px;
    right:16px;
    z-index:0;
    height:44px;
    display:flex;
    align-items:center;
    gap:8px;
    padding:0 16px 0 12px;
    color:var(--blue);
    font-weight:600;
    font-size:1rem;
    text-decoration:none;
    transition:color 0.15s;
}

.navbar .nav-help::before,
.navbar .nav-help::after{
    content:"";
    position:absolute;
    pointer-events:none;
}

.navbar .nav-help::before{
    inset:0;
    z-index:-2;
    background:rgba(var(--blue-rgb),0.6);
    border-radius:14px 0 0 0;
    clip-path:polygon(0 0,100% 0,100% calc(100% - 10px),calc(100% - 10px) 100%,0 100%);
    transition:background 0.15s;
}

.navbar .nav-help::after{
    inset:1px;
    z-index:-1;
    background:#3a393b;
    border-radius:13px 0 0 0;
    clip-path:polygon(0 0,100% 0,100% calc(100% - 9.41px),calc(100% - 9.41px) 100%,0 100%);
    transition:background 0.15s;
}

.navbar .nav-help svg{
    width:22px;
    height:22px;
    flex:none;
}

.navbar .nav-help:hover,.navbar .nav-help:focus-visible{
    color:var(--text);
    outline:none;
}

.navbar .nav-help:hover::before,.navbar .nav-help:focus-visible::before{
    background:var(--blue);
}

.navbar .nav-help:hover::after,.navbar .nav-help:focus-visible::after{
    background:#3f4c4c;
}

/* Small Phones: Icon Only, So It Never Crowds the Logo */
@media (max-width:379px){
    .navbar .nav-help{
        padding:0 9px;
    }

    .navbar .nav-help span{
        display:none;
    }
}


/* Navbar Logo on Service Pages — the 4th Co. Site's Lockup: the Mark, Then the Bold Service Name Over "by 4th Co." */
.navbar .logo-brand{
    align-self:flex-start;
    display:flex;
    align-items:center;
    gap:12px;
    min-height:44px;
}

.navbar .logo-brand img{
    width:40px;
    height:40px;
    flex:none;
}

.navbar .logo-brand span{
    display:flex;
    flex-direction:column;
    font-size:inherit;
    font-weight:inherit;
    text-align:left;
}

.navbar .logo-brand b{
    font-size:1.2rem;
    font-weight:700;
    line-height:1.1;
    letter-spacing:0.01em;
}

.navbar .logo-brand small{
    font-size:0.8rem;
    font-weight:500;
    line-height:1.25;
    color:#a3a2a6;
}

/* Phones: Leave Room for the Help Button on the Right */
@media (max-width:520px){
    .navbar .logo-brand img{
        width:34px;
        height:34px;
    }

    .navbar .logo-brand b{
        font-size:1.05rem;
    }
}


/* Welcome Card Page Map — One Box per Tap, a Down Arrow Between Each, All Outlined the Same */
.tour-path{
    list-style:none;
    margin:14px 0 0;
    padding:0;
    display:flex;
    flex-direction:column;
}

.tour-path li{
    position:relative;
    display:flex;
    align-items:center;
    gap:12px;
    padding:9px 14px;
    font-size:0.975rem;
    font-weight:600;
    color:var(--text);
    background:rgba(var(--bg-rgb),0.45);
    border:1px solid rgba(var(--blue-rgb),0.55);
    border-radius:10px 0 0 0;
}

.tour-path li img{
    width:24px;
    height:24px;
    flex:none;
    object-fit:contain;
}

.tour-path li + li{
    margin-top:22px;
}

/* Down Arrow in the Gap Above Each Box After the First */
.tour-path li + li::before{
    content:"";
    position:absolute;
    left:22px;
    top:-17px;
    width:7px;
    height:7px;
    border-right:2px solid var(--blue);
    border-bottom:2px solid var(--blue);
    transform:rotate(45deg);
}


/* Phones: the Explained Tile Drops to Half Height (Icon Beside Its Name) and Its Tip Fills the Space Below */
@media (max-width:700px){
    .page .dash-tile.tour-half{
        aspect-ratio:auto;
        height:var(--tour-half-h);
        flex-direction:row;
        gap:18px;
    }

    .page .dash-tile.tour-half img{
        width:auto;
        height:52%;
        max-height:96px;
    }
}

/* Page Welcome List — One Row per Thing on the Page: Its Name in Bold, Then What It Does. 1px Line Between Rows. */
.tour-list{
    list-style:none;
    margin:12px 0 0;
    padding:0;
}

.tour-list li{
    display:flex;
    flex-direction:column;
    gap:2px;
    padding:9px 0;
    font-size:0.925rem;
    line-height:1.4;
    color:rgba(var(--text-rgb),0.85);
}

.tour-list li + li{
    border-top:1px solid rgba(var(--blue-rgb),0.3);
}

.tour-list li strong{
    font-weight:600;
    color:var(--blue);
}

/* A Long Welcome Scrolls Inside Its Card Instead of Running Off the Screen */
.tour-card{
    max-height:calc(100vh - 32px);
    max-height:calc(100dvh - 32px);
    overflow-y:auto;
}

/* Tip Card Link — e.g. "Learn How to Sell Your First Item" on the First-Signup Welcome */
.tour-link{
    display:inline-flex;
    align-items:center;
    gap:8px;
    margin-top:16px;
    color:var(--blue);
    font-weight:600;
    text-decoration:none;
    border-bottom:1px solid rgba(var(--blue-rgb),0.6);
    padding-bottom:2px;
}

.tour-link::after{
    content:"›";
    font-size:1.2em;
    line-height:1;
}

.tour-link:hover{
    border-bottom-color:var(--blue);
}

/* 4th Co. Shape for Outline Buttons. The Shape (from base.css) Clips the Border Off the Cut Corner,
   So a Thin Line Is Drawn Back Along the Cut in the Border's Color. Works on Any Background. */
.page a.btn-outline,
.page a.inv-manage,
.page a.tx-details,
.page .btn-outline.btn-disabled{
    --b-r:22px;
    --b-c:14px;
    --rim:var(--blue);
    position:relative;
    border-top-left-radius:var(--b-r);
    clip-path:polygon(0 0,100% 0,100% calc(100% - var(--b-c)),calc(100% - var(--b-c)) 100%,0 100%);
}

.page a.inv-manage,
.page a.tx-details{
    --b-r:9px;
    --b-c:6px;
}

.page a.btn-outline-red{
    --rim:var(--red);
}

.page a.btn-outline::after,
.page a.inv-manage::after,
.page a.tx-details::after,
.page .btn-outline.btn-disabled::after{
    content:"";
    position:absolute;
    right:-1px;
    bottom:-1px;
    width:var(--b-c);
    height:var(--b-c);
    pointer-events:none;
    background:linear-gradient(to top left,transparent 50%,var(--rim) 50%,var(--rim) calc(50% + 1.2px),transparent calc(50% + 1.2px));
}

.page a.tx-details:hover{
    box-shadow:inset 0 0 12px rgba(var(--blue-rgb),0.35);
}

.bottom-bar button.bar-save{
    --b-r:18px;
    --b-c:12px;
}

/* A Disabled Outline Button's Cut Line Matches Its Greyed-Out Border */
.page .btn-outline.btn-disabled{
    --rim:currentColor;
}
