/* Annot8 (templates/annot8.html): the story's overlays and copy, and the feature panels.
   Anything drawn from the app keeps the app's own look: dark-mode system colours, 30% box
   fills, capsule label buttons, rounded thumbnails with a green tick and a blue ring. */

/* ---------- the story ---------- */
.mx-app--annot8 .mx-story__word { --word: 17.6vw; }
.mx-app--annot8 .mx-story__glow {
  background:
    radial-gradient(30% 42% at 70% 50%, color-mix(in srgb, var(--accent) 17%, transparent), transparent 72%),
    radial-gradient(60% 50% at 70% 100%, color-mix(in srgb, var(--accent) 6%, transparent), transparent 70%);
}
.mx-app--annot8 .mx-story__fallback { top: 18vh; right: 5vw; height: auto; width: min(52vw, 820px); border-radius: 12px; box-shadow: 0 40px 80px -30px rgba(0, 0, 0, .8); }
.mx-app--annot8 .mx-story__step-in { max-width: 560px; min-width: 0; }
.mx-app--annot8 .mx-story__step h2 { font-size: clamp(38px, 3.9vw, 64px); }
.mx-app--annot8 .mx-story__fig .mx-read { max-width: none; margin-bottom: 10px; }
.mx-app--annot8 .mx-story__fig .mx-read b { font-weight: 650; color: var(--bone); }
.mx-app--annot8 .mx-story__step .mx-actions { margin-top: 26px; }

/* the overlays: the Data Label dialog and the pointer drawing the box */
.mx-an8-ui { position: absolute; inset: 0; z-index: 2; pointer-events: none; overflow: hidden; }
.mx-an8-dialog {
  position: absolute; left: 0; top: 0; width: 260px; padding: 16px 16px 14px;
  background: rgba(20, 20, 22, .82); -webkit-backdrop-filter: blur(18px) saturate(1.3); backdrop-filter: blur(18px) saturate(1.3);
  border: 1px solid rgba(255, 255, 255, .12); border-radius: 15px; box-shadow: 0 24px 60px -18px rgba(0, 0, 0, .8);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
  color: #fff; text-align: center; opacity: 0; transform-origin: 50% 50%; will-change: transform, opacity;
}
.mx-an8-dialog p { margin: 0; }
.mx-an8-dialog__t { font-weight: 600; font-size: 13px; }
.mx-an8-dialog__opts { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; margin-top: 12px !important; min-height: 0; }
.mx-an8-dialog__opts span {
  padding: 3px 10px; border-radius: 15px; background: color-mix(in srgb, var(--c) 80%, transparent);
  font-size: 12.5px; transition: background-color .15s, box-shadow .15s;
}
.mx-an8-dialog__opts span[hidden] { display: none; }
.mx-an8-dialog__opts span.is-on { background: var(--c); box-shadow: 0 0 0 2px rgba(255, 255, 255, .85); }
.mx-an8-dialog__field {
  position: relative; display: flex; align-items: center; height: 32px; margin-top: 12px !important; padding: 0 12px;
  background: rgba(0, 0, 0, .5); border-radius: 12px; font-size: 13px; text-align: left;
}
.mx-an8-dialog__field i { width: 1.5px; height: 15px; margin-left: 1px; background: #fff; animation: mx-an8-caret 1s steps(1) infinite; }
.mx-an8-dialog__field em { position: absolute; left: 12px; font-style: normal; color: rgba(160, 160, 165, .7); }
.mx-an8-dialog:not(.is-empty) .mx-an8-dialog__field em { display: none; }
.mx-an8-dialog__btns { display: flex; justify-content: center; gap: 8px; margin-top: 14px !important; font-size: 12.5px; }
.mx-an8-dialog__btns span { padding: 3px 10px; border-radius: 15px; background: rgba(142, 142, 147, .8); }
.mx-an8-dialog__btns .is-ok { background: rgba(10, 132, 255, .8); transition: background-color .15s, box-shadow .15s; }
.mx-an8-dialog.is-ok .mx-an8-dialog__btns .is-ok { background: #0A84FF; box-shadow: 0 0 0 2px rgba(255, 255, 255, .85); }
@keyframes mx-an8-caret { 50% { opacity: 0; } }
.mx-an8-key {
  position: absolute; left: 0; top: 0; display: flex; align-items: center; gap: 6px; margin: 0; padding: 8px 12px 8px 8px;
  background: rgba(20, 20, 22, .82); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, .12); border-radius: 14px; opacity: 0; will-change: transform, opacity;
}
.mx-an8-key kbd {
  display: inline-grid; place-items: center; min-width: 30px; height: 30px; padding: 0 7px; border-radius: 8px;
  background: linear-gradient(180deg, #3a3a40, #2a2a2f); box-shadow: 0 2px 0 #0b0b0d, inset 0 1px 0 rgba(255, 255, 255, .1);
  font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif; font-size: 14px; color: var(--bone);
}
.mx-an8-key span { margin-left: 6px; font-stretch: 62%; font-weight: 650; font-size: 12px; letter-spacing: .16em; text-transform: uppercase; color: var(--bone-2); }
.mx-an8-cursor { position: absolute; left: 0; top: 0; opacity: 0; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .5)); will-change: transform; }
.mx-an8.no-gl .mx-an8-ui { display: none; }

