/* ═══════════════════════════════════════════════════════════════════════
   r-account-buy.css: the account frame and the buyer's pages
   (redesign 2026-10-15; MojeAukcije, MojeAukcije--zavrsene,
   MojeAukcijeMobile, Praceno, Kupljeno). Built from tokens.css; loaded
   after ui.css, so equal specificity wins here.
   ═══════════════════════════════════════════════════════════════════════ */

/* ── The frame ─────────────────────────────────────────────────────────── */
body .account { margin: var(--space-8) 0 var(--space-12); }
body .account__head { margin-bottom: var(--space-6); }
/* PorukeAdmin (2026-10-16): on a section page the rail and the section's own
   title start level, with no "Moje aukcije" above them. It stays the page's
   h1 for screen readers; the menu page still shows it. */
body .account:not(.account--menu) .account__head { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; margin: 0; }
body .account__title { font: 800 36px/44px var(--font-sans); letter-spacing: -0.02em; color: var(--ink); }
body .account__layout { grid-template-columns: 248px minmax(0, 1fr); gap: var(--space-8); }

/* The rail, "B + profil" (2026-10-16): the profile card, then three groups
   on the page ground. The current entry is a white tile, never a fill. */
body .accnav { display: flex; flex-direction: column; gap: var(--space-6); padding: 0; background: none; border: 0; box-shadow: none; }
.accnav__group { display: flex; flex-direction: column; gap: var(--space-1); }
.accnav__heading, body .accmenu__heading {
    margin: 0; padding: 0 var(--space-3) 6px;
    font: 700 12px/16px var(--font-sans); letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted);
}
body .accnav ul { display: flex; flex-direction: column; gap: 2px; }
body .accnav__link, body .accnav__link:visited {
    display: flex; align-items: center; gap: var(--space-3);
    min-height: var(--touch-target); padding: 0 var(--space-3); border-radius: var(--radius-md);
    font: 600 15px/1.2 var(--font-sans); color: var(--ink-2);
}
body .accnav__link:hover { background: #E9EDF2; color: var(--ink); }
body .accnav__link--current, body .accnav__link--current:visited, body .accnav__link--current:hover {
    background: var(--surface); box-shadow: var(--shadow-float); color: var(--ink); font-weight: 800;
}
body .accnav__icon { flex: none; color: var(--ink-2); }
body .accnav__link--current .accnav__icon { color: var(--blue-700); }
.accnav__label { flex: 1 1 auto; min-width: 0; }

/* Counters: a plain muted number. One that waits for the reader (outbid, an
   offer to answer, an order to confirm, unread) gets an orange dot and an
   orange number, darkened from orange-600 to reach 4.5:1 on the ground. */
body .accnav__badge, body .accnav__link--current .accnav__badge {
    display: inline-flex; align-items: center; gap: 6px;
    min-width: 0; margin: 0 0 0 auto; padding: 0; border-radius: 0;
    background: none; color: var(--muted);
    font: 600 13px/1 var(--font-sans); font-variant-numeric: tabular-nums;
}
body .accnav__badge.accnav__badge--action { font-weight: 800; color: color-mix(in srgb, var(--orange-600) 90%, #000) !important; background: none !important; }
body .accnav__badge--action::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--orange-600); }

/* The profile card heading the rail and the phone menu. */
.accprofile, .accprofile:visited {
    display: flex; align-items: center; gap: var(--space-3);
    padding: var(--space-3); background: var(--surface);
    border: 1px solid var(--border); border-radius: var(--radius-lg); color: var(--ink);
}
.accprofile:hover { text-decoration: none; border-color: var(--border-strong); }
.accprofile__avatar {
    flex: none; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%;
    background: var(--navy-900); color: var(--surface); font: 800 14px/1 var(--font-sans);
}
.accprofile__text { display: flex; flex-direction: column; min-width: 0; }
.accprofile__name { font: 800 15px/1.3 var(--font-sans); color: var(--ink); overflow-wrap: anywhere; }
.accprofile__rating { font: 600 13px/1.4 var(--font-sans); color: var(--muted); }

/* Phone section pages: the group's sibling pages as chips under the title. */
.accchips { display: none; }

body .account__sectionhead { margin-bottom: var(--space-5); }
body .account__sectiontitle { font: 800 28px/34px var(--font-sans); letter-spacing: -0.01em; color: var(--ink); }
body .account__sectionlead { margin-top: var(--space-1); font: 500 15px/1.45 var(--font-sans); color: var(--muted); }

/* Every action in these lists meets the touch target (btn--sm is 40 px). */
.lotrow .btn, .buyorder .btn, .accmurgent .btn { min-height: var(--touch-target); }

/* ── Pill tabs (Aktivne / Završene, Praćeni predmeti / Podsjetnici) ──── */
.pilltabs { display: flex; flex-wrap: wrap; gap: var(--space-2); margin: 0 0 var(--space-4); }
.pilltab, .pilltab:visited {
    display: inline-flex; align-items: center; gap: var(--space-2);
    min-height: var(--touch-target); padding: 0 var(--space-4);
    border: 1px solid var(--border); border-radius: var(--radius-pill); background: var(--surface);
    color: var(--ink); font: 700 14px/1 var(--font-sans); white-space: nowrap;
}
.pilltab:hover { border-color: var(--ink-2); text-decoration: none; }
.pilltab__count {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 22px; height: 22px; padding: 0 6px; border-radius: var(--radius-pill);
    background: var(--ground); color: var(--ink-2); font: 800 12px/1 var(--font-sans);
}
.pilltab.is-current, .pilltab.is-current:visited, .pilltab.is-current:hover { background: var(--blue-100) !important; border-color: var(--blue-700) !important; color: var(--blue-700) !important; }
.pilltab.is-current .pilltab__count { background: var(--surface) !important; color: var(--blue-700) !important; }

/* ── Licitiram: the three tallies ──────────────────────────────────────── */
.bidstats { margin: 0 0 var(--space-5); padding: 0; list-style: none; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-3); }
.bidstats__card {
    display: flex; flex-direction: column; gap: var(--space-1);
    padding: var(--space-4) var(--space-5);
    background: var(--surface); border: 1px solid var(--border); border-left-width: 3px; border-radius: var(--radius-lg);
}
.bidstats__card--leading { border-left-color: var(--green-600); }
.bidstats__card--outbid  { border-left-color: var(--orange-600); }
.bidstats__card--won     { border-left-color: var(--navy-900); }
.bidstats__label { font: 600 13px/1.3 var(--font-sans); color: var(--ink-2); }
.bidstats__value { font: 800 26px/1.15 var(--font-sans); color: var(--ink); font-variant-numeric: tabular-nums; }
.bidstats__sub { font: 500 12px/1.3 var(--font-sans); color: var(--muted); }
.bidstats__link, .bidstats__link:visited { align-self: flex-start; display: inline-flex; align-items: center; min-height: var(--touch-target); margin: calc(-1 * var(--space-3)) 0; font: 700 13px/1.3 var(--font-sans); color: var(--blue-700); }

