.hero {
  padding: 22px 0 34px;
}

.hero-inner {
  width: min(1180px, calc(100vw - 40px));
  margin: 0 auto;
}

.hero-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 440px);
  gap: 48px;
  align-items: start;
  min-height: 620px;
  padding: 56px;
  border-radius: 28px;
  background: #ffffff;
  box-shadow: 0 28px 80px rgba(40, 98, 155, 0.18);
}

.hero-copy {
  max-width: 650px;
}

.homepage-hero .hero-inner {
  grid-template-areas:
    "heading heading"
    "copy preview";
  grid-template-columns: minmax(0, 1fr) minmax(320px, 390px);
  column-gap: 48px;
  row-gap: 28px;
}

.homepage-hero-heading {
  grid-area: heading;
}

.homepage-hero-heading h1 {
  max-width: none;
  font-size: clamp(38px, 4.2vw, 52px);
  white-space: nowrap;
}

.homepage-hero .hero-copy {
  grid-area: copy;
  max-width: none;
}

.homepage-hero .intro {
  margin-top: 0;
}

.homepage-hero .preview {
  grid-area: preview;
  padding-top: 0;
}

.form {
  display: grid;
  gap: 14px;
  max-width: 650px;
  margin-top: 30px;
  padding: 18px;
  border: 1px solid rgba(119, 172, 223, 0.45);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 18px 48px rgba(59, 118, 178, 0.14);
}

.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.custom-instructions-field {
  display: grid;
  gap: 7px;
}

.custom-instructions-field label small {
  margin-left: 4px;
  color: #6a7d94;
  font-weight: 700;
}

.custom-instructions-control {
  position: relative;
}

.custom-instructions-control textarea {
  display: block;
  width: 100%;
  min-height: 112px;
  border: 1px solid #b8d1eb;
  border-radius: 12px;
  padding: 12px;
  background: #fff;
  color: #12233b;
  font: inherit;
  line-height: 1.45;
  outline: none;
  resize: vertical;
}

.custom-instructions-control textarea:focus {
  border-color: #145ac9;
  box-shadow: 0 0 0 4px rgba(20, 90, 201, 0.14);
}

.custom-instructions-control textarea:disabled {
  opacity: 0.58;
  resize: none;
}

.custom-instructions-upgrade {
  position: absolute;
  inset: 0;
  display: flex;
  justify-content: center;
  width: 100%;
  min-height: 112px;
  border: 1px solid rgba(20, 90, 201, 0.3);
  border-radius: 12px;
  padding: 18px;
  background: rgba(245, 250, 255, 0.92);
  color: #203650;
  box-shadow: none;
  text-align: left;
}

.custom-instructions-upgrade:hover,
.custom-instructions-upgrade:focus-visible {
  border-color: #145ac9;
  background: rgba(238, 246, 255, 0.97);
  color: #145ac9;
  box-shadow: 0 0 0 4px rgba(20, 90, 201, 0.14);
}

.custom-instructions-upgrade > span:last-child {
  display: grid;
  gap: 3px;
}

.custom-instructions-upgrade small {
  color: #4d6078;
  font-weight: 700;
  line-height: 1.35;
}

.custom-instructions-plus-badge {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 4px 8px;
  background: #145ac9;
  color: #fff;
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.custom-instructions-help {
  margin: 0;
  color: #60748c;
  font-size: 12px;
  font-weight: 650;
  line-height: 1.4;
}

.url-field input {
  min-height: 54px;
  font-size: 16px;
}

.youtube-search {
  display: grid;
  gap: 10px;
}

.youtube-search-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.youtube-search-row input {
  min-height: 46px;
}

.youtube-search-status {
  min-height: 20px;
  color: #4d6078;
  font-size: 13px;
  font-weight: 700;
}

.youtube-search-status.error {
  color: #c3322d;
}

.youtube-search-results {
  display: grid;
  gap: 8px;
}

.youtube-search-result {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 10px;
  width: 100%;
  min-height: 72px;
  padding: 8px;
  border: 1px solid rgba(119, 172, 223, 0.34);
  border-radius: 10px;
  background: #fff;
  color: #12233b;
  box-shadow: none;
  text-align: left;
}

.youtube-search-result:hover,
.youtube-search-result:focus-visible {
  border-color: #145ac9;
  background: #f5faff;
}

.youtube-search-result-selected {
  border-color: #145ac9;
  box-shadow: 0 0 0 3px rgba(20, 90, 201, 0.14);
}

.youtube-search-result img {
  display: block;
  width: 112px;
  aspect-ratio: 16 / 9;
  border-radius: 7px;
  object-fit: cover;
  background: #eaf5ff;
}

.youtube-search-result-body {
  display: grid;
  align-content: center;
  gap: 4px;
  min-width: 0;
}

.youtube-search-result-body strong,
.youtube-search-result-body span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.youtube-search-result-body strong {
  color: #12233b;
  font-size: 14px;
  line-height: 1.3;
}

.youtube-search-result-body span {
  color: #5d7089;
  font-size: 12px;
  font-weight: 700;
}

@media (prefers-reduced-motion: reduce) {
  .summary-generation-visual span {
    transition: none !important;
  }
}

.homepage-recent {
  width: min(1180px, calc(100vw - 40px));
  margin: 0 auto 56px;
}

.homepage-recent-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: end;
  margin-bottom: 16px;
}