/* step 1: the boxes on the plate, ticked off as they are saved */
.mx-an8-log { max-width: 460px; margin: 22px 0 0; padding: 0; list-style: none; border-top: 1px solid var(--line); }
.mx-an8-log li {
  display: grid; grid-template-columns: 16px minmax(0, 1fr) auto; align-items: center; gap: 12px;
  padding: 10px 0; border-bottom: 1px solid var(--line); color: var(--ash); transition: color .3s var(--ease);
}
.mx-an8-log li i {
  width: 14px; height: 11px; border-radius: 2px; border: 1.5px solid var(--line-2);
  transition: background-color .3s var(--ease), border-color .3s var(--ease), box-shadow .3s var(--ease);
}
.mx-an8-log li b { font-weight: 600; font-size: 14px; font-variant-numeric: tabular-nums; }
.mx-an8-log li.is-now { color: var(--bone); }
.mx-an8-log li.is-now i { border-color: #9a9a9e; background: rgba(154, 154, 158, .3); }
.mx-an8-log li.is-done { color: var(--bone-2); }
.mx-an8-log li.is-done i { border-color: var(--c); background: color-mix(in srgb, var(--c) 32%, transparent); box-shadow: 0 0 10px color-mix(in srgb, var(--c) 45%, transparent); }

/* step 3: the classes, as the app's label buttons */
.mx-an8-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 24px 0 0; padding: 0; list-style: none; }
.mx-an8-chips li {
  display: inline-flex; align-items: baseline; gap: 10px; padding: 8px 16px; border-radius: 999px;
  background: color-mix(in srgb, var(--c) 80%, transparent); color: #fff;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Arial, sans-serif; font-weight: 600; font-size: 16px;
  transition: opacity .35s var(--ease), box-shadow .35s var(--ease), transform .35s var(--ease);
}
.mx-an8-chips li span { font-weight: 500; font-variant-numeric: tabular-nums; opacity: .85; }
.mx-an8-chips li.is-on { box-shadow: 0 0 0 2px rgba(255, 255, 255, .8), 0 0 28px color-mix(in srgb, var(--c) 60%, transparent); transform: translateY(-2px); }
.mx-an8-chips li.is-off { opacity: .4; }

/* step 4: annotations.csv, typed out a row at a time */
.mx-an8-file { min-width: 0; max-width: 100%; margin: 22px 0 0; border: 1px solid var(--line-2); border-radius: 14px; background: rgba(22, 22, 25, .9); overflow: hidden; }
.mx-an8-file figcaption { display: flex; justify-content: space-between; gap: 12px; padding: 9px 14px; border-bottom: 1px solid var(--line); }
.mx-an8-file figcaption span:first-child { color: var(--bone); }
.mx-an8-file pre {
  margin: 0; padding: 12px 14px 14px; overflow-x: auto; scrollbar-width: thin;
  font: 500 12px/1.75 ui-monospace, "SF Mono", Menlo, Consolas, monospace; color: var(--bone-2);
}
.mx-an8-file pre:focus-visible { outline: 2px solid var(--bone); outline-offset: -3px; }
.mx-an8-file [data-ln]:first-child { color: var(--ash); }
.mx-an8-file.is-typing [data-ln] { display: inline-block; vertical-align: top; overflow: hidden; width: calc(var(--n, 0) * 1ch); white-space: pre; }
.mx-an8-file.is-typing [data-ln].is-now { box-shadow: 2px 0 0 var(--accent-ink); }

/* photo credits, under the story */
.mx-an8-credits { position: relative; z-index: 1; padding-bottom: clamp(56px, 9vh, 110px); }
.mx-an8-credits p { max-width: 96ch; margin: 0; font-size: 12.5px; line-height: 1.6; color: var(--ash-2); }
.mx-an8-credits a { color: var(--ash); }

