:root {
  --bg: #f7f9fc;
  --ink: #111827;
  --muted: #5b6472;
  --line: #d9e0ea;
  --panel: #ffffff;
  --red: #ef233c;
  --blue: #1d4ed8;
  --cyan: #0ea5e9;
  --green: #10b981;
  --shadow: 0 24px 70px rgba(15, 23, 42, 0.12);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body.ytd-page {
  margin: 0;
  background:
    linear-gradient(135deg, rgba(239, 35, 60, 0.08), transparent 28%),
    linear-gradient(225deg, rgba(14, 165, 233, 0.13), transparent 34%),
    var(--bg);
  color: var(--ink);
  font-family: "Inter", "Noto Sans JP", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

.ytd-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  max-width: 1180px;
  margin: 0 auto;
  padding: 22px 20px 12px;
}

.ytd-brand,
.ytd-header nav,
.ytd-header nav a,
.ytd-footer a,
.ytd-primary-actions a,
.tpn-all {
  color: inherit;
  text-decoration: none;
}

.ytd-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 16px;
}

.ytd-mark {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--red);
  position: relative;
  box-shadow: 0 10px 26px rgba(239, 35, 60, 0.28);
}

.ytd-mark::after {
  content: "";
  position: absolute;
  left: 13px;
  top: 9px;
  border-left: 11px solid white;
  border-top: 7px solid transparent;
  border-bottom: 7px solid transparent;
}

.ytd-header nav {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  color: #475569;
}

.ytd-header nav a {
  padding: 10px 12px;
  border-radius: 8px;
}

.ytd-header nav a:hover { background: rgba(15, 23, 42, 0.07); }

main {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 20px 44px;
}

.ytd-hero {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(420px, 1.05fr);
  gap: 22px;
  align-items: stretch;
  padding: 18px 0 18px;
}

.ytd-hero-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 300px;
  padding: 18px 0;
}

.ytd-kicker,
.ytd-card-label {
  margin: 0;
  color: var(--blue);
  font-size: 14px;
  font-weight: 900;
}

.ytd-hero h1 {
  margin: 12px 0 18px;
  font-size: clamp(38px, 5.1vw, 62px);
  line-height: 1.02;
  letter-spacing: 0;
}

.ytd-lead {
  max-width: 670px;
  margin: 0;
  color: #374151;
  font-size: 19px;
  line-height: 1.72;
  font-weight: 700;
}

.ytd-safe-line {
  display: flex;
  align-items: center;
  gap: 12px;
  width: fit-content;
  margin-top: 18px;
  padding: 14px 18px;
  border: 1px solid rgba(16, 185, 129, 0.34);
  border-radius: 8px;
  background: #ecfdf5;
  color: #065f46;
  font-weight: 900;
  line-height: 1.45;
}

.ytd-safe-line span {
  flex: 0 0 20px;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  background: var(--green);
  position: relative;
}

.ytd-safe-line span::after {
  content: "";
  position: absolute;
  width: 9px;
  height: 5px;
  left: 5px;
  top: 6px;
  border-left: 2px solid white;
  border-bottom: 2px solid white;
  transform: rotate(-45deg);
}

