/*
 * 오리온스타 고객 포털 — 화면 스타일
 *
 * 기준: OSK 디자인 시스템("Design System" tokens.json)과
 *       같은 기준을 쓰는 백오피스(app.os-portal.com)·견적 조회·CMS.
 * - 브랜드 색은 osk-logo #2660AD 하나. 위계는 같은 파란 계열의 밝기 단계로만 만든다.
 * - 꽉 찬 파랑은 주 버튼(한 영역에 하나)에만 쓴다. 선택 상태는 blue-50 바탕 + osk-logo 글자.
 * - 모서리 8px, 간격 4/8/16/24, 포커스 링 blue-400. 글자에 blue-300·400을 쓰지 않는다.
 * - 그라데이션 버튼, 왼쪽 띠 강조 카드, 이모지 장식을 쓰지 않는다.
 */

:root {
  /* 디자인 시스템 색 */
  --osk-logo: #2660ad;
  --blue-50: #eff4fa;
  --blue-100: #dce6f5;
  --blue-200: #b8ceea;
  --blue-300: #89addc;
  --blue-400: #4b87d8;
  --blue-500: #2b6dc5;
  --blue-700: #1c467d;
  --blue-800: #153560;
  --blue-900: #0f2543;
  --ink: #1f2937;
  --mute: #6b7280;
  --line: #e5e7eb;
  --white: #ffffff;
  --bad: #b3412e;

  /* 간격·모서리 */
  --xs: 4px;
  --sm: 8px;
  --md: 16px;
  --lg: 24px;
  --radius: 8px;

  --sidebar: 200px;
  --tabbar: 60px;
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  font-feature-settings: "tnum" 1; /* 숫자 자리 맞춤 */
}

body {
  margin: 0;
  font-family: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  color: var(--ink);
  background: var(--white);
  font-size: 15px;
  line-height: 1.55;
  word-break: keep-all; /* 한국어 단어 중간에서 줄이 바뀌지 않게 */
  -webkit-font-smoothing: antialiased;
}

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

button,
input,
select,
textarea {
  font: inherit;
}

button,
a,
input,
select,
textarea {
  -webkit-tap-highlight-color: transparent;
}

button,
a {
  touch-action: manipulation;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
}

:focus-visible {
  outline: 2px solid var(--blue-400);
  outline-offset: 2px;
}

/* 화면 전환 후 제목으로 옮기는 초점은 읽기용이라 테두리를 그리지 않는다 */
h1:focus {
  outline: none;
}

[hidden] {
  display: none !important;
}

h1 {
  font-size: 26px;
  line-height: 1.3;
  margin: 0;
  font-weight: 700;
}

h2 {
  font-size: 17px;
  line-height: 1.4;
  margin: 0;
  font-weight: 700;
}

h3 {
  font-size: 15px;
  margin: 0;
  font-weight: 700;
}

p {
  margin: 0;
}

.icon {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ── 프로토타입 안내 띠 ───────────────────────────── */

.demo-strip {
  position: sticky;
  top: 0;
  z-index: 50;
  min-height: 32px;
  background: var(--blue-100);
  color: var(--blue-800);
  text-align: center;
  font-size: 12.5px;
  font-weight: 600;
  padding: 7px 16px;
}

.demo-strip span {
  font-weight: 400;
  margin-left: 12px;
}

/* ── 왼쪽 메뉴 (PC) ─────────────────────────────── */

.sidebar {
  position: fixed;
  top: 32px;
  bottom: 0;
  width: var(--sidebar);
  background: var(--white);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  z-index: 30;
}

.brand {
  display: block;
  padding: 20px 20px 16px;
}

.brand img {
  display: block;
  height: 22px;
  width: auto;
}

.brand span {
  display: block;
  margin-top: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--mute);
}

.workspace {
  display: flex;
  align-items: center;
  gap: var(--sm);
  margin: 0 12px 12px;
  padding: 10px 12px;
  border-radius: var(--radius);
  background: var(--blue-50);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
}

.workspace .icon {
  width: 20px;
  height: 20px;
  color: var(--osk-logo);
}

