:root {
  --ptac-yellow: #ffdd17;
  --ptac-yellow-soft: #fff4a4;
  --ptac-red: #e31c23;
  --ptac-red-dark: #ad1117;
  --shop-black: #101114;
  --shop-charcoal: #1b1d22;
  --shop-graphite: #2a2d33;
  --panel: #ffffff;
  --panel-warm: #fffdf0;
  --ink: #111111;
  --muted: #62666d;
  --line: #202124;
  --line-soft: #d9d9d9;
  --success: #198754;
  --warning: #9f5d0b;
  --shadow: 0 22px 46px rgba(0, 0, 0, 0.3);
  --hard-shadow: 8px 8px 0 rgba(255, 221, 23, 0.95);
  --red-shadow: 8px 8px 0 rgba(227, 28, 35, 0.9);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
  background:
    linear-gradient(180deg, var(--ptac-yellow) 0 12px, transparent 12px),
    linear-gradient(90deg, rgba(227, 28, 35, 0.95) 0 5px, transparent 5px),
    repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.035) 0 1px, transparent 1px 17px),
    radial-gradient(circle at 50% -12%, rgba(255, 221, 23, 0.16), transparent 36vw),
    linear-gradient(145deg, #1c1f24 0%, #111215 52%, #08090b 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(118deg, transparent 0 57%, rgba(255, 221, 23, 0.08) 57% 60%, transparent 60%),
    linear-gradient(118deg, transparent 0 64%, rgba(227, 28, 35, 0.1) 64% 65%, transparent 65%);
  pointer-events: none;
}

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

.shell {
  width: min(1210px, calc(100vw - 36px));
  margin: 0 auto;
  padding: 24px 0 58px;
}

.brand-bar {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  margin-bottom: 24px;
  padding: 12px 14px;
  border: 3px solid #050505;
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(255, 221, 23, 0.16), transparent 34%),
    #ffffff;
  box-shadow: var(--hard-shadow), var(--shadow);
}

.brand-bar::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -3px;
  height: 6px;
  background:
    linear-gradient(90deg, var(--ptac-red), var(--ptac-red) 34%, var(--ptac-yellow) 34%, var(--ptac-yellow) 68%, var(--shop-black) 68%);
}

.brand-mark {
  width: 138px;
  min-height: 84px;
  display: grid;
  place-items: center;
  border: 3px solid #111;
  border-radius: 8px;
  background: var(--ptac-yellow);
  overflow: hidden;
  box-shadow: 4px 4px 0 #111;
}

.brand-mark img {
  width: 100%;
  height: auto;
  display: block;
}

.brand-copy {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.brand-copy strong {
  color: var(--ink);
  font-size: clamp(24px, 3vw, 40px);
  line-height: 0.96;
  font-weight: 900;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

.brand-copy span {
  max-width: 620px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 900;
  line-height: 1.28;
}

.header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.status-pill,
.nav-pill {
  min-height: 42px;
  display: inline-grid;
  place-items: center;
  padding: 9px 14px;
  border: 2px solid #050505;
  border-radius: 8px;
  background: var(--shop-black);
  color: var(--ptac-yellow);
  font-weight: 900;
  font-size: 13px;
  line-height: 1.15;
  text-align: center;
  box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.22);
}

.nav-pill {
  background: var(--ptac-yellow);
  color: var(--ink);
  text-decoration: none;
}

.nav-pill:hover {
  background: #ffe957;
}

.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 360px);
  gap: 24px;
  align-items: stretch;
  margin-bottom: 22px;
  padding: 24px;
  border: 3px solid #050505;
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(227, 28, 35, 0.22) 0 6px, transparent 6px),
    repeating-linear-gradient(90deg, rgba(255, 221, 23, 0.08) 0 1px, transparent 1px 24px),
    linear-gradient(135deg, #191b20 0%, #101114 100%);
  color: #fff;
  box-shadow: var(--red-shadow), var(--shadow);
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent 0 72%, rgba(255, 221, 23, 0.16) 72% 75%, transparent 75%);
  pointer-events: none;
}

.hero-copy,
.hero-card {
  position: relative;
  z-index: 1;
}

.hero-copy {
  min-width: 0;
  display: grid;
  align-content: center;
  gap: 12px;
}

