/* Rolekite — light UI in the indigo/cyan palette of the sign-in page.
   Mobile first: base rules target phones, min-width queries widen the layout. */
:root {
  color-scheme: light;
  --bg: #f4f6fb;
  --surface: #ffffff;
  --surface-2: #f7f8fd;
  --ink: #0f172a;
  --ink-2: #334155;
  --muted: #64748b;
  --line: #e4e7f1;
  --line-strong: #cfd5e6;
  --accent: #4f46e5;
  --accent-hover: #4338ca;
  --accent-soft: #eef0ff;
  --accent-ink: #3730a3;
  --cyan: #22d3ee;
  --cyan-soft: #e3f9fd;
  --cyan-ink: #0e7490;
  --brand: linear-gradient(135deg, #6366f1 0%, #22d3ee 100%);
  --warn-bg: #fff7e8;
  --warn-line: #f6d9a4;
  --warn-ink: #8a4b08;
  --danger-bg: #fff1f2;
  --danger-line: #fecdd3;
  --danger-ink: #9f1239;
  --success-bg: #ecfdf5;
  --success-line: #a7f3d0;
  --success-ink: #065f46;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .05);
  --shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 10px 30px -12px rgba(49, 46, 129, .18);
  --focus: 0 0 0 3px rgba(99, 102, 241, .35);
  --font: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(60rem 30rem at -10% -10%, rgba(99, 102, 241, .14), transparent 60%),
    radial-gradient(50rem 26rem at 110% -5%, rgba(34, 211, 238, .14), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  overflow-x: hidden;
}
a { color: var(--accent); }
h1, h2, h3 { margin: 0; letter-spacing: -.02em; line-height: 1.2; }
p { margin: 0; }
svg { flex: none; }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: 8px; }

.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.shell { width: min(100% - 32px, 1040px); margin-inline: auto; }
.main { flex: 1; display: grid; gap: 20px; padding: 20px 0 40px; }

/* Top bar */
.topbar { position: sticky; top: 0; z-index: 10; background: rgba(255, 255, 255, .82); border-bottom: 1px solid var(--line); backdrop-filter: saturate(160%) blur(14px); -webkit-backdrop-filter: saturate(160%) blur(14px); }
.topbar__inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 60px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); font-weight: 750; font-size: 1.05rem; letter-spacing: -.02em; text-decoration: none; }
.brand__mark { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 11px; background: var(--brand); color: #0b1220; box-shadow: 0 6px 16px rgba(99, 102, 241, .3); }
.nav { display: flex; align-items: center; gap: 2px; }
.nav__link { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-width: 44px; min-height: 44px; padding: 0 10px; border-radius: 12px; color: var(--ink-2); font-size: .9rem; font-weight: 600; text-decoration: none; }
.nav__link:hover { background: var(--surface-2); color: var(--ink); }
.nav__link.is-active { background: var(--accent-soft); color: var(--accent-ink); }
/* Labels stay readable for screen readers while phones show icons only. */
.nav__label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.avatar { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--brand); color: #0b1220; font-size: .8rem; font-weight: 800; text-transform: uppercase; }

/* Hero */
.hero { display: grid; gap: 8px; padding: 8px 0 4px; }
.eyebrow { color: var(--accent); font-size: .75rem; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; }
.hero h1 { font-size: clamp(1.6rem, 6vw, 2.4rem); font-weight: 800; }
.hero h1 .grad { background: var(--brand); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero__text { max-width: 58ch; color: var(--muted); }

/* Panels */
.panel { display: grid; gap: 14px; padding: 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.panel__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.panel__head h2 { font-size: 1.05rem; }
.panel__hint { margin-top: 4px; color: var(--muted); font-size: .875rem; }
.counter { flex: none; padding: 3px 10px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); color: var(--ink-2); font-size: .8rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.counter.is-full { background: var(--accent-soft); border-color: transparent; color: var(--accent-ink); }

/* Position chips */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.chip { display: inline-flex; align-items: center; gap: 2px; padding: 4px 4px 4px 12px; border-radius: 999px; background: linear-gradient(var(--surface), var(--surface)) padding-box, var(--brand) border-box; border: 1.5px solid transparent; color: var(--ink); font-size: .9rem; font-weight: 650; }
.chip form { display: contents; }
.chip__remove { display: grid; place-items: center; width: 30px; height: 30px; border: 0; border-radius: 50%; background: transparent; color: var(--muted); cursor: pointer; }
.chip__remove:hover { background: var(--danger-bg); color: var(--danger-ink); }
.add-title { display: flex; gap: 8px; }
.add-title input { flex: 1; min-width: 0; }
.add-title__button { padding: 0 14px; }
.add-title__label { display: none; }
.empty-hint { padding: 12px 14px; border: 1px dashed var(--line-strong); border-radius: var(--radius-sm); background: var(--surface-2); color: var(--ink-2); font-size: .9rem; }

/* Form controls */
.field { display: grid; gap: 6px; }
.field label, .label { color: var(--ink-2); font-size: .8rem; font-weight: 700; }
.field small { color: var(--muted); font-size: .8rem; }
.input, .field input, .field select, .add-title input {
  width: 100%; min-height: 46px; padding: 10px 14px;
  border: 1px solid var(--line-strong); border-radius: 12px;
  background: var(--surface); color: var(--ink); font: inherit; font-size: 1rem;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.field select { appearance: none; padding-right: 40px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; }
input::placeholder { color: #94a3b8; }
input:focus, select:focus { outline: none; border-color: var(--accent); box-shadow: var(--focus); }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 0 18px; border: 0; border-radius: 12px; background: var(--accent); color: #fff; font: inherit; font-weight: 700; text-decoration: none; cursor: pointer; box-shadow: 0 6px 18px -6px rgba(79, 70, 229, .55); transition: background .15s ease, transform .15s ease; }
.button:hover { background: var(--accent-hover); }
.button:active { transform: translateY(1px); }
.button--ghost { background: var(--surface); color: var(--ink-2); border: 1px solid var(--line-strong); box-shadow: none; }
.button--ghost:hover { background: var(--surface-2); color: var(--ink); }
.button--danger { background: var(--danger-ink); box-shadow: 0 6px 18px -6px rgba(159, 18, 57, .45); }
.button--danger:hover { background: #7f1030; }
.panel--danger { border-color: var(--danger-line); }
.check { display: flex; align-items: flex-start; gap: 10px; color: var(--ink-2); font-size: .9rem; cursor: pointer; }
.check input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--danger-ink); }

/* Notices and badges */
.notice { padding: 10px 14px; border: 1px solid; border-radius: var(--radius-sm); font-size: .9rem; }
.notice--error { background: var(--danger-bg); border-color: var(--danger-line); color: var(--danger-ink); }
.notice--success { background: var(--success-bg); border-color: var(--success-line); color: var(--success-ink); }
.notice--info { background: var(--accent-soft); border-color: #dcdffe; color: var(--accent-ink); }
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 999px; font-size: .75rem; font-weight: 700; white-space: nowrap; }
.badge--warn { background: var(--warn-bg); border: 1px solid var(--warn-line); color: var(--warn-ink); }
.badge--source { background: var(--cyan-soft); color: var(--cyan-ink); }
.badge--admin { background: var(--accent-soft); color: var(--accent-ink); }
.badge--remote { background: var(--success-bg); border: 1px solid var(--success-line); color: var(--success-ink); }
.order-place { display: grid; gap: 10px; padding-top: 14px; border-top: 1px solid var(--line); }
.badge--expired { background: var(--surface-2); border: 1px solid var(--line-strong); color: var(--muted); }
.job--expired { opacity: .72; }
.job--expired .job__title { text-decoration: line-through; text-decoration-color: rgba(100, 116, 139, .5); }
.toggle { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; color: var(--ink-2); font-size: .9rem; font-weight: 600; cursor: pointer; }
.toggle input { width: 20px; height: 20px; accent-color: var(--accent); }
.badge--member { background: var(--surface-2); border: 1px solid var(--line); color: var(--ink-2); }

/* Search */
.results { display: grid; gap: 14px; scroll-margin-top: 76px; }
.search { display: grid; gap: 10px; }
.search__bar { position: relative; }
.search__bar svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.search__bar input { padding-left: 44px; min-height: 50px; border-radius: 14px; box-shadow: var(--shadow-sm); }
.search__row { display: grid; gap: 10px; }
.more { border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.more summary { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 46px; padding: 0 14px; color: var(--ink-2); font-size: .9rem; font-weight: 650; cursor: pointer; list-style: none; }
.more summary::-webkit-details-marker { display: none; }
.more summary svg { transition: transform .2s ease; }
.more[open] summary svg { transform: rotate(180deg); }
.more__body { display: grid; gap: 12px; padding: 0 14px 14px; }
.summary__end { display: inline-flex; align-items: center; gap: 8px; }
.more__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.search__submit { width: 100%; }
@media (min-width: 560px) { .search__submit { width: auto; } }
.summary { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding-top: 4px; }
.summary h2 { font-size: 1.05rem; }
.summary p { color: var(--muted); font-size: .875rem; font-variant-numeric: tabular-nums; }

/* Job cards */
.jobs { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; }
.job { position: relative; display: grid; gap: 8px; padding: 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-sm); transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease; }
.job:hover { border-color: #c7cbfb; box-shadow: var(--shadow); }
.job__top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.job__title { font-size: 1.05rem; font-weight: 750; line-height: 1.3; }
.job__link { color: var(--ink); text-decoration: none; }
.job__link::after { content: ""; position: absolute; inset: 0; border-radius: var(--radius); }
.job__link:focus-visible { box-shadow: none; }
.job:focus-within { box-shadow: var(--focus); }
.job__arrow { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--surface-2); color: var(--accent); transition: background .15s ease, transform .15s ease; }
.job:hover .job__arrow { background: var(--accent-soft); transform: translate(2px, -2px); }
.job__company { color: var(--ink-2); font-weight: 600; font-size: .95rem; }
.job__meta { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 0; padding: 0; list-style: none; color: var(--muted); font-size: .85rem; }
.job__meta li { display: inline-flex; align-items: center; gap: 5px; }
.job__foot { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.tag { padding: 2px 9px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-ink); font-size: .75rem; font-weight: 650; }
.job__note { color: var(--warn-ink); font-size: .82rem; }
.evidence { color: var(--ink-2); font-size: .85rem; }
.evidence b { color: var(--muted); font-weight: 650; }

.empty { display: grid; justify-items: center; gap: 8px; padding: 36px 20px; border: 1px dashed var(--line-strong); border-radius: var(--radius); background: rgba(255, 255, 255, .6); text-align: center; }
.empty__icon { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 16px; background: var(--brand); color: #0b1220; }
.empty h3 { font-size: 1.05rem; }
.empty p { max-width: 46ch; color: var(--muted); font-size: .9rem; }

.pagination { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.pagination__page { color: var(--muted); font-size: .875rem; font-variant-numeric: tabular-nums; }

/* Account */
.profile { display: flex; align-items: center; gap: 14px; }
.profile__avatar { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 16px; background: var(--brand); color: #0b1220; font-size: 1.3rem; font-weight: 800; text-transform: uppercase; }
.profile__email { font-weight: 700; overflow-wrap: anywhere; }
.stack { display: grid; gap: 14px; }

/* Admin tables */
.table-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-sm); }
.data-table { width: 100%; border-collapse: collapse; text-align: left; font-size: .9rem; }
.data-table--sources { min-width: 900px; }
.data-table th, .data-table td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: top; overflow-wrap: anywhere; }
.data-table tr:last-child th, .data-table tr:last-child td { border-bottom: 0; }
.data-table thead th { white-space: nowrap; background: var(--surface-2); color: var(--ink-2); font-size: .75rem; letter-spacing: .04em; text-transform: uppercase; }
.data-table tbody th { font-weight: 700; }
.data-table tbody td { font-variant-numeric: tabular-nums; }
.data-table small { color: var(--muted); font-weight: 400; }
.source-problems { margin: 10px 0 0; padding-left: 1.2rem; }
.source-problems li + li { margin-top: 6px; }

.footer { padding: 20px 0 28px; color: var(--muted); font-size: .8rem; text-align: center; }

/* Legal pages: readable text column, no grid gaps between paragraphs. */
.legal { display: block; max-width: 720px; color: var(--ink-2); line-height: 1.6; }
.legal h1 { color: var(--ink); font-size: 1.6rem; letter-spacing: -.02em; }
.legal h2 { margin: 28px 0 8px; color: var(--ink); font-size: 1.1rem; }
.legal h3 { margin: 18px 0 4px; color: var(--ink); font-size: .95rem; }
.legal p, .legal ul { margin: 0 0 10px; }
.legal ul { padding-left: 1.2rem; }
.legal li + li { margin-top: 6px; }
.legal__meta { color: var(--muted); font-size: .85rem; }

@media (min-width: 560px) {
  .add-title__label { display: inline; }
  .order-place { grid-template-columns: minmax(0, 1.4fr) minmax(0, .8fr) minmax(0, 1fr) auto; align-items: end; }
  .add-title__button { padding: 0 18px; }
  .nav__label { position: static; width: auto; height: auto; overflow: visible; clip: auto; }
  .search__row { grid-template-columns: minmax(0, 1fr) auto; align-items: end; }
  .more__body { grid-template-columns: 1fr 1fr; }
}

@media (min-width: 860px) {
  .main { gap: 24px; padding-top: 32px; }
  .panel { padding: 22px; }
  .jobs { grid-template-columns: 1fr 1fr; }
  .account-grid { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 20px; align-items: start; }
  .account-grid .panel--danger { grid-column: 2; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