.workspace small {
  display: block;
  font-size: 12px;
  color: var(--mute);
  font-weight: 400;
}

.sidebar nav {
  flex: 1;
  padding: 0 12px;
}

.sidebar nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 2px 0;
  padding: 10px 12px;
  border-radius: var(--radius);
  color: var(--mute);
  font-size: 15px;
  font-weight: 600;
}

.sidebar nav a:hover {
  background: var(--blue-50);
  color: var(--ink);
}

.sidebar nav a.active {
  background: var(--blue-50);
  color: var(--osk-logo);
}

.nav-group {
  margin: 16px 12px 4px;
  font-size: 12px;
  font-weight: 600;
  color: var(--mute);
}

.sidebar-bottom {
  border-top: 1px solid var(--line);
  padding: 16px 20px;
  font-size: 13px;
}

.sidebar-bottom strong {
  display: block;
  font-weight: 600;
}

.sidebar-bottom span {
  color: var(--mute);
}

/* ── 본문 ───────────────────────────────────────── */

.app {
  margin-left: var(--sidebar);
}

main {
  max-width: 1164px; /* 본문 1100px + 좌우 여백 (백오피스와 같은 폭) */
  margin: 0 auto;
  padding: 24px 32px 0;
}

.page-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: var(--lg);
}

.page-heading p {
  color: var(--mute);
  margin-top: 10px;
  font-size: 14px;
}

.context label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--mute);
  margin-bottom: var(--xs);
}

select {
  background-color: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 9px 32px 9px 12px;
  color: var(--ink);
  font-size: 15px;
  max-width: 100%;
}

select:focus,
textarea:focus {
  border-color: var(--blue-400);
  outline: none;
  box-shadow: 0 0 0 3px rgba(75, 135, 216, .35);
}

.context select {
  min-width: 220px;
}

.context-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  margin: 16px 0 var(--lg);
  padding-bottom: 12px;
  font-size: 13px;
  color: var(--mute);
  gap: 10px;
}

.context-line strong {
  font-weight: 600;
  color: var(--ink);
}

.dot {
  display: inline-block;
  height: 7px;
  width: 7px;
  border-radius: 50%;
  background: var(--osk-logo);
  margin-right: 6px;
  vertical-align: 1px;
}

/* ── 카드·배지 공통 ─────────────────────────────── */

.card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.card-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.card-heading p {
  font-size: 13px;
  color: var(--mute);
  margin-top: var(--xs);
}

/* 작은 상태 표시: 회색 이름표 (백오피스의 태그 스티커와 같은 모양) */
.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  background: #f3f4f6;
  color: var(--mute);
  font-size: 12px;
  font-weight: 500;
  padding: 2px 8px;
  white-space: nowrap;
}

/* 카드 안 작은 머리말 (영문 장식 대신 한글 분류) */
.eyebrow {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  color: var(--osk-logo);
}

/* ── 버튼 (디자인 시스템 버튼 규칙) ─────────────── */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sm);
  min-height: 40px;
  padding: 0 var(--md);
  border-radius: var(--radius);
  border: 1px solid transparent;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
}

/* 주 버튼: osk-logo 배경, hover blue-700, 눌림 blue-800 */
.primary {
  background: var(--osk-logo);
  color: var(--white);
}

.primary:hover:not(:disabled) {
  background: var(--blue-700);
}

.primary:active:not(:disabled) {
  background: var(--blue-800);
}

/* 보조 버튼: 흰 배경, 1px osk-logo 테두리·글자, hover blue-50 */
.secondary {
  background: var(--white);
  border-color: var(--osk-logo);
  color: var(--osk-logo);
}

.secondary:hover:not(:disabled) {
  background: var(--blue-50);
}

/* 비활성: 회색 (브랜드 색으로 비활성을 표현하지 않음) */
.button:disabled {
  background: var(--line);
  border-color: var(--line);
  color: var(--mute);
}