.hero h1 {
  margin: 0;
  max-width: 780px;
  color: #ffffff;
  font-size: clamp(40px, 6vw, 72px);
  line-height: 0.94;
  letter-spacing: 0;
  text-shadow: 0 4px 0 rgba(0, 0, 0, 0.28);
}

.hero p {
  max-width: 680px;
  margin: 0;
  color: var(--ptac-yellow-soft);
  font-size: clamp(16px, 1.7vw, 20px);
  line-height: 1.42;
  font-weight: 900;
}

.hero-card {
  display: grid;
  align-content: center;
  gap: 9px;
  padding: 20px;
  border: 3px solid #050505;
  border-radius: 8px;
  background:
    linear-gradient(135deg, #fff281, var(--ptac-yellow) 54%, #ffca08);
  color: var(--ink);
  box-shadow: 8px 8px 0 var(--ptac-red);
}

.hero-card span,
.hero-card p {
  margin: 0;
  color: #242424;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
  line-height: 1.35;
}

.hero-card strong {
  font-size: clamp(24px, 3vw, 34px);
  line-height: 1.02;
  font-weight: 900;
}

.workflow {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(340px, 0.95fr);
  gap: 20px;
  margin-bottom: 20px;
}

.panel {
  position: relative;
  border: 3px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.panel::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 8px;
  background: linear-gradient(90deg, var(--ptac-red), var(--ptac-red) 38%, var(--ptac-yellow) 38%, var(--ptac-yellow) 74%, var(--shop-black) 74%);
}

.form-panel,
.match-panel,
.sequence-panel,
.results-panel,
.library-panel {
  padding: 24px;
}

.form-panel {
  background:
    linear-gradient(180deg, rgba(255, 221, 23, 0.1), transparent 110px),
    #ffffff;
}

label {
  display: grid;
  gap: 9px;
  margin-bottom: 16px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

input,
select,
textarea {
  width: 100%;
  border: 2px solid #b9b9b9;
  border-radius: 7px;
  padding: 13px 14px;
  background: #fffdf0;
  color: var(--ink);
  font-size: 15px;
  font-weight: 800;
  outline: none;
  box-shadow: inset 0 2px 0 rgba(0, 0, 0, 0.06);
}

select {
  min-height: 48px;
  cursor: pointer;
}

input[type="file"] {
  padding: 11px;
  cursor: pointer;
  background: #ffffff;
}

input[readonly] {
  background: var(--ptac-yellow-soft);
  border-color: #111;
  color: var(--ink);
}

textarea {
  resize: vertical;
  line-height: 1.45;
}

.field-help {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1.35;
  text-transform: none;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--ptac-red);
  box-shadow:
    inset 0 2px 0 rgba(0, 0, 0, 0.06),
    0 0 0 4px rgba(227, 28, 35, 0.16);
}

.field-grid {
  display: grid;
  grid-template-columns: minmax(160px, 0.85fr) minmax(190px, 1.15fr);
  gap: 14px;
}

.actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

button {
  min-height: 44px;
  border: 2px solid #111;
  border-radius: 7px;
  padding: 0 17px;
  cursor: pointer;
  font-weight: 900;
  letter-spacing: 0;
  box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.22);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
  box-shadow: none;
}

.primary {
  background: var(--ptac-red);
  color: #fff;
}

.primary:hover {
  background: var(--ptac-red-dark);
}

.secondary {
  background: var(--ptac-yellow);
  color: var(--ink);
}

.secondary:hover {
  background: #ffe957;
}

.section-title {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-bottom: 16px;
  color: #4b4f55;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.section-title span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.section-title span::before {
  content: "";
  width: 18px;
  height: 8px;
  border-radius: 2px;
  background: var(--ptac-red);
  box-shadow: 10px 0 0 var(--ptac-yellow);
}

.section-title strong {
  color: var(--ink);
  text-align: right;
}

.empty-state {
  min-height: 156px;
  display: grid;
  place-items: center;
  border: 2px dashed #bdbdbd;
  border-radius: 8px;
  padding: 20px;
  background:
    linear-gradient(135deg, rgba(255, 221, 23, 0.08), transparent 52%),
    #ffffff;
  color: var(--muted);
  font-weight: 900;
  text-align: center;
  line-height: 1.42;
}

.match-card {
  display: grid;
  gap: 14px;
}

