* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
}

.home-page {
  min-height: 100svh;
  overflow: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

.topbar {
  align-items: center;
  display: flex;
  height: 64px;
  justify-content: space-between;
  padding: 0 clamp(14px, 4vw, 40px);
}

.brand {
  font-weight: 800;
}

.nav {
  display: flex;
  gap: 14px;
}

.nav a {
  color: var(--muted);
  font-size: 14px;
}

.home-shell {
  align-items: center;
  display: grid;
  gap: clamp(18px, 3vw, 36px);
  grid-template-columns: minmax(0, 1fr) minmax(260px, 34vh);
  height: calc(100svh - 64px);
  margin: 0 auto;
  max-width: 1180px;
  overflow: hidden;
  padding: clamp(12px, 2.5vw, 26px) 20px;
}

.writer {
  min-width: 0;
}

.kicker {
  color: var(--accent);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1 {
  font-size: clamp(28px, 5vw, 68px);
  line-height: 1;
  margin: 8px 0 12px;
  max-width: 760px;
}

.subtitle {
  color: var(--muted);
  font-size: clamp(15px, 1.7vw, 18px);
  line-height: 1.45;
  max-width: 680px;
  margin: 0;
}

.question {
  border-left: 4px solid var(--primary);
  font-size: clamp(18px, 2.2vw, 24px);
  font-weight: 750;
  line-height: 1.28;
  margin: clamp(16px, 2.8vh, 28px) 0;
  max-width: 720px;
  padding-left: 18px;
}

label {
  display: grid;
  gap: 8px;
  font-weight: 700;
}

textarea,
input,
select {
  background: var(--surface);
  border: 1px solid rgba(0, 0, 0, 0.14);
  border-radius: var(--radius);
  color: var(--text);
  font: inherit;
  padding: 12px 14px;
}

textarea {
  height: clamp(118px, 21vh, 190px);
  min-height: 0;
  resize: vertical;
  width: 100%;
}

.writer-actions {
  align-items: center;
  display: flex;
  gap: 14px;
}

.primary-btn {
  background: var(--primary);
  border: 0;
  border-radius: var(--radius);
  color: white;
  cursor: pointer;
  font: inherit;
  font-weight: 800;
  margin-top: 16px;
  min-height: 46px;
  padding: 0 18px;
}

.secondary-btn {
  background: var(--surface);
  border: 1px solid rgba(0, 0, 0, 0.16);
  border-radius: var(--radius);
  color: var(--text);
  cursor: pointer;
  font: inherit;
  font-weight: 800;
  margin-top: 16px;
  min-height: 46px;
  padding: 0 18px;
}

#sealStatus {
  color: var(--muted);
  font-size: 14px;
}

.primary-btn:disabled {
  opacity: 0.6;
}

.heart-panel {
  align-self: start;
  background: var(--surface);
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: var(--radius);
  overflow: hidden;
  width: min(100%, 34vh);
}

#soulCanvas {
  aspect-ratio: 9 / 16;
  display: block;
  width: 100%;
}

.heart-copy {
  padding: 14px 16px 16px;
}

.heart-copy h2 {
  margin: 0 0 8px;
}

.heart-copy p,
.note {
  color: var(--muted);
  line-height: 1.55;
}

.heart-copy p {
  font-size: 14px;
  margin: 0 0 8px;
}

.heart-copy h2 {
  font-size: 18px;
}

.video-dialog {
  background: var(--surface);
  border: 0;
  border-radius: var(--radius);
  color: var(--text);
  max-width: min(420px, calc(100vw - 28px));
  padding: 14px;
  width: 420px;
}

.video-dialog::backdrop {
  background: rgba(0, 0, 0, 0.56);
}

.video-dialog-head {
  align-items: center;
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
}

.video-dialog h2 {
  font-size: 18px;
  margin: 0;
}

.icon-btn {
  background: transparent;
  border: 0;
  color: var(--text);
  cursor: pointer;
  font-size: 26px;
  height: 34px;
  width: 34px;
}

.video-dialog video {
  aspect-ratio: 9 / 16;
  background: #111;
  border-radius: var(--radius);
  display: block;
  width: 100%;
}

.download-btn {
  align-items: center;
  display: flex;
  justify-content: center;
  text-align: center;
}

.admin-shell {
  margin: 0 auto;
  max-width: 1040px;
  padding: 48px 24px;
}

.login-panel,
.admin-workbench {
  background: var(--surface);
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: var(--radius);
  padding: 24px;
}

.login-panel {
  max-width: 420px;
}

.tabs {
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
  display: flex;
  gap: 8px;
  margin-bottom: 22px;
}

.tab {
  background: transparent;
  border: 0;
  border-bottom: 3px solid transparent;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-weight: 800;
  padding: 12px 10px;
}

.tab.active {
  border-color: var(--primary);
  color: var(--text);
}

.tab-panel {
  display: none;
  gap: 16px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.tab-panel.active {
  display: grid;
}

.field span {
  color: var(--muted);
  font-size: 13px;
}

.admin-actions {
  align-items: center;
  display: flex;
  gap: 14px;
}

@media (max-width: 820px) {
  .home-page {
    overflow: auto;
  }

  .home-shell {
    grid-template-columns: minmax(0, 1fr) minmax(136px, 28vw);
    height: calc(100svh - 64px);
    padding-top: 8px;
  }

  .subtitle {
    display: none;
  }

  .heart-panel {
    width: min(100%, 28vw);
  }

  .heart-copy {
    display: none;
  }

  textarea {
    height: clamp(112px, 25vh, 180px);
  }

  .tab-panel.active {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .topbar {
    height: 54px;
  }

  .home-shell {
    gap: 10px;
    grid-template-columns: 1fr;
    grid-template-rows: minmax(0, 1fr) 92px;
    height: calc(100svh - 54px);
    padding: 8px 12px 12px;
  }

  h1 {
    font-size: clamp(26px, 8vw, 38px);
  }

  .question {
    margin: 10px 0;
  }

  textarea {
    height: clamp(110px, 24vh, 160px);
  }

  .heart-panel {
    display: none;
  }
}