/* 어두운 배경 위의 버튼: 흰 바탕 + osk-logo 글자 */
.on-dark {
  background: var(--white);
  color: var(--osk-logo);
  margin-top: var(--lg);
}

.on-dark:hover {
  background: var(--blue-50);
}

/* ── 화면 1: 로봇 현황 ─────────────────────────── */

.overview-grid {
  display: grid;
  grid-template-columns: 1.65fr 1fr;
  gap: var(--md);
}

/* 디자인 시스템: 그라데이션은 히어로 배경에만, blue-600 → blue-800 같은 계열 안에서만 */
.hero-card {
  background: linear-gradient(135deg, var(--osk-logo) 0%, var(--blue-800) 100%);
  color: var(--white);
  border-radius: var(--radius);
  position: relative;
  min-height: 290px;
  overflow: hidden;
  padding: 28px;
}

.hero-copy {
  position: relative;
  z-index: 2;
}

.pill {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  border-radius: 999px;
  padding: 3px 10px;
  background: rgba(255, 255, 255, .16);
  color: var(--white);
}

.hero-card h2 {
  font-size: 28px;
  line-height: 1.4;
  margin: 14px 0 10px;
  font-weight: 700;
}

.hero-card p {
  font-size: 14px;
  color: var(--blue-100);
  line-height: 1.7;
}

.hero-card strong {
  font-weight: 600;
  color: var(--white);
}

.robot-art {
  position: absolute;
  width: 135px;
  height: 215px;
  right: 9%;
  top: 44px;
  transform: rotate(-5deg);
  z-index: 1;
}

.robot-head {
  position: absolute;
  width: 77px;
  height: 47px;
  left: 29px;
  top: 0;
  border-radius: 20px 22px 14px 14px;
  background: linear-gradient(120deg, var(--white), var(--blue-100));
  padding: 7px;
}

.eyes {
  height: 28px;
  background: var(--blue-900);
  border-radius: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 17px;
}

.eyes i {
  width: 9px;
  height: 5px;
  background: var(--blue-200);
  border-radius: 50%;
}

.robot-neck {
  position: absolute;
  left: 60px;
  top: 45px;
  width: 18px;
  height: 20px;
  background: var(--blue-200);
}

.robot-body {
  position: absolute;
  left: 13px;
  top: 59px;
  width: 109px;
  height: 116px;
  border-left: 11px solid var(--blue-50);
  border-right: 11px solid var(--blue-200);
  border-radius: 8px;
}

.tray {
  height: 12px;
  background: linear-gradient(var(--white), var(--blue-200));
  margin: 17px -17px 0;
  border-radius: 9px;
  box-shadow: 0 5px 0 rgba(15, 37, 67, .35);
}

.robot-base {
  position: absolute;
  left: 7px;
  top: 172px;
  width: 121px;
  height: 34px;
  background: linear-gradient(120deg, var(--white), var(--blue-100));
  border-radius: 10px 10px 25px 25px;
  box-shadow: 0 5px 0 var(--blue-900);
  text-align: center;
  color: var(--blue-700);
  font-size: 12px;
  padding-top: 4px;
}

.robot-shadow {
  position: absolute;
  bottom: -10px;
  width: 140px;
  height: 15px;
  background: rgba(15, 37, 67, .55);
  filter: blur(7px);
  border-radius: 50%;
}

.status-card {
  padding: var(--lg);
}

.battery {
  display: flex;
  align-items: baseline;
  gap: var(--xs);
  margin-top: 20px;
}

.battery > span:first-child {
  font-size: 44px;
  font-weight: 700;
  line-height: 1.2;
}

.battery small {
  font-size: 18px;
  color: var(--mute);
}

.battery-label {
  margin-left: auto;
  font-size: 13px;
  color: var(--mute);
}

.battery-track {
  height: 6px;
  background: var(--blue-50);
  border-radius: 999px;
  margin-top: 12px;
  overflow: hidden;
}

.battery-track div {
  width: 82%;
  background: var(--osk-logo);
  height: 100%;
  border-radius: 999px;
}

.status-list {
  margin: 20px 0 0;
}

