@import url("https://fonts.googleapis.com/css2?family=Be+Vietnam+Pro:wght@400;500;600;700;800&display=swap");

:root {
  color-scheme: light;
  --ink: #0b1830;
  --ink-soft: #42506a;
  --paper: #f5f8fb;
  --card: #ffffff;
  --line: #dce5ee;
  --cyan: #65d9e7;
  --cyan-deep: #0c8394;
  --gold: #d9aa52;
  --gold-soft: #fff1cc;
  --danger: #b54735;
  --success: #18765b;
  --shadow: 0 14px 40px rgba(16, 35, 62, 0.08);
  --radius-lg: 24px;
  --radius-md: 17px;
  --radius-sm: 12px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  margin: 0;
  background:
    radial-gradient(circle at 12% -5%, rgba(101, 217, 231, 0.2), transparent 27rem),
    var(--paper);
  color: var(--ink);
  font-family: "Be Vietnam Pro", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.5;
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
}

button:focus-visible,
input:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(12, 131, 148, 0.35);
  outline-offset: 2px;
}

.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;
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: 12px;
  left: 12px;
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--ink);
  color: white;
  transform: translateY(-150%);
}

.skip-link:focus {
  transform: translateY(0);
}

.topbar {
  position: sticky;
  z-index: 20;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 78px;
  padding: 12px clamp(18px, 4vw, 52px);
  border-bottom: 1px solid rgba(220, 229, 238, 0.85);
  background: rgba(245, 248, 251, 0.9);
  backdrop-filter: blur(16px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border-radius: 15px;
  background: var(--ink);
  box-shadow: 0 8px 18px rgba(11, 24, 48, 0.2);
}

.brand-mark svg {
  width: 31px;
  fill: none;
  stroke: var(--cyan);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.5px;
}

.brand-mark svg circle:last-child {
  stroke: var(--gold);
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 1.02rem;
  letter-spacing: -0.02em;
}

.brand small {
  margin-top: 1px;
  color: var(--ink-soft);
  font-size: 0.75rem;
}

.mode-switch {
  display: inline-grid;
  grid-template-columns: repeat(3, 1fr);
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #eaf0f5;
}

.mode-button {
  min-height: 40px;
  padding: 8px 16px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #57657a;
  cursor: pointer;
  font-size: 0.84rem;
  font-weight: 700;
  transition: background 160ms ease, color 160ms ease, transform 160ms ease;
}

.mode-button:hover {
  color: var(--ink);
}

.mode-button.is-active {
  background: var(--ink);
  color: white;
  box-shadow: 0 4px 12px rgba(11, 24, 48, 0.18);
}

.app-shell {
  display: grid;
  grid-template-columns: minmax(230px, 280px) minmax(440px, 1fr) minmax(310px, 380px);
  align-items: start;
  gap: 22px;
  width: min(1680px, 100%);
  margin: 0 auto;
  padding: 26px clamp(18px, 3vw, 42px) 44px;
}

.camera-panel,
.detail-panel {
  position: sticky;
  top: 104px;
}

.assistant-workspace {
  min-height: calc(100vh - 150px);
  padding: clamp(16px, 3vw, 25px);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(145deg, rgba(101, 217, 231, 0.1), transparent 35%),
    var(--card);
  box-shadow: var(--shadow);
}

.assistant-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.assistant-heading p {
  max-width: 610px;
  margin: 8px 0 0;
  color: var(--ink-soft);
  font-size: 0.84rem;
}

.local-badge {
  flex: 0 0 auto;
  padding: 7px 10px;
  border: 1px solid #bce9dc;
  border-radius: 999px;
  background: #e8faf4;
  color: var(--success);
  font-size: 0.68rem;
  font-weight: 800;
}

.assistant-context {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 19px;
  padding: 11px 13px;
  border: 1px solid #c9eaf0;
  border-radius: 13px;
  background: #effbfd;
}

.assistant-context svg {
  flex: 0 0 auto;
  width: 27px;
  fill: none;
  stroke: var(--cyan-deep);
  stroke-width: 1.8;
}

.assistant-context small,
.assistant-context strong {
  display: block;
}

.assistant-context small {
  color: #5d7d86;
  font-size: 0.64rem;
  font-weight: 700;
}

.assistant-context strong {
  font-size: 0.78rem;
}

.quick-prompts {
  display: flex;
  gap: 7px;
  margin: 13px 0 16px;
  overflow-x: auto;
  scrollbar-width: none;
}

.quick-prompts::-webkit-scrollbar {
  display: none;
}

.prompt-chip {
  flex: 0 0 auto;
  min-height: 36px;
  padding: 7px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: white;
  color: #516075;
  cursor: pointer;
  font-size: 0.7rem;
  font-weight: 700;
}

.prompt-chip:hover {
  border-color: var(--cyan-deep);
  color: var(--cyan-deep);
}

.assistant-log {
  display: grid;
  align-content: start;
  gap: 11px;
  min-height: 260px;
  max-height: calc(100vh - 475px);
  overflow-y: auto;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #f6f8fb;
  scrollbar-width: thin;
}

.chat-empty {
  display: grid;
  min-height: 230px;
  place-items: center;
  color: #7a8798;
  text-align: center;
}

.chat-empty div {
  max-width: 360px;
}

.chat-empty strong,
.chat-empty span {
  display: block;
}

.chat-empty strong {
  color: var(--ink);
  font-size: 0.84rem;
}

.chat-empty span {
  margin-top: 6px;
  font-size: 0.71rem;
}

.chat-message {
  max-width: 88%;
  padding: 11px 12px;
  border-radius: 14px;
  font-size: 0.73rem;
  line-height: 1.55;
}

.chat-message.is-user {
  justify-self: end;
  border-bottom-right-radius: 4px;
  background: var(--ink);
  color: white;
}

.chat-message.is-assistant {
  justify-self: start;
  border: 1px solid #d6e1e9;
  border-bottom-left-radius: 4px;
  background: white;
  color: #344258;
}

.chat-message h3 {
  margin: 0 0 7px;
  color: var(--ink);
  font-size: 0.82rem;
}

.chat-message p {
  margin: 0 0 7px;
}

.chat-message ol,
.chat-message ul {
  margin: 7px 0 4px;
  padding-left: 20px;
}

.chat-message li + li {
  margin-top: 4px;
}

.assistant-result-note {
  margin-top: 8px;
  padding: 8px 9px;
  border-radius: 9px;
  background: #fff6df;
  color: #72501e;
  font-size: 0.67rem;
}

.apply-tone-button {
  margin-top: 9px;
  padding: 7px 10px;
  border: 0;
  border-radius: 9px;
  background: #e4f7f9;
  color: var(--cyan-deep);
  cursor: pointer;
  font-size: 0.68rem;
  font-weight: 800;
}

.assistant-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 9px;
  margin-top: 11px;
}

