/* =========================================================
   1994 콘텐츠 스튜디오 — style.css
   크림·버터·캐러멜 톤. 모바일 우선.
   ========================================================= */

:root {
  --cream: #fbf6ec;
  --cream-2: #f6eedd;
  --paper: #ffffff;
  --ink: #2a211c;
  --ink-soft: #6d5c4d;
  --ink-faint: #9a8878;
  --line: #e8ddca;
  --line-strong: #d8c9b0;
  --accent: #c0703b;
  --accent-deep: #8a451f;
  --accent-soft: #f7e3cc;
  --butter: #f2c879;
  --ok: #3f7d52;
  --warn: #b0602f;
  --danger: #b23b32;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 1px 2px rgba(58, 40, 24, .05), 0 10px 26px -18px rgba(58, 40, 24, .35);
  --shadow-lift: 0 2px 6px rgba(58, 40, 24, .07), 0 18px 40px -22px rgba(58, 40, 24, .45);
  --font: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo",
          "Noto Sans KR", "Malgun Gothic", "맑은 고딕", system-ui, sans-serif;
  --serif: "Nanum Myeongjo", "AppleMyungjo", "Batang", "바탕", serif;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background:
    radial-gradient(1200px 500px at 80% -10%, #fdf1dd 0%, rgba(253, 241, 221, 0) 60%),
    var(--cream);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  padding-bottom: calc(28px + var(--safe-bottom));
}

[hidden], .hidden { display: none !important; }

h1, h2, h3, p, ul, figure { margin: 0; }
ul { padding: 0; list-style: none; }
button { font: inherit; color: inherit; }
a { color: var(--accent-deep); }

.wrap { width: 100%; max-width: 960px; margin: 0 auto; padding: 0 16px; }

/* 스크롤 이동 시 sticky 헤더에 가리지 않게 */
.panel, .output, .card, .out-card { scroll-margin-top: 118px; }

/* 파일 선택 버튼 다듬기 */
input[type="file"] { font-size: 13px; color: var(--ink-soft); }
input[type="file"]::file-selector-button {
  font: inherit;
  font-size: 12.5px;
  font-weight: 700;
  margin-right: 10px;
  padding: 8px 12px;
  border-radius: 9px;
  border: 1px solid var(--line-strong);
  background: #fffdf9;
  color: var(--ink-soft);
  cursor: pointer;
}
input[type="file"]::file-selector-button:hover { border-color: var(--accent); color: var(--accent-deep); }

/* ───────────────────────── header ───────────────────────── */

.app-header {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(251, 246, 236, .92);
  backdrop-filter: saturate(150%) blur(12px);
  -webkit-backdrop-filter: saturate(150%) blur(12px);
  border-bottom: 1px solid var(--line);
  padding-top: max(8px, env(safe-area-inset-top, 0px));
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 6px;
  padding-bottom: 8px;
}

.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; min-width: 0; }

.brand-mark {
  flex: none;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--ink);
  color: #fdf4e6;
  font-size: 12.5px;
  font-weight: 800;
  letter-spacing: .02em;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .14);
}

.brand-text { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.brand-text b { font-size: 16.5px; letter-spacing: -.02em; }
.brand-text small { font-size: 11.5px; color: var(--ink-faint); letter-spacing: .01em; }

.header-actions { display: flex; align-items: center; gap: 6px; flex: none; }

.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 11px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: var(--paper);
  font-size: 12px;
  color: var(--ink-soft);
  cursor: pointer;
  white-space: nowrap;
  max-width: 42vw;
  overflow: hidden;
}
.status-chip .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ink-faint); flex: none; }
.status-chip.is-ok .dot { background: var(--ok); }
.status-chip.is-warn .dot { background: var(--warn); }
.status-chip.is-off .dot { background: #c7b7a6; }
.status-label { overflow: hidden; text-overflow: ellipsis; }

.icon-btn {
  width: 38px; height: 38px;
  display: grid; place-items: center;
  border-radius: 50%;
  border: 1px solid transparent;
  background: transparent;
  cursor: pointer;
  color: var(--ink-soft);
}
.icon-btn:hover { background: rgba(0, 0, 0, .045); }
.icon-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

/* tabs */
.tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  padding-bottom: 8px;
}