.status-list div {
  display: flex;
  justify-content: space-between;
  margin-top: 10px;
  font-size: 14px;
  gap: var(--sm);
}

.status-list dt {
  color: var(--mute);
}

.status-list dd {
  margin: 0;
  font-weight: 600;
  text-align: right;
}

.section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin: 32px 0 12px;
  gap: 12px;
}

.section-heading span {
  font-size: 13px;
  color: var(--mute);
}

.metrics {
  display: grid;
  grid-template-columns: 1fr 1fr 1.15fr;
  gap: var(--md);
}

.metric {
  padding: 20px var(--lg);
}

.metric > span {
  font-size: 13px;
  font-weight: 600;
  color: var(--mute);
}

.metric div {
  margin: 12px 0 6px;
}

.metric strong {
  font-size: 34px;
  line-height: 1;
  font-weight: 700;
}

.metric small {
  margin-left: 6px;
  font-size: 14px;
  color: var(--mute);
}

.metric p {
  font-size: 13px;
  color: var(--mute);
}

.next-step {
  background: var(--blue-50);
  border-color: var(--blue-100);
  padding: 20px var(--lg);
}

.next-step h2 {
  font-size: 16px;
  margin-top: 6px;
}

.next-step p {
  font-size: 13px;
  color: var(--mute);
  margin: 6px 0 14px;
}

/* 텍스트 버튼: osk-logo 글자, hover 밑줄 */
.next-step a,
.related {
  font-size: 14px;
  font-weight: 600;
  color: var(--osk-logo);
}

.next-step a {
  display: flex;
  justify-content: space-between;
}

.next-step a:hover,
.related:hover {
  text-decoration: underline;
}

.notice {
  display: flex;
  align-items: flex-start;
  gap: var(--sm);
  font-size: 13px;
  color: var(--mute);
  padding: var(--md) 0;
  line-height: 1.7;
}

.notice .icon {
  width: 18px;
  height: 18px;
  margin-top: 2px;
}

footer {
  margin-top: 32px;
  border-top: 1px solid var(--line);
  padding: var(--md) 0;
  display: flex;
  justify-content: space-between;
  gap: var(--md);
  color: var(--mute);
  font-size: 12px;
}

/* ── 화면 2·3: 편집 화면 공통 ─────────────────── */

.editor-layout {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(240px, 1fr);
  gap: var(--lg);
}

.editor {
  padding: var(--lg);
}

.editor .card-heading {
  padding-bottom: var(--md);
  border-bottom: 1px solid var(--line);
}

.form-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--md);
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}

.form-row:last-child {
  border: 0;
  padding-bottom: 0;
}

.form-row label,
.speech-field label {
  font-size: 15px;
  font-weight: 600;
}

.form-row p,
.speech-field p {
  font-size: 13px;
  color: var(--mute);
  margin-top: 2px;
}

.number-unit {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
  padding-right: 12px;
}

.number-unit:focus-within {
  border-color: var(--blue-400);
  box-shadow: 0 0 0 3px rgba(75, 135, 216, .35);
}

.number-unit input {
  width: 76px;
  border: 0;
  background: transparent;
  padding: 9px 12px;
  color: var(--ink);
  font-size: 15px;
}

.number-unit input:focus-visible {
  outline: none;
}

.number-unit span {
  color: var(--mute);
  font-size: 13px;
}

.form-row select {
  max-width: 170px;
}

.switch {
  appearance: none;
  width: 44px;
  height: 26px;
  border-radius: 999px;
  background: #d1d5db;
  position: relative;
  flex-shrink: 0;
  margin: 0;
  cursor: pointer;
}

.switch::after {
  content: "";
  position: absolute;
  background: var(--white);
  width: 20px;
  height: 20px;
  border-radius: 50%;
  top: 3px;
  left: 3px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .2);
}

.switch:checked {
  background: var(--osk-logo);
}

.switch:checked::after {
  left: 21px;
}

.tip-card,
.preview-card {
  background: var(--blue-50);
  border-radius: var(--radius);
  padding: var(--lg);
}

