:root {
  color-scheme: light;
  --ink: #242421;
  --muted: #747066;
  --paper: #f8f5ec;
  --paper-strong: #fffaf0;
  --sage: #6f8875;
  --sage-dark: #3f594e;
  --rose: #b66f78;
  --brass: #bd8a3d;
  --line: rgba(36, 36, 33, 0.12);
  --shadow: 0 24px 70px rgba(19, 21, 19, 0.28);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at 12% 10%, rgba(216, 160, 119, 0.22), transparent 34%),
    radial-gradient(circle at 85% 22%, rgba(111, 136, 117, 0.28), transparent 30%),
    #262522;
  color: var(--ink);
  font-family:
    "Pretendard",
    "Apple SD Gothic Neo",
    "Noto Sans KR",
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
}

button,
input {
  font: inherit;
}

button {
  -webkit-tap-highlight-color: transparent;
}

[hidden] {
  display: none !important;
}

.appViewport {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 20px;
}

.phoneShell {
  position: relative;
  width: min(100%, 430px);
  height: min(920px, calc(100dvh - 40px));
  min-height: 720px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 32px;
  background: var(--paper);
  box-shadow: var(--shadow);
}

.homeScreen {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-rows: auto 1fr auto;
  background:
    linear-gradient(180deg, rgba(255, 250, 240, 0.96), rgba(248, 245, 236, 0.92)),
    url("public/splash-art.svg");
  background-size: cover;
  background-position: center;
}

.topBar {
  position: relative;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 26px 28px 8px;
}

.appTitle {
  display: grid;
  gap: 1px;
  text-align: center;
  color: var(--sage-dark);
}

.appTitle span {
  font-size: 0.74rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.appTitle strong {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.34rem;
  font-weight: 600;
}

.cornerButton,
.iconButton,
.deleteButton {
  display: inline-grid;
  place-items: center;
  border: 0;
  cursor: pointer;
}

.cornerButton {
  position: absolute;
  top: 24px;
  width: 48px;
  height: 48px;
  border-radius: 999px;
  color: var(--paper-strong);
  background: rgba(63, 89, 78, 0.96);
  box-shadow: 0 12px 26px rgba(63, 89, 78, 0.26);
}

.cornerButton.left {
  left: 24px;
}

.cornerButton.right {
  right: 24px;
}

.icon,
.smallIcon,
.emptyIcon,
.recordIcon {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon {
  width: 22px;
  height: 22px;
  stroke-width: 2.4;
}

.smallIcon {
  width: 17px;
  height: 17px;
  stroke-width: 2.2;
}

.emptyIcon {
  width: 30px;
  height: 30px;
  stroke-width: 2;
}

.recordIcon {
  width: 34px;
  height: 34px;
  stroke-width: 1.9;
}

.recordIcon.stop {
  display: none;
}

.recordButton.recording .recordIcon.mic {
  display: none;
}

.recordButton.recording .recordIcon.stop {
  display: block;
}

.homeContent {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 24px;
  padding: 18px 32px 24px;
  text-align: center;
}

.questionMeta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border: 1px solid rgba(63, 89, 78, 0.18);
  border-radius: 999px;
  background: rgba(255, 250, 240, 0.72);
  color: var(--sage-dark);
}

.questionMeta span,
.questionMeta small {
  white-space: nowrap;
}

.questionMeta span {
  font-size: 0.76rem;
  font-weight: 700;
}

.questionMeta small {
  color: var(--muted);
  font-size: 0.7rem;
}

.homeContent h1 {
  width: 100%;
  margin: 0;
  color: #2f2d2a;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.84rem, 8vw, 2.52rem);
  line-height: 1.28;
  font-weight: 500;
  word-break: keep-all;
  overflow-wrap: anywhere;
}

.recordArea {
  display: grid;
  place-items: center;
  gap: 10px;
}

.recordButton {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 104px;
  height: 104px;
  border: 0;
  border-radius: 999px;
  color: #fffaf4;
  background: var(--rose);
  box-shadow:
    0 18px 36px rgba(182, 111, 120, 0.34),
    inset 0 -8px 18px rgba(88, 35, 43, 0.18);
  cursor: pointer;
  transition:
    transform 180ms ease,
    box-shadow 180ms ease,
    background 180ms ease;
}

.recordButton::after {
  content: "";
  position: absolute;
  inset: -8px;
  border: 1px solid rgba(182, 111, 120, 0.3);
  border-radius: inherit;
}

.recordButton:active {
  transform: scale(0.97);
}

.recordButton.recording {
  background: #9f4f59;
  animation: recordPulse 1400ms ease-in-out infinite;
}

@keyframes recordPulse {
  0%,
  100% {
    box-shadow:
      0 18px 36px rgba(182, 111, 120, 0.34),
      0 0 0 0 rgba(182, 111, 120, 0.28);
  }
  50% {
    box-shadow:
      0 18px 36px rgba(182, 111, 120, 0.34),
      0 0 0 18px rgba(182, 111, 120, 0);
  }
}

.timer {
  min-width: 72px;
  margin: 6px 0 0;
  color: var(--sage-dark);
  font-size: 1.18rem;
  font-weight: 800;
}

.statusText {
  min-height: 38px;
  max-width: 270px;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.45;
  word-break: keep-all;
}

.privacyPill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  max-width: 310px;
  padding: 10px 12px;
  border-radius: 999px;
  background: rgba(111, 136, 117, 0.12);
  color: var(--sage-dark);
  font-size: 0.78rem;
  line-height: 1.35;
}

