:root {
  /* Основная палитра (~70%) */
  --cream: #f8f4ed;
  --sand: #eadfd4;
  --taupe: #d1bda9;
  --moka: #8c6e56;
  --graphite: #1f1b17;

  /* Дополнительная (~20%) */
  --stone: #c9b8a7;
  --fog: #a89a8e;
  --shadow: #6b5d52;

  /* Акцент (~10%) */
  --orange: #e87639;
  --amber: #f5a86b;
  --peach: #ffdcc0;
  --gold: #d4a373;

  /* Функциональные */
  --success: #22c55e;
  --error: #ef4444;
  --info: #3b82f6;
  --warning: #f59e0b;

  /* Нейтрали UI */
  --white: #ffffff;
  --light: #f3ede5;
  --muted: #e1d6ca;
  --border: #d6c9bb;
  --dark: #2b2621;

  --font-display: "Inter Tight", sans-serif;
  --font-body: "Manrope", sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --radius-lg: 1.5rem;
  --radius-xl: 2rem;
  --soft-shadow: 0 12px 40px rgba(31, 27, 23, 0.08);
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  height: 100%;
  min-height: 100dvh;
  background: var(--cream);
  overflow-x: hidden;
  touch-action: pan-y;
}

body {
  font-family: var(--font-body);
  color: var(--graphite);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  cursor: pointer;
}

img {
  display: block;
  max-width: 100%;
}

.app {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  height: var(--app-h, 100svh);
  max-height: 100dvh;
  margin: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto 1fr auto auto;
  padding: max(0.85rem, env(safe-area-inset-top)) 1.35rem max(1.35rem, env(safe-area-inset-bottom));
  /* F75: soft diagonal cream light, no photo texture */
  background:
    linear-gradient(148deg, rgba(255, 255, 255, 0.82) 0%, transparent 36%),
    linear-gradient(208deg, transparent 42%, rgba(232, 118, 57, 0.08) 100%),
    linear-gradient(180deg, #faf7f2 0%, var(--cream) 46%, #f3ebe3 100%);
  overflow: hidden;
  overflow-x: hidden;
  touch-action: pan-y;
  overscroll-behavior: none;
}

.app__light {
  position: absolute;
  pointer-events: none;
  border-radius: 50%;
  filter: blur(60px);
}

.app__light--tl {
  width: 70%;
  aspect-ratio: 1.2;
  top: -18%;
  left: -20%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.85), transparent 68%);
}

.app__light--br {
  width: 65%;
  aspect-ratio: 1;
  right: -22%;
  bottom: 8%;
  background: radial-gradient(circle, rgba(245, 168, 107, 0.16), transparent 70%);
}

.app__orb {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  filter: blur(52px);
}

.app__orb--a {
  width: 62%;
  aspect-ratio: 1.1;
  top: 48%;
  left: 50%;
  transform: translateX(-50%);
  background: radial-gradient(circle, rgba(232, 118, 57, 0.13), transparent 70%);
  animation: breathe 7s ease-in-out infinite;
}

.app__orb--b {
  width: 42%;
  aspect-ratio: 1;
  bottom: 2%;
  left: 50%;
  transform: translateX(-50%);
  background: radial-gradient(circle, rgba(212, 163, 115, 0.1), transparent 68%);
}

/* Планшет и десктоп: тот же телефонный экран по центру молочного поля.
   Альбомный телефон (низкий) остаётся на всю ширину. */
@media (min-width: 900px), (min-width: 720px) and (min-height: 900px) {
  body {
    display: grid;
    place-items: center;
    background:
      radial-gradient(ellipse 50% 40% at 50% 20%, rgba(232, 118, 57, 0.1), transparent),
      linear-gradient(180deg, var(--sand), var(--cream));
  }

  .app {
    position: relative;
    inset: auto;
    width: min(440px, 100%);
    height: min(880px, 96dvh);
    border-radius: var(--radius-xl);
    border: 1px solid rgba(201, 184, 167, 0.55);
    box-shadow:
      0 40px 100px rgba(31, 27, 23, 0.12),
      0 0 0 1px rgba(255, 255, 255, 0.4) inset;
  }
}

