/* data.artkiv.app: the Artkiv app's design system adapted to the web, as artkiv.app adapts it.
   Tokens from the review site's mockup. Phone first; three columns from 1024px. */

@font-face {
  font-family: "Mansalva";
  src: url("/fonts/mansalva-regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Inter";
  src: url("/fonts/inter-var-latin.woff2") format("woff2-variations");
  font-weight: 400 800;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304,
    U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Inter";
  src: url("/fonts/inter-var-latin-ext.woff2") format("woff2-variations");
  font-weight: 400 800;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308,
    U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113,
    U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --cream: #fff7ec;
  --paper: #fff1d6;
  --ink: #2a211b;
  --ink2: #424242;
  --soft: #6b5847;
  --muted: #6e655e; /* the mockup's #7a716a, darkened to keep 4.5:1 on paper and chips */
  --accent: #b0441a;
  --hair: #f0e9e0;
  --field: #e6dacb;
  --dash: #d6c9bb;
  --err: #c62828;
  --warn: #a35b00;
  --ok: #2b7530; /* the mockup's #2e7d32, darkened to keep 4.5:1 on its chip */
  --rest: #f3ede5;
  --track: #e2dad0;
  --orange: #ff6b35;
  --grad: linear-gradient(135deg, #ff6b35, #ffa500);
  --sh: 0 2px 8px rgba(0, 0, 0, 0.08);
  --glow: 0 8px 24px rgba(255, 107, 53, 0.38);
  --font: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  --display: Mansalva, "Bradley Hand", cursive;
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.4;
}

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

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

:focus-visible {
  outline: 3px solid var(--orange);
  outline-offset: 2px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* The screen ------------------------------------------------------------------------------ */

.scr {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  max-width: 640px;
  margin: 0 auto;
}

.hdr {
  position: relative;
  background: var(--paper);
  padding: 24px 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.hdr::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 8px;
  background: var(--grad);
}

.kick {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--soft);
}

.title {
  font-family: var(--display);
  font-size: 34px;
  font-weight: 400;
  line-height: 1.1;
  margin: 0;
  overflow-wrap: anywhere;
}

.sub {
  font-size: 14px;
  color: var(--soft);
  margin: 0;
}

.back {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 44px;
  font-size: 15px;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
  align-self: flex-start;
}

button.back {
  background: none;
  border: none;
  padding: 0;
  font-family: var(--font);
  cursor: pointer;
}

.bar {
  height: 6px;
  border-radius: 999px;
  background: var(--track);
  display: flex;
  margin-top: 8px;
}

.bar > span {
  background: var(--grad);
  border-radius: 999px;
}

.body {
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  flex-grow: 1;
}

.sec {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.over {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0;
}

.card {
  background: #fff;
  border-radius: 12px;
  box-shadow: var(--sh);
  display: flex;
  flex-direction: column;
}

.row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  min-height: 56px;
  border: none;
  border-top: 1px solid var(--hair);
  text-decoration: none;
  color: inherit;
  background: none;
  width: 100%;
  text-align: left;
}

.card > .row:first-child,
.card > :first-child > .row:first-child {
  border-top: none;
}

.row.wrap {
  flex-wrap: wrap;
}

.row.wrap > .grid2 {
  width: 100%;
}

details.sec > summary {
  cursor: pointer;
  min-height: 44px;
  display: flex;
  align-items: center;
}

details.sec > summary::-webkit-details-marker {
  display: none;
}

details.sec > summary::before {
  content: "▸";
  margin-right: 8px;
  color: var(--accent);
}

details.sec[open] > summary::before {
  content: "▾";
}

.sec h3.k {
  margin: 8px 0 0;
  font-weight: 600;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.k {
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
}

.k.warn {
  color: var(--warn);
}

.v {
  font-size: 16px;
  overflow-wrap: anywhere;
}

.name {
  font-size: 16px;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.miss {
  color: var(--err);
  font-weight: 600;
}

.none {
  color: var(--muted);
}

.act {
  font-size: 14px;
  font-weight: 600;
  color: var(--accent);
  white-space: nowrap;
  background: none;
  border: none;
  min-height: 44px;
  padding: 0 4px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}

.acts {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-shrink: 0;
}

.cap {
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  margin: 0;
}

.cap.bad {
  color: var(--err);
}

.chip {
  font-size: 12px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  white-space: nowrap;
}

.c-ok {
  color: var(--ok);
  background: #e6f2e7;
}

.c-bad {
  color: var(--err);
  background: #fbe9e7;
}

.c-todo,
.c-none {
  color: var(--muted);
  background: var(--rest);
}

.c-warn {
  color: var(--warn);
  background: #fff1d6;
}

.pills {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.pill {
  font-size: 14px;
  font-weight: 600;
  min-height: 44px;
  padding: 0 16px;
  border-radius: 999px;
  background: #fff;
  box-shadow: var(--sh);
  color: var(--ink);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  border: none;
}

.cta {
  font-family: var(--display);
  font-size: 24px;
  font-weight: 400;
  min-height: 58px;
  border-radius: 24px;
  border: none;
  background: var(--grad);
  color: var(--ink);
  box-shadow: var(--glow);
  width: 100%;
  padding: 0 24px;
}

.cta[disabled] {
  background: #f5f5f5;
  color: #757575;
  box-shadow: none;
  cursor: default;
}

.btn2,
.btnd {
  font: 600 15px var(--font);
  min-height: 48px;
  border-radius: 8px;
  background: #fff;
  border: 1.5px solid #ff8c42;
  color: var(--accent);
  padding: 0 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.btnd {
  border-color: var(--err);
  color: var(--err);
}

.btn2[aria-pressed="true"],
.btnd[aria-pressed="true"] {
  background: var(--paper);
}

.btn2[disabled] {
  border-color: var(--track);
  color: var(--muted);
  cursor: default;
}

.lbl {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink2);
}

.field {
  font: 400 16px var(--font);
  min-height: 48px;
  padding: 12px;
  border: 1px solid var(--field);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  width: 100%;
}

textarea.field {
  resize: vertical;
}

.field.bad {
  border: 1.5px solid var(--err);
}

.foot {
  background: var(--cream);
  padding: 16px 20px 28px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  border-top: 1px solid var(--hair);
}

.foot.pinned {
  position: sticky;
  bottom: 0;
}

.grid2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.warnbox {
  background: #fff;
  border-radius: 12px;
  box-shadow: var(--sh);
  padding: 16px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.warnbox svg {
  flex-shrink: 0;
}

.warnbox strong {
  font-size: 14px;
  color: var(--warn);
}

.warnbox .lines {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 14px;
  color: var(--ink2);
}

.opt {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  min-height: 56px;
  border: none;
  border-top: 1px solid var(--hair);
  background: none;
  width: 100%;
  text-align: left;
}

.card > .opt:first-child {
  border-top: none;
}

.opt .name {
  font-weight: 400;
}

.opt[aria-checked="true"] .name,
.opt[aria-pressed="true"] .name {
  font-weight: 700;
}

.dashed {
  border: 1.5px dashed var(--dash);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.quote {
  margin: 0;
  padding: 0 16px 12px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink2);
}

mark {
  background: #ffe4b5;
  color: inherit;
  padding: 0 2px;
  border-radius: 4px;
}

details > summary {
  list-style: none;
  cursor: pointer;
}

details > summary::-webkit-details-marker {
  display: none;
}

.notice {
  background: #fff;
  border-radius: 12px;
  box-shadow: var(--sh);
  padding: 12px 16px;
  font-size: 14px;
}

.notice.bad {
  color: var(--err);
}

/* The sheet ------------------------------------------------------------------------------- */

.scrim {
  position: fixed;
  inset: 0;
  background: rgba(42, 33, 27, 0.45);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  z-index: 10;
}

.sheet {
  background: var(--cream);
  border-radius: 28px 28px 0 0;
  padding: 8px 20px 28px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.2);
  max-height: 92vh;
  overflow-y: auto;
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
}

.sheet .handle {
  align-self: center;
  width: 40px;
  height: 4px;
  border-radius: 999px;
  background: var(--track);
  margin: 4px 0;
  touch-action: none;
  cursor: grab;
  padding: 0;
  border: none;
  min-height: 4px;
}

.sheet h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
}

/* The card's title, with the decisions beside it on a computer */
.titlerow {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.poster {
  width: 100%;
  height: auto;
  border-radius: 8px;
  background: var(--rest);
}

.pad {
  padding: 16px;
}

.sheet.inline {
  border-radius: 12px;
  margin: 8px 0;
  max-height: none;
  overflow: visible;
  box-shadow: var(--sh);
  border: 1.5px solid var(--field);
  padding: 8px 16px 16px;
}

.sheet.inline > .row {
  padding: 8px 0;
  min-height: 44px;
}

.sheet.inline .foot {
  position: static;
  padding: 8px 0 0;
  border-top: none;
  background: none;
}

/* The computer layout (spec 4.5): the list, the card, the source panel */
/* The (i) beside a label and the help line it opens under it. */
.withhelp {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.info {
  position: relative;
  width: 18px;
  height: 18px;
  flex: none;
  border-radius: 50%;
  border: 1.5px solid var(--muted);
  color: var(--muted);
  font: italic 700 11px/1 Georgia, serif;
  display: inline-grid;
  place-items: center;
  cursor: pointer;
}

.info::after {
  content: "";
  position: absolute;
  inset: -13px;
}

.info[aria-expanded="true"] {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}

.info:focus-visible,
.addchip:focus-visible {
  outline: 2px solid var(--orange);
  outline-offset: 2px;
}

.help {
  display: block;
  margin: 2px 0;
  padding: 8px 10px;
  border-radius: 10px;
  background: var(--paper);
  color: var(--ink2);
  font-size: 13px;
  font-weight: 400;
  line-height: 1.45;
  text-transform: none;
  letter-spacing: 0;
}

.help[hidden] {
  display: none;
}

.over small {
  margin-left: 8px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
}

/* An edition on the card: its head, its groups, its fee cards. */
.edition {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.ehead {
  background: #fff;
  border-radius: 12px;
  box-shadow: var(--sh);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ehead .top,
.feehead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.ename {
  font-size: 19px;
  font-weight: 800;
}

.sum {
  font-size: 14px;
  color: var(--soft);
}

.tally,
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.dates {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.dates > * + * {
  border-left: 1px solid var(--hair);
}

.row.cell,
.row.part {
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 6px;
}

.row.cell .acts,
.row.part .acts {
  flex-wrap: wrap;
}

.dates > .row.cell,
.dates > :first-child > .row.cell {
  border-top: none;
}

.misses {
  padding: 10px 16px 12px;
  border-top: 1px solid var(--hair);
  background: #fffcf7;
  display: flex;
  flex-direction: column;
  gap: 8px;
  border-radius: 0 0 12px 12px;
}

.card > .misses:first-child {
  border-top: none;
}

.addchip {
  border: 1px dashed var(--dash);
  background: #fff;
  border-radius: 999px;
  min-height: 36px;
  padding: 6px 12px;
  font: 600 13px var(--font);
  color: var(--accent);
  cursor: pointer;
}

.addchip.off {
  color: var(--muted);
  cursor: default;
}

.fee .row.amount .v {
  font-size: 24px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.fee .parts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.fee .parts > * + * {
  border-left: 1px solid var(--hair);
}

.fee .parts .row.part {
  padding: 10px 12px;
}

.fee .parts .v {
  font-size: 14px;
}

.fee.added {
  outline: 2px dashed var(--dash);
  outline-offset: -2px;
}

/* The new-edition form: "Quando" open, the rest in closed sections with a turning +. */
.fs {
  background: #fff;
  border-radius: 12px;
  box-shadow: var(--sh);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.fs > .over {
  color: var(--ink);
}

.tag {
  margin-left: 6px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: var(--accent);
  background: var(--paper);
  border-radius: 4px;
  padding: 2px 5px;
}

details.fs {
  padding: 0;
  gap: 0;
}

details.fs > summary {
  padding: 14px 16px;
  min-height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

details.fs > summary .plus {
  font-size: 22px;
  line-height: 1;
  color: var(--accent);
  transition: transform 0.15s;
}

details.fs[open] > summary .plus {
  transform: rotate(45deg);
}

details.fs > .inner {
  padding: 0 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.feeopt {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.feeopt + .feeopt {
  border-top: 1px solid var(--hair);
  padding-top: 14px;
}

@media (prefers-reduced-motion: reduce) {
  details.fs > summary .plus {
    transition: none;
  }
}

@media (min-width: 1024px) {
  .desk {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
  }

  .deskbar {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 24px 32px 16px;
  }

  .deskbar .kick {
    text-decoration: none;
  }

  .deskbar .notice {
    flex: 1 1 280px;
    margin: 0;
  }

  .cols {
    display: flex;
    gap: 24px;
    padding: 24px 32px;
    align-items: flex-start;
  }

  .desknav {
    flex: 1 1 220px;
    max-width: 260px;
    position: sticky;
    top: 16px;
  }

  .desknav .row {
    min-height: 48px;
    text-decoration: none;
    color: inherit;
  }

  .desknav .name {
    font-size: 14px;
    font-weight: 500;
  }

  .desknav .row.current {
    box-shadow: inset 3px 0 0 #ff6b35;
  }

  .desknav .row.current .name {
    font-weight: 700;
  }

  .deskcard {
    flex: 999 1 420px;
    min-width: 0;
    display: flex;
    flex-direction: column;
  }

  .deskcard > .hdr {
    border-radius: 12px 12px 0 0;
    overflow: hidden;
  }

  .deskcard > .body {
    padding: 16px 0;
  }

  .titlerow {
    flex-direction: row;
    justify-content: space-between;
    align-items: flex-end;
    gap: 16px;
    flex-wrap: wrap;
  }

  .deskacts {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
  }

  .deskacts .acts {
    display: flex;
    gap: 8px;
    align-items: center;
  }

  .deskacts .cta {
    width: auto;
    padding: 0 24px;
  }

  .panel {
    flex: 1 1 340px;
    max-width: 420px;
    position: sticky;
    top: 16px;
    max-height: calc(100vh - 32px);
    overflow-y: auto;
  }

  .tabs {
    margin: 12px;
    padding: 4px;
    border-radius: 999px;
    background: var(--track);
    display: flex;
    gap: 4px;
  }

  .tab {
    flex: 1;
    min-height: 40px;
    font: 500 14px var(--font);
    color: var(--ink2);
    padding: 8px;
    border: none;
    border-radius: 999px;
    background: none;
    cursor: pointer;
  }

  .tab[aria-selected="true"] {
    font-weight: 700;
    color: var(--ink);
    background: #fff;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
  }

  .tabpanel {
    padding: 0 16px 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
  }

  .tabpanel > .row {
    padding: 0;
    border-top: none;
    min-height: 44px;
  }
}

.tabpanel .stack > p {
  margin: 0;
}

.sheet.inline {
  width: auto;
  max-width: none;
  margin: 8px 16px 16px;
}

.sheet.inline > .body {
  padding: 0;
}