.privacyPill span {
  word-break: keep-all;
}

.quickStats {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 0 18px 22px;
}

.quickStats div {
  display: grid;
  gap: 2px;
  min-width: 0;
  padding: 14px 6px;
  border: 1px solid rgba(36, 36, 33, 0.08);
  border-radius: 18px;
  background: rgba(255, 250, 240, 0.74);
  text-align: center;
}

.quickStats span {
  color: var(--sage-dark);
  font-size: 1.02rem;
  font-weight: 800;
}

.quickStats small {
  color: var(--muted);
  font-size: 0.72rem;
}

.slidePanel {
  position: absolute;
  z-index: 5;
  top: 0;
  bottom: 0;
  width: min(88%, 378px);
  padding: 24px 18px;
  overflow: auto;
  background: rgba(255, 250, 240, 0.98);
  box-shadow: 0 22px 70px rgba(31, 30, 26, 0.24);
  transition: transform 260ms ease;
}

.questionPanel {
  left: 0;
  transform: translateX(-106%);
  border-right: 1px solid var(--line);
}

.menuPanel {
  right: 0;
  transform: translateX(106%);
  border-left: 1px solid var(--line);
}

.slidePanel.open {
  transform: translateX(0);
}

.panelHeader {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.panelHeader div {
  display: grid;
  gap: 3px;
}

.panelHeader span {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
}

.panelHeader strong {
  color: var(--ink);
  font-size: 1.24rem;
}

.iconButton {
  width: 38px;
  height: 38px;
  border-radius: 999px;
  color: var(--sage-dark);
  background: rgba(111, 136, 117, 0.13);
}

.sectionIntro,
.blockTitle {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--sage-dark);
}

.sectionIntro {
  padding: 12px 2px 16px;
}

.sectionIntro p,
.blockTitle h2 {
  margin: 0;
  font-size: 0.96rem;
}

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

.categoryButton {
  min-height: 72px;
  padding: 14px;
  border: 1px solid rgba(63, 89, 78, 0.14);
  border-radius: 18px;
  background: #fffdf6;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  transition:
    border-color 170ms ease,
    opacity 170ms ease,
    transform 170ms ease,
    background 170ms ease;
}

.categoryButton span,
.categoryButton small {
  display: block;
}

.categoryButton span {
  font-size: 1.02rem;
  font-weight: 800;
}

.categoryButton small {
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.72rem;
}

.categoryButton.answered {
  opacity: 0.48;
  background: #f1efe6;
}

.categoryButton.selected {
  opacity: 1;
  border-color: rgba(189, 138, 61, 0.72);
  background: rgba(189, 138, 61, 0.12);
}

.categoryButton:active {
  transform: scale(0.98);
}

.archiveBlock,
.settingsBlock {
  display: grid;
  gap: 14px;
  padding: 8px 0 20px;
}

.recordingList {
  display: grid;
  gap: 12px;
}

.recordingItem {
  position: relative;
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid rgba(36, 36, 33, 0.1);
  border-radius: 18px;
  background: #fffdf6;
}

