/* PRTY OS — Artist Advance screen styles. Tokens only. Status icon chip (.adv-sicon) lives in advancing.css. */

/* ---------- Header ---------- */
.aa-head { padding: var(--s-5) 0 var(--s-4); display: flex; flex-direction: column; gap: var(--s-4); }
.aa-head__top { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); min-height: 28px; }
.aa-head__eyebrow { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; min-width: 0; font-size: var(--fs-12); color: var(--text-3); }
.aa-head__eyebrow a:hover { color: var(--text); }
.aa-head__eyebrow .icon { color: var(--text-4); }
.aa-head__dot { color: var(--text-4); }

.aa-head__main { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: var(--s-4); }
.aa-head__main > .ring .ring__label { font-size: var(--fs-13) !important; }
.aa-head__id { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.aa-head__title { font-size: 22px; letter-spacing: 0.01em; }
.aa-head__name { display: inline-flex; align-items: center; gap: 8px; font: inherit; letter-spacing: inherit; text-align: left; border-radius: var(--r-1); }
.aa-head__name .icon { color: var(--text-4); transition: color var(--dur-1); }
.aa-head__name:hover .icon { color: var(--text-2); }
.aa-head__name:hover { text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 4px; }
.aa-head__sub { font-size: var(--fs-12); color: var(--text-3); }

.aa-nav { display: flex; align-items: center; gap: 2px; flex-shrink: 0; }
.aa-nav__pos { font-size: var(--fs-12); color: var(--text-3); padding: 0 6px; white-space: nowrap; }
.aa-nav__name { max-width: 150px; overflow: hidden; text-overflow: ellipsis; }

.aa-facts { display: flex; align-items: stretch; }
.aa-fact { display: flex; flex-direction: column; gap: 4px; padding: 2px var(--s-5); border-left: 1px solid var(--line-soft); white-space: nowrap; }
.aa-fact:first-child { border-left: 0; }
.aa-fact__label { font-size: var(--fs-11); color: var(--text-3); text-transform: uppercase; letter-spacing: 0.07em; font-weight: 500; }
.aa-fact__value { font-size: var(--fs-14); font-weight: 600; }

/* ---------- Quick contacts ---------- */
.aa-qc { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: var(--r-3); background: var(--surface); margin-bottom: var(--s-4); }
.aa-qc__cell { padding: 12px var(--s-4); border-left: 1px solid var(--line-soft); min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.aa-qc__cell:first-child { border-left: 0; }
.aa-qc__role { font-size: var(--fs-11); color: var(--text-3); text-transform: uppercase; letter-spacing: 0.07em; font-weight: 500; }
.aa-qc__body { display: flex; align-items: center; gap: var(--s-3); min-width: 0; }
.aa-qc__who { flex: 1; min-width: 0; }
.aa-qc__name { font-weight: 500; }
.aa-qc__sub { font-size: var(--fs-12); color: var(--text-3); }
.aa-qc__actions { display: flex; gap: 4px; flex-shrink: 0; }
.aa-qc__none { color: var(--text-4); font-size: var(--fs-13); line-height: 38px; }

/* ---------- Critical block ---------- */
.aa-crit {
  --c: var(--red);
  border: 1px solid color-mix(in srgb, var(--c) 28%, transparent);
  background: color-mix(in srgb, var(--c) 6%, var(--surface));
  border-radius: var(--r-3);
  margin-bottom: var(--s-4);
  overflow: hidden;
}
.aa-crit__head { display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 0 var(--s-4); border-bottom: 1px solid color-mix(in srgb, var(--c) 16%, transparent); }
.aa-crit__head > .icon { color: var(--c); }
.aa-crit__title { font-weight: 600; }
.aa-crit__hint { margin-left: auto; font-size: var(--fs-12); color: var(--text-3); }
.aa-crit__row { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; gap: var(--s-3); align-items: center; padding: 10px var(--s-4); border-bottom: 1px solid color-mix(in srgb, var(--c) 10%, transparent); animation: rise-in var(--dur-2) var(--ease) both; }
.aa-crit__row:last-child { border-bottom: 0; }
.aa-crit__main { min-width: 0; }
.aa-crit__label { font-weight: 500; }
.aa-crit__label span { color: var(--text); }
.aa-crit__text { font-size: var(--fs-12); color: var(--text-2); margin-top: 1px; }
.aa-crit__section { color: var(--text-3); }
.aa-crit__actions { display: flex; align-items: center; gap: 6px; }

.aa-allclear { display: flex; align-items: center; gap: 10px; padding: 10px var(--s-4); margin-bottom: var(--s-4); border: 1px solid color-mix(in srgb, var(--green) 24%, transparent); background: color-mix(in srgb, var(--green) 6%, var(--surface)); border-radius: var(--r-3); color: var(--text); animation: rise-in var(--dur-3) var(--ease) both; }

/* ---------- Body ---------- */
.aa-body { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: var(--s-4); align-items: start; }
.aa-body--single { margin-top: var(--s-4); grid-template-columns: minmax(0, 1fr); }
.aa-body--single .aa-side { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-4); }
.aa-main { display: flex; flex-direction: column; gap: var(--s-3); min-width: 0; }
.aa-side { display: flex; flex-direction: column; gap: var(--s-3); min-width: 0; }
.aa-side__venue { margin-bottom: 4px; }
.aa-empty { margin-top: 0; }

/* Section panel */
.aa-sec { scroll-margin-top: var(--s-4); }
.aa-sec__head { gap: 10px; }
.aa-sec__icon { width: 26px; height: 26px; border-radius: var(--r-2); display: grid; place-items: center; background: var(--surface-3); color: var(--text-2); flex-shrink: 0; transition: background var(--dur-3) var(--ease), color var(--dur-3) var(--ease); }
.aa-sec.is-complete .aa-sec__icon { background: color-mix(in srgb, var(--green) 14%, transparent); color: var(--green); }
.aa-sec__count { font-size: var(--fs-12); color: var(--text-3); font-weight: 500; }
.aa-sec__crit { display: inline-flex; align-items: center; gap: 4px; font: 600 var(--fs-10)/1 var(--font); text-transform: uppercase; letter-spacing: 0.07em; color: var(--red); }
.aa-sec__crit .icon { stroke-width: 2.25; }
.aa-sec__progress { width: 88px; margin-left: var(--s-2); display: flex; align-items: center; }
.aa-sec__progress .progress { width: 100%; }
.aa-sec__done { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-12); font-weight: 500; color: var(--green); white-space: nowrap; animation: fade-in var(--dur-3) var(--ease); }
.aa-sec__donemark { width: 16px; height: 16px; border-radius: 50%; display: grid; place-items: center; background: var(--green); color: var(--on-inverse); animation: pop 420ms var(--ease); }
.aa-sec__donemark .icon { stroke-width: 3; }
.aa-sec__body { display: flex; flex-direction: column; }
.aa-sec__empty { padding: 14px var(--s-4); color: var(--text-3); font-size: var(--fs-12); }

