/* UGC Portal - visual system
   Warm paper, deep forest ink, colour reserved almost entirely for urgency.
   If a row is tinted, it needs attention today. Nothing else is decorated. */

:root {
  --paper:      #FBFAF7;
  --card:       #FFFFFF;
  --ink:        #17211F;
  --muted:      #6E7A74;
  --line:       #E4E5DF;
  --accent:     #1F4D3D;
  --accent-ink: #FFFFFF;

  --late:       #B23A2E;
  --late-bg:    #FDF0EE;
  --late-line:  #F2DAD6;
  --soon:       #A9691A;
  --soon-bg:    #FDF5E9;
  --soon-line:  #F3E3C9;

  --radius:     10px;
  --shadow:     0 1px 2px rgba(23,33,31,.05), 0 8px 24px -16px rgba(23,33,31,.25);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 16px/1.55 'Inter', ui-sans-serif, system-ui, -apple-system, sans-serif;
}

h1, h2, h3, .display {
  font-family: 'Bricolage Grotesque', 'Inter', ui-sans-serif, system-ui, sans-serif;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin: 0;
}

a { color: var(--accent); }

/* ---------- chrome ---------- */

.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 1rem;
  padding: .875rem 1.25rem;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}
.topbar .brand { font-size: 1rem; letter-spacing: -.01em; text-decoration: none; color: var(--ink); }
.topbar .spacer { flex: 1; }
.topbar .who { color: var(--muted); font-size: .8125rem; }
.topbar form { margin: 0; }

.wrap { max-width: 940px; margin: 0 auto; padding: 1.75rem 1.25rem 4rem; }

.pagehead {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 1rem; margin-bottom: 1.5rem; flex-wrap: wrap;
}
.pagehead h1 { font-size: 1.75rem; }
.pagehead .count { color: var(--muted); font-size: .875rem; margin-top: .25rem; }
.backlink { display: inline-block; color: var(--muted); font-size: .8125rem; text-decoration: none; margin-bottom: .75rem; }
.backlink:hover { color: var(--accent); }

/* ---------- buttons ---------- */

.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  font: 600 .9375rem/1 'Inter', sans-serif;
  padding: .7rem 1.1rem; border-radius: var(--radius);
  border: 1px solid var(--accent); background: var(--accent); color: var(--accent-ink);
  cursor: pointer; text-decoration: none; white-space: nowrap;
}
.btn:hover { filter: brightness(1.15); }
.btn:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.btn.ghost { background: var(--card); color: var(--ink); border-color: var(--line); }
.btn.ghost:hover { border-color: var(--muted); filter: none; }
.btn.small { padding: .45rem .75rem; font-size: .8125rem; }
.btn.danger { background: var(--card); color: var(--late); border-color: var(--late-line); }

/* ---------- the job list ----------
   Signature: every row leads with days remaining, the only number that
   changes what she does today. Status is secondary, shown as a pill. */

.jobs { display: flex; flex-direction: column; gap: .625rem; list-style: none; margin: 0; padding: 0; }

.job {
  display: grid;
  grid-template-columns: 68px 1fr auto;
  align-items: center; gap: 1rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: .875rem 1rem;
  transition: transform .12s ease, box-shadow .12s ease;
}
.job:hover { transform: translateY(-1px); box-shadow: var(--shadow); }

.clock {
  display: grid; place-items: center; gap: 1px;
  border-radius: 8px; padding: .5rem .25rem;
  border: 1px solid transparent;
}
.clock .n {
  font-family: 'Bricolage Grotesque', sans-serif; font-weight: 700;
  font-size: 1.5rem; line-height: 1; letter-spacing: -.03em;
  font-variant-numeric: tabular-nums;
}
.clock .u { font-size: .625rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }

.job.late .clock { background: var(--late-bg); border-color: var(--late-line); }
.job.late .clock .n, .job.late .clock .u { color: var(--late); }
.job.soon .clock { background: var(--soon-bg); border-color: var(--soon-line); }
.job.soon .clock .n, .job.soon .clock .u { color: var(--soon); }
.job.done .clock .n, .job.none .clock .n { color: var(--muted); font-size: 1.0625rem; }

.job .title { font-weight: 600; letter-spacing: -.01em; text-decoration: none; color: var(--ink); }
.job .title:hover { text-decoration: underline; text-underline-offset: 3px; }
.job .meta { color: var(--muted); font-size: .8125rem; margin-top: .15rem; }
.job .meta span + span::before { content: '\00b7'; margin: 0 .45rem; }

.job .right { display: flex; align-items: center; gap: .625rem; }