/* ——— Top bar ——— */
.topbar {
  position: relative;
  display: grid;
  grid-template-columns: 2.5rem 1fr 2.5rem;
  align-items: center;
  z-index: 2;
  animation: rise 0.7s var(--ease) both;
}

.icon-btn {
  width: 2.5rem;
  height: 2.5rem;
  display: grid;
  place-items: center;
  color: var(--fog);
  border-radius: 50%;
  transition: color 0.25s var(--ease), background 0.25s var(--ease);
}

.icon-btn:hover {
  color: var(--graphite);
  background: rgba(31, 27, 23, 0.04);
}

.icon-btn svg {
  width: 1.35rem;
  height: 1.35rem;
}

.logo {
  justify-self: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.45rem;
  letter-spacing: -0.045em;
  text-decoration: none;
  color: var(--graphite);
}

.logo span {
  background: linear-gradient(180deg, var(--amber), var(--orange) 55%, #c4763a);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ——— Stage ——— */
.stage {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding-top: clamp(1.25rem, 6vh, 3rem);
  gap: clamp(0.45rem, 1.4vh, 0.9rem);
  text-align: center;
  z-index: 1;
  min-height: 0;
}

.stage__glow {
  position: absolute;
  width: 78%;
  aspect-ratio: 1;
  top: auto;
  bottom: 4%;
  left: 50%;
  transform: translateX(-50%);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(232, 118, 57, 0.14), transparent 68%);
  filter: blur(36px);
  animation: glow-breathe-center 5.5s ease-in-out infinite;
  pointer-events: none;
}

/* F75: маленькая звезда над заголовком, не ribbon-mark */
.spark {
  position: relative;
  z-index: 0;
  width: 1.35rem;
  height: 1.35rem;
  margin: 0 0 0.35rem;
  filter: drop-shadow(0 0 10px rgba(232, 118, 57, 0.55));
  animation: float-in 0.9s 0.1s var(--ease) both, spark-pulse 3.8s 1s ease-in-out infinite;
}

.spark svg {
  width: 100%;
  height: 100%;
  display: block;
}

.stage.has-reply .spark {
  width: 1.05rem;
  height: 1.05rem;
  margin-bottom: 0.15rem;
}

.stage:has(.reply.is-long:not([hidden])) .spark {
  display: none;
}

.stage.has-reply .headline {
  display: none;
}

/* ——— Готовность ——— */
.ready {
  position: relative;
  justify-self: end;
  width: 2.5rem;
  height: 2.5rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: conic-gradient(var(--orange) calc(var(--pct, 0) * 1%), var(--muted) 0);
  animation: fade 0.4s var(--ease) both;
  box-shadow: 0 4px 14px rgba(232, 118, 57, 0.2);
}

.ready::before {
  content: "";
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  background: var(--cream);
}

.ready span {
  position: relative;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.7rem;
  letter-spacing: -0.02em;
  color: var(--graphite);
}

.ready[hidden] {
  display: none;
}

.hints {
  max-width: 19.5rem;
  font-size: 0.78rem;
  line-height: 1.55;
  color: var(--fog);
  animation: rise 0.8s 0.3s var(--ease) both;
}

.hints span {
  color: var(--moka);
  white-space: nowrap;
}

.hints .is-known {
  color: var(--fog);
}

.hints .is-known::before {
  content: "✓ ";
  color: var(--success);
}

.hints[hidden],
.facts[hidden] {
  display: none;
}

.facts {
  max-width: 22rem;
  font-size: 0.78rem;
  letter-spacing: 0.01em;
  color: var(--moka);
}

.app.is-train .facts {
  font-weight: 600;
  color: var(--orange);
}

.app.is-train .voice__prompt,
.app.is-train #listen-text {
  color: var(--orange);
}

.reply__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.75rem;
}

.reply__actions[hidden] {
  display: none;
}

