* { box-sizing: border-box; }
:root {
  --bg: #e7e2d7;
  --paper: #faf9f4;
  --ink: #111827;
  --muted: #5b6472;
  --line: rgba(17, 24, 39, 0.16);
  --button: #111827;
  --button-text: #ffffff;
}
html, body { height: 100%; margin: 0; overflow: hidden; }
body {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: radial-gradient(circle at 15% 20%, #f6f0df 0, transparent 28%), var(--bg);
  color: var(--ink);
}
.app-shell {
  height: 100vh;
  height: 100dvh;
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 16px;
  padding: 22px;
  max-width: 1240px;
  margin: 0 auto;
}
.topbar, .controls, .card-frame {
  background: rgba(250, 249, 244, 0.88);
  border: 1px solid var(--line);
  box-shadow: 0 18px 50px rgba(17, 24, 39, 0.08);
}
.topbar {
  min-height: 86px;
  border-radius: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  gap: 20px;
}
.eyebrow, .card-type {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 700;
}
h1 { font-size: clamp(1.15rem, 2.3vw, 2rem); margin: 0; line-height: 1.05; }
.version {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 12px;
  font-weight: 800;
  color: var(--muted);
}
.card-frame {
  min-height: 0;
  border-radius: 32px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.92fr);
  overflow: hidden;
  height: 100%;
}
.visual-panel {
  min-height: 0;
  min-width: 0;
  overflow: hidden;
  display: grid;
  place-items: center;
  padding: clamp(18px, 4vw, 46px);
  border-right: 1px solid var(--line);
}
.visual-panel img {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: block;
}
.text-panel {
  min-height: 0;
  min-width: 0;
  overflow: hidden;
  padding: clamp(22px, 4vw, 52px);
  display: flex;
  flex-direction: column;
}
h2 { font-size: clamp(1.8rem, 4vw, 4.1rem); line-height: 0.98; letter-spacing: -0.05em; margin: 0 0 22px; flex: 0 0 auto; }
.card-text {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 10px;
  font-size: clamp(1rem, 1.35vw, 1.25rem);
  line-height: 1.62;
  color: #202938;
}
.card-text p { margin: 0 0 1em; }
.controls {
  min-height: 74px;
  border-radius: 22px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 16px;
  padding: 14px 16px;
}
button {
  appearance: none;
  border: none;
  border-radius: 999px;
  background: var(--button);
  color: var(--button-text);
  font-weight: 800;
  padding: 12px 18px;
  cursor: pointer;
}
button:disabled { opacity: 0.35; cursor: not-allowed; }
.progress-wrap { display: grid; gap: 8px; }
.progress-label { color: var(--muted); font-weight: 700; font-size: 0.9rem; text-align: center; }
.progress-track { height: 10px; background: rgba(17,24,39,.12); border-radius: 999px; overflow: hidden; }
.progress-bar { height: 100%; width: 0; background: var(--ink); border-radius: 999px; transition: width 180ms ease; }
@media (max-width: 820px) {
  .app-shell { padding: 12px; gap: 12px; }
  .topbar { border-radius: 18px; align-items: flex-start; }
  .card-frame { grid-template-columns: 1fr; grid-template-rows: minmax(210px, 38vh) minmax(0, 1fr); border-radius: 22px; }
  .visual-panel { border-right: none; border-bottom: 1px solid var(--line); padding: 16px; }
  .visual-panel img { max-height: 100%; }
  .text-panel { padding: 22px; }
  .controls { grid-template-columns: 1fr 1fr; }
  .progress-wrap { grid-column: 1 / -1; grid-row: 1; }
}
