:root {
  color-scheme: light;
  --ink: #112231;
  --ink-soft: #546575;
  --paper: #f3f0e8;
  --surface: #fffdf8;
  --line: #d9d5ca;
  --navy: #101d29;
  --navy-2: #1d3040;
  --teal: #0c7b78;
  --teal-light: #d9efeb;
  --yellow: #f0c431;
  --red: #c83d35;
  --red-dark: #8e2623;
  --green: #187052;
  --warning: #ad7214;
  --shadow: 0 12px 34px rgba(17, 34, 49, 0.09);
  --radius: 22px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--paper);
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(180deg, var(--navy) 0 360px, transparent 360px),
    var(--paper);
  min-height: 100vh;
}

button,
input {
  font: inherit;
}

button {
  touch-action: manipulation;
}

button:focus-visible,
input:focus-visible {
  outline: 3px solid var(--yellow);
  outline-offset: 3px;
}

.app-header {
  position: sticky;
  z-index: 20;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: max(12px, env(safe-area-inset-top)) max(18px, env(safe-area-inset-right)) 12px max(18px, env(safe-area-inset-left));
  color: white;
  background: rgba(16, 29, 41, 0.94);
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(18px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  color: var(--navy);
  background: var(--yellow);
  border-radius: 12px;
  font-size: 1.35rem;
  font-weight: 900;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  letter-spacing: 0.08em;
}

.brand small {
  margin-top: 1px;
  color: #acbac5;
  font-size: 0.7rem;
}

.clock-block {
  display: flex;
  align-items: flex-end;
  flex-direction: column;
  gap: 4px;
  text-align: right;
}

.clock-block > strong {
  font-size: 0.82rem;
  font-variant-numeric: tabular-nums;
}

main {
  width: min(100% - 28px, 880px);
  margin: 0 auto;
  padding-bottom: 60px;
}

.hero {
  min-height: 275px;
  padding: 44px 6px 28px;
  color: white;
}

.hero h1 {
  max-width: 650px;
  margin: 7px 0 14px;
  font-size: clamp(2.5rem, 9vw, 5.3rem);
  line-height: 0.92;
  letter-spacing: -0.055em;
}

.hero > p:not(.eyebrow) {
  max-width: 610px;
  margin: 0;
  color: #cad4dc;
  font-size: 1.02rem;
  line-height: 1.55;
}

.eyebrow {
  margin: 0;
  color: var(--teal);
  font-size: 0.72rem;
  font-weight: 850;
  letter-spacing: 0.16em;
}

.hero .eyebrow {
  color: var(--yellow);
}

.support-box {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 22px;
  color: #b8c5ce;
  font-size: 0.8rem;
}

.panel {
  margin: 16px 0;
  padding: clamp(20px, 5vw, 34px);
  background: var(--surface);
  border: 1px solid rgba(17, 34, 49, 0.07);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.section-heading {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 22px;
}

.section-heading h2 {
  margin: 2px 0 0;
  font-size: clamp(1.55rem, 5vw, 2.1rem);
  letter-spacing: -0.035em;
}

.step-number {
  display: grid;
  flex: 0 0 auto;
  width: 48px;
  height: 48px;
  place-items: center;
  color: var(--teal);
  background: var(--teal-light);
  border-radius: 14px;
  font-weight: 850;
}

.section-copy {
  margin: -7px 0 22px 62px;
  color: var(--ink-soft);
  line-height: 1.5;
}

.camera-grid {
  display: grid;
  gap: 14px;
}

.camera-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 15px;
  align-items: center;
  padding: 18px;
  background: #f6f4ee;
  border: 1px solid var(--line);
  border-radius: 17px;
}

.camera-identity {
  display: flex;
  align-items: center;
  gap: 13px;
  min-width: 0;
}

.camera-identity > div {
  min-width: 0;
}

.camera-identity h3,
.camera-identity p {
  overflow: hidden;
  margin: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.camera-identity h3 {
  font-size: 1rem;
}

.camera-identity p {
  margin-top: 5px;
  color: var(--ink-soft);
  font-size: 0.76rem;
}

.camera-code {
  display: grid;
  flex: 0 0 auto;
  width: 47px;
  height: 47px;
  place-items: center;
  color: white;
  background: var(--navy);
  border-radius: 14px;
  font-weight: 900;
}

.camera-code-360 {
  color: var(--navy);
  background: var(--yellow);
  font-size: 0.77rem;
}

.camera-card .button {
  grid-column: 1 / -1;
}

.status {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  min-height: 24px;
  padding: 4px 9px;
  color: #59636d;
  background: #e8e8e5;
  border-radius: 999px;
  font-size: 0.69rem;
  font-weight: 800;
  white-space: nowrap;
}

.status[data-tone="ok"] {
  color: #0c5a3e;
  background: #d9efe5;
}

.status[data-tone="warning"] {
  color: #744b08;
  background: #fae9bd;
}

.status[data-tone="error"] {
  color: #842e29;
  background: #f6dcd8;
}

.button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  min-height: 50px;
  padding: 12px 18px;
  border: 0;
  border-radius: 14px;
  font-weight: 850;
  cursor: pointer;
  transition: transform 120ms ease, filter 120ms ease;
}

.button:not(:disabled):active {
  transform: scale(0.985);
}

.button:disabled {
  cursor: not-allowed;
  filter: grayscale(0.6);
  opacity: 0.48;
}

.button.secondary {
  color: var(--navy);
  background: white;
  border: 1px solid #c9c8c1;
}

.button.primary {
  color: white;
  background: var(--teal);
}

.message {
  position: sticky;
  z-index: 15;
  top: 78px;
  margin: 12px 0;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: start;
  padding: 14px 14px 14px 16px;
  color: #204963;
  background: #e1f0f8;
  border: 1px solid #b7d8e8;
  border-radius: 14px;
  box-shadow: 0 8px 24px rgba(17, 34, 49, 0.14);
  font-size: 0.86rem;
  line-height: 1.45;
}

.message[hidden] {
  display: none;
}

.message-close {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  padding: 0;
  color: currentColor;
  background: rgba(255, 255, 255, 0.46);
  border: 0;
  border-radius: 50%;
  font-size: 1.45rem;
  line-height: 1;
  cursor: pointer;
}

.message[data-tone="success"] {
  color: #13563f;
  background: #def1e8;
  border-color: #b5dfcd;
}

.message[data-tone="warning"] {
  color: #6d480d;
  background: #fff0c9;
  border-color: #efd489;
}

.message[data-tone="error"] {
  color: #7d2c28;
  background: #f9dfdc;
  border-color: #eebfba;
}

.profile-list {
  display: grid;
  gap: 10px;
}

.profile {
  display: flex;
  align-items: stretch;
  flex-direction: column;
  gap: 7px;
  min-height: 118px;
  padding: 16px;
  color: var(--ink);
  text-align: left;
  background: #f6f4ee;
  border: 2px solid transparent;
  border-radius: 16px;
  cursor: pointer;
}

.profile.selected {
  background: #ecf7f4;
  border-color: var(--teal);
  box-shadow: inset 0 0 0 1px rgba(12, 123, 120, 0.1);
}

.profile-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.profile > span:not(.profile-top) {
  color: var(--ink-soft);
  font-size: 0.78rem;
  line-height: 1.35;
}

.profile .profile-metric {
  margin-top: auto;
  color: var(--ink) !important;
  font-weight: 760;
}

.risk {
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
}

.risk-bajo {
  color: var(--green);
  background: #dcefe5;
}

.risk-medio {
  color: #77500b;
  background: #fae7b7;
}

.risk-alto {
  color: var(--red-dark);
  background: #f5d8d4;
}

.profile-application {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

.profile-device {
  display: flex;
  flex-direction: column;
  gap: 9px;
  padding: 18px;
  background: var(--navy);
  border-radius: 17px;
  color: white;
}

.profile-device > span,
.profile-device label {
  color: #aebbc4;
  font-size: 0.73rem;
}

.profile-device > strong {
  font-size: 1.22rem;
}

.profile-device input[type="number"],
.profile-device select,
.session-meta input {
  width: 100%;
  min-height: 48px;
  padding: 10px 12px;
  color: var(--ink);
  background: white;
  border: 1px solid #c8cbd0;
  border-radius: 11px;
}

.profile-device select {
  appearance: auto;
}

.preset-diagnostic {
  display: grid;
  gap: 4px;
  padding: 11px 12px;
  color: #d9e2e8;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 11px;
  font-size: 0.72rem;
}

.preset-diagnostic strong {
  color: white;
  font-size: 0.82rem;
}

.preset-diagnostic strong[data-tone="ok"] {
  color: #a9efd3;
}

.preset-diagnostic strong[data-tone="error"] {
  color: #ffb8b0;
}

.preset-caution {
  color: #e4c97a;
  font-size: 0.68rem;
  line-height: 1.4;
}

.profile-validation {
  display: grid;
  gap: 9px;
  padding: 12px;
  color: var(--ink);
  background: #f7f4eb;
  border-radius: 12px;
}

.profile-validation[hidden] {
  display: none;
}

.profile-validation > strong[data-tone="ok"] {
  color: var(--green);
}

.profile-validation > strong[data-tone="warning"] {
  color: #8a5b08;
}

.profile-validation ul {
  display: grid;
  gap: 6px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.profile-validation li {
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 7px;
  align-items: start;
  padding: 7px 8px;
  background: white;
  border-radius: 8px;
  font-size: 0.72rem;
}

.profile-validation li > span:first-child {
  display: grid;
  width: 20px;
  height: 20px;
  place-items: center;
  color: white;
  background: var(--green);
  border-radius: 50%;
  font-weight: 900;
}

.profile-validation li[data-result="mismatch"] > span:first-child {
  background: var(--red);
}

.profile-validation li[data-result="unknown"] > span:first-child {
  color: var(--ink);
  background: var(--yellow);
}

.profile-validation li span:last-child {
  display: grid;
  gap: 2px;
}

.profile-validation li small {
  color: var(--ink-soft);
  line-height: 1.35;
}

.insta-profile {
  color: var(--ink);
  background: #f3e6af;
}

.insta-profile > span,
.insta-profile label {
  color: #655628;
}

.recommendation {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.52);
  border-radius: 11px;
  font-size: 0.75rem;
}

.check-row {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  line-height: 1.4;
}

.check-row input {
  flex: 0 0 auto;
  width: 23px;
  height: 23px;
  margin: 1px 0 0;
  accent-color: var(--teal);
}

.session-meta {
  display: grid;
  gap: 12px;
  margin-bottom: 18px;
}

.session-meta label {
  display: grid;
  gap: 6px;
  color: var(--ink-soft);
  font-size: 0.75rem;
  font-weight: 750;
}

.preflight {
  padding: 18px;
  background: #f4f2ec;
  border: 1px solid var(--line);
  border-radius: 17px;
}

.preflight > div {
  display: flex;
  align-items: center;
  gap: 9px;
}

.counter {
  color: var(--teal);
  font-size: 1.25rem;
  font-weight: 900;
}

.preflight ul {
  display: grid;
  gap: 9px;
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
}

.preflight li {
  display: flex;
  align-items: center;
  gap: 9px;
  color: #7a858e;
  font-size: 0.79rem;
}

.preflight li > span:first-child {
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  background: #e2e0da;
  border-radius: 50%;
  font-weight: 900;
}

.preflight li.ok {
  color: var(--green);
}

.preflight li.ok > span:first-child {
  color: white;
  background: var(--green);
}

.preflight li.warning {
  color: var(--warning);
}

.preflight li.warning > span:first-child {
  color: white;
  background: var(--warning);
}

.test-mode {
  margin: 14px 2px;
  color: var(--ink-soft);
  font-size: 0.75rem;
}

.monitoring {
  display: grid;
  gap: 10px;
  padding: 16px;
  background: #e9f1f1;
  border: 1px solid #bfd5d4;
  border-radius: 16px;
}

.monitor-heading {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.monitor-heading > div {
  display: grid;
  gap: 2px;
}

.monitoring > p,
.monitoring > small {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.72rem;
  line-height: 1.45;
}

.monitor-camera {
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 8px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.72);
  border-radius: 10px;
  font-size: 0.76rem;
}

.monitor-camera span {
  color: var(--ink-soft);
}

.synchronization {
  display: grid;
  gap: 10px;
  margin-top: 14px;
  padding: 16px;
  color: #edf7f6;
  background: #173a42;
  border: 1px solid #2d6870;
  border-radius: 16px;
}

.synchronization > p,
.synchronization > small {
  margin: 0;
  color: #c5dcda;
  font-size: 0.72rem;
  line-height: 1.45;
}

.synchronization .monitor-heading .eyebrow {
  color: #9ed6cf;
}

.sync-candidate {
  padding: 10px 12px;
  color: #e8f4f2;
  background: rgba(255, 255, 255, 0.1);
  border: 1px dashed rgba(214, 242, 237, 0.46);
  border-radius: 10px;
  font-size: 0.75rem;
  line-height: 1.4;
}

.sync-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
}

.sync-actions .button {
  min-height: 44px;
  font-size: 0.75rem;
}

.sync-confirmations {
  grid-template-columns: 1fr 1fr;
}

.sync-confirmations .button.plain {
  grid-column: 1 / -1;
  color: #d6ebe7;
  background: transparent;
  border: 1px solid rgba(214, 235, 231, 0.56);
}

.synchronization .button.secondary {
  color: var(--navy);
  background: #dce9e7;
}

.synchronization .button.primary {
  color: var(--navy);
  background: var(--yellow);
}

.active-alerts {
  display: grid;
  gap: 9px;
  padding: 15px;
  color: #702824;
  background: #f9dfdc;
  border: 2px solid #d8675e;
  border-radius: 16px;
}

.active-alerts[hidden] {
  display: none;
}

.active-alerts ul {
  display: grid;
  gap: 8px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.active-alerts li {
  display: grid;
  gap: 3px;
  padding: 9px 10px;
  background: rgba(255, 255, 255, 0.55);
  border-radius: 9px;
  font-size: 0.76rem;
}

.active-alerts li[data-severity="warning"] {
  color: #704b0e;
  background: #fff0c9;
}

.session-display {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 18px 0;
  padding: 18px 20px;
  color: white;
  background: var(--navy);
  border-radius: 18px;
}

.session-display > div {
  min-width: 0;
}

.session-display small {
  display: block;
  overflow: hidden;
  max-width: 50vw;
  margin-top: 6px;
  color: #9dabb5;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.session-state {
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.13em;
}

.session-state[data-tone="recording"] {
  color: #ff7068;
}

.session-state[data-tone="warning"] {
  color: var(--yellow);
}

.session-state[data-tone="error"] {
  color: #ff8e84;
}

.elapsed {
  font-size: clamp(2rem, 11vw, 3.4rem);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.04em;
}

.capture-actions {
  display: grid;
  gap: 12px;
}

.button.record,
.button.stop {
  min-height: 68px;
  font-size: 1rem;
  letter-spacing: 0.035em;
}

.button.record {
  color: white;
  background: var(--red);
  box-shadow: 0 9px 24px rgba(200, 61, 53, 0.23);
}

.button.stop {
  color: white;
  background: var(--navy-2);
}

.record-dot {
  width: 16px;
  height: 16px;
  background: white;
  border-radius: 50%;
}

.stop-square {
  width: 15px;
  height: 15px;
  background: white;
  border-radius: 2px;
}

.technical-note {
  margin: 15px 2px 0;
  color: var(--ink-soft);
  font-size: 0.72rem;
  line-height: 1.45;
}

.zip-callout {
  display: grid;
  gap: 15px;
  padding: 19px;
  color: white;
  background: var(--teal);
  border-radius: 18px;
}

.zip-callout p {
  margin: 7px 0 0;
  color: #d3efeb;
  font-size: 0.78rem;
  line-height: 1.45;
}

.button.export {
  color: var(--navy);
  background: var(--yellow);
}

.event-list {
  display: grid;
  gap: 8px;
  margin: 17px 0 0;
  padding: 0;
  list-style: none;
}

.event-list li {
  display: grid;
  grid-template-columns: 70px 1fr;
  gap: 8px;
  padding: 10px 2px;
  color: var(--ink-soft);
  border-bottom: 1px solid #ebe8df;
  font-size: 0.74rem;
}

.event-list time {
  color: var(--teal);
  font-variant-numeric: tabular-nums;
  font-weight: 800;
}

footer {
  display: flex;
  align-items: center;
  flex-direction: column;
  gap: 6px;
  padding: 25px 20px max(30px, env(safe-area-inset-bottom));
  color: #7b858d;
  font-size: 0.72rem;
  text-align: center;
}

footer strong {
  color: var(--ink);
}

@media (min-width: 680px) {
  body {
    background:
      linear-gradient(180deg, var(--navy) 0 420px, transparent 420px),
      var(--paper);
  }

  .hero {
    min-height: 330px;
    padding-top: 65px;
  }

  .camera-grid,
  .profile-application,
  .session-meta {
    grid-template-columns: 1fr 1fr;
  }

  .profile-list {
    grid-template-columns: repeat(3, 1fr);
  }

  .session-meta .wide {
    grid-column: 1 / -1;
  }

  .capture-actions,
  .zip-callout {
    grid-template-columns: 1fr 1fr;
    align-items: center;
  }

  .zip-callout {
    grid-template-columns: 1fr auto;
  }
}

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