.reply__action {
  max-width: 100%;
  padding: 0.55rem 0.9rem;
  border-radius: 999px;
  font-size: 0.8rem;
  line-height: 1.2;
  color: var(--graphite);
  background: var(--peach);
  border: 1px solid rgba(232, 118, 57, 0.28);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: background 0.2s var(--ease), border-color 0.2s var(--ease), transform 0.2s var(--ease);
}

.reply__action:hover,
.reply__action:focus-visible {
  outline: none;
  background: var(--amber);
  border-color: rgba(232, 118, 57, 0.45);
}

.reply__action.is-done {
  background: rgba(34, 197, 94, 0.12);
  border-color: rgba(34, 197, 94, 0.35);
}

.reply.is-long {
  max-height: 54vh;
}

/* При ответе — больше места карточке: мик уезжает в компактный dock */
.app:has(.stage.has-reply) .reply {
  max-height: 48vh;
}

.app:has(.stage.has-reply) .reply.is-long {
  max-height: min(68vh, calc(100% - 5.5rem));
  flex: 0 1 auto;
  min-height: 0;
}

.reply {
  position: relative;
  z-index: 5;
  flex-shrink: 0;
  width: min(100%, 22rem);
  max-height: 36vh;
  overflow-y: auto;
  padding: 1rem 1.1rem;
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(214, 201, 187, 0.9);
  backdrop-filter: blur(16px);
  text-align: left;
  animation: rise 0.4s var(--ease) both;
  box-shadow: var(--soft-shadow);
}

@media (max-height: 800px) {
  .reply.is-long {
    max-height: 50vh;
  }
}

.headline {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.28rem, 5.2vw, 1.55rem);
  letter-spacing: -0.03em;
  line-height: 1.28;
  color: var(--graphite);
  max-width: 16.5rem;
  animation: rise 0.8s 0.2s var(--ease) both;
  transition: opacity 0.35s var(--ease);
}

.headline.is-dim {
  opacity: 0.35;
}

.reply[hidden] {
  display: none;
}

.reply.is-thinking {
  border-color: rgba(232, 118, 57, 0.35);
}

.reply__text {
  font-size: 0.92rem;
  line-height: 1.5;
  color: var(--graphite);
  white-space: pre-wrap;
}

.reply.is-thinking .reply__text {
  color: var(--shadow);
}

.reply__head {
  color: var(--shadow);
}

.reply__tail {
  color: var(--graphite);
}

/* ——— Voice + listen dock ——— */
.dock {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-self: center;
  width: min(100%, 22rem);
  gap: 0.15rem;
}

.voice {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex-shrink: 0;
  gap: 0.85rem;
  margin-top: 0;
  margin-bottom: clamp(0.15rem, 1vh, 0.55rem);
  padding-top: 0.35rem;
  animation: rise 0.8s 0.35s var(--ease) both;
}

.mic {
  position: relative;
  width: 6.9rem;
  height: 6.9rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--graphite);
  background:
    radial-gradient(circle at 36% 30%, #ffffff 0%, #fffaf5 40%, var(--cream) 76%, var(--sand) 100%);
  border: 1.5px solid rgba(232, 118, 57, 0.4);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.95) inset,
    0 -2px 8px rgba(140, 110, 86, 0.05) inset,
    0 0 0 7px rgba(232, 118, 57, 0.07),
    0 18px 38px rgba(140, 110, 86, 0.13);
  transition:
    transform 0.3s var(--ease),
    box-shadow 0.3s var(--ease),
    border-color 0.3s var(--ease),
    background 0.3s var(--ease);
}

.mic__aura {
  position: absolute;
  inset: -22px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(232, 118, 57, 0.2), transparent 70%);
  filter: blur(10px);
  z-index: 0;
  opacity: 0.85;
  animation: glow-breathe 4.5s ease-in-out infinite;
}

.mic:hover {
  border-color: rgba(232, 118, 57, 0.48);
}

.mic:disabled {
  opacity: 0.5;
  cursor: wait;
}

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

