/* ==========================================================================
   UnloadPal: client & team portal
   Builds on the tokens in styles.css (light + dark).
   ========================================================================== */

.is-loading .app-main { visibility: hidden; }

.app-body { min-height: 100vh; display: flex; flex-direction: column; background: var(--bg); }
.app-main { flex: 1; padding: clamp(1.25rem, 3vw, 2rem) 0 4rem; }

/* ---------- Top bar ---------- */
.app-header {
  position: sticky; top: 0; z-index: 40;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: saturate(160%) blur(12px);
  -webkit-backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid var(--border);
}
.app-bar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 64px; }
.app-bar .brand-mark { width: 30px; height: 30px; }
.app-nav { display: flex; align-items: center; gap: .25rem; flex-wrap: wrap; justify-content: flex-end; }
.app-nav a, .app-signout {
  padding: .5rem .8rem; border-radius: var(--radius-sm); font-size: .9rem; font-weight: 500;
  color: var(--text-2); background: none; border: 0; cursor: pointer;
}
.app-nav a:hover, .app-signout:hover { background: var(--surface-2); color: var(--text); }
.app-nav a[aria-current="page"] { background: var(--accent-soft); color: var(--accent); }
@media (max-width: 640px) {
  .app-bar { flex-wrap: wrap; padding-block: .6rem; }
  .app-nav { width: 100%; justify-content: flex-start; overflow-x: auto; flex-wrap: nowrap; margin-inline: -.5rem; }
  .app-nav a, .app-signout { white-space: nowrap; }
}

/* ---------- Page headings ---------- */
.page-top { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 1rem; margin-bottom: 1.5rem; }
.page-top h1 { font-size: clamp(1.5rem, 3vw, 2rem); font-weight: 700; }
.page-top p { color: var(--text-2); margin-top: .35rem; }

/* ---------- Cards ---------- */
.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: .75rem; margin-bottom: 1rem; }
.card-head h2 { font-size: 1.05rem; font-weight: 600; }
.card-sub { font-size: .8rem; color: var(--text-3); }
.muted { color: var(--text-3); font-size: .92rem; }
.app-main .card { box-shadow: var(--shadow-sm); padding: 1.25rem; }