.ytd-hero-panel,
.ytd-card,
.ytd-preview-card,
.ytd-copy-card,
.ytd-guide,
.ytd-size-card {
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(217, 224, 234, 0.9);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.ytd-hero-panel {
  align-self: center;
  padding: 22px;
}

.ytd-hero-panel label {
  display: block;
  margin-bottom: 12px;
  font-size: 18px;
  font-weight: 900;
}

.ytd-input-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.ytd-input-row input,
.ytd-copy-card textarea {
  width: 100%;
  border: 2px solid #cbd5e1;
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  font: inherit;
  font-weight: 800;
}

.ytd-input-row input {
  min-height: 58px;
  padding: 0 16px;
  font-size: 18px;
}

.ytd-input-row button,
.ytd-primary-actions button,
.ytd-primary-actions a,
.ytd-copy-card button,
.ytd-size-actions button,
.ytd-size-actions a {
  min-height: 46px;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  font: inherit;
  font-weight: 900;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  white-space: nowrap;
}

.ytd-input-row button {
  padding: 0 22px;
  background: var(--red);
  color: #fff;
  box-shadow: 0 16px 32px rgba(239, 35, 60, 0.22);
}

.ytd-url-examples {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.ytd-url-examples button {
  min-height: 36px;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  background: #f8fafc;
  color: #334155;
  padding: 0 13px;
  font-weight: 900;
  cursor: pointer;
}

.ytd-status {
  min-height: 28px;
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 15px;
  font-weight: 800;
}

.ytd-workspace {
  display: grid;
  grid-template-columns: 310px minmax(0, 1fr);
  gap: 22px;
  margin-top: 6px;
}

.ytd-side {
  display: grid;
  gap: 16px;
  align-self: start;
}

.ytd-card {
  padding: 20px;
  box-shadow: none;
}

.ytd-id-card strong {
  display: block;
  margin-top: 8px;
  font-size: 28px;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.ytd-id-card span {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-weight: 800;
}

.ytd-check-card h2 {
  margin: 0 0 14px;
  font-size: 24px;
}

.ytd-check-card label {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 10px;
  margin: 12px 0;
  color: #273449;
  font-size: 15px;
  line-height: 1.55;
  font-weight: 800;
}

.ytd-check-card input {
  width: 18px;
  height: 18px;
  margin-top: 3px;
}

.ytd-check-card p {
  margin: 16px 0 0;
  color: var(--muted);
  line-height: 1.65;
  font-weight: 700;
}

.ytd-bulk-card h2 {
  margin: 0 0 12px;
  font-size: 24px;
}

.ytd-bulk-card label {
  display: block;
  margin-bottom: 8px;
  font-weight: 900;
}

.ytd-bulk-card textarea {
  width: 100%;
  min-height: 104px;
  border: 2px solid #cbd5e1;
  border-radius: 8px;
  padding: 10px;
  color: #111827;
  font: inherit;
  font-size: 14px;
  line-height: 1.55;
  resize: vertical;
}

.ytd-bulk-card button {
  width: 100%;
  min-height: 44px;
  margin-top: 10px;
  border: 0;
  border-radius: 8px;
  background: #0f766e;
  color: #ffffff;
  font: inherit;
  font-weight: 900;
  cursor: pointer;
}

.ytd-bulk-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.ytd-bulk-item {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  border: 1px solid #dbe3ee;
  border-radius: 8px;
  padding: 8px;
  background: #f8fafc;
}

.ytd-bulk-item img {
  width: 72px;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 6px;
  background: #0f172a;
}

.ytd-bulk-item button {
  min-height: 32px;
  margin: 6px 0 0;
  background: #e0f2fe;
  color: #075985;
}

.ytd-bulk-item b,
.ytd-bulk-item small {
  display: block;
  overflow-wrap: anywhere;
}

.ytd-preview-area {
  display: grid;
  gap: 20px;
  min-width: 0;
}

.ytd-preview-card {
  padding: 22px;
}

.ytd-preview-head,
.ytd-section-title,
.ytd-copy-card > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.ytd-preview-head h2,
.ytd-section-title h2,
.ytd-copy-card h2 {
  margin: 4px 0 0;
  font-size: 25px;
}

#previewBadge {
  flex: 0 0 auto;
  border-radius: 999px;
  background: #eef2ff;
  color: #3730a3;
  padding: 8px 12px;
  font-weight: 900;
}

.ytd-preview-frame {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 16 / 9;
  margin-top: 16px;
  overflow: hidden;
  border-radius: 8px;
  background:
    linear-gradient(135deg, #111827, #243042),
    #111827;
}

.ytd-preview-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: none;
}

.ytd-preview-frame.is-ready img { display: block; }
.ytd-preview-frame.is-ready .ytd-preview-empty { display: none; }

.ytd-preview-empty {
  padding: 20px;
  color: #cbd5e1;
  font-size: 22px;
  font-weight: 900;
  text-align: center;
}

.ytd-primary-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.ytd-save-note {
  margin: 10px 0 0;
  color: #64748b;
  font-size: 13px;
  line-height: 1.55;
  font-weight: 800;
}

.ytd-primary-actions button {
  background: var(--blue);
  color: white;
}

.ytd-primary-actions a {
  background: #eef2ff;
  color: #1e3a8a;
  padding: 0 12px;
}

.ytd-size-section {
  min-width: 0;
}

.ytd-size-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 14px;
}

.ytd-size-card {
  overflow: hidden;
  box-shadow: none;
}

.ytd-size-thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #0f172a;
}