/* ── Licitiram: one row card per lot ───────────────────────────────────── */
.lotrows { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: var(--space-3); }
.lotrow {
    display: flex; align-items: center; gap: var(--space-4);
    padding: var(--space-4);
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
}
.lotrow__body { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-1); }
.lotrow__title, .lotrow__title:visited { color: var(--ink); font: 800 17px/1.3 var(--font-sans); }
.lotrow__title:hover { color: var(--blue-700); }
/* The title is the row's link to the lot: a 44 px target, the extra height
   taken back from the gaps around it so the row keeps its rhythm. */
.lotrow__title, .ordline__title { display: inline-flex; align-items: center; min-height: var(--touch-target); margin-block: calc(-1 * var(--space-2)); }
.lotrow__facts { margin: 0; font: 500 13px/1.45 var(--font-sans); color: var(--muted); }
/* A label stays with its value; on a phone each fact takes its own line. */
.lotrow__facts > span { white-space: nowrap; }
.lotrow__facts b { color: var(--ink); font-weight: 800; }
.lotrow__note { margin: 0; font: 500 13px/1.4 var(--font-sans); color: var(--amber-800); }
.lotrow__side { flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: var(--space-2); }
.lotrow__side .accclock { font: 800 15px/1.2 var(--font-sans); color: var(--ink); font-variant-numeric: tabular-nums; white-space: nowrap; }
.lotrow__side .accclock.clock--critical { color: var(--red-700); }
.amount { font-variant-numeric: tabular-nums; white-space: nowrap; }