.pill {
  font-size: .75rem; font-weight: 600; padding: .3rem .6rem;
  border-radius: 999px; white-space: nowrap; border: 1px solid currentColor;
}

.iconlink {
  display: grid; place-items: center; width: 34px; height: 34px;
  border: 1px solid var(--line); border-radius: 8px; color: var(--muted);
  text-decoration: none; font-size: .875rem;
}
.iconlink:hover { color: var(--accent); border-color: var(--accent); }

/* ---------- forms ---------- */

.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.5rem; }
.field { margin-bottom: 1.125rem; }
.field label { display: block; font-size: .8125rem; font-weight: 600; margin-bottom: .375rem; }
.field .hint { display: block; font-weight: 400; color: var(--muted); font-size: .75rem; margin-top: .3rem; }

input[type=text], input[type=url], input[type=date], input[type=password], select, textarea {
  width: 100%; padding: .65rem .75rem; font: 400 1rem/1.4 'Inter', sans-serif;
  color: var(--ink); background: var(--card);
  border: 1px solid var(--line); border-radius: 8px;
}
textarea { min-height: 110px; resize: vertical; }
input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent);
}
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.actions { display: flex; gap: .625rem; align-items: center; margin-top: 1.5rem; flex-wrap: wrap; }

.alert {
  border-radius: 8px; padding: .7rem .85rem; font-size: .875rem; margin-bottom: 1.25rem;
  background: var(--late-bg); border: 1px solid var(--late-line); color: var(--late);
}
.alert ul { margin: .35rem 0 0; padding-left: 1.1rem; }

/* ---------- detail ---------- */

.detailgrid { display: grid; grid-template-columns: 1fr 270px; gap: 1.25rem; align-items: start; }
.dl { display: grid; grid-template-columns: 132px 1fr; gap: .65rem 1rem; margin: 0; font-size: .9375rem; }
.dl dt { color: var(--muted); font-size: .8125rem; padding-top: .12rem; }
.dl dd { margin: 0; overflow-wrap: anywhere; }
.side .panel + .panel { margin-top: 1rem; }
.side h2 { font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: .85rem; font-family: 'Inter', sans-serif; font-weight: 600; }

.timeline { list-style: none; margin: 0; padding: 0; font-size: .8125rem; }
.timeline li { padding-left: 1rem; position: relative; padding-bottom: .65rem; color: var(--muted); }
.timeline li::before {
  content: ''; position: absolute; left: 0; top: .45rem;
  width: 6px; height: 6px; border-radius: 50%; background: var(--line);
}
.timeline li:first-child::before { background: var(--accent); }
.timeline strong { color: var(--ink); font-weight: 600; }

/* ---------- empty ---------- */

.empty { text-align: center; padding: 3.5rem 1.5rem; }
.empty h2 { font-size: 1.25rem; margin-bottom: .4rem; }
.empty p { color: var(--muted); margin: 0 0 1.5rem; }

/* ---------- auth ---------- */

.authwrap { min-height: 100vh; display: grid; place-items: center; padding: 1.25rem; }
.authcard { width: min(390px, 100%); }
.authcard .mark { font-size: 1.5rem; margin-bottom: .2rem; }
.authcard .sub { color: var(--muted); font-size: .875rem; margin: 0 0 1.5rem; }
.authcard .btn { width: 100%; justify-content: center; margin-top: .25rem; }

/* ---------- responsive ---------- */

@media (max-width: 640px) {
  .job { grid-template-columns: 56px 1fr; row-gap: .75rem; }
  .job .right { grid-column: 1 / -1; justify-content: flex-start; }
  .row2 { grid-template-columns: 1fr; }
  .detailgrid { grid-template-columns: 1fr; }
  .dl { grid-template-columns: 108px 1fr; }
  .pagehead h1 { font-size: 1.5rem; }
}

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

/* ---------- gate 4: money ---------- */


.owed {
  display: block; margin-bottom: 1rem; padding: .75rem 1rem;
  background: var(--soon-bg); border: 1px solid var(--soon-line);
  border-radius: var(--radius); color: var(--soon);
  font-size: .9375rem; text-decoration: none;
}
.owed strong { font-family: 'Bricolage Grotesque', sans-serif; font-size: 1.0625rem; }
.owed:hover { filter: brightness(.98); }

.job .meta .owed-dot { color: var(--soon); font-weight: 600; }
.job .meta .ispaid { color: var(--accent); font-weight: 600; }