.assistant-form textarea {
  width: 100%;
  min-height: 76px;
  max-height: 170px;
  padding: 12px 13px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 13px;
  outline: 0;
  background: white;
  color: var(--ink);
  font: inherit;
  font-size: 0.78rem;
  line-height: 1.5;
}

.assistant-form textarea:focus {
  border-color: var(--cyan-deep);
  box-shadow: 0 0 0 3px rgba(12, 131, 148, 0.1);
}

.assistant-form .primary-button {
  min-height: 48px;
  white-space: nowrap;
}

.assistant-privacy {
  margin: 7px 0 0;
  color: #8792a2;
  font-size: 0.61rem;
  text-align: right;
}

.camera-panel,
.detail-panel,
.tone-panel {
  min-width: 0;
}

.camera-panel,
.detail-panel {
  max-height: calc(100vh - 126px);
  overflow: auto;
  scrollbar-width: thin;
}

.panel-heading,
.tone-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.step-kicker {
  display: block;
  margin-bottom: 3px;
  color: var(--cyan-deep);
  font-size: 0.73rem;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1,
h2 {
  margin-bottom: 0;
  font-size: clamp(1.3rem, 2vw, 1.75rem);
  line-height: 1.22;
  letter-spacing: -0.035em;
}

.count-pill,
.mini-badge,
.recipe-badge,
.tone-code {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 800;
}

.count-pill {
  padding: 6px 9px;
  background: #e4f7f9;
  color: var(--cyan-deep);
}

.search-box {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 18px 0 12px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--card);
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.search-box:focus-within {
  border-color: var(--cyan-deep);
  box-shadow: 0 0 0 3px rgba(12, 131, 148, 0.1);
}

.search-box svg {
  width: 20px;
  fill: none;
  stroke: #718096;
  stroke-linecap: round;
  stroke-width: 1.8;
}

.search-box input {
  width: 100%;
  min-height: 44px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-size: 0.88rem;
}

.brand-tabs,
.category-scroller {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  scrollbar-width: none;
}

.brand-tabs::-webkit-scrollbar,
.category-scroller::-webkit-scrollbar {
  display: none;
}

.filter-chip {
  min-height: 36px;
  padding: 7px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
  color: #5b687a;
  cursor: pointer;
  font-size: 0.76rem;
  font-weight: 700;
  white-space: nowrap;
}

.filter-chip:hover,
.filter-chip.is-active {
  border-color: var(--ink);
  background: var(--ink);
  color: white;
}

.camera-list {
  display: grid;
  gap: 8px;
  margin-top: 13px;
  padding-bottom: 8px;
}

.camera-option {
  display: grid;
  grid-template-columns: 38px 1fr auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 58px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--card);
  text-align: left;
  cursor: pointer;
  transition: border-color 150ms ease, box-shadow 150ms ease, transform 150ms ease;
}