.tip-card h2 {
  font-size: 18px;
  line-height: 1.5;
  margin: 10px 0 12px;
}

.tip-card p {
  font-size: 14px;
  line-height: 1.75;
  color: var(--mute);
}

.tip-card hr {
  border: 0;
  border-top: 1px solid var(--blue-100);
  margin: var(--md) 0;
}

.related {
  display: flex;
  justify-content: space-between;
  padding: 20px 4px;
}

.speech-field {
  padding: 18px 0 4px;
}

textarea {
  width: 100%;
  resize: vertical;
  min-height: 72px;
  max-height: 300px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px 12px;
  margin-top: 10px;
  background: var(--white);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.7;
}

.music-note {
  display: flex;
  gap: 12px;
  background: #f9fafb;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  padding: var(--md);
  margin-top: 22px;
}

.music-note .icon {
  color: var(--mute);
}

.music-note p {
  font-size: 13px;
  color: var(--mute);
  margin: 4px 0 10px;
}

.preview-card h2 {
  font-size: 16px;
  margin: 8px 0 var(--md);
}

.message-bubble {
  padding: 20px;
  border-radius: 12px 12px 12px 2px;
  background: var(--white);
  border: 1px solid var(--blue-100);
  line-height: 1.8;
  font-size: 15px;
  min-height: 96px;
  white-space: pre-wrap;
  overflow-wrap: break-word;
}

.preview-card > p {
  font-size: 12px;
  color: var(--mute);
  margin-top: 12px;
}

/* ── 저장 영역 ─────────────────────────────────── */

.savebar {
  position: sticky;
  bottom: var(--md);
  margin-top: var(--lg);
  padding: 12px var(--md);
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 6px 24px rgba(15, 37, 67, .08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--md);
  z-index: 5;
}

.savebar strong {
  font-size: 14px;
  display: block;
}

.savebar small {
  font-size: 12px;
  color: var(--mute);
  display: block;
  margin-top: 2px;
}

.save-actions {
  display: flex;
  gap: var(--sm);
  flex-shrink: 0;
}

/* ── 알림·확인창 ───────────────────────────────── */

#toast {
  position: fixed;
  bottom: 96px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--ink);
  color: var(--white);
  border-radius: var(--radius);
  padding: 12px 18px;
  font-size: 14px;
  z-index: 60;
  max-width: 90%;
  box-shadow: 0 8px 30px rgba(0, 0, 0, .15);
}

#toast:empty {
  display: none;
}

dialog {
  border: 0;
  border-radius: 12px;
  max-width: 420px;
  width: calc(100% - 32px);
  padding: var(--lg);
  color: var(--ink);
  box-shadow: 0 10px 60px rgba(0, 0, 0, .18);
}

dialog::backdrop {
  background: rgba(31, 41, 55, .4); /* ink 40% (백오피스 시트와 같은 어둡기) */
}

dialog p {
  font-size: 14px;
  color: var(--mute);
  margin: 10px 0 var(--lg);
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: var(--sm);
}

/* ── 좁은 PC ───────────────────────────────────── */

@media (max-width: 1100px) {
  main {
    padding: 24px 24px 0;
  }
  .hero-card h2 {
    font-size: 24px;
  }
  .robot-art {
    right: 2%;
    transform: scale(.83) rotate(-5deg);
    transform-origin: right center;
  }
  .hero-copy {
    max-width: 65%;
  }
  .editor-layout {
    grid-template-columns: minmax(0, 1fr);
  }
  .editor-aside {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    align-items: start;
  }
  .tip-card h2 br {
    display: none;
  }
  .metric,
  .next-step {
    padding: 18px 20px;
  }
  .context select {
    min-width: 190px;
  }
}

/* ── 모바일: 위에 로고, 아래 탭 (백오피스와 같은 구조) ── */