/* The thumbnail: photograph or the category's tone with its icon. */
.accthumb { flex: none; display: flex; align-items: center; justify-content: center; overflow: hidden; border-radius: var(--radius-md); background: var(--ground); }
.accthumb--md { width: 80px; height: 80px; }
.accthumb--sm { width: 64px; height: 64px; }
.accthumb img { width: 100%; height: 100%; object-fit: cover; }
.accthumb .tone__icon { width: 46%; }

/* ── Praćeno: the lot cards, four to a row beside the rail ─────────────── */
body .account .accwatchgrid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--space-4); }
/* ui.css reddens a critical clock inside .account; on the red badge it stays white. */
body .account .tbadge--critical .clock--critical { color: #fff; }
.lotcard__kicker { margin: 0 0 var(--space-1); font: 600 12px/1.3 var(--font-sans); color: var(--ink-2); }
/* An announced lot's "Počinje pet 16.10. u 04:15" is longer than a clock:
   it wraps to a second line rather than run under the heart. */
body .account .accwatchgrid .tbadge {
    max-width: calc(100% - var(--touch-target) - var(--space-3) * 2);
    height: auto; min-height: 28px; padding-block: 5px;
    white-space: normal; line-height: 1.25;
}
@media (max-width: 700px) {
    body .account .accwatchgrid .tbadge { padding-inline: 6px; font-size: 12px; letter-spacing: -0.01em; }
}
@media (max-width: 1200px) { body .account .accwatchgrid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* ── Kupljeno: one card per order ──────────────────────────────────────── */
.buyorders { display: flex; flex-direction: column; gap: var(--space-4); }
.buyorder { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; }
.buyorder:target { border-color: var(--blue-700); }
.buyorder__head {
    display: flex; align-items: center; justify-content: space-between; gap: var(--space-3) var(--space-6); flex-wrap: wrap;
    padding: var(--space-4) var(--space-5); background: var(--ground); border-bottom: 1px solid var(--border);
}
.buyorder__facts { margin: 0; display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-6); }
.buyorder__facts dt, .ordline__nums dt { font: 600 12px/1.3 var(--font-sans); color: var(--ink-2); }
.buyorder__facts dd { margin: 2px 0 0; font: 800 15px/1.3 var(--font-sans); color: var(--ink); font-variant-numeric: tabular-nums; }
.buyorder__rating { font-weight: 600; color: var(--muted); white-space: nowrap; }
.buyorder__lines { margin: 0; padding: 0 var(--space-5); list-style: none; }
.ordline { display: flex; align-items: center; gap: var(--space-4); padding: var(--space-4) 0; }
.ordline + .ordline { border-top: 1px solid var(--border); }
.ordline__text { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ordline__title, .ordline__title:visited { color: var(--ink); font: 800 16px/1.3 var(--font-sans); }
.ordline__title:hover { color: var(--blue-700); }
.ordline__id { font: 500 13px/1.3 var(--font-sans); color: var(--muted); }
.ordline__nums { margin: 0; display: flex; gap: var(--space-6); }
.ordline__nums dd { margin: 2px 0 0; font: 800 15px/1.3 var(--font-sans); color: var(--ink); }

.buyorder__foot { margin: 0 var(--space-5); padding: var(--space-4) 0; border-top: 1px solid var(--border); }
.buyorder__acts { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-3); flex-wrap: wrap; }
.ordfinish { display: flex; align-items: flex-start; justify-content: flex-end; gap: var(--space-3); flex-wrap: wrap; margin-left: auto; }   /* stays right when it wraps under the message button */
.ordfinish form { margin: 0; }
.ordfinish__ask { margin: 0; align-self: center; font: 800 15px/1.3 var(--font-sans); color: var(--ink); }
.ordclose { display: flex; align-items: center; gap: var(--space-3); margin: var(--space-3) 0 0; font: 500 13px/1.4 var(--font-sans); color: var(--muted); }
.ordclose b { color: var(--ink); }
/* The days left of the auto-close window, as a native <progress>. */
.ordclose__bar {
    flex: none; width: 120px; height: 4px; overflow: hidden;
    appearance: none; -webkit-appearance: none;
    border: 0; border-radius: var(--radius-pill); background: var(--border); color: var(--muted);
}
.ordclose__bar::-webkit-progress-bar { background: var(--border); border-radius: var(--radius-pill); }
.ordclose__bar::-webkit-progress-value { background: var(--muted); border-radius: var(--radius-pill); }
.ordclose__bar::-moz-progress-bar { background: var(--muted); border-radius: var(--radius-pill); }

.ordrated { display: flex; align-items: center; gap: var(--space-2); margin: 0; font: 500 14px/1.45 var(--font-sans); color: var(--ink-2); }
.ordrated svg { flex: none; color: var(--green-600); }
.ordrated b { color: var(--ink); }
.ordrate { display: grid; gap: var(--space-2); max-width: 640px; }
.ordrate__choices { margin: 0; padding: 0; border: 0; display: flex; flex-wrap: wrap; gap: var(--space-2); }
.ordrate__legend { width: 100%; margin-bottom: var(--space-2); padding: 0; font: 800 15px/1.3 var(--font-sans); color: var(--ink); }
.ordrate__note { width: 100%; margin: 0 0 var(--space-1); font: 500 13px/1.4 var(--font-sans); color: var(--ink-2); }
.ordrate__choice { display: inline-flex; align-items: center; gap: var(--space-2); min-height: var(--touch-target); padding: 0 var(--space-4); border: 1px solid var(--border-strong); border-radius: var(--radius-pill); font: 700 14px/1 var(--font-sans); cursor: pointer; }
.ordrate__choice:has(input:checked) { background: var(--blue-100) !important; border-color: var(--blue-700) !important; color: var(--blue-700) !important; }
.ordrate__label { font: 700 13px/1.3 var(--font-sans); color: var(--ink-2); }
.ordrate__text { width: 100%; min-height: 72px; padding: var(--space-3); border: 1px solid var(--border-strong); border-radius: var(--radius-md); font: 500 15px/1.45 var(--font-sans); color: var(--ink); background: var(--surface); }
.ordrate__hint, .ordrate__closed { margin: 0; font: 500 13px/1.45 var(--font-sans); color: var(--muted); }
.ordrate .btn { justify-self: start; }

/* ── The phone menu (MojeAukcijeMobile) ────────────────────────────────── */
.accmurgent { display: none; }
/* Nothing links to the menu page on a wide screen, but its address works:
   there the grouped list is the page, and the rail beside it would repeat
   every entry, so the rail steps aside. */
@media (min-width: 768px) {
    body .account--menu .accnav { display: none; }
    body .account--menu .account__layout { grid-template-columns: minmax(0, 720px); }
}

@media (max-width: 767px) {
    /* A phone has the menu page instead of the rail (account.css, 2026-10-09). */
    body .accnav { display: none; }
    body .account { margin-top: 0; }
    body .account__layout { grid-template-columns: minmax(0, 1fr); }

    /* The menu page: the profile card, then the groups as white lists. */
    .account--menu .account__head { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
    .account--menu .accprofile { margin-bottom: var(--space-4); }
    body .accmenu { gap: var(--space-3); }
    body .accmenu__group, body .accmenu__logout { border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: none; background: var(--surface); }
    body .accmenu__heading { padding: var(--space-4) var(--space-4) var(--space-2); }
    body .accmenu__list li + li { border-top: 1px solid var(--border); }
    body .accmenu__link, body .accmenu__link:visited { gap: var(--space-3); min-height: 52px; padding: 0 var(--space-4); font: 600 15px/1.2 var(--font-sans); color: var(--ink); }
    body .accmenu__link:hover { background: #E9EDF2; }
    body .accmenu__link .accnav__icon { color: var(--ink-2); }
    body .accmenu__chevron { color: var(--muted); }
    .accmenu__value { font: 800 14px/1 var(--font-sans); color: var(--ink); font-variant-numeric: tabular-nums; white-space: nowrap; }

    /* Section pages: "‹ Moj račun", the title, then the sibling chips. */
    body .account__back, body .account__back:visited {
        display: inline-flex; align-items: center; gap: var(--space-1); width: auto; height: auto;
        min-height: var(--touch-target); padding: 0 var(--space-2) 0 0; color: var(--blue-700); font: 700 15px/1 var(--font-sans);
    }
    .accchips {
        display: flex; gap: var(--space-2);
        margin: 0 calc(-1 * var(--gutter)) var(--space-4); padding: 0 0 0 var(--gutter);
        overflow-x: auto; scrollbar-width: none;
    }
    .accchips::-webkit-scrollbar { display: none; }
    .accchip, .accchip:visited {
        flex: 0 0 auto; display: inline-flex; align-items: center;
        min-height: var(--touch-target); padding: 0 var(--space-4);
        border: 1px solid var(--border-strong); border-radius: var(--radius-pill); background: var(--surface);
        font: 700 14px/1 var(--font-sans); color: var(--ink-2); white-space: nowrap;
    }
    .accchip:hover { text-decoration: none; border-color: var(--blue-700); }
    .accchip.is-selected { background: var(--blue-100) !important; border-color: var(--blue-700) !important; color: var(--blue-700) !important; }
    .accchips__end { flex: 0 0 calc(var(--gutter) - var(--space-2)); }
}

@media (max-width: 900px) {
    .bidstats { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-2); }
    .bidstats__card { padding: var(--space-3); }
    .bidstats__value { font-size: 22px; }
    body .account .accwatchgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-3); }
}