.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: .75rem; margin-bottom: 1.25rem; }
.tile {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 1.125rem 1.25rem;
  display: flex; flex-direction: column; gap: .2rem;
}
.tile.flag { background: var(--soon-bg); border-color: var(--soon-line); }
.tile .k { font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.tile .v {
  font-family: 'Bricolage Grotesque', sans-serif; font-weight: 700;
  font-size: 1.65rem; letter-spacing: -.03em; font-variant-numeric: tabular-nums;
}
.tile.flag .v { color: var(--soon); }
.tile .s { font-size: .8125rem; color: var(--muted); }

h2.sect {
  font-family: 'Inter', sans-serif; font-weight: 600;
  font-size: .75rem; text-transform: uppercase; letter-spacing: .08em;
  color: var(--muted); margin-bottom: .9rem;
}
.none { color: var(--muted); font-size: .875rem; margin: 0; }

table.money { width: 100%; border-collapse: collapse; font-size: .9375rem; }
table.money th {
  text-align: right; font-size: .75rem; text-transform: uppercase;
  letter-spacing: .06em; color: var(--muted); font-weight: 600;
  padding: 0 0 .6rem; border-bottom: 1px solid var(--line);
}
table.money th:first-child, table.money td:first-child { text-align: left; }
table.money td {
  text-align: right; padding: .6rem 0; border-bottom: 1px solid var(--line);
  font-variant-numeric: tabular-nums;
}
table.money tr:last-child td { border-bottom: 0; }
table.money td.net { font-weight: 600; }

.job.plat { grid-template-columns: 1fr auto; }
.job.plat .title { display: block; }
.job.plat.off { opacity: .55; }

.radios { display: flex; gap: 1rem; flex-wrap: wrap; }
.radio { display: inline-flex; align-items: center; gap: .4rem; font-size: .9375rem; font-weight: 400; }
.radio input { width: auto; }

@media (max-width: 640px) {
  .tiles { grid-template-columns: 1fr; }
  table.money { font-size: .875rem; }
  .topbar { flex-wrap: wrap; gap: .625rem 1rem; }
}

/* ---------- menu ---------- */

.topbar .btn.small { height: 34px; padding: 0 .75rem; font-size: .8125rem; }

.menu { position: relative; }

/* The disclosure triangle has to be killed three ways: Safari needs the
   webkit marker rule, Firefox needs ::marker, and neither is reliable unless
   summary is not a list-item. */
.menu summary { list-style: none; }
.menu summary::-webkit-details-marker { display: none; }
.menu summary::marker { display: none; content: ''; }

.burger {
  display: inline-flex; align-items: center; gap: .35rem;
  height: 34px; padding: 0 .6rem 0 .5rem;
  border: 1px solid var(--line); border-radius: 8px;
  background: var(--card); color: var(--ink); cursor: pointer;
  font: 600 .8125rem/1 'Inter', sans-serif; position: relative;
  -webkit-tap-highlight-color: transparent;
}
.burger svg { width: 16px; height: 16px; display: block; }
.burger:hover { border-color: var(--muted); }
.burger:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.menu[open] .burger { border-color: var(--accent); color: var(--accent); }

.burger .dot {
  position: absolute; top: -4px; right: -4px;
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--soon); border: 2px solid var(--paper);
}

.scrim { display: none; }

.sheet {
  position: absolute; right: 0; top: calc(100% + .5rem); z-index: 30;
  min-width: 230px; background: var(--card);
  border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: .4rem;
  display: flex; flex-direction: column;
}
.sheet .whoami {
  font-size: .75rem; color: var(--muted);
  padding: .6rem .85rem .45rem;
}
.sheet a, .sheet button {
  display: flex; align-items: center; justify-content: space-between; gap: .6rem;
  text-align: left; width: 100%; min-height: 46px;
  font: 500 1rem/1.2 'Inter', sans-serif;
  color: var(--ink); text-decoration: none; padding: .7rem .85rem;
  border: 0; background: none; border-radius: 8px; cursor: pointer;
}
.sheet a:hover, .sheet button:hover { background: var(--paper); }
.sheet a:active, .sheet button:active { background: var(--line); }
.sheet form { margin: .35rem 0 0; border-top: 1px solid var(--line); padding-top: .35rem; }
.sheet button { color: var(--late); font-weight: 600; }
.sheet .badge {
  background: var(--soon-bg); color: var(--soon); border: 1px solid var(--soon-line);
  font-size: .75rem; font-weight: 600; padding: .15rem .5rem; border-radius: 999px;
  white-space: nowrap;
}

/* On a phone the menu becomes a bottom sheet: thumb-reachable, big rows,
   and a scrim so tapping anywhere else dismisses it. */