.match-main {
  padding: 18px;
  border: 3px solid #111;
  border-radius: 8px;
  background:
    linear-gradient(90deg, var(--ptac-yellow) 0 10px, transparent 10px),
    linear-gradient(135deg, #fffdf0, #fff4a4);
  box-shadow: 5px 5px 0 rgba(227, 28, 35, 0.85);
}

.match-main h2 {
  margin: 0;
  font-size: 25px;
  line-height: 1.12;
}

.match-heading-line {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.match-main p {
  margin: 0 0 12px;
  color: var(--muted);
  font-weight: 900;
}

.source-chip {
  display: inline-grid;
  min-height: 30px;
  place-items: center;
  padding: 4px 9px;
  border: 2px solid #111;
  border-radius: 7px;
  background: var(--shop-black);
  color: var(--ptac-yellow);
  font-size: 11px;
  font-weight: 900;
  white-space: nowrap;
}

.visual-source-note {
  display: block;
  margin-top: 10px;
  color: var(--shop-black);
  font-size: 13px;
  font-weight: 900;
}

.warning-note {
  color: var(--ptac-red-dark);
}

.match-main a,
.result-link {
  color: var(--ptac-red-dark);
  font-weight: 900;
}

.alternatives {
  display: grid;
  gap: 9px;
}

.alternative {
  width: 100%;
  min-height: 46px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 2px solid #cfcfcf;
  background: #ffffff;
  color: var(--ink);
  text-align: left;
  box-shadow: none;
}

.alternative:hover {
  border-color: #111;
  background: #fff8c9;
}

.alternative small {
  color: var(--ptac-red-dark);
  font-weight: 900;
}

.sequence-panel,
.results-panel {
  margin-top: 20px;
}

.sequence {
  display: grid;
  grid-template-columns: 1fr 58px 1fr;
  align-items: stretch;
  gap: 14px;
}

.sequence-step {
  display: grid;
  grid-template-columns: 50px minmax(0, 1fr);
  gap: 14px;
  min-height: 124px;
  padding: 18px;
  border: 2px solid #111;
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 221, 23, 0.18), transparent),
    #fffdf0;
}

.step-number {
  width: 50px;
  height: 50px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  border: 3px solid #111;
  background: var(--ptac-yellow);
  color: var(--ink);
  font-size: 22px;
  font-weight: 900;
  box-shadow: 4px 4px 0 var(--ptac-red);
}

.sequence-step h2 {
  margin: 0 0 8px;
  font-size: 20px;
  line-height: 1.12;
}

.sequence-step p {
  margin: 0;
  color: var(--muted);
  font-weight: 800;
  line-height: 1.42;
  overflow-wrap: anywhere;
}

.connector {
  align-self: center;
  height: 8px;
  border: 2px solid #111;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--ptac-yellow), var(--ptac-red));
  box-shadow: 0 0 0 3px rgba(255, 221, 23, 0.16);
}

.result-ready {
  display: grid;
  gap: 10px;
  border: 3px solid #0f5d35;
  background:
    linear-gradient(90deg, rgba(25, 135, 84, 0.16), transparent),
    #effaf5;
  color: var(--success);
  text-align: left;
}

.render-progress {
  display: block;
  position: relative;
  overflow: hidden;
  border: 3px solid #111;
  background:
    linear-gradient(135deg, rgba(255, 221, 23, 0.22), rgba(255, 255, 255, 0.96) 42%),
    #fff9d8;
  color: var(--ink);
  text-align: left;
  box-shadow: inset 0 0 0 3px rgba(255, 221, 23, 0.26);
}

.result-warning {
  display: grid;
  gap: 10px;
  border: 2px solid #d49a3d;
  background: #fff8ec;
  color: var(--warning);
  text-align: left;
}

.result-ready p,
.result-warning p {
  margin: 0;
}

.progress-wrap {
  display: grid;
  position: relative;
  gap: 16px;
  width: 100%;
}

.progress-topline,
.queue-line {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
}

.progress-title {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 10px;
}

.progress-pulse {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
  border: 2px solid #111;
  border-radius: 999px;
  background: var(--ptac-red);
  box-shadow: 0 0 0 0 rgba(227, 28, 35, 0.42);
  animation: progressPulse 1.35s ease-out infinite;
}