.mic svg {
  width: 1.95rem;
  height: 1.95rem;
  position: relative;
  z-index: 1;
}

.mic__ring {
  position: absolute;
  inset: -18px;
  border-radius: 50%;
  border: 1.5px solid rgba(232, 118, 57, 0.35);
  animation: ring 2.6s ease-out infinite;
  opacity: 0.22;
  z-index: 0;
}

.mic__ring--delay {
  animation-delay: 1.3s;
}

.mic.is-active {
  color: var(--graphite);
  border-color: var(--orange);
  background:
    radial-gradient(circle at 38% 32%, #ffffff 0%, var(--peach) 48%, var(--amber) 100%);
  box-shadow:
    0 0 0 12px rgba(232, 118, 57, 0.12),
    0 0 48px rgba(232, 118, 57, 0.38),
    inset 0 0 18px rgba(255, 255, 255, 0.45);
}

.mic.is-active .mic__aura {
  opacity: 1;
  inset: -28px;
  background: radial-gradient(circle, rgba(232, 118, 57, 0.38), transparent 70%);
}

.mic.is-active .mic__ring {
  opacity: 1;
  border-color: rgba(232, 118, 57, 0.55);
}

.voice__prompt {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(0.98rem, 3.8vw, 1.08rem);
  letter-spacing: -0.02em;
  color: var(--shadow);
  transition: color 0.25s var(--ease), font-size 0.25s var(--ease);
}

.voice:has(.mic.is-active) .voice__prompt {
  color: var(--graphite);
  font-size: clamp(1.05rem, 4vw, 1.14rem);
}

.voice__prompt[hidden] {
  display: none;
}

/* Компактная полоска: мик слева, волна+статус справа — только когда есть ответ */
.app:has(.stage.has-reply) .dock {
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  justify-self: center;
  width: min(100%, 22rem);
  max-width: 22rem;
  min-width: 0;
  gap: 0.85rem;
  padding: 0.2rem 0.15rem 0.1rem;
  animation: rise 0.35s var(--ease) both;
}

.app:has(.stage.has-reply) .voice {
  flex-direction: row;
  margin: 0;
  padding: 0;
  gap: 0;
  animation: none;
}

.app:has(.stage.has-reply) .voice__prompt {
  display: none;
}

.app:has(.stage.has-reply) .mic {
  width: 3.55rem;
  height: 3.55rem;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.95) inset,
    0 8px 20px rgba(140, 110, 86, 0.12),
    0 0 0 4px rgba(232, 118, 57, 0.08);
}

.app:has(.stage.has-reply) .mic svg {
  width: 1.35rem;
  height: 1.35rem;
}

.app:has(.stage.has-reply) .mic__aura {
  inset: -10px;
  filter: blur(6px);
}

.app:has(.stage.has-reply) .mic__ring {
  inset: -7px;
  border-width: 1px;
}

.app:has(.stage.has-reply) .listen {
  flex: 1 1 auto;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  gap: 0.45rem;
  min-width: 0;
  max-width: 100%;
  padding: 0.25rem 0.15rem;
  justify-self: stretch;
  overflow: hidden;
  animation: none;
}

/* Волна всегда у правого края; текст слева от неё, не двигает финьтифлюшку */
.app:has(.stage.has-reply) .wave {
  order: 2;
  width: 5.5rem;
  height: 1.65rem;
  flex: 0 0 5.5rem;
  margin-left: auto;
  min-width: 5.5rem;
}

.app:has(.stage.has-reply) .listen #listen-text {
  order: 1;
}

.app:has(.stage.has-reply) .listen.is-active #listen-text {
  position: static;
  width: auto;
  height: auto;
  margin: 0;
  padding: 0;
  overflow: hidden;
  clip: auto;
  flex: 1 1 0;
  min-width: 0;
  max-width: 100%;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 0.75rem;
  text-align: right;
  color: var(--graphite);
}