@media (max-width: 640px) {

  .menu[open] .scrim {
    display: block; position: fixed; inset: 0; z-index: 40;
    background: rgba(23, 33, 31, .35);
  }
  .menu[open] .sheet {
    position: fixed; z-index: 50;
    left: .6rem; right: .6rem; top: auto;
    bottom: calc(.6rem + env(safe-area-inset-bottom, 0px));
    max-height: 78vh; overflow-y: auto; overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    border-radius: 16px; padding: .5rem .5rem .65rem;
    box-shadow: 0 -8px 40px -12px rgba(23,33,31,.45);
  }
  .sheet::before {
    content: ''; display: block; width: 38px; height: 4px; border-radius: 2px;
    background: var(--line); margin: .4rem auto .5rem;
  }
  .sheet .whoami { text-align: center; padding-bottom: .6rem; }
  .sheet a, .sheet button { min-height: 48px; font-size: 1rem; }
}



/* ---------- drive previews ---------- */

.cover { display: block; width: 40px; height: 40px; border-radius: 7px; overflow: hidden;
         border: 1px solid var(--line); flex: 0 0 auto; background: var(--paper); }
.cover img { width: 100%; height: 100%; object-fit: cover; display: block; }

.drivepreview { display: block; width: 100%; max-width: 220px; margin-bottom: .5rem;
                border: 1px solid var(--line); border-radius: 10px; overflow: hidden;
                background: var(--paper); }
.drivepreview img { width: 100%; display: block; }

/* ---------- link thumbnails ---------- */

.strip { display: inline-flex; align-items: center; gap: 3px; flex: 0 0 auto; }
.cover { display: block; width: 30px; height: 30px; border-radius: 5px; overflow: hidden;
         border: 1px solid var(--line); background: var(--paper); flex: 0 0 auto; }
.cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.strip .more { font-size: .6875rem; color: var(--muted); font-weight: 600; padding-left: 2px; }

.linklist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .5rem; }
.linklist a { display: flex; align-items: center; gap: .6rem; text-decoration: none; }
.lthumb { display: block; width: 44px; height: 44px; border-radius: 6px; overflow: hidden;
          border: 1px solid var(--line); background: var(--paper); flex: 0 0 auto; }
.lthumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.lurl { font-size: .8125rem; overflow-wrap: anywhere; }

@media (max-width: 640px) {
  .cover { width: 26px; height: 26px; }
}


/* Overdue payment. Uses the same red as the "filmed" status rather than a new
   colour, so the palette does not grow a fifth red. */
.meta .overdue {
  color: #B23A2E;
  font-weight: 600;
}
tr.late td { color: #B23A2E; }
tr.late td a { color: #B23A2E; }


/* Usage rights: a quiet badge on the card, and a grouped block on the form.
   Deliberately understated — it is reference, not a status. */
.meta .usagebadge {
  color: var(--accent, #1F4D3D);
  font-weight: 600;
}
fieldset.usage {
  border: 1px solid var(--line, #E3DFD7);
  border-radius: 10px;
  padding: 1rem 1rem .5rem;
  margin: 0 0 1rem;
}
fieldset.usage legend {
  font-weight: 600;
  padding: 0 .4rem;
}
label.check {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin: .4rem 0;
  font-weight: 500;
}
label.check input { width: auto; margin: 0; }


/* Deliverables checklist. A ticked line is struck through and faded rather
   than moved, so the list keeps the order the brief was written in. */
.checklist { list-style: none; margin: 0 0 .875rem; padding: 0; }
.checklist li {
  display: flex; align-items: center; gap: .5rem;
  padding: .35rem 0; border-bottom: 1px solid var(--line, #E3DFD7);
  font-size: .875rem;
}
.checklist li:last-child { border-bottom: 0; }
.checklist li.done .what { text-decoration: line-through; color: var(--muted, #6E7A74); }
.checklist .tick button {
  width: 1.25rem; height: 1.25rem; padding: 0; line-height: 1;
  border: 1px solid var(--line, #E3DFD7); border-radius: 4px;
  background: transparent; cursor: pointer;
}
.checklist li.done .tick button { background: #15803D; color: #fff; border-color: #15803D; }
.checklist .what { flex: 1; }
.checklist .variant { color: var(--muted, #6E7A74); }
.checklist .rm button {
  border: 0; background: transparent; color: var(--muted, #6E7A74);
  cursor: pointer; font-size: 1rem; padding: 0 .25rem;
}
.addrow { display: flex; gap: .4rem; align-items: center; flex-wrap: wrap; }
.addrow input[type=number] { width: 4rem; }
.addrow input[type=text] { flex: 1; min-width: 8rem; }
.meta .deliv { color: var(--muted, #6E7A74); font-weight: 600; }
.meta .deliv.all { color: #15803D; }