.camera-option:hover {
  transform: translateY(-1px);
  border-color: #b5c6d5;
  box-shadow: 0 7px 18px rgba(16, 35, 62, 0.07);
}

.camera-option.is-active {
  border-color: var(--cyan-deep);
  background: linear-gradient(135deg, #fff, #effbfd);
  box-shadow: 0 0 0 2px rgba(12, 131, 148, 0.1);
}

.camera-icon {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 11px;
  background: #edf2f7;
  color: var(--ink);
}

.camera-icon svg {
  width: 25px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
}

.camera-name,
.camera-meta {
  display: block;
}

.camera-name {
  font-size: 0.84rem;
  font-weight: 800;
}

.camera-meta {
  margin-top: 2px;
  overflow: hidden;
  color: #738095;
  font-size: 0.67rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.camera-arrow {
  color: #9aa6b6;
  font-size: 1.1rem;
}

.empty-state {
  padding: 28px 14px;
  border: 1px dashed #bcc9d5;
  border-radius: 14px;
  color: var(--ink-soft);
  text-align: center;
  font-size: 0.84rem;
}

.tone-panel {
  padding: 2px 0;
}

.tone-header p {
  margin: 7px 0 0;
  color: var(--ink-soft);
  font-size: 0.87rem;
}

.ghost-button,
.secondary-button,
.primary-button,
.icon-button {
  border-radius: 12px;
  cursor: pointer;
  font-weight: 800;
}

.ghost-button {
  flex: 0 0 auto;
  min-height: 40px;
  padding: 8px 13px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink-soft);
  font-size: 0.8rem;
}

.ghost-button:hover,
.secondary-button:hover {
  border-color: #9babbc;
  color: var(--ink);
}

.category-scroller {
  margin: 19px 0 15px;
  padding-bottom: 2px;
}

.tone-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 13px;
}

.tone-card {
  position: relative;
  min-width: 0;
  overflow: hidden;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--card);
  text-align: left;
  cursor: pointer;
  box-shadow: 0 5px 18px rgba(16, 35, 62, 0.04);
  transition: transform 170ms ease, border-color 170ms ease, box-shadow 170ms ease;
}

.tone-card:hover {
  transform: translateY(-3px);
  border-color: #b0bfce;
  box-shadow: 0 14px 28px rgba(16, 35, 62, 0.1);
}

.tone-card.is-active {
  border-color: var(--cyan-deep);
  box-shadow: 0 0 0 2px rgba(12, 131, 148, 0.14), 0 14px 28px rgba(16, 35, 62, 0.1);
}

.tone-preview {
  position: relative;
  height: 116px;
  overflow: hidden;
  background: var(--tone-gradient);
}

.tone-preview::before,
.tone-preview::after {
  position: absolute;
  content: "";
}

.tone-preview::before {
  right: 12%;
  bottom: -28%;
  width: 62%;
  height: 94%;
  border-radius: 50% 50% 28% 28%;
  background: rgba(255, 255, 255, 0.26);
  filter: blur(1px);
  transform: rotate(-10deg);
}

.tone-preview::after {
  top: 19%;
  left: 11%;
  width: 26%;
  height: 56%;
  border-radius: 50% 50% 45% 45%;
  background: rgba(6, 18, 38, 0.28);
  box-shadow: 18px 13px 0 rgba(255, 255, 255, 0.17);
  transform: rotate(12deg);
}

.preview-label {
  position: absolute;
  z-index: 2;
  right: 9px;
  bottom: 8px;
  padding: 4px 7px;
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: 999px;
  background: rgba(11, 24, 48, 0.52);
  color: white;
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  backdrop-filter: blur(5px);
}