.btn-sm { padding: .55rem .85rem; font-size: .85rem; }
.btn-sm svg { width: 16px; height: 16px; }
.btn-danger { background: #d93a44; color: #fff; }
.btn-danger:hover { background: #c02f39; }
.btn-danger-text { color: #d93a44; }
.btn-danger-text:hover { color: #d93a44; border-color: #d93a44; }
.btn:disabled { opacity: .6; cursor: not-allowed; transform: none; }
.icon-btn {
  width: 36px; height: 36px; flex: none; display: grid; place-items: center;
  border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface); color: var(--text-2); cursor: pointer;
}
.icon-btn:hover { color: var(--accent); border-color: var(--accent); }
.icon-btn svg { width: 18px; height: 18px; }

.spinner {
  width: 14px; height: 14px; border-radius: 50%; flex: none;
  border: 2px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Chips & notices ---------- */
.chip { display: inline-flex; align-items: center; gap: .35rem; padding: .22rem .6rem; border-radius: var(--radius-pill); font-size: .75rem; font-weight: 600; white-space: nowrap; }
.chip::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.chip-blue { background: var(--accent-soft); color: var(--accent); }
.chip-amber { background: color-mix(in srgb, var(--warning) 16%, transparent); color: #b7780f; }
.chip-green { background: color-mix(in srgb, var(--success) 14%, transparent); color: var(--success); }
.chip-violet { background: color-mix(in srgb, #8a5bff 16%, transparent); color: #7a48f0; }
.chip-red { background: rgba(217, 58, 68, .12); color: #d93a44; }
.chip-gray { background: var(--surface-2); color: var(--text-3); }
@media (prefers-color-scheme: dark) { .chip-amber { color: var(--warning); } .chip-violet { color: #a88bff; } }

.notice { margin-top: 1rem; padding: .85rem 1rem; border-radius: var(--radius-sm); font-size: .92rem; border: 1px solid transparent; }
.notice-green { background: color-mix(in srgb, var(--success) 10%, transparent); border-color: color-mix(in srgb, var(--success) 25%, transparent); }
.notice-red { background: rgba(217, 58, 68, .08); border-color: rgba(217, 58, 68, .25); }
.notice-blue { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 25%, transparent); }
.notice-amber { background: color-mix(in srgb, var(--warning) 12%, transparent); border-color: color-mix(in srgb, var(--warning) 30%, transparent); }
.warn-text { color: #d93a44; font-weight: 600; }
.badge-private { font-size: .7rem; font-weight: 600; padding: .2rem .5rem; border-radius: var(--radius-pill); background: rgba(217, 58, 68, .1); color: #d93a44; }
.nick { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .92em; }

/* ---------- Tabs ---------- */
/* The base line is an inset shadow, so the active underline can cover it without overflowing (a -1px margin
   made the row scroll vertically and show scroll arrows). */
.tabs { display: flex; gap: .25rem; box-shadow: inset 0 -1px 0 var(--border); margin-bottom: 1rem; overflow-x: auto; overflow-y: hidden; }
.tab {
  padding: .7rem 1rem; border: 0; background: none; cursor: pointer; white-space: nowrap;
  font-weight: 600; font-size: .9rem; color: var(--text-3); border-bottom: 2px solid transparent;
}
.tab[aria-selected="true"] { color: var(--accent); border-bottom-color: var(--accent); }
.tab .count { margin-inline-start: .35rem; font-size: .75rem; padding: .05rem .45rem; border-radius: var(--radius-pill); background: var(--surface-2); color: var(--text-2); }

/* ---------- Order list ---------- */
.order-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .6rem; }
.order-item {
  display: grid; grid-template-columns: 1fr auto; gap: .35rem 1rem; align-items: center;
  padding: 1rem 1.1rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  transition: border-color .2s, box-shadow .2s;
}
.order-item:hover { border-color: var(--accent); box-shadow: var(--shadow-sm); }
.order-item .oi-title { font-weight: 600; display: flex; align-items: center; gap: .5rem; min-width: 0; }
.order-item .oi-title span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.order-item .oi-meta { grid-column: 1; font-size: .82rem; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.order-item .oi-side { grid-row: 1 / span 2; grid-column: 2; display: flex; flex-direction: column; align-items: flex-end; gap: .35rem; }
.order-item .oi-side small { color: var(--text-3); font-size: .78rem; }
.order-item.is-unread { border-inline-start: 3px solid var(--accent); }
.unread-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); flex: none; }
.order-number { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .85em; color: var(--text-3); font-weight: 600; }
.order-item .quick-assign { max-width: 180px; padding: .35rem 2rem .35rem .6rem; font-size: .8rem; }
@media (max-width: 560px) {
  .order-item { grid-template-columns: 1fr; }
  .order-item .oi-side { grid-row: auto; grid-column: 1; flex-direction: row; align-items: center; justify-content: space-between; }
}

.empty { text-align: center; padding: 3rem 1.5rem; }
.empty h2 { font-size: 1.2rem; margin-bottom: .5rem; }
.empty p { color: var(--text-2); margin-bottom: 1.25rem; }
.skeleton { border-radius: var(--radius); background: linear-gradient(90deg, var(--surface-2), var(--surface), var(--surface-2)); background-size: 200% 100%; animation: shimmer 1.2s infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- Dashboard ---------- */
.dash-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 1.25rem; align-items: start; }
@media (max-width: 900px) { .dash-grid { grid-template-columns: 1fr; } .dash-grid > aside { order: -1; } }
.dash-grid > * { min-width: 0; }
.sub-card .sub-status { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem; margin-bottom: .75rem; }
.sub-card .price { font-family: var(--font-display); font-size: 1.6rem; font-weight: 700; }
.sub-card .price small { font-size: .85rem; font-weight: 500; color: var(--text-3); }
.sub-card ol, .sub-card ul { margin: .5rem 0 0; padding-inline-start: 1.1rem; font-size: .88rem; color: var(--text-2); display: grid; gap: .3rem; }
.pay-lines { list-style: none; padding: .9rem 1rem !important; margin-top: .75rem !important; background: var(--surface-2); border-radius: var(--radius-sm); }
.nick-card p { font-size: .88rem; color: var(--text-2); }
.nick-card .nick { font-size: 1.05rem; color: var(--text); font-weight: 600; display: block; margin: .35rem 0; }

/* ---------- Order page ---------- */
.back-link { font-size: .88rem; color: var(--text-3); font-weight: 500; }
.back-link:hover { color: var(--accent); }
.order-head { margin-bottom: 1.25rem; }
.order-head-row { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 1rem; margin-top: .5rem; }
.order-head h1 { font-size: clamp(1.35rem, 3vw, 1.8rem); font-weight: 700; margin: .25rem 0 .5rem; overflow-wrap: anywhere; }
.order-meta-line { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; font-size: .88rem; color: var(--text-2); }
.order-actions { display: flex; flex-wrap: wrap; gap: .5rem; }

.order-grid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 1.25rem; align-items: start; }
.order-side { display: grid; gap: 1rem; }
@media (max-width: 960px) { .order-grid { grid-template-columns: 1fr; } }

.chat { display: flex; flex-direction: column; padding: 0 !important; overflow: hidden; }
.chat .card-head { padding: 1.1rem 1.25rem 0; }
.chat-list { height: min(60vh, 560px); overflow-y: auto; padding: .5rem 1.25rem 1rem; overscroll-behavior: contain; }
.chat-empty { text-align: center; padding: 3rem 0; }
.msg-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .9rem; }
.msg { max-width: 80%; display: flex; flex-direction: column; gap: .25rem; }
.msg-mine { align-self: flex-end; align-items: flex-end; }
.msg-author { font-size: .75rem; font-weight: 600; color: var(--text-3); }
.msg-bubble { padding: .7rem .9rem; border-radius: 14px 14px 14px 4px; background: var(--surface-2); overflow-wrap: anywhere; }
.msg-bubble p { white-space: pre-wrap; font-size: .93rem; line-height: 1.5; }
.msg-mine .msg-bubble { background: var(--accent); color: #fff; border-radius: 14px 14px 4px 14px; }
.msg time, .msg-system time { font-size: .7rem; color: var(--text-3); }
.msg-system { align-self: center; text-align: center; max-width: 90%; display: flex; flex-direction: column; align-items: center; gap: .35rem; font-size: .82rem; color: var(--text-2); }
.msg-system > span { background: var(--bg); border: 1px dashed var(--border-strong); padding: .4rem .8rem; border-radius: var(--radius-pill); }
.msg-attachments { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .4rem; }
.msg-bubble p + .msg-attachments { margin-top: .6rem; }
.attachment {
  display: inline-flex; align-items: center; gap: .4rem; max-width: 100%;
  padding: .4rem .6rem; border-radius: var(--radius-sm); cursor: pointer; font-size: .82rem; font-weight: 500;
  background: var(--surface); color: var(--text); border: 1px solid var(--border);
}
.attachment span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 220px; }
.attachment small { color: var(--text-3); }
.attachment svg { width: 16px; height: 16px; flex: none; color: var(--accent); }
.attachment:hover { border-color: var(--accent); }

.composer { border-top: 1px solid var(--border); padding: .9rem 1.25rem 1rem; display: grid; gap: .6rem; background: var(--surface); }
.composer .textarea { min-height: 64px; resize: vertical; }
.composer-row { display: flex; align-items: center; gap: .5rem; }
.composer-row label.btn { cursor: pointer; }
.composer-hint { margin-inline-end: auto; }
@media (max-width: 560px) { .composer-hint { display: none; } .composer-row label.btn { margin-inline-end: auto; } }
.composer-files { display: flex; flex-wrap: wrap; gap: .4rem; }
.composer-files:empty { display: none; }
.pending-chip { display: inline-flex; align-items: center; gap: .35rem; font-size: .8rem; padding: .3rem .4rem .3rem .6rem; border-radius: var(--radius-pill); background: var(--accent-soft); color: var(--accent); }
.pending-chip svg { width: 14px; height: 14px; }
.pending-chip button { border: 0; background: none; color: inherit; cursor: pointer; font-size: 1rem; line-height: 1; padding: 0 .25rem; }

.file-list { list-style: none; margin: 0 0 1rem; padding: 0; display: grid; gap: .5rem; }
.file-row { display: flex; align-items: flex-start; gap: .65rem; padding: .6rem; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--bg); }
.file-icon { width: 32px; height: 32px; flex: none; display: grid; place-items: center; border-radius: 8px; background: var(--accent-soft); color: var(--accent); }
.file-icon svg { width: 17px; height: 17px; }
.file-main { flex: 1; min-width: 0; }
.file-name { display: block; max-width: 100%; border: 0; background: none; padding: 0; cursor: pointer; text-align: start; font-weight: 600; font-size: .88rem; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-name:hover { color: var(--accent); }
.file-meta { font-size: .75rem; color: var(--text-3); }
.file-note { font-size: .8rem; color: var(--text-2); margin-top: .3rem; white-space: pre-wrap; }
.version { display: inline-block; margin-inline-end: .4rem; padding: .05rem .4rem; border-radius: 6px; background: var(--accent); color: #fff; font-size: .72rem; }
.latest-label { font-size: .7rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); margin-top: .25rem; }
.email-hint { display: flex; gap: .5rem; margin-top: .85rem; font-size: .8rem; color: var(--text-2); }
.email-hint svg { width: 16px; height: 16px; flex: none; margin-top: 2px; color: var(--accent); }
.email-hint a { color: var(--accent); }

.brief { display: grid; grid-template-columns: auto 1fr; gap: .35rem 1rem; margin: 0 0 .9rem; font-size: .88rem; }
.brief dt { color: var(--text-3); }
.brief dd { margin: 0; font-weight: 500; overflow-wrap: anywhere; }
.instructions { white-space: pre-wrap; font-size: .9rem; line-height: 1.6; padding: .9rem; background: var(--bg); border-radius: var(--radius-sm); border: 1px solid var(--border); max-height: 320px; overflow-y: auto; overflow-wrap: anywhere; }
.card-admin { border-color: rgba(217, 58, 68, .3) !important; }
.card-admin .field { margin-bottom: .75rem; }
.identity { margin-top: 1rem; padding-top: 1rem; border-top: 1px dashed var(--border-strong); }

/* ---------- Forms ---------- */
.form-card { max-width: 760px; }
.dropzone {
  display: grid; place-items: center; text-align: center; gap: .35rem;
  padding: 1.5rem; border: 2px dashed var(--border-strong); border-radius: var(--radius); background: var(--bg);
  cursor: pointer; transition: border-color .2s, background-color .2s;
}
.dropzone:hover, .dropzone.is-over { border-color: var(--accent); background: var(--accent-soft); }
.dropzone strong { color: var(--accent); }
.dropzone small { color: var(--text-3); }
.check { display: flex; gap: .6rem; align-items: flex-start; font-size: .9rem; cursor: pointer; }
.check input { margin-top: .25rem; width: 18px; height: 18px; accent-color: var(--accent); flex: none; }
.check a { color: var(--accent); text-decoration: underline; }
.progress { height: 8px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.progress > span { display: block; height: 100%; width: 0; background: var(--accent); transition: width .2s; }

/* ---------- Auth pages ---------- */
.auth-wrap { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.auth-aside {
  position: relative; overflow: hidden; color: #fff; padding: clamp(2rem, 5vw, 4rem);
  background: linear-gradient(150deg, var(--accent), #5b3cf0 60%, #121845);
  display: flex; flex-direction: column; justify-content: space-between; gap: 2rem;
}
.auth-aside .brand small { color: rgba(255,255,255,.7); }
.auth-aside h2 { font-size: clamp(1.6rem, 3vw, 2.3rem); font-weight: 700; max-width: 16ch; }
.auth-aside ul { list-style: none; padding: 0; margin: 1.5rem 0 0; display: grid; gap: .7rem; }
.auth-aside li { display: flex; gap: .6rem; color: rgba(255,255,255,.88); }
.auth-aside li::before { content: "✓"; font-weight: 700; }
.auth-aside .team-note { color: rgba(255,255,255,.75); font-size: .88rem; }
.auth-main { display: grid; place-items: center; padding: clamp(1.5rem, 5vw, 3rem) var(--gutter); background: var(--bg); }
.auth-card { width: 100%; max-width: 420px; }
.auth-card h1 { font-size: 1.7rem; font-weight: 700; }
.auth-card > p { color: var(--text-2); margin-top: .4rem; }
.auth-card .tabs { margin-top: 1.5rem; }
.btn-google { gap: .65rem; margin-top: 1.25rem; background: var(--surface); color: var(--text); border: 1px solid var(--border-strong); }
.btn-google:hover { background: var(--surface-2); }
.btn-google svg { flex: none; }
.auth-google-note { margin-top: .6rem; text-align: center; }
.auth-google-note a { color: var(--accent); }
.auth-or { display: flex; align-items: center; gap: .75rem; margin: 1.25rem 0 .25rem; color: var(--text-3); font-size: .85rem; }
.auth-or::before, .auth-or::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.auth-switch { margin-top: 1.25rem; font-size: .9rem; color: var(--text-2); text-align: center; }
.auth-switch button, .link-btn { border: 0; background: none; padding: 0; color: var(--accent); font-weight: 600; cursor: pointer; }
.auth-mobile-brand { display: none; margin-bottom: 1.5rem; }
@media (max-width: 860px) {
  .auth-wrap { grid-template-columns: 1fr; }
  .auth-aside { display: none; }
  .auth-mobile-brand { display: inline-flex; }
}

/* ---------- Tables (admin) ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.table th, .table td { padding: .75rem .9rem; text-align: start; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table th { font-size: .75rem; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); font-weight: 600; background: var(--bg); white-space: nowrap; }
.table tr:last-child td { border-bottom: 0; }
.table td small { display: block; color: var(--text-3); }
.table .actions { display: flex; gap: .4rem; flex-wrap: wrap; }
.toolbar { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; justify-content: space-between; margin-bottom: 1rem; }
.toolbar .input { max-width: 280px; }
.setup-link { margin-top: 1rem; word-break: break-all; font-size: .8rem; }

/* ---------- Modal ---------- */
.modal { border: 0; padding: 0; border-radius: var(--radius-lg); width: min(520px, calc(100vw - 32px)); background: var(--surface); color: var(--text); box-shadow: var(--shadow-lg); }
.modal::backdrop { background: rgba(10, 14, 40, .5); backdrop-filter: blur(2px); }
.modal-body { padding: 1.5rem; display: grid; gap: 1rem; }
.modal-body h2 { font-size: 1.25rem; font-weight: 600; }
.modal-text { color: var(--text-2); font-size: .92rem; }
.modal-actions { display: flex; justify-content: flex-end; gap: .5rem; margin-top: .25rem; }

/* ---------- Toasts ---------- */
.toasts { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 100; display: grid; gap: .5rem; width: min(420px, calc(100vw - 32px)); }
.toast { padding: .8rem 1rem; border-radius: var(--radius-sm); background: var(--ink); color: #fff; font-size: .9rem; box-shadow: var(--shadow-lg); animation: toast-in .25s ease; transition: opacity .4s, transform .4s; }
.toast-error { background: #c02f39; }
.toast.is-leaving { opacity: 0; transform: translateY(8px); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

/* ---------- Language picker ---------- */
.lang-select { width: auto; padding: .4rem 2rem .4rem .7rem; font-size: .85rem; background-color: transparent; border-color: var(--border); }
.auth-lang { display: flex; justify-content: flex-end; margin-bottom: 1rem; }

/* ---------- Admin: landing pages ---------- */
.lp-builder-row { display: grid; grid-template-columns: 120px 200px 1fr; gap: 1rem; }
@media (max-width: 700px) { .lp-builder-row { grid-template-columns: 1fr; } }
.lp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 1rem; margin-top: 1rem; }
.lp-card { display: flex; flex-direction: column; gap: .6rem; }
.lp-card-head { display: grid; gap: .2rem; }
.lp-card-head h3 { font-size: 1.05rem; font-weight: 600; }
.lp-stats { font-size: .8rem; color: var(--text-3); white-space: nowrap; }
.lp-stats strong { color: var(--text); }
.lp-headline { font-size: .9rem; font-style: italic; color: var(--text-2); }
.lp-links { display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; font-size: .85rem; }
.lp-lang { padding: .2rem .55rem; border-radius: var(--radius-pill); border: 1px solid var(--border); font-weight: 600; font-size: .78rem; color: var(--accent); }
.lp-lang:hover { background: var(--accent-soft); }
.lp-url { margin-top: auto; display: flex; gap: .5rem; align-items: center; padding-top: .5rem; border-top: 1px dashed var(--border); }
.lp-url code { flex: 1; min-width: 0; font-size: .75rem; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.source-tag { display: inline-block; font-size: .78rem; padding: .15rem .5rem; border-radius: var(--radius-pill); background: var(--accent-soft); color: var(--accent); max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: middle; }

/* Online payment (PayPal) on the subscription card */
.pay-online { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--border); }
.pay-online h3, .pay-or { font-size: .95rem; font-weight: 600; margin: 0 0 .35rem; }
.pay-online .muted { font-size: .85rem; }
.paypal-buttons { margin-top: .75rem; min-height: 45px; }
.pay-or { margin-top: 1.25rem; padding-top: 1rem; border-top: 1px solid var(--border); }
.sub-renew { font-size: .85rem; margin-top: .25rem; }

/* ---------- Paying for a single task ---------- */
.pay-task { margin: 0 0 1.25rem; display: grid; gap: .6rem; }
.pay-task .paypal-buttons { max-width: 420px; }
.price-note { margin: 0; }

/* ---------- Payment gate (pop-up between placing a task and its page) ---------- */
.pay-gate .pay-gate-task { display: grid; gap: .2rem; }
.pay-gate .pay-gate-task .order-number { font-size: .8rem; }
.pay-gate .pay-gate-price .amount { font-family: var(--font-display); font-size: 2rem; font-weight: 700; letter-spacing: -0.02em; }
.pay-gate .paypal-buttons { min-height: 110px; }
/* An unpaid task shows only the "Pay now" notice, not the conversation and files. */
.is-unpaid .order-grid { display: none; }

/* ---------- Task catalogue ---------- */
.page-actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.catalog-search { display: grid; grid-template-columns: 1fr minmax(0, 220px); gap: .6rem; margin-bottom: 1.25rem; }
.input-lg { font-size: 1.05rem; padding: .85rem 1rem; }
@media (max-width: 600px) { .catalog-search { grid-template-columns: 1fr; } }
.task-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: .8rem; }
.task-card { display: flex; flex-direction: column; gap: .4rem; height: 100%; padding: 1.1rem 1.15rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); color: inherit; text-decoration: none; transition: border-color .15s, transform .15s; }
.task-card:hover, .task-card:focus-visible { border-color: var(--accent); transform: translateY(-1px); }
.task-card-cat { font-size: .75rem; font-weight: 600; color: var(--accent); }
.task-card-title { font-size: 1rem; line-height: 1.35; }
.task-card-summary { font-size: .86rem; color: var(--text-2); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.task-card-meta { margin-top: auto; padding-top: .5rem; display: flex; flex-wrap: wrap; gap: .35rem .9rem; font-size: .8rem; color: var(--text-3); }
.task-card-price { font-weight: 700; color: var(--text); }
.catalog-more { display: flex; justify-content: center; margin-top: 1.25rem; }
.catalog-more[hidden] { display: none; }
.catalog-loading { text-align: center; margin-top: 1rem; }
.task-page { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 1rem; align-items: start; margin-top: .75rem; }
@media (max-width: 860px) { .task-page { grid-template-columns: 1fr; } .task-buy { order: -1; } }
.task-main h1 { font-size: clamp(1.4rem, 3vw, 1.9rem); margin: .25rem 0 .5rem; }
.task-main h2 { font-size: 1.02rem; margin: 1.4rem 0 .5rem; }
.task-summary { color: var(--text-2); font-size: 1.02rem; }
.task-text { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.65; font-size: .93rem; }
.task-steps { margin: 0; padding-inline-start: 1.2rem; display: grid; gap: .35rem; font-size: .93rem; color: var(--text-2); }
.task-buy { position: sticky; top: 1rem; display: grid; gap: .85rem; }
.task-buy .price, .catalog-step .price { font-family: var(--font-display); font-size: 1.7rem; font-weight: 700; }
.task-buy .brief { margin: 0; }
.task-details { margin-top: .9rem; font-size: .9rem; }
.task-details summary { cursor: pointer; font-weight: 600; margin-bottom: .5rem; }
.catalog-step { margin-top: 1rem; }
.catalog-step .notice { margin: .75rem 0 1rem; }
.ok-text { color: var(--success); font-weight: 600; }
.jev-panel { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--border); display: grid; gap: .6rem; }
.jev-panel h3 { font-size: .95rem; }
.jev-panel .brief { margin: 0; }
.jev-actions { display: flex; flex-wrap: wrap; gap: .4rem; }
.catalog-needs { margin-bottom: 1rem; }
.review-card { margin-top: 1rem; display: grid; gap: .75rem; }
.card-jev { border-color: color-mix(in srgb, #8a5bff 35%, transparent) !important; }
.card-jev .brief { margin-bottom: .75rem; }
.guard-section { margin-top: 1.75rem; }
.guard-section h2 { font-size: 1.1rem; margin-bottom: .75rem; }
.rule-list { list-style: none; margin: 0 0 .75rem; padding: 0; display: grid; gap: .75rem; }
.rule-card { display: grid; gap: .5rem; }
.rule-card .rule-id { max-width: 110px; }
.rule-card details summary { cursor: pointer; font-weight: 600; font-size: .88rem; margin-bottom: .5rem; }
.rule-card [data-remove] { justify-self: start; }
.threshold-grid { display: grid; gap: 0 1.25rem; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); align-items: start; }
.threshold-grid button { grid-column: 1 / -1; justify-self: start; }
.jev-sections { display: grid; gap: 1.25rem; }
.jev-sections > * { min-width: 0; }
.free-note { margin-top: .75rem; display: inline-block; }