.ytd-size-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.ytd-size-state {
  position: absolute;
  left: 10px;
  top: 10px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.82);
  color: white;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 900;
}

.ytd-size-body {
  padding: 14px;
}

.ytd-size-body h3 {
  margin: 0;
  font-size: 18px;
}

.ytd-size-body p {
  margin: 5px 0 12px;
  color: var(--muted);
  font-weight: 800;
}

.ytd-size-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.ytd-size-actions button,
.ytd-size-actions a {
  min-height: 38px;
  border: 1px solid #dbe3ee;
  background: #f8fafc;
  color: #243042;
  padding: 0 8px;
  font-size: 13px;
  text-decoration: none;
}

.ytd-copy-zone {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-top: 22px;
}

.ytd-copy-card {
  display: grid;
  gap: 12px;
  padding: 20px;
  box-shadow: none;
}

.ytd-copy-card textarea {
  min-height: 132px;
  resize: vertical;
  padding: 14px;
  color: #243042;
  line-height: 1.55;
}

.ytd-copy-card button {
  background: #111827;
  color: white;
}

.ytd-copy-buttons {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.ytd-guide {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 22px;
  align-items: center;
  margin-top: 22px;
  padding: 24px;
  box-shadow: none;
}

.ytd-guide h2 {
  margin: 0 0 10px;
  font-size: 28px;
}

.ytd-guide p {
  margin: 0;
  color: #374151;
  font-size: 18px;
  line-height: 1.75;
  font-weight: 700;
}

.ytd-guide-points {
  display: grid;
  gap: 10px;
}

.ytd-guide-points span {
  padding: 14px 16px;
  border-radius: 8px;
  background: #f1f5f9;
  color: #1f2937;
  font-weight: 900;
}

.tool-page-nav {
  margin-top: 24px;
}

.tool-page-nav svg {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  display: block;
}

.tpn-grid a {
  min-width: 0;
}

.tpn-grid a span {
  flex: 0 0 auto;
}

.ytd-footer {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 18px;
  padding: 28px 20px 42px;
  color: #526071;
  font-weight: 800;
}

@media (max-width: 900px) {
  .ytd-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .ytd-hero,
  .ytd-workspace,
  .ytd-copy-zone,
  .ytd-guide {
    grid-template-columns: 1fr;
  }

  .ytd-preview-area {
    order: -1;
  }

  .ytd-hero-copy {
    min-height: auto;
    padding: 22px 0 8px;
  }

  .ytd-hero {
    gap: 14px;
  }

  .ytd-guide {
    padding: 20px;
  }
}

@media (max-width: 620px) {
  main {
    padding: 0 14px 34px;
  }

  .ytd-header {
    padding: 18px 14px 8px;
  }

  .ytd-header nav {
    width: 100%;
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .ytd-hero h1 {
    font-size: 42px;
  }

  .ytd-lead {
    font-size: 18px;
  }

  .ytd-safe-line {
    width: 100%;
    align-items: flex-start;
  }

  .ytd-hero-panel,
  .ytd-preview-card,
  .ytd-card,
  .ytd-copy-card {
    padding: 16px;
  }

  .ytd-input-row,
  .ytd-primary-actions,
  .ytd-size-grid,
  .ytd-size-actions {
    grid-template-columns: 1fr;
  }

  .ytd-input-row input {
    min-height: 56px;
    font-size: 16px;
  }

  .ytd-preview-head,
  .ytd-section-title,
  .ytd-copy-card > div {
    align-items: flex-start;
    flex-direction: column;
  }

  .ytd-preview-empty {
    font-size: 18px;
  }
}