.tab {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 6px;
  border: 0;
  background: transparent;
  border-radius: 12px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink-faint);
  cursor: pointer;
  letter-spacing: -.01em;
  transition: background .15s, color .15s;
}
.tab svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.tab:hover { color: var(--ink-soft); background: rgba(0, 0, 0, .03); }
.tab.is-active { background: var(--ink); color: #fdf4e6; }
.tab span { white-space: nowrap; }

/* ───────────────────────── panels ───────────────────────── */

.main { padding-top: 20px; }

.panel { animation: fade .22s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.panel-intro { margin-bottom: 16px; }
.panel-intro h1 { font-size: 22px; letter-spacing: -.03em; }
.panel-intro p { margin-top: 6px; color: var(--ink-soft); font-size: 14px; line-height: 1.65; max-width: 60ch; }

.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
}
.card + .card, .card + .output, .output + .card { margin-top: 16px; }

/* ───────────────────────── form ───────────────────────── */

.field { display: block; margin-top: 16px; }
.field:first-child { margin-top: 0; }
.field-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-soft);
  margin-bottom: 7px;
  letter-spacing: -.01em;
}
.req { font-style: normal; font-size: 10.5px; font-weight: 700; color: #fff; background: var(--accent); border-radius: 999px; padding: 1px 7px; }
.hint-inline { font-style: normal; font-weight: 500; font-size: 11.5px; color: var(--ink-faint); }
.hint { display: block; margin-top: 6px; font-size: 12px; color: var(--ink-faint); line-height: 1.5; }
.hint code { background: var(--cream-2); padding: 1px 4px; border-radius: 4px; font-size: 11.5px; }

input[type="text"], input[type="password"], textarea, select {
  width: 100%;
  padding: 12px 13px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: #fffdf9;
  font: inherit;
  font-size: 15px;
  color: var(--ink);
  transition: border-color .15s, box-shadow .15s, background .15s;
  -webkit-appearance: none;
  appearance: none;
}
textarea { resize: vertical; line-height: 1.62; min-height: 44px; }
select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236d5c4d' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 11px center;
  background-size: 16px;
  padding-right: 34px;
}
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(192, 112, 59, .16);
  background: #fff;
}
input::placeholder, textarea::placeholder { color: #b9a795; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
@media (max-width: 520px) { .grid-2 { grid-template-columns: 1fr; } }

.check { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--ink-soft); padding: 11px 0; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); }

.more { margin-top: 16px; border-top: 1px dashed var(--line); padding-top: 10px; }
.more summary { cursor: pointer; font-size: 13px; color: var(--ink-faint); list-style: none; }
.more summary::-webkit-details-marker { display: none; }
.more summary::before { content: "+ "; font-weight: 700; }
.more[open] summary::before { content: "− "; }

/* chips */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: #fffdf9;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink-soft);
  cursor: pointer;
  transition: all .15s;
}
.chip:hover { border-color: var(--accent); color: var(--accent-deep); }
.chip.is-on { background: var(--ink); border-color: var(--ink); color: #fdf4e6; }

.sub-field { margin-top: 12px; }

/* buttons */
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; align-items: center; }
.actions.tight { margin-top: 0; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 20px;
  border-radius: 13px;
  border: 1px solid transparent;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -.01em;
  cursor: pointer;
  transition: transform .08s, background .15s, box-shadow .15s, opacity .15s;
  min-height: 48px;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--ink); color: #fdf4e6; box-shadow: 0 8px 18px -12px rgba(42, 33, 28, .8); }