/* Item row */
.aa-item {
  display: grid;
  grid-template-columns: 28px minmax(150px, 220px) minmax(0, 1fr) 168px 26px;
  grid-template-areas: "check label value status more";
  align-items: start; column-gap: var(--s-3);
  padding: 8px var(--s-3) 8px var(--s-4);
  min-height: 48px;
  border-bottom: 1px solid var(--line-soft);
  transition: background var(--dur-2) var(--ease), opacity var(--dur-3) var(--ease);
}
.aa-item:last-child { border-bottom: 0; }
.aa-item:hover { background: var(--hover); }
.aa-item__check { grid-area: check; padding-top: 3px; }
.aa-item__label { grid-area: label; display: flex; flex-direction: column; align-items: flex-start; gap: 3px; padding-top: 5px; min-width: 0; }
.aa-item__name { font-weight: 500; line-height: 1.3; }
.aa-item__value { grid-area: value; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.aa-item__value .inline-edit { min-height: 30px; }
.aa-item__value .inline-edit .num { font-variant-numeric: normal; }
.aa-item__note { text-align: left; font-size: var(--fs-12); color: var(--text-3); line-height: 1.4; padding: 0 8px; margin: 0 -8px; border-radius: var(--r-1); }
.aa-item__note:hover { color: var(--text-2); background: var(--hover); }
.aa-item__noteinput { margin-top: 2px; }
.aa-item__status { grid-area: status; display: flex; justify-content: flex-end; padding-top: 4px; }
.aa-item__more { grid-area: more; padding-top: 2px; }
.aa-item__more .btn { color: var(--text-4); }
.aa-item:hover .aa-item__more .btn { color: var(--text-2); }

.aa-item.is-done .aa-item__name { color: var(--text-2); }
.aa-item.is-done .inline-edit .num { color: var(--text-2); }
.aa-item.is-nr .aa-item__name, .aa-item.is-nr .inline-edit { color: var(--text-3); }
.aa-item.is-critical { background: color-mix(in srgb, var(--red) 4%, transparent); }
.aa-item.is-critical:hover { background: color-mix(in srgb, var(--red) 7%, transparent); }

/* Completion check — the one-click affordance */
.aa-check {
  --c: var(--grey);
  width: 22px; height: 22px; border-radius: 50%;
  display: grid; place-items: center;
  box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--c) 60%, var(--line-strong));
  color: transparent;
  transition: background var(--dur-2) var(--ease), box-shadow var(--dur-2) var(--ease), color var(--dur-2) var(--ease), transform var(--dur-1) var(--ease);
}
.aa-check svg { fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; overflow: visible; }
.aa-check__path { stroke-dasharray: 1; stroke-dashoffset: 1; transition: stroke-dashoffset var(--dur-3) var(--ease); }
.aa-check:hover { box-shadow: inset 0 0 0 1.5px var(--green); color: color-mix(in srgb, var(--green) 70%, transparent); background: color-mix(in srgb, var(--green) 10%, transparent); }
.aa-check:hover .aa-check__path { stroke-dashoffset: 0; }
.aa-check:active { transform: scale(0.92); }
.aa-check.is-done { background: var(--green); box-shadow: inset 0 0 0 1.5px var(--green); color: var(--on-inverse); }
.aa-check.is-done .aa-check__path { stroke-dashoffset: 0; }
.aa-check.is-done:hover { background: color-mix(in srgb, var(--green) 80%, var(--text)); }
.aa-check.is-nr { box-shadow: inset 0 0 0 1.5px var(--line-strong); }
.aa-check.is-nr::after { content: ""; width: 8px; height: 1.5px; background: var(--text-4); border-radius: 1px; position: absolute; }
.aa-check.is-nr { position: relative; }
.aa-check.is-nr:hover::after { display: none; }