/* ——— Listen: в макете — медная волна, не pill со статусом ——— */
.listen {
  position: relative;
  z-index: 2;
  justify-self: center;
  flex-shrink: 0;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  background: transparent;
  border: none;
  color: var(--shadow);
  font-size: 0.75rem;
  letter-spacing: 0.01em;
  animation: rise 0.8s 0.45s var(--ease) both;
  transition: color 0.3s var(--ease);
  min-height: 2rem;
}

.listen.is-active {
  color: var(--graphite);
}

.listen:not(.is-active) {
  cursor: text;
}

.listen:not(.is-active) #listen-text {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.type {
  width: min(100%, 22rem);
  justify-self: center;
  margin-top: 0.65rem;
  animation: rise 0.3s var(--ease) both;
}

.type[hidden] {
  display: none;
}

.type input {
  width: 100%;
  padding: 0.85rem 1.15rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.88);
  color: var(--graphite);
  font: inherit;
  /* ≥16px: иначе iOS Safari зумит страницу при фокусе */
  font-size: 16px;
  outline: none;
  box-shadow: var(--soft-shadow);
}

.type input:focus {
  border-color: rgba(232, 118, 57, 0.55);
  box-shadow: 0 0 0 4px rgba(232, 118, 57, 0.12);
}

.type input::placeholder {
  color: var(--fog);
}

.wave {
  display: block;
  width: 7.25rem;
  height: 2.5rem;
  overflow: visible;
  filter: drop-shadow(0 0 8px rgba(232, 118, 57, 0.22));
}

.wave circle,
.wave rect {
  fill: #e87639;
}

.wave circle {
  opacity: 0.38;
}

.wave rect:nth-of-type(1),
.wave rect:nth-of-type(11) { opacity: 0.45; }
.wave rect:nth-of-type(2),
.wave rect:nth-of-type(3),
.wave rect:nth-of-type(9),
.wave rect:nth-of-type(10) { opacity: 0.55; }
.wave rect:nth-of-type(4),
.wave rect:nth-of-type(8) { opacity: 0.72; }
.wave rect:nth-of-type(5),
.wave rect:nth-of-type(7) { opacity: 0.88; }
.wave__bar--peak { opacity: 1; }

.listen.is-active .wave {
  filter: drop-shadow(0 0 10px rgba(232, 118, 57, 0.4));
}

.listen.is-active .wave rect,
.listen.is-active .wave circle {
  transform-box: fill-box;
  transform-origin: center;
  animation: wave-bars 0.95s ease-in-out infinite;
}

.listen.is-active .wave rect:nth-of-type(odd) { animation-delay: 0.1s; }
.listen.is-active .wave rect:nth-of-type(even) { animation-delay: 0.2s; }
.listen.is-active .wave__bar--peak { animation-delay: 0s; }
.listen.is-active .wave circle { animation-delay: 0.28s; animation-duration: 1.15s; }

@keyframes wave-bars {
  0%,
  100% { transform: scaleY(0.55); }
  50% { transform: scaleY(1); }
}