.btn.primary:hover { background: #3b2e26; }
.btn.ghost { background: transparent; border-color: var(--line-strong); color: var(--ink-soft); }
.btn.ghost:hover { border-color: var(--ink-soft); color: var(--ink); }
.btn.tiny { padding: 7px 11px; min-height: 0; font-size: 12.5px; border-radius: 9px; }
.btn.danger { background: transparent; border-color: #e3c4be; color: var(--danger); }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn.is-loading { pointer-events: none; opacity: .75; }
.btn.is-loading .btn-label::after {
  content: "";
  display: inline-block;
  width: 12px; height: 12px;
  margin-left: 8px;
  vertical-align: -1px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* status */
.status-line {
  margin-top: 14px;
  font-size: 13.5px;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  background: var(--cream-2);
  color: var(--ink-soft);
  border: 1px solid var(--line);
}
.status-line.is-error { background: #fdf0ee; border-color: #eecec8; color: var(--danger); }
.status-line.is-ok { background: #eef6ef; border-color: #cfe4d3; color: var(--ok); }

/* ───────────────────────── output ───────────────────────── */

.output { margin-top: 18px; }

.out-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.out-head h2 { font-size: 16px; letter-spacing: -.02em; }
.out-head .meta { font-size: 12px; color: var(--ink-faint); }

.out-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
}
.out-card + .out-card { margin-top: 14px; }

.out-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}
.out-card-head h3 { font-size: 14px; color: var(--ink-soft); letter-spacing: -.01em; display: flex; align-items: center; gap: 7px; }
.out-card-head h3 .tag { font-size: 10.5px; font-weight: 700; color: var(--accent-deep); background: var(--accent-soft); border-radius: 999px; padding: 2px 8px; }

.title-list { display: grid; gap: 8px; }
.title-opt {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  text-align: left;
  width: 100%;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: #fffdf9;
  cursor: pointer;
  font-size: 15px;
  line-height: 1.45;
  transition: all .15s;
}
.title-opt .num { flex: none; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; font-weight: 800; background: var(--cream-2); color: var(--ink-soft); margin-top: 1px; }
.title-opt:hover { border-color: var(--accent); }
.title-opt.is-on { border-color: var(--ink); background: #fff8ee; box-shadow: inset 0 0 0 1px var(--ink); }
.title-opt.is-on .num { background: var(--ink); color: #fdf4e6; }

.block { margin-top: 16px; }
.block:first-child { margin-top: 0; }
.block-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.block-head .label { font-size: 12px; font-weight: 700; color: var(--ink-faint); letter-spacing: .02em; }

.auto-text {
  width: 100%;
  border: 1px solid transparent;
  background: var(--cream);
  border-radius: var(--radius-sm);
  padding: 12px 13px;
  font-size: 15px;
  line-height: 1.75;
  color: var(--ink);
  resize: vertical;
  min-height: 80px;
}
.auto-text:hover { border-color: var(--line); }
.auto-text:focus { background: #fff; border-color: var(--accent); }

.section-block { border-top: 1px dashed var(--line); padding-top: 14px; margin-top: 14px; }
.section-block:first-of-type { border-top: 0; padding-top: 0; margin-top: 0; }
.section-heading {
  width: 100%;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  padding: 4px 0 8px;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -.02em;
  color: var(--ink);
  margin-bottom: 8px;
}
.section-heading:focus { outline: none; border-bottom-color: var(--accent); }

.hashtags { display: flex; flex-wrap: wrap; gap: 7px; }
.hashtag {
  font-size: 13px;
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-deep);
  font-weight: 600;
  cursor: pointer;
  border: 0;
}
.hashtag:hover { background: #f2d3b2; }

.copy-ok { color: var(--ok) !important; border-color: #cfe4d3 !important; }

textarea + .count, .count { font-size: 11.5px; color: var(--ink-faint); text-align: right; margin-top: 4px; }
.count.over { color: var(--danger); }

/* ───────────────────────── cardnews ───────────────────────── */

.cn-toolbar { display: grid; gap: 12px; }
.theme-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.theme-swatch {
  width: 40px; height: 40px;
  border-radius: 10px;
  border: 2px solid transparent;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .08);
}
.theme-swatch.is-on { border-color: var(--ink); }
.theme-swatch span { position: absolute; inset: 0; display: grid; place-items: center; font-size: 10px; font-weight: 800; color: rgba(0, 0, 0, .45); }

.seg-toggle { display: inline-flex; border: 1px solid var(--line-strong); border-radius: 10px; overflow: hidden; }
.seg-toggle button { border: 0; background: #fffdf9; padding: 9px 14px; font-size: 13px; font-weight: 600; color: var(--ink-soft); cursor: pointer; }
.seg-toggle button.is-on { background: var(--ink); color: #fdf4e6; }

.cover-upload { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.cover-thumb { width: 54px; height: 68px; border-radius: 8px; object-fit: cover; border: 1px solid var(--line); }

.slide-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; margin-top: 16px; }
.slide-item { border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: #fffdf9; }
.slide-canvas-wrap { position: relative; background: var(--cream-2); }
.slide-canvas-wrap canvas { display: block; width: 100%; height: auto; }
.slide-actions { position: absolute; top: 8px; right: 8px; display: flex; gap: 6px; }
.slide-actions .icon-btn { background: rgba(255, 255, 255, .88); width: 32px; height: 32px; }
.slide-actions .icon-btn svg { width: 16px; height: 16px; }
.slide-fields { padding: 10px 12px 12px; display: grid; gap: 6px; }
.slide-fields input { font-size: 13.5px; padding: 8px 10px; border-radius: 9px; }
.slide-fields .sub { font-size: 12.5px; color: var(--ink-soft); }
.slide-no { font-size: 11px; color: var(--ink-faint); font-weight: 700; }

/* ───────────────────────── shorts ───────────────────────── */

.step-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.step-no {
  flex: none;
  width: 26px; height: 26px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent-deep);
  font-size: 13px;
  font-weight: 800;
  display: grid; place-items: center;
}
.step-head h2 { font-size: 16px; letter-spacing: -.02em; }
.step-head small { margin-left: auto; font-size: 12px; color: var(--ink-faint); }

.dropzone {
  border: 1.5px dashed var(--line-strong);
  border-radius: var(--radius-sm);
  background: #fffdf9;
  padding: 26px 16px;
  text-align: center;
  cursor: pointer;
  transition: all .15s;
}
.dropzone:hover, .dropzone.is-over { border-color: var(--accent); background: #fff7ec; }
.dropzone svg { width: 30px; height: 30px; fill: none; stroke: var(--ink-faint); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.dropzone p { margin-top: 8px; font-size: 14px; display: flex; flex-direction: column; gap: 2px; }
.dropzone p span { font-size: 12px; color: var(--ink-faint); }
.dropzone p b { font-weight: 700; }

.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; margin-top: 12px; }
.photo-grid:empty { margin-top: 0; }
.photo-item { position: relative; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); aspect-ratio: 3 / 4; background: var(--cream-2); }
.photo-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-item .idx {
  position: absolute; top: 5px; left: 5px;
  background: rgba(0, 0, 0, .62); color: #fff;
  font-size: 10.5px; font-weight: 700;
  border-radius: 999px; padding: 1px 7px;
}
.photo-item .del {
  position: absolute; top: 4px; right: 4px;
  width: 22px; height: 22px; border-radius: 50%;
  border: 0; background: rgba(0, 0, 0, .55); color: #fff;
  font-size: 13px; line-height: 1; cursor: pointer; display: grid; place-items: center;
}
.photo-item .move { position: absolute; bottom: 4px; left: 4px; right: 4px; display: flex; gap: 4px; justify-content: center; opacity: 0; transition: opacity .15s; }
.photo-item:hover .move, .photo-item:focus-within .move { opacity: 1; }
@media (hover: none) { .photo-item .move { opacity: 1; } }
.photo-item .move button { border: 0; background: rgba(0, 0, 0, .55); color: #fff; border-radius: 6px; width: 24px; height: 22px; font-size: 12px; cursor: pointer; }

.cuts { display: grid; gap: 12px; margin-top: 14px; }
.cut-row { display: grid; grid-template-columns: 56px 1fr; gap: 10px; align-items: start; }
.cut-thumb { width: 56px; aspect-ratio: 9 / 16; border-radius: 8px; overflow: hidden; background: var(--cream-2); border: 1px solid var(--line); }
.cut-thumb img { width: 100%; height: 100%; object-fit: cover; }
.cut-thumb.empty { display: grid; place-items: center; font-size: 11px; color: var(--ink-faint); }
.cut-fields { display: grid; gap: 6px; }
.cut-fields .row { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.cut-fields label { display: block; }
.cut-fields .cap { font-size: 14.5px; font-weight: 700; }
.cut-fields .sub { font-size: 13px; }
.cut-fields .mini-label { font-size: 10.5px; color: var(--ink-faint); font-weight: 700; letter-spacing: .03em; display: block; margin-bottom: 2px; }

.render-wrap { display: grid; grid-template-columns: minmax(0, 300px) minmax(0, 1fr); gap: 20px; align-items: start; }
@media (max-width: 720px) { .render-wrap { grid-template-columns: 1fr; } }

.phone-frame {
  position: relative;
  border-radius: 22px;
  overflow: hidden;
  background: #161210;
  box-shadow: var(--shadow-lift);
  aspect-ratio: 9 / 16;
  width: 100%;
  max-width: 300px;
  margin: 0 auto;
}
.phone-frame canvas { display: block; width: 100%; height: 100%; }
.phone-badge {
  position: absolute;
  inset: auto 12px 12px;
  text-align: center;
  font-size: 11.5px;
  line-height: 1.4;
  padding: 7px 10px;
  border-radius: 8px;
  background: rgba(0, 0, 0, .45);
  color: rgba(255, 255, 255, .9);
  backdrop-filter: blur(4px);
}

.render-side { display: grid; gap: 12px; align-content: start; }

.progress { display: flex; align-items: center; gap: 10px; font-size: 12px; color: var(--ink-soft); }
.progress .bar { flex: 1; height: 8px; border-radius: 999px; background: var(--cream-2); overflow: hidden; }
.progress .bar i { display: block; height: 100%; width: 0%; background: linear-gradient(90deg, var(--accent), var(--butter)); transition: width .2s linear; }

.result { display: grid; gap: 10px; }
.result video { width: auto; max-width: 100%; max-height: 420px; display: block; margin: 0 auto; border-radius: 14px; background: #000; }
.result .file-info { font-size: 12.5px; color: var(--ink-soft); display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }

.foot-note { margin-top: 16px; font-size: 12px; color: var(--ink-faint); text-align: center; }

/* ───────────────────────── modal ───────────────────────── */

.modal { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 16px; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(35, 26, 20, .5); backdrop-filter: blur(3px); }
.modal-card {
  position: relative;
  width: min(560px, 100%);
  max-height: min(88vh, 900px);
  display: flex;
  flex-direction: column;
  background: var(--paper);
  border-radius: 22px;
  box-shadow: 0 30px 80px -30px rgba(0, 0, 0, .5);
  overflow: hidden;
  animation: pop .18s ease;
}
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(.99); } to { opacity: 1; transform: none; } }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px 8px; }
.modal-head h2 { font-size: 18px; letter-spacing: -.02em; }
.modal-body { padding: 4px 18px 18px; overflow-y: auto; }
.modal-actions { display: flex; gap: 10px; margin-top: 20px; }
.modal-actions .btn { flex: 1; }

.segmented { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; background: var(--cream-2); border-radius: 12px; padding: 4px; }
.segmented .seg { border: 0; background: transparent; padding: 10px; border-radius: 9px; font-size: 14px; font-weight: 700; color: var(--ink-soft); cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 6px; }
.segmented .seg small { font-size: 10px; font-weight: 700; background: var(--accent-soft); color: var(--accent-deep); padding: 1px 6px; border-radius: 999px; }
.segmented .seg.is-on { background: var(--paper); color: var(--ink); box-shadow: 0 1px 4px rgba(58, 40, 24, .12); }

.key-row { display: flex; gap: 8px; }
.key-row input { flex: 1; }
.key-row .btn { flex: none; }

.tiny-note { margin-top: 12px; font-size: 11.5px; color: var(--ink-faint); line-height: 1.55; }

/* ───────────────────────── toast ───────────────────────── */

.toast-wrap { position: fixed; left: 50%; bottom: calc(20px + var(--safe-bottom)); transform: translateX(-50%); z-index: 80; display: grid; gap: 8px; width: min(420px, calc(100% - 32px)); pointer-events: none; }
.toast {
  background: rgba(42, 33, 28, .94);
  color: #fff8ec;
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 13.5px;
  line-height: 1.45;
  box-shadow: 0 12px 30px -12px rgba(0, 0, 0, .5);
  animation: toastIn .2s ease;
  text-align: center;
}
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ───────────────────────── footer ───────────────────────── */

.app-foot { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; margin-top: 36px; font-size: 11.5px; color: var(--ink-faint); }

/* ───────────────────────── util ───────────────────────── */

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

@media (max-width: 560px) {
  body { font-size: 15.5px; }
  .card { padding: 16px; border-radius: 16px; }
  .panel-intro h1 { font-size: 20px; }
  .tab span { font-size: 12.5px; }
  .tab svg { display: none; }
  .brand-text small { display: none; }
  .actions .btn { flex: 1 1 auto; }
  .modal { padding: 0; align-items: end; }
  .modal-card { border-radius: 22px 22px 0 0; max-height: 92vh; width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