.hot-badge {
  position: absolute;
  z-index: 3;
  top: 9px;
  left: 9px;
  padding: 5px 8px;
  border-radius: 999px;
  background: var(--gold-soft);
  color: #7b5215;
  font-size: 0.62rem;
  font-weight: 900;
  letter-spacing: 0.05em;
}

.limited-badge {
  position: absolute;
  z-index: 3;
  top: 9px;
  right: 9px;
  padding: 5px 7px;
  border-radius: 999px;
  background: rgba(11, 24, 48, 0.78);
  color: white;
  font-size: 0.58rem;
  font-weight: 800;
}

.tone-body {
  padding: 12px 12px 13px;
}

.tone-body h3 {
  min-height: 2.45em;
  margin-bottom: 6px;
  font-size: 0.86rem;
  line-height: 1.25;
  letter-spacing: -0.02em;
}

.tone-body p {
  display: -webkit-box;
  min-height: 2.8em;
  margin-bottom: 10px;
  overflow: hidden;
  color: #667489;
  font-size: 0.7rem;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.tone-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.tone-code {
  color: #758195;
  font-size: 0.62rem;
}

.tone-palette {
  display: flex;
  flex-direction: row-reverse;
}

.tone-palette i {
  display: block;
  width: 15px;
  height: 15px;
  margin-left: -4px;
  border: 2px solid white;
  border-radius: 50%;
  background: var(--chip);
  box-shadow: 0 1px 4px rgba(11, 24, 48, 0.2);
}

.detail-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--card);
  box-shadow: var(--shadow);
}

.detail-cover {
  position: relative;
  min-height: 154px;
  padding: 17px;
  overflow: hidden;
  border-radius: 23px 23px 0 0;
  background: var(--tone-gradient);
  color: white;
}

.detail-cover::after {
  position: absolute;
  right: -24px;
  bottom: -58px;
  width: 180px;
  height: 180px;
  border: 36px solid rgba(255, 255, 255, 0.13);
  border-radius: 50%;
  content: "";
}

.detail-cover-top,
.detail-cover-copy {
  position: relative;
  z-index: 2;
}

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

.detail-close {
  display: none;
  width: 34px;
  height: 34px;
  padding: 0;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.38);
  border-radius: 10px;
  background: rgba(11, 24, 48, 0.34);
  color: white;
  cursor: pointer;
  font-size: 1.2rem;
  line-height: 1;
}

.recipe-badge {
  padding: 5px 8px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(11, 24, 48, 0.3);
  color: white;
  backdrop-filter: blur(5px);
}

.detail-cover-copy {
  margin-top: 30px;
}

.detail-cover-copy small {
  display: block;
  margin-bottom: 2px;
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.71rem;
  font-weight: 700;
}

.detail-cover-copy h2 {
  max-width: 86%;
  font-size: 1.45rem;
  text-shadow: 0 2px 12px rgba(11, 24, 48, 0.2);
}

.detail-body {
  padding: 17px;
}

.selection-line {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 15px;
  padding: 10px 11px;
  border-radius: 12px;
  background: #f0f5f8;
}

.selection-line svg {
  flex: 0 0 auto;
  width: 24px;
  fill: none;
  stroke: var(--cyan-deep);
  stroke-width: 1.8;
}

.selection-line span,
.selection-line strong {
  display: block;
}

.selection-line span {
  color: #718095;
  font-size: 0.66rem;
}

.selection-line strong {
  font-size: 0.8rem;
}

.info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
  margin-bottom: 14px;
}

.info-tile {
  min-width: 0;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.info-tile small,
.info-tile strong {
  display: block;
}

.info-tile small {
  margin-bottom: 3px;
  color: #7a8798;
  font-size: 0.64rem;
  font-weight: 700;
}

.info-tile strong {
  font-size: 0.75rem;
  line-height: 1.4;
}

.notice {
  margin: 12px 0;
  padding: 11px 12px;
  border-left: 4px solid var(--gold);
  border-radius: 9px;
  background: #fff8e8;
  color: #694d20;
  font-size: 0.7rem;
  line-height: 1.5;
}

.notice.is-warning {
  border-left-color: #cc725f;
  background: #fff1ed;
  color: #7e3e31;
}

.action-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
  margin-top: 14px;
}

.primary-button,
.secondary-button {
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid transparent;
  font-size: 0.76rem;
}