.aa-item.is-flash { animation: aa-settle 1.1s var(--ease); }
.aa-item.is-flash .aa-check { animation: pop 420ms var(--ease); }
.aa-item.is-flash .aa-check__path { animation: aa-draw 380ms var(--ease) 60ms both; }
@keyframes aa-draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes aa-settle {
  0% { background: color-mix(in srgb, var(--green) 12%, transparent); }
  100% { background: transparent; }
}

/* Add item */
.aa-add { display: flex; align-items: center; gap: var(--s-2); flex-wrap: wrap; padding: 10px var(--s-3) 10px var(--s-4); background: var(--bg-2); border-top: 1px solid var(--line-soft); animation: rise-in var(--dur-2) var(--ease) both; }
.aa-add__input { flex: 1; min-width: 220px; }
.aa-add__actions { display: flex; gap: var(--s-1); }

/* Sidebar section nav */
.aa-jump { display: flex; flex-direction: column; padding: 4px; }
.aa-jump__item { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 34px; padding: 0 10px; border-radius: var(--r-2); text-align: left; color: var(--text-2); transition: background var(--dur-1), color var(--dur-1); }
.aa-jump__item:hover { background: var(--hover); color: var(--text); }
.aa-jump__label { flex: 1; min-width: 0; }
.aa-jump__crit { color: var(--red); display: inline-flex; }
.aa-jump__count { font-size: var(--fs-12); color: var(--text-3); }

/* ---------- Mobile sticky header ---------- */
.aa-mhead { display: none; }

@media (max-width: 1100px) {
  .aa-head__main { grid-template-columns: auto minmax(0, 1fr); }
  .aa-facts { grid-column: 1 / -1; flex-wrap: wrap; row-gap: var(--s-3); border-top: 1px solid var(--line-soft); padding-top: var(--s-3); }
  .aa-fact:first-child { padding-left: 0; }
  .aa-body { grid-template-columns: minmax(0, 1fr); }
  .aa-side { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-3); }
  .aa-side__sections { display: none; }
  .aa-item { grid-template-columns: 28px minmax(130px, 180px) minmax(0, 1fr) 160px 26px; }
}