@media (max-width: 860px) {
  .mx-app--annot8 .mx-story__word { --word-phone: 17.4vw; top: 35%; }
  .mx-app--annot8 .mx-story__glow { background: radial-gradient(64% 30% at 50% 32%, color-mix(in srgb, var(--accent) 18%, transparent), transparent 72%); }
  .mx-app--annot8 .mx-story__fallback { top: 14vh; right: 50%; width: 92vw; transform: translateX(50%); }
  .mx-app--annot8 .mx-story__step h2 { font-size: 34px; }
  .mx-app--annot8 .mx-story__fig { margin-top: 18px; }
  .mx-app--annot8 .mx-story__fig .mx-num { font-size: 84px; }
  .mx-an8-log { margin-top: 14px; }
  .mx-an8-log li { padding: 7px 0; font-size: 15px; }
  .mx-an8-chips { margin-top: 16px; }
  .mx-an8-chips li { padding: 7px 14px; font-size: 15px; }
  .mx-an8-file { margin-top: 14px; }
  .mx-an8-file pre { max-height: 132px; font-size: 11px; padding: 10px 12px; }
  .mx-app--annot8 .mx-story__step .mx-story__src { margin-top: 14px; }
  .mx-app--annot8 .mx-story__step .mx-actions { margin-top: 16px; }
  .mx-an8-credits { background: linear-gradient(180deg, transparent, rgba(14, 14, 17, .92) 40px); padding-top: 40px; }
}