@media (max-width: 760px) {
  .demo-strip {
    font-size: 12px;
    padding: 6px 10px;
  }
  .demo-strip span {
    display: block;
    margin: 0;
    font-size: 11.5px;
  }

  .sidebar {
    position: static;
    width: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    display: flex;
    flex-direction: row;
    align-items: center;
  }
  .brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
  }
  .brand img {
    height: 18px;
  }
  .brand span {
    margin: 0;
    font-size: 13px;
  }
  .workspace,
  .nav-group,
  .sidebar-bottom {
    display: none;
  }

  .sidebar nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 40;
    display: flex;
    padding: 0 0 env(safe-area-inset-bottom);
    background: var(--white);
    border-top: 1px solid var(--line);
  }
  .sidebar nav a {
    flex: 1 1 0;
    min-width: 0;
    flex-direction: column;
    gap: 2px;
    margin: 0;
    padding: 7px 2px 6px;
    border-radius: 0;
    font-size: 11.5px;
  }
  .sidebar nav a .icon {
    width: 21px;
    height: 21px;
  }
  .sidebar nav a:hover,
  .sidebar nav a.active {
    background: none;
  }
  .sidebar nav a.active {
    color: var(--osk-logo);
  }

  .app {
    margin: 0;
    padding-bottom: calc(var(--tabbar) + env(safe-area-inset-bottom));
  }
  main {
    padding: 20px 16px 0;
  }
  .page-heading {
    display: block;
  }
  h1 {
    font-size: 22px;
  }
  .page-heading p {
    margin-top: 6px;
    font-size: 13px;
  }
  .context {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 16px;
    gap: 12px;
  }
  .context label {
    margin: 0;
    flex-shrink: 0;
  }
  .context select {
    min-width: 0;
    flex: 1;
    max-width: 240px;
  }
  .context-line {
    margin: 12px 0 16px;
    font-size: 12px;
  }

  .overview-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .hero-card {
    min-height: 270px;
    padding: 22px;
  }
  .hero-card h2 {
    font-size: 23px;
  }
  .hero-card p {
    font-size: 13px;
  }
  .robot-art {
    right: 4%;
    top: 40px;
    transform: scale(.8) rotate(-5deg);
  }
  .status-card {
    padding: 20px;
  }
  .battery > span:first-child {
    font-size: 38px;
  }
  .metrics {
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }
  .next-step {
    grid-column: 1 / -1;
  }
  .next-step p br {
    display: none;
  }
  .section-heading {
    margin: 24px 0 10px;
  }
  .section-heading h2 {
    font-size: 16px;
    white-space: nowrap;
  }
  .section-heading span {
    text-align: right;
    font-size: 12px;
  }
  .metric {
    padding: 16px;
  }
  .metric strong {
    font-size: 30px;
  }

  .editor {
    padding: 18px 16px;
  }
  .editor-aside {
    display: block;
  }
  .tip-card,
  .preview-card {
    padding: 20px;
  }
  .form-row {
    gap: 12px;
  }
  .form-row > div:first-child {
    min-width: 0;
  }
  .number-unit input {
    width: 64px;
    font-size: 16px; /* 아이폰 확대 방지 */
  }
  .form-row select {
    max-width: 130px;
    font-size: 16px;
  }
  .context select,
  .speech-field textarea {
    font-size: 16px;
  }

  /* 저장 영역은 아래 탭 바로 위에 붙는다 */
  .savebar {
    bottom: calc(var(--tabbar) + env(safe-area-inset-bottom) + 8px);
    padding: 12px;
    flex-wrap: wrap;
  }
  .save-actions {
    width: 100%;
  }
  .save-actions button {
    flex: 1;
  }

  #toast {
    bottom: calc(var(--tabbar) + env(safe-area-inset-bottom) + 96px);
  }

  .related {
    padding-bottom: 4px;
  }
  footer {
    align-items: center;
  }
  footer span {
    text-align: right;
  }
  .dialog-actions {
    flex-wrap: wrap;
  }
}

@media (max-width: 360px) {
  .robot-art {
    display: none;
  }
  .hero-copy {
    max-width: 100%;
  }
  .brand span {
    display: none;
  }
}

@media (prefers-reduced-motion: no-preference) {
  a,
  button {
    transition: background-color .15s, color .15s;
  }
}