.recordingTop {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.recordingTop span {
  color: var(--sage-dark);
  font-weight: 800;
}

.recordingTop small,
.durationBadge {
  color: var(--muted);
  font-size: 0.72rem;
}

.recordingItem p {
  margin: 0;
  color: #44413b;
  font-size: 0.86rem;
  line-height: 1.5;
  word-break: keep-all;
}

.audioRow {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 34px;
  align-items: center;
  gap: 8px;
}

.audioRow audio {
  width: 100%;
  height: 34px;
}

.deleteButton {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  color: #904a52;
  background: rgba(182, 111, 120, 0.12);
}

.durationBadge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.emptyState {
  display: grid;
  place-items: center;
  gap: 10px;
  min-height: 150px;
  border: 1px dashed rgba(63, 89, 78, 0.25);
  border-radius: 20px;
  color: var(--muted);
  text-align: center;
}

.emptyState p {
  margin: 0;
  font-size: 0.9rem;
}

.settingToggle {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 48px;
  align-items: center;
  gap: 12px;
  width: 100%;
  border: 1px solid rgba(36, 36, 33, 0.1);
  border-radius: 18px;
  background: #fffdf6;
  color: var(--ink);
  cursor: pointer;
  text-align: left;
}

.settingToggle span {
  display: grid;
  gap: 4px;
  padding: 14px 0 14px 14px;
}

.settingToggle strong {
  font-size: 0.92rem;
}

.settingToggle small {
  color: var(--muted);
  font-size: 0.74rem;
  line-height: 1.35;
  word-break: keep-all;
}

.settingToggle i {
  position: relative;
  width: 42px;
  height: 26px;
  border-radius: 999px;
  background: #ddd8cc;
  transition: background 160ms ease;
}

.settingToggle i::after {
  content: "";
  position: absolute;
  top: 4px;
  left: 4px;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: #fffaf4;
  box-shadow: 0 2px 7px rgba(36, 36, 33, 0.2);
  transition: transform 160ms ease;
}

.settingToggle.active i {
  background: var(--sage);
}

.settingToggle.active i::after {
  transform: translateX(16px);
}

.secondaryAction {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 44px;
  border: 0;
  border-radius: 16px;
  background: rgba(63, 89, 78, 0.12);
  color: var(--sage-dark);
  font-weight: 800;
  cursor: pointer;
}

.scrim {
  position: absolute;
  z-index: 4;
  inset: 0;
  border: 0;
  background: rgba(31, 30, 26, 0.18);
}

.splashScreen {
  position: absolute;
  z-index: 10;
  inset: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(21, 24, 21, 0.16), rgba(21, 24, 21, 0.42)),
    url("public/splash-art.svg");
  background-position: center;
  background-size: cover;
  color: #fffaf2;
  animation: splashIn 360ms ease both;
}

.splashShade {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(33, 35, 31, 0.08), rgba(33, 35, 31, 0.56));
}

.brandMark {
  position: relative;
  display: grid;
  place-items: center;
  width: 132px;
  height: 132px;
}

.brandRing,
.brandDot {
  position: absolute;
  border-radius: 999px;
}

.brandRing {
  inset: 0;
  border: 1px solid rgba(255, 250, 242, 0.72);
  box-shadow:
    0 0 0 18px rgba(255, 250, 242, 0.12),
    inset 0 0 0 24px rgba(255, 250, 242, 0.1);
}

.brandDot {
  width: 22px;
  height: 22px;
  background: #fffaf2;
}

.splashCopy {
  position: absolute;
  bottom: 86px;
  display: grid;
  gap: 8px;
  width: 100%;
  padding: 0 32px;
  text-align: center;
}

.splashCopy p {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 2.06rem;
  font-weight: 600;
}

.splashCopy span {
  color: rgba(255, 250, 242, 0.82);
  font-size: 0.88rem;
}

@keyframes splashIn {
  from {
    opacity: 0;
    transform: scale(1.02);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@media (max-width: 520px) {
  .appViewport {
    padding: 0;
    background: var(--paper);
  }

  .phoneShell {
    width: 100%;
    height: 100dvh;
    min-height: 640px;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .homeContent {
    padding-inline: 24px;
  }

  .homeContent h1 {
    font-size: clamp(1.72rem, 9vw, 2.36rem);
  }

  .cornerButton {
    top: 20px;
  }

  .cornerButton.left {
    left: 18px;
  }

  .cornerButton.right {
    right: 18px;
  }

  .quickStats {
    padding-inline: 12px;
  }
}

@media (max-height: 720px) {
  .phoneShell {
    min-height: 100dvh;
  }

  .homeContent {
    gap: 16px;
  }

  .recordButton {
    width: 88px;
    height: 88px;
  }

  .quickStats div {
    padding-block: 10px;
  }
}