.progress-topline strong {
  min-width: 0;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.progress-topline span,
.queue-line {
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.progress-percent {
  min-width: 62px;
  display: inline-grid;
  place-items: center;
  padding: 7px 10px;
  border: 2px solid #111;
  border-radius: 7px;
  background: var(--ptac-yellow);
  color: var(--ink) !important;
  font-size: 14px !important;
  font-weight: 900 !important;
}

.progress-bar {
  height: 26px;
  position: relative;
  overflow: hidden;
  border: 3px solid #111;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: inset 0 2px 0 rgba(0, 0, 0, 0.1);
}

.progress-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0) 34%),
    repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.28) 0 9px, rgba(255, 255, 255, 0) 9px 18px),
    linear-gradient(90deg, var(--ptac-red), var(--ptac-red-dark));
  background-size: 100% 100%, 36px 36px, 100% 100%;
  box-shadow: inset 0 -4px 0 rgba(0, 0, 0, 0.14);
  transition: width 0.28s ease;
  animation: progressStripe 1.05s linear infinite;
}

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

.status-step {
  min-height: 40px;
  display: grid;
  place-items: center;
  border: 2px solid #d7d7d7;
  border-radius: 7px;
  padding: 7px;
  color: var(--muted);
  background: #fff;
  font-size: 12px;
  font-weight: 900;
  text-align: center;
}

.status-step.done {
  border-color: #0f5d35;
  background: #effaf5;
  color: var(--success);
}

.status-step.active {
  border-color: #111;
  background: var(--ptac-yellow);
  color: var(--ink);
  box-shadow: 0 0 0 3px rgba(227, 28, 35, 0.14);
  animation: activeStepPulse 1.4s ease-in-out infinite;
}

@keyframes progressStripe {
  from {
    background-position: 0 0, 0 0, 0 0;
  }

  to {
    background-position: 0 0, 36px 0, 0 0;
  }
}

@keyframes progressPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(227, 28, 35, 0.42);
  }

  70% {
    box-shadow: 0 0 0 10px rgba(227, 28, 35, 0);
  }

  100% {
    box-shadow: 0 0 0 0 rgba(227, 28, 35, 0);
  }
}

@keyframes activeStepPulse {
  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-2px);
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .progress-bar span,
  .progress-pulse,
  .status-step.active {
    animation: none;
  }
}

.copy-link {
  width: fit-content;
  background: var(--success);
  color: #fff;
}

.filename-line {
  color: var(--ink);
  font-weight: 900;
  overflow-wrap: anywhere;
}

.final-url {
  max-width: 100%;
  overflow-wrap: anywhere;
  color: var(--ink);
  font-size: 13px;
  font-weight: 900;
}

.library-shell {
  padding-bottom: 72px;
}

.recent-panel {
  padding: 22px;
  margin-bottom: 20px;
  background:
    linear-gradient(90deg, rgba(255, 221, 23, 0.12), transparent 62%),
    #ffffff;
}

.recent-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.recent-card {
  display: grid;
  grid-template-rows: auto 1fr;
  border: 3px solid #111;
  border-radius: 8px;
  background: #fffdf0;
  overflow: hidden;
  box-shadow: 6px 6px 0 rgba(0, 0, 0, 0.18);
}

.recent-card-body {
  display: grid;
  gap: 8px;
  align-content: start;
  padding: 14px;
}

.recent-card h2 {
  margin: 0;
  font-size: 20px;
  line-height: 1.12;
  overflow-wrap: anywhere;
}

.recent-card p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
  overflow-wrap: anywhere;
}

.recent-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 2px;
}

.recent-actions .copy-link {
  min-height: 36px;
  padding: 0 12px;
  box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.18);
}

.library-controls {
  display: grid;
  grid-template-columns: repeat(5, minmax(150px, 1fr));
  gap: 14px;
  align-items: end;
  padding: 22px;
  margin-bottom: 20px;
  background:
    linear-gradient(90deg, rgba(255, 221, 23, 0.12), transparent 56%),
    #ffffff;
}

.library-controls label {
  margin-bottom: 0;
}

.store-login-panel {
  padding: 22px;
  margin-bottom: 20px;
  background:
    linear-gradient(90deg, rgba(227, 28, 35, 0.1), transparent 58%),
    #ffffff;
}

.store-login-grid {
  display: grid;
  grid-template-columns: minmax(180px, 1.05fr) minmax(190px, 1fr) minmax(160px, 0.82fr);
  gap: 14px;
  align-items: end;
}

.store-login-grid label {
  margin-bottom: 0;
}

.store-login-actions {
  grid-column: 1 / -1;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.store-login-actions button {
  min-width: 164px;
}

.library-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  grid-column: 1 / -1;
}