@media (max-width: 720px) {
  .aa-mhead {
    display: block;
    position: sticky; top: 0; z-index: 30;
    margin: 0 calc(-1 * var(--page-pad));
    padding: 8px var(--page-pad) 0;
    background: var(--bg);
    border-bottom: 1px solid var(--line-soft);
  }
  .aa-mhead__row { display: flex; align-items: center; gap: var(--s-2); min-height: 36px; }
  .aa-mhead__name { font-weight: 600; font-size: var(--fs-14); letter-spacing: 0.02em; white-space: nowrap; }
  .aa-mhead__sub { flex: 1; font-size: var(--fs-12); color: var(--text-3); }
  .aa-mhead__pct { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; flex-shrink: 0; }
  .aa-mhead__chips { display: flex; gap: 6px; overflow-x: auto; padding: 6px 0 10px; scrollbar-width: none; }
  .aa-mhead__chips::-webkit-scrollbar { display: none; }
  .aa-mchip { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 10px 0 8px; border: 1px solid var(--line); border-radius: 999px; font-size: var(--fs-12); font-weight: 500; color: var(--text-2); white-space: nowrap; flex-shrink: 0; }
  .aa-mchip .num { color: var(--text-3); }
  .aa-mchip.has-crit { border-color: color-mix(in srgb, var(--red) 40%, transparent); }
  .aa-mchip:active { background: var(--press); }

  .aa-sec { scroll-margin-top: 104px; }
  .aa-head { padding-top: var(--s-4); }
  .aa-head__top { flex-direction: column; align-items: stretch; gap: var(--s-2); }
  .aa-nav { justify-content: space-between; border: 1px solid var(--line); border-radius: var(--r-2); padding: 2px; }
  .aa-nav .btn { --btn-h: 38px; }
  .aa-nav__name { max-width: 110px; }
  .aa-head__main { gap: var(--s-3); }
  .aa-head__main > .ring { width: 44px !important; height: 44px !important; }
  .aa-head__main > .ring svg { width: 44px; height: 44px; }
  .aa-head__title { font-size: var(--fs-20); }
  .aa-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-3) 0; }
  .aa-fact { padding: 0; border-left: 0; }
  .aa-fact:last-child { grid-column: 1 / -1; }

  .aa-qc { grid-template-columns: minmax(0, 1fr); }
  .aa-qc__cell { border-left: 0; border-top: 1px solid var(--line-soft); }
  .aa-qc__cell:first-child { border-top: 0; }
  .aa-qc__actions .btn { --btn-h: 44px; width: 44px; }
  .aa-qc__actions .btn .icon { width: 18px; height: 18px; }

  .aa-crit__row { grid-template-columns: 22px minmax(0, 1fr); align-items: start; }
  .aa-crit__actions { grid-column: 2; }
  .aa-crit__actions .btn { --btn-h: 38px; }

  .aa-side, .aa-body--single .aa-side { grid-template-columns: minmax(0, 1fr); }

  .aa-sec__head { flex-wrap: wrap; padding-top: 8px; padding-bottom: 8px; }
  .aa-sec__progress { width: 56px; }
  .aa-sec__head .panel__actions .btn { --btn-h: 36px; width: 36px; }

  .aa-item {
    grid-template-columns: 40px minmax(0, 1fr) 32px;
    grid-template-areas: "check label more" "check value value" "check status status";
    row-gap: 4px; padding: 10px var(--s-3) 12px var(--s-3);
  }
  .aa-item__check { padding-top: 0; }
  .aa-check { width: 32px; height: 32px; }
  .aa-check svg { width: 16px; height: 16px; }
  .aa-item__label { padding-top: 6px; }
  .aa-item__status { justify-content: flex-start; padding-top: 2px; }
  .aa-item__more .btn { --btn-h: 40px; }
  .aa-item__status button { min-height: 40px; }
  .aa-add { padding: 10px var(--s-3); }
  .aa-add__input { min-width: 100%; height: 40px; font-size: var(--fs-14); }
}

.aa-costs { margin-bottom: 16px; }
.aa-costs__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; padding: 12px 16px 16px; }
.aa-cost { display: grid; grid-template-columns: 1fr 96px; gap: 12px; align-items: end; }

.aa-sec__actions { display: flex; justify-content: flex-end; padding: var(--s-2) var(--s-3); border-bottom: 1px solid var(--line-soft); }
.aa-sec:not([open]) > summary { border-bottom: 0; }
@media (max-width: 600px) {
  .aa-sec__head .panel__title { flex: 1; }
  .aa-sec__head .aa-sec__progress { display: none; }
  .aa-sec__head .aa-sec__crit { font-size: var(--fs-11); text-transform: none; letter-spacing: normal; }
  .aa-check { width: 44px; height: 44px; }
  .aa-item { grid-template-columns: 44px minmax(0, 1fr) 44px; }
  .aa-item__more .btn, .aa-item__status button, .aa-sec__actions .btn { min-width: 44px; min-height: 44px; }
  .aa-add__input, .aa-item input, .aa-item textarea, .aa-item select { font-size: 16px; min-height: 44px; }
  .aa-item__value .inline-edit { min-height: 44px; }
}
.aa-sec__head > .aa-sec__icon { flex: 0 0 26px; }
.aa-sec__head > .panel__title { min-width: 0; flex: 1; }