@keyframes fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes float-in {
  from {
    opacity: 0;
    transform: scale(0.9) translateY(16px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

@keyframes float {
  0%,
  100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

@keyframes breathe {
  0%,
  100% {
    opacity: 0.55;
    transform: translateX(-50%) scale(1);
  }
  50% {
    opacity: 0.95;
    transform: translateX(-50%) scale(1.08);
  }
}

@keyframes glow-breathe {
  0%,
  100% {
    opacity: 0.55;
    transform: scale(1);
  }
  50% {
    opacity: 0.95;
    transform: scale(1.08);
  }
}

@keyframes glow-breathe-center {
  0%,
  100% {
    opacity: 0.5;
    transform: translateX(-50%) scale(1);
  }
  50% {
    opacity: 0.9;
    transform: translateX(-50%) scale(1.08);
  }
}

@keyframes spark-pulse {
  0%,
  100% {
    opacity: 0.85;
    transform: scale(1);
    filter: drop-shadow(0 0 8px rgba(232, 118, 57, 0.45));
  }
  50% {
    opacity: 1;
    transform: scale(1.08);
    filter: drop-shadow(0 0 14px rgba(232, 118, 57, 0.7));
  }
}

@keyframes ring {
  0% {
    transform: scale(0.85);
    opacity: 0.55;
  }
  100% {
    transform: scale(1.35);
    opacity: 0;
  }
}

/* Короткие экраны: правила ниже базовых, иначе ширина мика их перебивает */
@media (max-height: 740px) {
  .stage {
    padding-top: 0.5rem;
    gap: 0.3rem;
  }

  .headline {
    font-size: 1.05rem;
  }

  .mic {
    width: 5.5rem;
    height: 5.5rem;
  }

  .mic svg {
    width: 1.7rem;
    height: 1.7rem;
  }

  .voice {
    gap: 0.45rem;
    margin-bottom: 0.15rem;
    padding-top: 0.15rem;
  }

  .app:has(.stage.has-reply) .mic {
    width: 3.25rem;
    height: 3.25rem;
  }

  .hints {
    font-size: 0.72rem;
  }
}

/* Альбомный телефон: подсказка и крупный мик не налезают друг на друга */
@media (max-height: 500px) {
  .app {
    padding-top: max(0.35rem, env(safe-area-inset-top));
    padding-bottom: max(0.4rem, env(safe-area-inset-bottom));
  }

  .spark,
  .hints {
    display: none;
  }

  .stage {
    padding-top: 0.15rem;
    gap: 0.15rem;
  }

  .stage:not(.has-reply) {
    justify-content: flex-end;
    padding-bottom: 0.85rem;
  }

  .headline {
    font-size: 1rem;
    max-width: 18rem;
  }

  .mic {
    width: 4.5rem;
    height: 4.5rem;
  }

  .mic svg {
    width: 1.45rem;
    height: 1.45rem;
  }

  .voice {
    gap: 0.2rem;
    margin-bottom: 0;
    padding-top: 0;
  }

  .wave {
    width: 5.5rem;
    height: 1.6rem;
  }

  .app:has(.stage.has-reply) .reply.is-long {
    max-height: calc(100% - 2.2rem);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}

/* ——— План для печати и PDF ——— */
.print-plan {
  display: none;
}

@media print {
  @page {
    margin: 14mm;
  }

  html,
  body {
    height: auto;
    min-height: 0;
    overflow: visible;
    background: #fff;
  }

  body {
    display: block;
  }

  .app {
    display: none !important;
  }

  .print-plan {
    display: block;
    color: #111;
    font: 10.5pt/1.45 -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  }

  .print-plan h1 {
    margin: 0 0 1.5mm;
    font-size: 18pt;
  }

  .print-plan__meta {
    margin: 0 0 5mm;
    color: #666;
  }

  .print-plan h2 {
    margin: 5mm 0 2mm;
    padding-bottom: 1mm;
    font-size: 12.5pt;
    border-bottom: 1px solid #ccc;
    break-after: avoid;
  }

  .print-plan dl {
    display: grid;
    grid-template-columns: 34mm 1fr;
    gap: 1.2mm 4mm;
    margin: 0;
  }

  .print-plan dt {
    color: #555;
  }

  .print-plan dd {
    margin: 0;
  }

  .print-plan ul,
  .print-plan ol {
    margin: 0;
    padding-left: 5mm;
  }

  .print-plan li {
    break-inside: avoid;
  }

  .print-plan__sub {
    margin: 2mm 0 1mm;
    color: #555;
  }

  .print-plan table {
    width: 100%;
    border-collapse: collapse;
  }

  .print-plan th,
  .print-plan td {
    padding: 1mm 2mm;
    text-align: left;
    border-bottom: 1px solid #e3e3e3;
  }

  .print-plan th {
    color: #555;
    font-weight: 600;
  }

  .print-plan .num {
    text-align: right;
    white-space: nowrap;
  }

  .print-plan__total td {
    font-weight: 700;
    border-bottom: none;
  }

  .print-plan a {
    color: #111;
    text-decoration: none;
  }
}