.primary-button {
  background: var(--ink);
  color: white;
  box-shadow: 0 7px 16px rgba(11, 24, 48, 0.18);
}

.primary-button:hover {
  background: #162846;
}

.primary-button.is-done {
  background: var(--success);
}

.secondary-button {
  border-color: var(--line);
  background: white;
  color: var(--ink-soft);
}

.mode-hint {
  margin: 13px 0 0;
  color: #7a8798;
  font-size: 0.65rem;
  text-align: center;
}

.staff-intro {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 11px;
}

.staff-intro h3 {
  margin: 0;
  font-size: 0.91rem;
}

.mini-badge {
  padding: 5px 8px;
  background: #e7f7f7;
  color: var(--cyan-deep);
}

.formula-list {
  display: grid;
  gap: 6px;
  margin: 0;
}

.formula-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 39px;
  padding: 7px 10px;
  border-radius: 10px;
  background: #f4f7fa;
}

.formula-row dt {
  color: #67758a;
  font-size: 0.69rem;
  font-weight: 600;
}

.formula-row dd {
  max-width: 166px;
  margin: 0;
  color: var(--ink);
  font-size: 0.7rem;
  font-weight: 800;
  text-align: right;
}

.menu-path {
  margin-top: 12px;
  padding: 11px;
  border: 1px dashed #b7c6d4;
  border-radius: 11px;
}

.menu-path small,
.menu-path strong {
  display: block;
}

.menu-path small {
  margin-bottom: 4px;
  color: #778498;
  font-size: 0.62rem;
  font-weight: 700;
}

.menu-path strong {
  font-size: 0.68rem;
  line-height: 1.55;
}

.checklist-title {
  margin: 16px 0 8px;
  font-size: 0.82rem;
}

.checklist {
  display: grid;
  gap: 7px;
}

.check-item {
  display: grid;
  grid-template-columns: 19px 1fr;
  align-items: start;
  gap: 8px;
  color: #526075;
  cursor: pointer;
  font-size: 0.68rem;
}

.check-item input {
  width: 17px;
  height: 17px;
  margin: 1px 0 0;
  accent-color: var(--success);
}

.staff-source {
  margin-top: 12px;
  color: #8590a1;
  font-size: 0.6rem;
  line-height: 1.5;
}

.mobile-selection {
  display: none;
}

.toast {
  position: fixed;
  z-index: 80;
  right: 22px;
  bottom: 22px;
  max-width: min(360px, calc(100vw - 32px));
  padding: 11px 15px;
  border-radius: 12px;
  background: var(--ink);
  color: white;
  font-size: 0.78rem;
  font-weight: 700;
  box-shadow: 0 14px 34px rgba(11, 24, 48, 0.25);
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.guide-dialog {
  width: min(560px, calc(100vw - 28px));
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 22px;
  background: white;
  color: var(--ink);
  box-shadow: 0 24px 90px rgba(11, 24, 48, 0.3);
}

.guide-dialog::backdrop {
  background: rgba(4, 13, 29, 0.58);
  backdrop-filter: blur(5px);
}

.dialog-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 20px 14px;
}

.dialog-head h2 {
  font-size: 1.35rem;
}

.icon-button {
  display: grid;
  flex: 0 0 auto;
  width: 39px;
  height: 39px;
  padding: 0;
  place-items: center;
  border: 1px solid var(--line);
  background: white;
  font-size: 1.35rem;
  line-height: 1;
}

.guide-steps {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 8px 25px 16px 54px;
}

.guide-steps li {
  padding-left: 4px;
}

.guide-steps li::marker {
  color: var(--cyan-deep);
  font-weight: 900;
}

.guide-steps strong,
.guide-steps span {
  display: block;
}

.guide-steps strong {
  font-size: 0.83rem;
}

.guide-steps span {
  margin-top: 2px;
  color: var(--ink-soft);
  font-size: 0.73rem;
}

.dialog-note {
  padding: 15px 20px 18px;
  background: #fff8e8;
  color: #6a4c1f;
  font-size: 0.72rem;
  line-height: 1.6;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 18px clamp(18px, 4vw, 52px) 28px;
  border-top: 1px solid var(--line);
  color: #7a8798;
  font-size: 0.68rem;
}