.homepage-recent-heading h2 {
  font-size: 30px;
}

.homepage-recent-heading p:not(.eyebrow) {
  max-width: 620px;
  margin-top: 8px;
  color: #4d6078;
  font-size: 16px;
  line-height: 1.5;
}

.homepage-recent-link {
  white-space: nowrap;
}

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

.homepage-summary-card {
  display: grid;
  gap: 8px;
  min-width: 0;
  padding: 10px;
  border: 1px solid rgba(119, 172, 223, 0.22);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 10px 26px rgba(49, 102, 157, 0.08);
}

.homepage-summary-thumbnail-link {
  display: block;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 8px;
  background: #eaf5ff;
}

.homepage-summary-thumbnail {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  object-fit: cover;
}

.homepage-summary-card h3 {
  margin: 0;
  font-size: 16px;
  line-height: 1.28;
}

.homepage-summary-card h3 a {
  display: -webkit-box;
  overflow: hidden;
  color: #12233b;
  text-decoration: none;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.homepage-summary-card h3 a:hover {
  color: #145ac9;
}

.homepage-summary-meta,
.homepage-summary-preview {
  margin: 0;
  color: #4d6078;
  font-size: 13px;
  line-height: 1.35;
}

.homepage-summary-preview {
  display: -webkit-box;
  overflow: hidden;
  color: #5a6878;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.preview {
  display: flex;
  justify-content: center;
}

.summary-preview-card {
  width: min(100%, 420px);
  overflow: hidden;
  border: 1px solid rgba(99, 148, 196, 0.34);
  border-radius: 24px;
  background: #ffffff;
  box-shadow: 0 24px 58px rgba(30, 86, 150, 0.18);
}

.summary-preview-media {
  position: relative;
  display: grid;
  min-height: 200px;
  place-items: center;
  background:
    linear-gradient(135deg, rgba(18, 52, 92, 0.9), rgba(20, 90, 201, 0.72)),
    linear-gradient(45deg, #d9ecff 0 25%, #f7fbff 25% 50%, #d9ecff 50% 75%, #f7fbff 75%);
  background-size: auto, 28px 28px;
}

.summary-preview-thumbnail {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
}

.summary-preview-play {
  position: relative;
  z-index: 1;
  display: grid;
  width: 58px;
  height: 58px;
  place-items: center;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 12px 28px rgba(7, 24, 48, 0.26);
}

.summary-preview-play::before {
  content: "";
  width: 0;
  height: 0;
  margin-left: 4px;
  border-top: 12px solid transparent;
  border-bottom: 12px solid transparent;
  border-left: 18px solid #145ac9;
}

.summary-preview-duration {
  position: absolute;
  right: 14px;
  bottom: 12px;
  padding: 5px 8px;
  border-radius: 7px;
  background: rgba(9, 20, 36, 0.82);
  color: #fff;
  font-size: 12px;
  font-weight: 850;
  line-height: 1;
  z-index: 1;
}

.summary-preview-body {
  display: grid;
  gap: 14px;
  padding: 20px;
}

.summary-preview-card h2 {
  color: #12233b;
  font-size: 22px;
  line-height: 1.15;
}

.summary-preview-value {
  padding: 11px 12px;
  border: 1px solid rgba(24, 85, 39, 0.18);
  border-radius: 12px;
  background: #f1fbf4;
  color: #185527;
  font-size: 13px;
  font-weight: 850;
  line-height: 1.35;
}

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

.summary-generation-visual {
  display: grid;
  gap: 11px;
  min-height: 146px;
  align-content: center;
  padding: 18px;
  border: 1px solid rgba(119, 172, 223, 0.24);
  border-radius: 14px;
  background: linear-gradient(145deg, #f8fbff, #edf6ff);
  overflow: hidden;
}

.summary-generation-visual span {
  display: block;
  width: 100%;
  height: 10px;
  border-radius: 999px;
  background: linear-gradient(90deg, #145ac9, #2f8cff 58%, #6cb9ee);
  box-shadow: 0 5px 18px rgba(20, 90, 201, 0.13);
  transform-origin: left center;
}

.summary-generation-visual span:nth-child(2) {
  width: 84%;
}

.summary-generation-visual span:nth-child(3) {
  width: 68%;
}

.summary-preview-row {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 11px;
  border: 1px solid rgba(119, 172, 223, 0.24);
  border-radius: 12px;
  background: #f8fbff;
}

.summary-preview-jump {
  position: relative;
  display: inline-grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border: 1px solid rgba(20, 90, 201, 0.22);
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 2px 8px rgba(20, 90, 201, 0.12);
}

.summary-preview-jump::before {
  content: "";
  width: 0;
  height: 0;
  margin-left: 2px;
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
  border-left: 9px solid #145ac9;
}

.summary-preview-row p {
  color: #405775;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.42;
}

.seo-preview-image {
  display: block;
  width: min(100%, 390px);
  height: auto;
  border: 1px solid rgba(99, 148, 196, 0.34);
  border-radius: 32px;
  box-shadow: 0 30px 70px rgba(30, 86, 150, 0.24);
  transform: rotate(2deg);
}

.preview-window {
  display: none;
  width: min(100%, 390px);
  border: 1px solid rgba(99, 148, 196, 0.34);
  border-radius: 32px;
  background: #ffffff;
  box-shadow: 0 30px 70px rgba(30, 86, 150, 0.24);
  overflow: hidden;
  transform: rotate(2deg);
}

.preview-toolbar {
  display: flex;
  gap: 8px;
  padding: 18px 20px;
  background: #145ac9;
}

.preview-toolbar span {
  width: 11px;
  height: 11px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
}

.preview-content {
  display: grid;
  gap: 16px;
  padding: 24px;
}

.preview-title {
  width: 62%;
  height: 22px;
  border-radius: 999px;
  background: #12345c;
}

.preview-line {
  width: 78%;
  height: 10px;
  border-radius: 999px;
  background: #cfe2f7;
}

.preview-line.wide {
  width: 94%;
}

.preview-line.medium {
  width: 180px;
}

.preview-line.short {
  width: 135px;
}

.preview-section {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  padding: 16px;
  border-radius: 18px;
  background: #f3f8fd;
}

.preview-section > div {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.preview-number {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 10px;
  background: #d9ecff;
  color: #145ac9;
  font-size: 14px;
  font-weight: 900;
}

@media (max-width: 900px) {
  .hero-inner {
    grid-template-columns: 1fr;
    min-height: 0;
    padding: 36px;
  }

  .homepage-hero .hero-inner {
    grid-template-areas:
      "heading"
      "copy"
      "preview";
    grid-template-columns: 1fr;
  }

  .homepage-hero-heading h1 {
    white-space: normal;
  }

  .preview-window {
    transform: none;
  }
}

@media (max-width: 720px) {
  .hero-inner,
  .homepage-recent {
    width: min(100vw - 16px, 1180px);
  }

  .hero {
    padding-top: 12px;
  }

  .hero-inner {
    gap: 28px;
    padding: 24px;
    border-radius: 20px;
  }

  .homepage-recent {
    margin-bottom: 40px;
  }

  .homepage-recent-heading {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .homepage-recent-list {
    grid-template-columns: 1fr;
  }

  .youtube-search-row {
    grid-template-columns: 1fr;
  }

  .youtube-search-row .secondary-button {
    width: 100%;
    justify-content: center;
  }

  .youtube-search-result {
    grid-template-columns: 96px minmax(0, 1fr);
  }

  .youtube-search-result img {
    width: 96px;
  }

  .summary-preview-card {
    width: min(100%, 360px);
  }

  .summary-preview-media {
    min-height: 150px;
  }

  .summary-preview-body {
    padding: 16px;
  }

  .summary-preview-card h2 {
    font-size: 19px;
  }

  .summary-preview-row {
    grid-template-columns: 30px minmax(0, 1fr);
    gap: 8px;
  }

  .summary-preview-jump {
    width: 30px;
    height: 30px;
  }

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

:root[data-theme="dark"] .homepage-summary-card h3 a {
  color: #f3f8ff;
}

:root[data-theme="dark"] .homepage-summary-card h3 a:hover {
  color: #b8ddff;
}

:root[data-theme="dark"] .hero-inner {
  background: #172333;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.34);
}

:root[data-theme="dark"] .homepage-recent-heading p:not(.eyebrow),
:root[data-theme="dark"] .homepage-summary-meta {
  color: #a9b9cc;
}

:root[data-theme="dark"] .form,
:root[data-theme="dark"] .homepage-summary-card {
  border-color: rgba(126, 179, 232, 0.24);
  background: #162334;
  box-shadow: 0 22px 64px rgba(0, 0, 0, 0.32);
}

:root[data-theme="dark"] .homepage-summary-preview {
  color: #d9e6f5;
}

:root[data-theme="dark"] .youtube-search-status {
  color: #a9b9cc;
}

:root[data-theme="dark"] .youtube-search-status.error {
  color: #ff9b91;
}

:root[data-theme="dark"] .youtube-search-result {
  border-color: rgba(126, 179, 232, 0.24);
  background: #0f1a27;
  color: #edf4ff;
}

:root[data-theme="dark"] .youtube-search-result:hover,
:root[data-theme="dark"] .youtube-search-result:focus-visible {
  border-color: #8fc7ff;
  background: #142235;
}

:root[data-theme="dark"] .youtube-search-result-selected {
  border-color: #8fc7ff;
  box-shadow: 0 0 0 3px rgba(143, 199, 255, 0.16);
}

:root[data-theme="dark"] .youtube-search-result img {
  background: #22344a;
}

:root[data-theme="dark"] .youtube-search-result-body strong {
  color: #edf4ff;
}

:root[data-theme="dark"] .youtube-search-result-body span {
  color: #a9b9cc;
}

:root[data-theme="dark"] .custom-instructions-control textarea {
  border-color: #35506b;
  background: #0f1a27;
  color: #edf4ff;
}

:root[data-theme="dark"] .custom-instructions-control textarea:focus {
  border-color: #8fc7ff;
  box-shadow: 0 0 0 4px rgba(143, 199, 255, 0.16);
}

:root[data-theme="dark"] .custom-instructions-upgrade {
  border-color: rgba(143, 199, 255, 0.34);
  background: rgba(24, 40, 58, 0.94);
  color: #edf4ff;
}

:root[data-theme="dark"] .custom-instructions-upgrade:hover,
:root[data-theme="dark"] .custom-instructions-upgrade:focus-visible {
  border-color: #8fc7ff;
  background: rgba(34, 54, 77, 0.98);
  color: #8fc7ff;
  box-shadow: 0 0 0 4px rgba(143, 199, 255, 0.16);
}

:root[data-theme="dark"] .custom-instructions-upgrade small,
:root[data-theme="dark"] .custom-instructions-help,
:root[data-theme="dark"] .custom-instructions-field label small {
  color: #a9b9cc;
}

:root[data-theme="dark"] .preview-window {
  border-color: rgba(126, 179, 232, 0.24);
  background: #162334;
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.34);
}

:root[data-theme="dark"] .summary-preview-card {
  border-color: rgba(126, 179, 232, 0.24);
  background: #162334;
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.34);
}

:root[data-theme="dark"] .summary-preview-media {
  background:
    linear-gradient(135deg, rgba(10, 24, 42, 0.94), rgba(31, 93, 152, 0.72)),
    linear-gradient(45deg, #162334 0 25%, #0f1a27 25% 50%, #162334 50% 75%, #0f1a27 75%);
  background-size: auto, 28px 28px;
}

:root[data-theme="dark"] .summary-preview-play {
  background: #edf4ff;
}

:root[data-theme="dark"] .summary-preview-card h2 {
  color: #edf4ff;
}

:root[data-theme="dark"] .summary-preview-value {
  border-color: rgba(99, 214, 158, 0.22);
  background: #13281f;
  color: #82e0b1;
}

:root[data-theme="dark"] .summary-preview-row {
  border-color: rgba(126, 179, 232, 0.22);
  background: #101a27;
}

:root[data-theme="dark"] .summary-preview-jump {
  border-color: rgba(126, 179, 232, 0.36);
  background: #18283a;
  box-shadow: none;
}

:root[data-theme="dark"] .summary-preview-jump::before {
  border-left-color: #8fc7ff;
}

:root[data-theme="dark"] .summary-preview-row p {
  color: #b8c8da;
}

:root[data-theme="dark"] .summary-generation-visual {
  border-color: rgba(126, 179, 232, 0.22);
  background: linear-gradient(145deg, #101a27, #14283c);
}

:root[data-theme="dark"] .seo-preview-image {
  border-color: rgba(126, 179, 232, 0.24);
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.34);
}

:root[data-theme="dark"] .preview-toolbar {
  background: #1f5d98;
}

:root[data-theme="dark"] .preview-title {
  background: #edf4ff;
}

:root[data-theme="dark"] .preview-line {
  background: #35506b;
}

:root[data-theme="dark"] .preview-section {
  background: #101a27;
}

:root[data-theme="dark"] .preview-number {
  background: #193a58;
  color: #8fc7ff;
}