@media (max-width: 700px) {
    body.has-appbar .account--menu { margin-top: var(--space-4); }

    .accmurgent { display: flex; flex-direction: column; gap: var(--space-3); margin-bottom: var(--space-4); }
    .accmurgent__card, .accmurgent__card:visited {
        display: flex; align-items: center; gap: var(--space-3);
        min-height: 64px; padding: var(--space-3) var(--space-4); border-radius: var(--radius-lg); border: 1px solid transparent; color: var(--ink);
    }
    .accmurgent__card:hover { text-decoration: none; }
    .accmurgent__card--warn { background: var(--amber-100); border-color: #F3DDB4; }
    .accmurgent__card--info { background: var(--blue-100); border-color: #BCD3EE; }
    .accmurgent__text { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
    .accmurgent__title { margin: 0; font: 800 16px/1.3 var(--font-sans); color: var(--ink); }
    .accmurgent__line { margin: 0; font: 500 13px/1.4 var(--font-sans); color: var(--ink-2); }
    .accmurgent__chevron { flex: none; color: var(--ink); }

    /* Section pages: the navy app bar (back to the menu) replaces the
       masthead and the white back bar; the section's own heading follows. */
    body .account__mobilehead { margin-bottom: var(--space-4); }
    body.has-appbar .account__mobilehead { display: none; }
    body.has-appbar .account { margin-top: var(--space-4); }
    body.has-appbar .account__mobilehead ~ .account__layout .account__sectiontitle { display: block; font-size: 24px; line-height: 30px; }
    body.has-appbar .account__sectionhead { margin-bottom: var(--space-4); }

    /* The three tallies: a row that scrolls sideways, 16 px from the edge
       at both ends, rather than three crushed columns. */
    .bidstats {
        grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 46%;
        margin-inline: calc(-1 * var(--space-4)); padding: 0 var(--space-4) var(--space-1);
        overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding-inline: var(--space-4);
        scrollbar-width: none;
    }
    .bidstats::-webkit-scrollbar { display: none; }
    .bidstats__card { scroll-snap-align: start; }
    .bidstats__link, .bidstats__sub { white-space: nowrap; }

    /* Each fact on its own line, the separator dropped. */
    .lotrow__facts > span:not(.lotrow__sep) { display: block; }
    .lotrow__sep { display: none; }

    /* Licitiram rows: thumb and text, the clock and action beneath. */
    .lotrow { flex-wrap: wrap; align-items: flex-start; gap: var(--space-3); padding: var(--space-3); }
    .accthumb--md { width: 64px; height: 64px; }
    .lotrow__body { flex: 1 1 calc(100% - 64px - var(--space-3)); }
    .lotrow__title { font-size: 16px; }
    .lotrow__side { flex: 1 1 100%; flex-direction: row; align-items: center; justify-content: space-between; }
    .bidstats__card { padding: var(--space-3) var(--space-2) var(--space-3) var(--space-3); }
    .bidstats__label, .bidstats__link { font-size: 12px; }

    /* Kupljeno: facts wrap, the numbers move under the title. */
    .buyorder__head { padding: var(--space-3) var(--space-4); }
    .buyorder__facts { gap: var(--space-2) var(--space-4); }
    .buyorder__lines { padding: 0 var(--space-4); }
    .ordline { flex-wrap: wrap; }
    .ordline__text { flex: 1 1 calc(100% - 64px - var(--space-4)); }
    .ordline__nums { flex: 1 1 100%; justify-content: flex-start; gap: var(--space-5); padding-left: calc(64px + var(--space-4)); }
    .buyorder__foot { margin: 0 var(--space-4); }
    .buyorder__acts, .ordfinish { flex-direction: column; align-items: stretch; }
    .ordfinish { margin-left: 0; }
    .ordfinish__ask { align-self: flex-start; }
    .buyorder__acts .btn, .ordfinish .btn { width: 100%; }
}

/* The three tallies on a narrow phone (MOBILE-FIXES B8): three equal boxes in
   one row, the number over a short label, no sideways scroll. The outbid
   box's link is stretched over the box, so the whole box is the link. */
.bidstats__short { display: none; }
@media (max-width: 599px) {
    .bidstats { grid-template-columns: repeat(3, minmax(0, 1fr)); grid-auto-flow: row; gap: var(--space-2); margin-inline: 0; padding: 0; overflow: visible; }
    .bidstats__card { position: relative; align-items: flex-start; gap: 2px; padding: var(--space-3); }
    .bidstats__value { order: -1; font-size: 24px; }
    .bidstats__label { font-size: 12px; }
    .bidstats__long, .bidstats__sub { display: none; }
    .bidstats__short { display: inline; }
    .bidstats__link { position: absolute; inset: 0; align-self: stretch; margin: 0; overflow: hidden; color: transparent; }   /* stretch: align-self also sizes an absolute box */
}

@media (prefers-reduced-motion: reduce) {
    .pilltab, .lotrow, .buyorder { transition: none !important; animation: none !important; }
}