@media (max-width: 1260px) {
  .app-shell {
    grid-template-columns: minmax(220px, 250px) minmax(420px, 1fr) minmax(290px, 330px);
    gap: 16px;
  }

  .tone-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 960px) {
  body {
    padding-bottom: 82px;
  }

  .app-shell {
    grid-template-columns: minmax(210px, 250px) 1fr;
  }

  .detail-panel {
    position: fixed;
    z-index: 50;
    inset: auto 10px 10px;
    max-height: min(78vh, 780px);
    border-radius: 24px;
    opacity: 0;
    pointer-events: none;
    transform: translateY(calc(100% + 24px));
    transition: opacity 200ms ease, transform 230ms ease;
  }

  .detail-panel.is-mobile-open {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
  }

  .detail-close {
    display: grid;
  }

  .detail-panel.is-mobile-open::before {
    position: fixed;
    z-index: -1;
    inset: -100vh -20px -20px;
    background: rgba(4, 13, 29, 0.5);
    content: "";
  }

  .mobile-selection {
    position: fixed;
    z-index: 40;
    right: 10px;
    bottom: 10px;
    left: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    min-height: 62px;
    padding: 10px 14px;
    border: 0;
    border-radius: 18px;
    background: var(--ink);
    color: white;
    text-align: left;
    box-shadow: 0 16px 35px rgba(11, 24, 48, 0.28);
  }

  .mobile-selection small,
  .mobile-selection strong {
    display: block;
  }

  .mobile-selection small {
    color: #9eb1c9;
    font-size: 0.59rem;
  }

  .mobile-selection strong {
    max-width: 58vw;
    overflow: hidden;
    font-size: 0.72rem;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mobile-selection > span:last-child {
    color: var(--cyan);
    font-size: 0.68rem;
    font-weight: 800;
    white-space: nowrap;
  }

  .site-footer {
    padding-bottom: 14px;
  }
}

@media (max-width: 690px) {
  .topbar {
    align-items: stretch;
    flex-direction: column;
    gap: 10px;
    min-height: auto;
    padding: 10px 14px 12px;
  }

  .brand-mark {
    width: 40px;
    height: 40px;
    border-radius: 13px;
  }

  .brand-mark svg {
    width: 27px;
  }

  .mode-switch {
    width: 100%;
  }

  .mode-button {
    min-height: 37px;
    padding: 7px 9px;
    font-size: 0.75rem;
  }

  .assistant-workspace {
    min-height: 640px;
    padding: 14px;
  }

  .assistant-heading p {
    font-size: 0.73rem;
  }

  .local-badge {
    padding: 6px 8px;
    font-size: 0.6rem;
  }

  .quick-prompts {
    margin-right: -14px;
    padding-right: 14px;
  }

  .assistant-log {
    min-height: 300px;
    max-height: 48vh;
  }

  .assistant-form {
    grid-template-columns: 1fr;
  }

  .assistant-form .primary-button {
    width: 100%;
  }

  .app-shell {
    display: block;
    padding: 19px 14px 30px;
  }

  .camera-panel {
    position: static;
    max-height: none;
    overflow: visible;
  }

  .camera-list {
    display: flex;
    margin-right: -14px;
    padding-right: 14px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
  }

  .camera-list::-webkit-scrollbar {
    display: none;
  }

  .camera-option {
    flex: 0 0 196px;
    scroll-snap-align: start;
  }

  .tone-panel {
    margin-top: 26px;
  }

  .tone-header {
    align-items: center;
  }

  .tone-header p {
    font-size: 0.75rem;
  }

  .ghost-button {
    min-height: 38px;
    padding: 7px 10px;
    font-size: 0.72rem;
  }

  .category-scroller {
    margin-right: -14px;
    padding-right: 14px;
  }

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

  .tone-preview {
    height: 104px;
  }

  .tone-body {
    padding: 10px;
  }

  .tone-body h3 {
    font-size: 0.78rem;
  }

  .tone-body p {
    font-size: 0.65rem;
  }

  .detail-panel {
    inset: auto 7px 7px;
    max-height: 84vh;
  }

  .detail-cover {
    min-height: 133px;
    padding: 14px;
  }

  .detail-cover-copy {
    margin-top: 21px;
  }

  .detail-cover-copy h2 {
    font-size: 1.22rem;
  }

  .detail-body {
    padding: 14px;
  }

  .site-footer {
    display: grid;
    gap: 5px;
    padding: 14px 14px 0;
  }
}

@media (max-width: 390px) {
  .tone-grid {
    grid-template-columns: 1fr;
  }

  .tone-preview {
    height: 126px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