.refresh-button {
  min-height: 42px;
}

.library-count {
  min-width: 128px;
}

.video-list {
  display: grid;
  gap: 18px;
}

.date-group {
  display: grid;
  gap: 14px;
}

.date-group-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  padding: 14px;
  border: 3px solid #111;
  border-radius: 8px;
  background:
    linear-gradient(90deg, var(--ptac-yellow) 0 10px, transparent 10px),
    linear-gradient(135deg, #ffffff, #fff7bd);
  box-shadow: 5px 5px 0 rgba(227, 28, 35, 0.82);
}

.date-group-header h2 {
  margin: 0 0 4px;
  font-size: 25px;
  line-height: 1.05;
}

.date-group-header p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.store-counts {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.store-counts span {
  display: inline-grid;
  min-height: 32px;
  place-items: center;
  padding: 5px 10px;
  border: 2px solid #111;
  border-radius: 7px;
  background: var(--shop-black);
  color: var(--ptac-yellow);
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.date-video-list {
  display: grid;
  gap: 14px;
}

.video-thumb {
  position: relative;
  min-height: 132px;
  display: grid;
  place-items: center;
  align-self: stretch;
  overflow: hidden;
  border: 3px solid #111;
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(227, 28, 35, 0.18), transparent 48%),
    var(--ptac-yellow);
  color: var(--ink);
  text-decoration: none;
  box-shadow: 4px 4px 0 var(--ptac-red);
}

.video-thumb > img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.thumb-fallback {
  display: grid;
  place-items: center;
  gap: 7px;
  padding: 12px;
  text-align: center;
}

.thumb-fallback img {
  width: min(120px, 70%);
  height: auto;
  display: block;
  border: 2px solid #111;
  border-radius: 7px;
  background: var(--ptac-yellow);
}

.thumb-fallback small {
  color: var(--ink);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.recent-thumb {
  min-height: 156px;
  border-width: 0 0 3px;
  border-radius: 0;
  box-shadow: none;
}

.video-card {
  position: relative;
  display: grid;
  grid-template-columns: minmax(150px, 210px) minmax(0, 1fr) auto;
  gap: 16px;
  align-items: stretch;
  padding: 18px 18px 18px 24px;
  border: 3px solid #111;
  border-radius: 8px;
  background:
    linear-gradient(90deg, var(--ptac-yellow) 0 9px, transparent 9px),
    #fffdf0;
  box-shadow: 6px 6px 0 rgba(0, 0, 0, 0.18);
}

.video-card-main {
  display: grid;
  gap: 9px;
  min-width: 0;
}

.video-topline {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.store-badge {
  display: inline-grid;
  place-items: center;
  min-height: 32px;
  padding: 5px 11px;
  border: 2px solid #111;
  border-radius: 7px;
  background: var(--ptac-yellow);
  color: var(--ink);
  box-shadow: 3px 3px 0 var(--ptac-red);
}

.view-status {
  width: fit-content;
  min-height: 30px;
  display: inline-grid;
  place-items: center;
  padding: 4px 10px;
  border: 2px solid #111;
  border-radius: 7px;
  color: #111;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
  box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.18);
}

.view-status.not-viewed {
  background: #ffffff;
}

.view-status.opened {
  background: var(--ptac-yellow);
}

.view-status.viewed {
  background: #20d45a;
}

.view-status.failed {
  background: var(--ptac-red);
  color: #fff;
}

.failed-video {
  background:
    linear-gradient(90deg, var(--ptac-red) 0 9px, transparent 9px),
    #fff2f2;
}

.failed-video .video-thumb {
  background:
    linear-gradient(135deg, rgba(227, 28, 35, 0.28), transparent 48%),
    #ffffff;
}

.failure-reason,
.failure-action {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 6px 10px;
  border: 2px solid #111;
  border-radius: 7px;
  background: #fff;
  color: var(--ptac-red-dark);
  font-size: 12px;
  font-weight: 900;
  line-height: 1.25;
}

.failure-action {
  justify-content: center;
  min-height: 42px;
  background: var(--ptac-red);
  color: #fff;
  text-align: center;
}

.video-card h2 {
  margin: 0;
  font-size: 24px;
  line-height: 1.14;
  overflow-wrap: anywhere;
}

.video-card p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
  overflow-wrap: anywhere;
}

.video-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.video-meta span {
  display: inline-flex;
  max-width: 100%;
  min-height: 31px;
  align-items: center;
  padding: 5px 10px;
  border: 1px solid #d5d5d5;
  border-radius: 7px;
  background: #ffffff;
  color: var(--ink);
  font-size: 12px;
  font-weight: 900;
  overflow-wrap: anywhere;
}

.video-card-actions {
  display: grid;
  grid-auto-rows: min-content;
  gap: 9px;
  justify-items: stretch;
  min-width: 154px;
}

.video-card-actions a,
.video-card-actions button {
  min-height: 42px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  text-align: center;
}

.drive-link {
  border: 2px solid #111;
  background: #fff;
  color: var(--ink);
  font-weight: 900;
  text-decoration: none;
  box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.14);
}

.auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px 0;
}

.auth-panel {
  width: min(540px, 100%);
  display: grid;
  gap: 18px;
  padding: 24px;
  background:
    linear-gradient(180deg, rgba(255, 221, 23, 0.18), transparent 180px),
    #ffffff;
  box-shadow: var(--hard-shadow), var(--shadow);
}

.auth-logo {
  width: 170px;
  min-height: 102px;
}

.auth-copy {
  display: grid;
  gap: 8px;
}

.auth-copy h1 {
  margin: 0;
  font-size: clamp(36px, 8vw, 58px);
  line-height: 0.96;
}

.auth-copy p {
  margin: 0;
  color: var(--muted);
  font-weight: 900;
  line-height: 1.4;
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.auth-tab {
  background: #fff;
  color: var(--ink);
}

.auth-tab.active {
  background: var(--ptac-yellow);
  box-shadow: 4px 4px 0 var(--ptac-red);
}

.auth-form {
  display: grid;
  gap: 14px;
}

.auth-form label {
  margin-bottom: 0;
}

.auth-submit {
  width: 100%;
  min-height: 50px;
}

.auth-secondary {
  width: 100%;
  min-height: 46px;
}

.auth-setup-panel {
  border-top: 3px solid #111;
  padding-top: 16px;
}

.auth-message {
  min-height: 22px;
  color: var(--warning);
  font-weight: 900;
  line-height: 1.35;
}

@media (max-width: 900px) {
  .brand-bar {
    grid-template-columns: auto 1fr;
    align-items: center;
  }

  .brand-mark {
    width: 132px;
    min-height: 82px;
  }

  .header-actions {
    grid-column: 1 / -1;
    width: 100%;
    justify-content: stretch;
  }

  .status-pill,
  .nav-pill {
    flex: 1 1 160px;
  }

  .hero,
  .workflow,
  .sequence,
  .recent-grid,
  .library-controls,
  .store-login-grid,
  .video-card {
    grid-template-columns: 1fr;
  }

  .field-grid {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .connector {
    width: 8px;
    height: 40px;
    justify-self: center;
  }

  .progress-topline,
  .queue-line {
    display: grid;
    gap: 6px;
  }

  .date-group-header {
    display: grid;
    align-items: start;
  }

  .store-counts {
    justify-content: flex-start;
  }

  .status-steps {
    grid-template-columns: 1fr;
  }

  .library-actions,
  .store-login-actions,
  .video-card-actions {
    min-width: 0;
  }

  .video-thumb {
    min-height: 190px;
  }

  .video-card-actions {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .shell {
    width: min(100% - 24px, 1210px);
    padding-top: 18px;
  }

  .brand-bar {
    gap: 12px;
    padding: 10px;
  }

  .brand-mark {
    width: 118px;
    min-height: 74px;
  }

  .brand-copy strong {
    font-size: 26px;
    line-height: 0.96;
  }

  .brand-copy span {
    font-size: 13px;
  }

  .hero {
    padding: 18px;
  }

  .hero h1 {
    font-size: 38px;
    line-height: 0.98;
  }

  .hero p {
    font-size: 16px;
  }

  .hero-card strong {
    font-size: 24px;
  }

  .form-panel,
  .match-panel,
  .sequence-panel,
  .results-panel,
  .recent-panel,
  .library-panel,
  .store-login-panel,
  .library-controls {
    padding: 18px;
  }

  .video-thumb {
    min-height: 164px;
  }

  button,
  .status-pill,
  .nav-pill {
    width: 100%;
  }

  .actions {
    display: grid;
  }

  .store-login-actions {
    display: grid;
  }

  .store-login-actions button {
    min-width: 0;
  }
}