/* ---------- what it does: the panels draw the app's own UI ---------- */
.mx-an8-win { padding: 0; overflow: hidden; justify-content: flex-start; background: #1e1e21; }
.mx-an8-win__bar { display: flex; align-items: center; gap: 7px; height: 30px; padding: 0 12px; background: #2a2a2e; border-bottom: 1px solid rgba(255, 255, 255, .07); }
.mx-an8-win__bar i { width: 10px; height: 10px; border-radius: 50%; background: #FF5F57; }
.mx-an8-win__bar i:nth-child(2) { background: #FEBC2E; }
.mx-an8-win__bar i:nth-child(3) { background: #28C840; }
.mx-an8-win__bar span { margin-left: 74px; font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif; font-weight: 600; font-size: 12px; color: rgba(236, 233, 226, .85); }
.mx-an8-win__body { display: flex; align-items: center; gap: 14px; padding: 14px 14px 14px 0; background: linear-gradient(90deg, #17171a 0 98px, transparent 98px); }
.mx-an8-win__side { display: flex; flex: none; flex-direction: column; align-items: center; gap: 8px; width: 98px; }
.mx-an8-shot { position: relative; flex: 1; min-width: 0; }
.mx-an8-shot img { display: block; width: 100%; height: 100%; object-fit: cover; }
.mx-an8-shot > i { position: absolute; border: 2px solid color-mix(in srgb, var(--c) 80%, transparent); border-radius: 3px; background: color-mix(in srgb, var(--c) 30%, transparent); }
.mx-an8-btn {
  position: absolute; right: 8px; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%;
  background: rgba(0, 0, 0, .5); color: #fff;
}
.mx-an8-btn--share { top: 8px; }
.mx-an8-btn--next { bottom: 8px; }
.mx-an8-thumb { position: relative; display: block; border-radius: 5px; }
.mx-an8-thumb img { display: block; height: 46px; width: auto; max-width: 82px; border-radius: 5px; object-fit: cover; }
.mx-an8-thumb.is-done::before {
  content: ""; position: absolute; left: 3px; top: 3px; width: 14px; height: 14px; border-radius: 50%;
  background: #30D158 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 14'%3E%3Cpath d='M3.6 7.2l2.2 2.2 4.6-4.8' fill='none' stroke='%23fff' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 14px no-repeat;
}
.mx-an8-thumb.is-on::after { content: ""; position: absolute; inset: -3px; border: 2px solid #0A84FF; border-radius: 7px; }

.mx-an8-keys { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; }
.mx-an8-keys li { display: grid; grid-template-columns: 150px minmax(0, 1fr); align-items: center; gap: 16px; }
.mx-an8-keys li > span { display: flex; gap: 6px; }
.mx-an8-keys b { font-weight: 550; color: var(--bone-2); }
.mx-an8-keys kbd {
  display: inline-grid; place-items: center; min-width: 38px; height: 38px; padding: 0 10px; border-radius: 9px;
  background: linear-gradient(180deg, #34343a, #26262b); border: 1px solid rgba(255, 255, 255, .1); box-shadow: 0 2px 0 #0b0b0d, inset 0 1px 0 rgba(255, 255, 255, .08);
  font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif; font-weight: 500; font-size: 15px; color: var(--bone);
}
.mx-an8-keys kbd.is-wide { font-size: 13px; }

.mx-an8-dlg {
  align-self: center; width: min(100%, 300px); padding: 16px; border-radius: 15px; background: rgba(0, 0, 0, .6);
  border: 1px solid rgba(255, 255, 255, .08); text-align: center; color: #fff;
  font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
}
.mx-an8-dlg p { margin: 0; }
.mx-an8-dlg__t { font-weight: 600; font-size: 14px; }
.mx-an8-dlg__opts { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; margin-top: 14px !important; }
.mx-an8-dlg__opts span { padding: 4px 11px; border-radius: 15px; background: color-mix(in srgb, var(--c) 80%, transparent); font-size: 13.5px; }
.mx-an8-dlg__field { margin-top: 14px !important; padding: 8px 14px; border-radius: 12px; background: rgba(0, 0, 0, .5); color: rgba(160, 160, 165, .7); font-size: 13.5px; text-align: left; }
.mx-an8-dlg__btns { display: flex; justify-content: center; gap: 8px; margin-top: 16px !important; font-size: 13.5px; }
.mx-an8-dlg__btns span { padding: 4px 11px; border-radius: 15px; background: rgba(142, 142, 147, .8); }
.mx-an8-dlg__btns .is-ok { background: rgba(10, 132, 255, .8); }

.mx-an8-prog { flex-direction: row; align-items: center; gap: 22px; }
.mx-an8-prog__side { display: flex; flex-direction: column; gap: 8px; padding: 10px 8px; border-radius: 12px; background: #17171a; }
.mx-an8-prog__fig { display: flex; flex-direction: column; gap: 8px; }
.mx-an8-prog__fig .mx-num { font-size: clamp(76px, 7vw, 110px); }

.mx-an8-mini { justify-content: flex-start; gap: 12px; overflow: hidden; }
.mx-an8-mini pre {
  margin: 0; overflow: hidden; font: 500 11.5px/1.8 ui-monospace, "SF Mono", Menlo, Consolas, monospace; color: var(--bone-2);
  -webkit-mask-image: linear-gradient(90deg, #000 70%, transparent); mask-image: linear-gradient(90deg, #000 70%, transparent);
}
.mx-an8-mini .mx-read { color: var(--bone); }

.mx-an8-drop { align-items: center; gap: 12px; text-align: center; background: #1c1c1f; }
.mx-an8-drop__t { margin: 0; font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif; font-weight: 600; font-size: 21px; }
.mx-an8-drop__btn { padding: 9px 22px; border-radius: 12px; background: #0A84FF; color: #fff; font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif; font-size: 14px; }
.mx-an8-drop__or { display: flex; align-items: center; gap: 10px; font-size: 11px; color: var(--ash); }
.mx-an8-drop__or::before, .mx-an8-drop__or::after { content: ""; width: 44px; height: 1px; background: var(--line-2); }
.mx-an8-drop__zone { display: grid; place-items: center; width: min(100%, 260px); height: 74px; border-radius: 15px; background: rgba(142, 142, 147, .1); color: var(--ash); font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif; font-size: 14px; }

.mx-an8-price { align-items: flex-start; }
.mx-an8-price p { display: flex; align-items: flex-end; gap: 14px; margin: 0; }
.mx-an8-price .mx-num { font-size: clamp(76px, 7.4vw, 120px); }
.mx-an8-price .mx-read { margin-bottom: 8px; }
.mx-an8-price__pills { flex-wrap: wrap; gap: 8px !important; margin-top: 26px !important; }
.mx-an8-price__pills span { padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; font-size: 13.5px; color: var(--bone-2); }

@media (max-width: 700px) {
  .mx-an8-win__body { background: linear-gradient(90deg, #17171a 0 74px, transparent 74px); }
  .mx-an8-win__side { width: 74px; }
  .mx-an8-thumb img { height: 34px; max-width: 60px; }
  .mx-an8-keys li { grid-template-columns: 128px minmax(0, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
  .mx-an8-dialog__field i { animation: none; }
  .mx-an8-chips li, .mx-an8-log li, .mx-an8-log li i { transition: none; }
}
