:root {
  --ink: #1c2320;
  --ink-soft: #5f6b65;
  --paper: #f5f2ea;
  --paper-strong: #fffdf8;
  --line: #ddd8cc;
  --line-strong: #c8c1b2;
  --jade: #1c7561;
  --jade-deep: #125343;
  --jade-soft: #dbeee7;
  --coral: #e96f51;
  --coral-soft: #f9e2db;
  --amber: #b87513;
  --amber-soft: #f7ead2;
  --danger: #b74332;
  --danger-soft: #f8dfda;
  --shadow: 0 34px 80px rgba(25, 31, 28, 0.22);
  --sans: "Segoe UI", "Microsoft YaHei UI", "PingFang SC", "Noto Sans SC", sans-serif;
  --mono: "Cascadia Code", "SFMono-Regular", Consolas, monospace;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: #dedbd2;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  color: var(--ink);
  font-family: var(--sans);
  background-color: #e6e2d8;
  background-image:
    linear-gradient(rgba(43, 57, 51, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(43, 57, 51, 0.045) 1px, transparent 1px);
  background-size: 32px 32px;
}

.bootstrap-status {
  position: fixed;
  z-index: 1000;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 28px;
  color: var(--ink);
  background: var(--paper);
  text-align: center;
}

.bootstrap-status::before {
  content: "";
  width: 30px;
  height: 30px;
  margin-bottom: 5px;
  border: 3px solid rgba(28, 117, 97, 0.18);
  border-top-color: var(--jade);
  border-radius: 50%;
  animation: spin 850ms linear infinite;
}

.bootstrap-status strong {
  font-size: 18px;
}

.bootstrap-status > span {
  max-width: 320px;
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.6;
}

.bootstrap-check-link {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 5px;
  padding: 8px 14px;
  border: 1px solid rgba(28, 117, 97, 0.3);
  border-radius: 8px;
  color: var(--jade-dark);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}

.bootstrap-status.is-hidden {
  display: none;
}

.bootstrap-status.is-error::before {
  width: 34px;
  height: 3px;
  border: 0;
  border-radius: 2px;
  background: var(--danger);
  animation: none;
}

.service-warning {
  position: fixed;
  z-index: 1100;
  top: max(12px, env(safe-area-inset-top, 0px));
  left: 50%;
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) auto;
  align-items: start;
  gap: 10px;
  width: min(620px, calc(100vw - 24px));
  padding: 13px;
  border: 1px solid #d8b78d;
  border-radius: 10px;
  color: #4c3824;
  background: #fff8e9;
  box-shadow: 0 14px 38px rgba(60, 44, 25, 0.2);
  transform: translateX(-50%);
}

.service-warning-mark {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  color: #fffaf0;
  background: #a56b22;
  font-size: 17px;
  font-weight: 800;
}

.service-warning-copy {
  min-width: 0;
}

.service-warning-copy strong {
  display: block;
  margin: 1px 0 4px;
  font-size: 13px;
  line-height: 1.35;
}

.service-warning-copy p {
  margin: 0;
  color: #6e5840;
  font-size: 10px;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.service-warning-copy .service-warning-next {
  margin-top: 4px;
  color: #826a4f;
}

.service-warning-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 8px;
}

.service-warning-actions button,
.service-warning-actions a,
.service-warning-dismiss {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 5px 9px;
  border: 1px solid rgba(116, 75, 30, 0.28);
  border-radius: 7px;
  color: #71491e;
  background: rgba(255, 255, 255, 0.62);
  font: inherit;
  font-size: 9px;
  font-weight: 750;
  text-decoration: none;
  cursor: pointer;
}

.service-warning-actions button {
  color: #fffaf0;
  background: #82551f;
}

.service-warning-actions button:disabled {
  opacity: 0.62;
}

.service-warning-dismiss {
  min-width: 44px;
  border-color: transparent;
  color: #7a6650;
  background: transparent;
}

button,
input,
textarea {
  font: inherit;
}

button {
  color: inherit;
}

button,
input,
label {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(28, 117, 97, 0.28);
  outline-offset: 2px;
}

button:disabled {
  cursor: wait;
}

svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.workspace {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 26px 20px 16px;
}

.phone {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.phone-frame {
  width: min(410px, calc(100vw - 40px));
  height: min(842px, calc(100vh - 78px));
  height: min(842px, calc(100dvh - 78px));
  min-height: 620px;
  position: relative;
  min-width: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.phone-frame::before,
.phone-frame::after {
  display: none;
  content: none;
}

.phone-screen {
  position: relative;
  width: 100%;
  height: 100%;
  min-width: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 38px;
  background: var(--paper);
  box-shadow: 0 32px 76px rgba(45, 74, 91, 0.24);
  container-name: phone-screen;
  container-type: size;
  isolation: isolate;
}

.phone-screen:has(.home-view.is-active) {
  background: #d7edf9;
}

.phone-screen::after {
  content: "";
  position: absolute;
  z-index: 40;
  top: 9px;
  left: 50%;
  width: 103px;
  height: 27px;
  border-radius: 999px;
  background: #101211;
  transform: translateX(-50%);
  pointer-events: none;
}

.status-bar {
  position: relative;
  z-index: 30;
  flex: 0 0 48px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 13px 21px 0;
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
}

.status-time {
  padding-top: 1px;
}

.status-indicators {
  display: flex;
  align-items: center;
  gap: 6px;
}

.status-indicators svg {
  width: 15px;
  height: 15px;
  stroke-width: 2.2;
}

.status-indicators svg:nth-child(2) {
  width: 16px;
}

.battery {
  width: 23px;
  height: 11px;
  padding: 2px;
  border: 1.5px solid currentColor;
  border-radius: 3px;
}

.battery span {
  display: block;
  width: 72%;
  height: 100%;
  border-radius: 1px;
  background: currentColor;
}

.screen-content {
  position: relative;
  flex: 1;
  min-height: 0;
  min-width: 0;
  overflow: hidden;
}

.view {
  position: absolute;
  inset: 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transform: translateX(18px);
  transition:
    opacity 180ms ease,
    transform 240ms ease,
    visibility 180ms ease;
}

.view.is-active {
  opacity: 1;
  visibility: visible;
  transform: translateX(0);
}

.home-view {
  padding: 6px 19px 17px;
  color: #23465c;
  background: #d7edf9;
  background-position: center;
  background-repeat: no-repeat;
  background-size: 100% 100%;
}

.home-wallpaper {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background:
    linear-gradient(155deg, rgba(255, 255, 255, 0.5), transparent 46%),
    linear-gradient(180deg, #dceffb 0%, #d2eafa 56%, #c8e3f4 100%);
  background-position: center;
  background-repeat: no-repeat;
  background-size: 100% 100%;
  pointer-events: none;
}

.wallpaper-line {
  position: absolute;
  display: block;
  border: 1px solid rgba(66, 120, 151, 0.14);
  border-radius: 50%;
}

.line-one {
  width: 92.68%;
  max-width: 92.68cqh;
  aspect-ratio: 1;
  top: 5.29%;
  right: -59.02%;
}

.line-two {
  width: 65.85%;
  max-width: 65.85cqh;
  aspect-ratio: 1;
  top: 12.09%;
  right: -46.34%;
}

.wallpaper-tile {
  position: absolute;
  display: block;
  border-radius: 22px;
  transform: rotate(17deg);
  opacity: 0.9;
}

.tile-one {
  width: 28.78%;
  max-width: 28.78cqh;
  aspect-ratio: 1;
  top: 30.86%;
  right: -14.63%;
  border: 1px solid rgba(228, 151, 126, 0.24);
  background: rgba(255, 189, 165, 0.28);
}

.tile-two {
  width: 15.12%;
  max-width: 15.12cqh;
  aspect-ratio: 1;
  top: 40.30%;
  right: 12.68%;
  border: 1px solid rgba(96, 169, 139, 0.2);
  background: rgba(189, 232, 211, 0.42);
}

.home-top,
.home-section-heading,
.device-summary,
.app-grid,
.home-note {
  position: relative;
  z-index: 2;
}

.home-top {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 2px 18px;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--ink-soft);
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.home-top .eyebrow {
  color: #5f8399;
}

.home-top h1 {
  margin: 0;
  font-size: 26px;
  line-height: 1.1;
  letter-spacing: 0;
}

.round-icon-button {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 1px solid rgba(74, 125, 154, 0.16);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.58);
  color: #315a72;
  box-shadow: 0 8px 20px rgba(73, 119, 145, 0.1);
  cursor: pointer;
  backdrop-filter: blur(12px);
  transition:
    background 160ms ease,
    transform 160ms ease;
}

.round-icon-button:hover {
  background: rgba(255, 255, 255, 0.82);
  transform: translateY(-1px);
}

.device-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.54);
  color: inherit;
  font: inherit;
  text-align: left;
  box-shadow: 0 12px 30px rgba(60, 105, 130, 0.11);
  backdrop-filter: blur(16px);
  appearance: none;
  cursor: pointer;
  transition:
    background 160ms ease,
    transform 160ms ease;
}

.device-summary:hover {
  background: rgba(255, 255, 255, 0.72);
  transform: translateY(-1px);
}

.device-summary:active {
  transform: translateY(0);
}

.device-summary:focus-visible {
  outline: 3px solid rgba(65, 139, 170, 0.36);
  outline-offset: 2px;
}

.summary-heading {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.summary-copy {
  min-width: 0;
}

.signal-orb {
  display: grid;
  place-items: center;
  flex: 0 0 42px;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  color: #a76631;
  background: rgba(248, 208, 154, 0.46);
  transition:
    color 180ms ease,
    background 180ms ease;
}

.signal-orb.is-connected {
  color: #277a62;
  background: rgba(164, 220, 196, 0.55);
}

.summary-kicker {
  display: block;
  margin: 0 0 3px;
  color: #668397;
  font-size: 10px;
}

.summary-heading strong {
  display: block;
  overflow: hidden;
  color: #24485d;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.text-link {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
  gap: 4px;
  padding: 7px 0;
  border: 0;
  background: transparent;
  color: #315f78;
  font-size: 11px;
  font-weight: 700;
  pointer-events: none;
}

.text-link svg {
  width: 14px;
  height: 14px;
}

.home-section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 20px 3px 13px;
  color: #587a8f;
  font-size: 11px;
  font-weight: 600;
}

.date-label {
  font-family: var(--mono);
  font-size: 9px;
}

.app-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 17px 12px;
}

.app-icon-button {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: #2c5065;
  font-size: 10px;
  cursor: pointer;
}

.app-icon-button:hover .app-icon {
  transform: translateY(-3px);
}

.app-icon-button.is-disabled {
  color: #7892a1;
  cursor: not-allowed;
}

.app-icon {
  display: grid;
  place-items: center;
  width: 55px;
  height: 55px;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 16px;
  box-shadow:
    0 10px 18px rgba(61, 106, 131, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.55);
  transition: transform 160ms ease;
}

.app-icon svg {
  width: 23px;
  height: 23px;
}

.app-guide {
  background: #a4d4c1;
  color: #265448;
}

.app-chat {
  background: #f2d8a4;
  color: #584a2f;
}

.app-settings {
  background: #efc2cc;
  color: #6b3f49;
}

.soon-label {
  position: absolute;
  top: -3px;
  right: -2px;
  padding: 2px 5px;
  border-radius: 999px;
  color: #16362d;
  background: #e8c17f;
  font-size: 7px;
  font-weight: 800;
}

.home-note {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin-top: auto;
  margin-bottom: 14px;
  padding: 12px 13px;
  border-top: 1px solid rgba(61, 112, 140, 0.14);
  border-bottom: 1px solid rgba(61, 112, 140, 0.14);
  color: #527489;
}

.home-note svg {
  flex: 0 0 16px;
  width: 16px;
  height: 16px;
  margin-top: 1px;
}

.home-note p {
  margin: 0;
  font-size: 9px;
  line-height: 1.55;
}

.settings-view,
.guide-view,
.chat-view {
  background: var(--paper);
}

.is-hidden {
  display: none !important;
}

.app-header {
  position: relative;
  z-index: 2;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 17px 13px;
  border-bottom: 1px solid var(--line);
  background: rgba(245, 242, 234, 0.94);
  backdrop-filter: blur(16px);
}

.app-header h1 {
  margin: 0;
  font-size: 21px;
  line-height: 1.1;
}

.app-header .eyebrow {
  margin-bottom: 3px;
}

.back-button {
  display: grid;
  place-items: center;
  flex: 0 0 37px;
  width: 37px;
  height: 37px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--ink);
  background: var(--paper-strong);
  cursor: pointer;
}

.back-button:hover {
  border-color: var(--line-strong);
}

.header-status {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-left: auto;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink-soft);
  background: var(--paper-strong);
  font-size: 9px;
  font-weight: 700;
}

.header-status.is-connected {
  color: var(--jade-deep);
  border-color: #b7d7cc;
  background: var(--jade-soft);
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #b6b0a5;
}

.header-status.is-connected .status-dot {
  background: #2b9b79;
  box-shadow: 0 0 0 3px rgba(43, 155, 121, 0.13);
}

.settings-scroll,
.guide-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: #bdb7ac transparent;
}

.settings-scroll {
  padding: 19px 19px 26px;
}

.connection-intro {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 2px 1px 20px;
}

.intro-icon {
  display: grid;
  place-items: center;
  flex: 0 0 43px;
  width: 43px;
  height: 43px;
  border-radius: 13px;
  color: var(--jade-deep);
  background: var(--jade-soft);
}

.intro-icon svg {
  width: 21px;
  height: 21px;
}

.connection-intro h2 {
  margin: 2px 0 6px;
  font-size: 16px;
  line-height: 1.25;
}

.connection-intro p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 11px;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.connection-intro > div:last-child {
  min-width: 0;
}

.settings-form {
  width: 100%;
  min-width: 0;
  padding-bottom: 2px;
}

.field {
  display: block;
  min-width: 0;
  max-width: 100%;
  margin-bottom: 18px;
}

.field-label {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0 0 8px 1px;
  color: #323a36;
  font-size: 11px;
  font-weight: 750;
}

.field-label svg {
  width: 15px;
  height: 15px;
  color: var(--jade);
}

.field input {
  width: 100%;
  max-width: 100%;
  height: 48px;
  padding: 0 13px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  color: var(--ink);
  background: var(--paper-strong);
  font-family: var(--mono);
  font-size: 11px;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.8);
  transition:
    border-color 150ms ease,
    box-shadow 150ms ease;
}

.field input::placeholder {
  color: #aaa398;
}

.field input:hover {
  border-color: #a9a191;
}

.field input:focus {
  border-color: var(--jade);
  outline: 0;
  box-shadow: 0 0 0 3px rgba(28, 117, 97, 0.12);
}

.field.has-error input {
  border-color: var(--danger);
}

.field-help {
  display: block;
  margin: 6px 1px 0;
  color: #857e72;
  font-size: 9px;
  line-height: 1.45;
}

.field-error {
  display: none;
  margin: 5px 1px 0;
  color: var(--danger);
  font-size: 9px;
  line-height: 1.4;
}

.field.has-error .field-error {
  display: block;
}

.input-with-action {
  position: relative;
  display: block;
  width: 100%;
  min-width: 0;
}

.input-with-action input {
  padding-right: 48px;
}

.field-action {
  position: absolute;
  top: 50%;
  right: 7px;
  display: grid;
  place-items: center;
  width: 35px;
  height: 35px;
  padding: 0;
  border: 0;
  border-radius: 9px;
  color: #767064;
  background: transparent;
  transform: translateY(-50%);
  cursor: pointer;
}

.field-action:hover {
  color: var(--ink);
  background: #eeeae1;
}

.field-action svg {
  width: 18px;
  height: 18px;
}

.primary-button {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 50px;
  padding: 0 18px;
  overflow: hidden;
  border: 0;
  border-radius: 13px;
  color: #f8fffb;
  background: var(--jade-deep);
  box-shadow: 0 10px 22px rgba(18, 83, 67, 0.19);
  font-size: 12px;
  font-weight: 750;
  cursor: pointer;
  transition:
    background 160ms ease,
    transform 160ms ease,
    box-shadow 160ms ease;
}

.primary-button:hover {
  background: #0d493a;
  box-shadow: 0 12px 26px rgba(18, 83, 67, 0.25);
  transform: translateY(-1px);
}

.primary-button:active {
  transform: translateY(0);
}

.button-label {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.button-label svg {
  width: 18px;
  height: 18px;
}

.button-spinner {
  display: none;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 700ms linear infinite;
}

.primary-button.is-loading .button-label {
  display: none;
}

.primary-button.is-loading .button-spinner {
  display: block;
}

.test-result {
  margin-top: 21px;
  padding: 16px;
  border: 1px solid #b9d8cd;
  border-radius: 15px;
  background: #e8f3ee;
}

.test-result.is-error {
  border-color: #e4bab1;
  background: var(--danger-soft);
}

.test-result.is-success {
  border-color: #b9d8cd;
  background: #e8f3ee;
}

.test-result.is-hidden {
  display: none;
}

.result-heading {
  display: flex;
  align-items: center;
  gap: 10px;
}

.result-icon {
  display: grid;
  place-items: center;
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  color: var(--jade-deep);
  background: rgba(255, 255, 255, 0.72);
}

.is-error .result-icon {
  color: var(--danger);
}

.result-icon svg {
  width: 19px;
  height: 19px;
}

.result-kicker {
  margin: 0 0 2px;
  color: var(--ink-soft);
  font-family: var(--mono);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.09em;
}

.result-heading h2 {
  margin: 0;
  font-size: 14px;
  line-height: 1.25;
}

.result-message {
  margin: 12px 0 0;
  color: #4e5e57;
  font-size: 10px;
  line-height: 1.65;
  overflow-wrap: anywhere;
}

.is-error .result-message {
  color: #76473e;
}

.result-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  margin: 12px 0 0;
}

.result-meta:empty {
  display: none;
}

.result-meta div {
  min-width: 0;
  padding: 8px 9px;
  border: 1px solid rgba(68, 101, 89, 0.12);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.48);
}

.result-meta dt {
  margin-bottom: 2px;
  color: #718179;
  font-size: 8px;
}

.result-meta dd {
  margin: 0;
  overflow: hidden;
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.next-step {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 12px;
  padding-top: 11px;
  border-top: 1px solid rgba(104, 69, 60, 0.16);
}

.next-step.is-hidden {
  display: none;
}

.next-step svg {
  flex: 0 0 15px;
  width: 15px;
  height: 15px;
  margin-top: 1px;
  color: #8d5a36;
}

.next-step p {
  margin: 0;
  color: #6b5142;
  font-size: 9px;
  line-height: 1.6;
}

.local-data-panel {
  margin-top: 20px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: rgba(255, 253, 248, 0.68);
}

.local-data-heading {
  display: flex;
  align-items: center;
  gap: 10px;
}

.local-data-icon {
  display: grid;
  place-items: center;
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  color: var(--jade-deep);
  background: var(--jade-soft);
}

.local-data-icon svg {
  width: 18px;
  height: 18px;
}

.local-data-heading > div:nth-child(2) {
  min-width: 0;
  flex: 1;
}

.local-data-heading h2 {
  margin: 1px 0 0;
  font-size: 14px;
}

.local-data-usage {
  flex: 0 0 auto;
  max-width: 112px;
  overflow: hidden;
  padding: 4px 7px;
  border: 1px solid rgba(28, 117, 97, 0.14);
  border-radius: 999px;
  color: #597067;
  background: rgba(219, 238, 231, 0.55);
  font-family: var(--mono);
  font-size: 7px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.local-data-description {
  margin: 11px 0 0;
  color: var(--ink-soft);
  font-size: 9px;
  line-height: 1.6;
}

.local-data-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.local-data-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 0;
  min-height: 38px;
  padding: 7px 9px;
  font-size: 9px;
}

.local-data-button svg {
  flex: 0 0 14px;
  width: 14px;
  height: 14px;
}

.local-data-button:disabled {
  opacity: 0.55;
  cursor: wait;
}

.local-data-status {
  margin-top: 11px;
  padding: 9px 10px;
  border: 1px solid rgba(28, 117, 97, 0.13);
  border-radius: 9px;
  color: #3f5c51;
  background: rgba(219, 238, 231, 0.42);
}

.local-data-status strong {
  display: block;
  font-size: 9px;
}

.local-data-status p,
.local-data-status small {
  display: block;
  margin: 3px 0 0;
  font-size: 8px;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.local-data-status small {
  color: #6e776f;
}

.local-data-status small:empty {
  display: none;
}

.local-data-status.is-error {
  border-color: #e2b8af;
  color: #76473e;
  background: #f9e9e4;
}

.local-data-status.is-error small {
  color: #875f55;
}

.local-data-status.is-success {
  border-color: #b9d8cd;
  color: #285c4d;
  background: #e8f3ee;
}

.privacy-note {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 20px;
  padding: 14px 2px 0;
  border-top: 1px solid var(--line);
}

.privacy-note > svg {
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
  margin-top: 1px;
  color: var(--jade);
}

.privacy-note strong {
  display: block;
  margin-bottom: 4px;
  font-size: 10px;
}

.privacy-note p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 9px;
  line-height: 1.55;
}

.chat-view {
  background:
    linear-gradient(180deg, rgba(255, 253, 248, 0.94), rgba(245, 242, 234, 0.98)),
    var(--paper);
  background-position: center;
  background-repeat: no-repeat;
  background-size: 100% 100%;
}

.chat-header {
  position: relative;
  z-index: 3;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 69px;
  padding: 8px 15px 11px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 253, 248, 0.94);
  backdrop-filter: blur(16px);
}

.chat-contact {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.chat-contact-copy {
  min-width: 0;
}

.chat-contact-copy h1 {
  max-width: 185px;
  margin: 0;
  overflow: hidden;
  font-size: 19px;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-contact-copy .eyebrow {
  margin-bottom: 2px;
  font-size: 7px;
}

.chat-avatar {
  display: grid;
  place-items: center;
  flex: 0 0 42px;
  width: 42px;
  height: 42px;
  overflow: hidden;
  border: 1px solid rgba(30, 64, 52, 0.14);
  border-radius: 50%;
  color: #f8fffb;
  background-color: #4d796a;
  background-position: center;
  background-size: cover;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.35);
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 800;
}

.chat-avatar.has-image {
  color: transparent;
}

.chat-header-avatar {
  flex-basis: 45px;
  width: 45px;
  height: 45px;
}

.chat-api-status {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 3px;
  color: #8a8175;
  font-size: 8px;
  font-weight: 700;
}

.chat-api-status.is-connected {
  color: var(--jade);
}

.chat-api-status.is-connected .status-dot {
  background: #2b9b79;
}

.chat-edit-button {
  display: grid;
  place-items: center;
  flex: 0 0 37px;
  width: 37px;
  height: 37px;
  margin-left: auto;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--ink);
  background: var(--paper-strong);
  cursor: pointer;
}

.chat-edit-button:hover {
  border-color: var(--line-strong);
  background: #f2eee5;
}

.chat-edit-button svg {
  width: 17px;
  height: 17px;
}

.chat-connection-warning {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  margin: 10px 15px 0;
  padding: 9px 10px;
  border: 1px solid #e1c79c;
  border-radius: 11px;
  color: #65481f;
  background: #f9edd8;
  font-size: 9px;
}

.connection-warning-icon {
  display: grid;
  place-items: center;
  flex: 0 0 24px;
  width: 24px;
  height: 24px;
  border-radius: 8px;
  color: #8b5b16;
  background: rgba(255, 255, 255, 0.55);
}

.connection-warning-icon svg {
  width: 14px;
  height: 14px;
}

.chat-connection-warning p {
  flex: 1;
  margin: 0;
  line-height: 1.4;
}

.chat-connection-warning button {
  flex: 0 0 auto;
  padding: 5px 7px;
  border: 1px solid rgba(101, 72, 31, 0.18);
  border-radius: 7px;
  color: #65481f;
  background: rgba(255, 255, 255, 0.55);
  font-size: 8px;
  font-weight: 800;
  cursor: pointer;
}

.chat-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 17px 15px 15px;
  scrollbar-width: thin;
  scrollbar-color: #bdb7ac transparent;
}

.chat-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100%;
  padding: 46px 26px;
  text-align: center;
}

.chat-empty-avatar {
  width: 78px;
  height: 78px;
  margin-bottom: 19px;
  flex-basis: 78px;
  color: #f8fffb;
  background-color: #315f51;
  box-shadow:
    0 18px 34px rgba(29, 70, 57, 0.18),
    inset 0 0 0 3px rgba(255, 255, 255, 0.2);
  font-size: 26px;
}

.chat-empty .eyebrow {
  margin-bottom: 7px;
}

.chat-empty h2 {
  margin: 0 0 8px;
  font-size: 20px;
  line-height: 1.3;
}

.chat-empty > p:last-child {
  max-width: 230px;
  margin: 0;
  color: var(--ink-soft);
  font-size: 10px;
  line-height: 1.65;
}

.message-list {
  display: flex;
  flex-direction: column;
  gap: 15px;
  min-height: 100%;
}

.message-list:empty {
  display: none;
}

.message-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  min-width: 0;
}

.message-row-user {
  justify-content: flex-end;
  padding-left: 36px;
}

.message-row-assistant {
  padding-right: 18px;
}

.message-avatar {
  display: grid;
  place-items: center;
  flex: 0 0 31px;
  width: 31px;
  height: 31px;
  overflow: hidden;
  border: 1px solid rgba(30, 64, 52, 0.13);
  border-radius: 50%;
  color: #f8fffb;
  background-color: #4d796a;
  background-position: center;
  background-size: cover;
  font-size: 11px;
  font-weight: 800;
}

.message-body {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  max-width: min(78%, 252px);
  min-width: 0;
}

.message-row-user .message-body {
  align-items: flex-end;
}

.message-bubble {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 5px 15px 15px;
  color: #26312c;
  background: var(--paper-strong);
  box-shadow: 0 4px 12px rgba(34, 43, 39, 0.05);
  font-size: 11px;
  line-height: 1.65;
  overflow-wrap: anywhere;
}

.user-bubble {
  border-color: #174d40;
  border-radius: 15px 5px 15px 15px;
  color: #f8fffb;
  background: #1c604f;
  box-shadow: 0 5px 14px rgba(20, 76, 61, 0.15);
  white-space: pre-wrap;
}

.assistant-bubbles {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}

.assistant-bubbles .message-bubble:not(:last-child) {
  border-bottom-left-radius: 9px;
}

.message-meta {
  display: flex;
  align-items: center;
  gap: 4px;
  min-height: 22px;
  margin-top: 2px;
  color: #9b9488;
}

.message-row-user .message-meta {
  justify-content: flex-end;
}

.message-time {
  display: block;
  color: #9b9488;
  font-family: var(--mono);
  font-size: 7px;
}

.message-menu {
  position: relative;
  flex: 0 0 auto;
}

.message-menu summary {
  display: grid;
  place-items: center;
  width: 22px;
  height: 20px;
  border-radius: 7px;
  color: #8d867b;
  cursor: pointer;
  list-style: none;
  transition:
    color 150ms ease,
    background 150ms ease;
}

.message-menu summary::-webkit-details-marker {
  display: none;
}

.message-menu summary:hover,
.message-menu[open] summary {
  color: #315f51;
  background: rgba(28, 117, 97, 0.09);
}

.message-menu summary svg {
  width: 15px;
  height: 15px;
}

.message-menu-panel {
  position: absolute;
  z-index: 18;
  right: 0;
  bottom: calc(100% + 5px);
  width: max-content;
  min-width: 112px;
  padding: 4px;
  border: 1px solid #d8d1c5;
  border-radius: 10px;
  background: #fffdf8;
  box-shadow: 0 12px 28px rgba(28, 38, 33, 0.19);
}

.message-row-assistant .message-menu-panel {
  right: auto;
  left: 0;
}

.message-menu-item {
  display: flex;
  align-items: center;
  gap: 7px;
  width: 100%;
  min-height: 30px;
  padding: 6px 8px;
  border: 0;
  border-radius: 7px;
  color: #4f4b43;
  background: transparent;
  font-size: 8px;
  font-weight: 800;
  text-align: left;
  white-space: nowrap;
  cursor: pointer;
}

.message-menu-item:hover {
  color: #245a4a;
  background: #edf4ef;
}

.message-menu-item + .message-menu-item {
  margin-top: 2px;
}

.message-menu-item svg {
  flex: 0 0 13px;
  width: 13px;
  height: 13px;
}

.chat-retraction-notice {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin: 2px 0 1px;
  padding: 10px;
  border: 1px dashed #d4c8b4;
  border-radius: 12px;
  background: #f7f2e8;
}

.retraction-icon {
  display: grid;
  place-items: center;
  flex: 0 0 27px;
  width: 27px;
  height: 27px;
  border-radius: 9px;
  color: #6d755f;
  background: #ebe4d7;
}

.retraction-icon svg {
  width: 14px;
  height: 14px;
}

.retraction-copy {
  min-width: 0;
  flex: 1;
}

.retraction-copy strong {
  display: block;
  color: #4e4a40;
  font-size: 9px;
}

.retraction-copy p {
  margin: 4px 0 0;
  color: #736d61;
  font-size: 8px;
  line-height: 1.55;
}

.retraction-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.regenerate-button,
.delete-turn-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 29px;
  max-width: 100%;
  padding: 6px 9px;
  border-radius: 8px;
  font-size: 8px;
  font-weight: 800;
  line-height: 1.25;
  cursor: pointer;
}

.regenerate-button svg,
.delete-turn-button svg {
  flex: 0 0 13px;
  width: 13px;
  height: 13px;
}

.regenerate-button {
  border: 1px solid #236b56;
  color: #f7fffb;
  background: #236b56;
}

.regenerate-button:hover:not(:disabled) {
  background: #185442;
}

.delete-turn-button {
  border: 1px solid #d8b2a8;
  color: #874f42;
  background: #fffaf7;
}

.delete-turn-button:hover:not(:disabled) {
  border-color: #c18d80;
  background: #f9e8e2;
}

.regenerate-button:disabled,
.delete-turn-button:disabled {
  opacity: 0.55;
  cursor: wait;
}

.message-failure {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  margin: -5px 0 0 39px;
  padding: 10px;
  border: 1px solid #e1b6ad;
  border-radius: 11px;
  background: #f9e9e4;
}

.failure-copy {
  min-width: 0;
  flex: 1;
}

.failure-copy strong {
  display: block;
  margin-bottom: 3px;
  color: #864638;
  font-size: 9px;
}

.failure-copy p,
.failure-copy small {
  display: block;
  margin: 0;
  color: #7b554b;
  font-size: 8px;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.failure-copy small {
  margin-top: 4px;
  color: #8a685e;
}

.retry-button {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 0 0 auto;
  padding: 7px 9px;
  border: 1px solid #d49d90;
  border-radius: 8px;
  color: #824333;
  background: #fff8f5;
  font-size: 8px;
  font-weight: 800;
  cursor: pointer;
}

.retry-button svg {
  width: 12px;
  height: 12px;
}

.chat-typing-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.typing-bubble {
  display: flex;
  align-items: center;
  gap: 4px;
  min-height: 35px;
  padding: 9px 13px;
  border: 1px solid var(--line);
  border-radius: 5px 15px 15px;
  background: var(--paper-strong);
}

.typing-bubble span {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #83958e;
  animation: typing-dot 1.05s ease-in-out infinite;
}

.typing-bubble span:nth-child(2) {
  animation-delay: 120ms;
}

.typing-bubble span:nth-child(3) {
  animation-delay: 240ms;
}

.chat-composer {
  position: relative;
  z-index: 4;
  flex: 0 0 auto;
  padding: 10px 15px 19px;
  border-top: 1px solid var(--line);
  background: rgba(255, 253, 248, 0.96);
  backdrop-filter: blur(16px);
}

.chat-composer-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 28px;
  margin-bottom: 7px;
}

.batch-mode-toggle {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex: 0 0 auto;
  min-height: 28px;
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink-soft);
  background: rgba(255, 253, 248, 0.72);
  font-size: 8px;
  font-weight: 800;
  cursor: pointer;
  transition:
    color 150ms ease,
    border-color 150ms ease,
    background 150ms ease;
}

.batch-mode-toggle svg {
  width: 13px;
  height: 13px;
}

.batch-mode-toggle:hover:not(:disabled) {
  border-color: #9dbdaf;
  color: var(--jade-deep);
}

.batch-mode-toggle.is-active {
  border-color: #8cb8a8;
  color: var(--jade-deep);
  background: var(--jade-soft);
  box-shadow: inset 0 0 0 1px rgba(28, 117, 97, 0.06);
}

.batch-mode-toggle:disabled {
  opacity: 0.56;
  cursor: wait;
}

.chat-pending-actions {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  margin-left: auto;
}

.pending-reply-count {
  flex: 0 0 auto;
  color: #7b6c56;
  font-size: 8px;
  font-weight: 700;
  white-space: nowrap;
}

.batch-reply-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 28px;
  padding: 5px 9px;
  border: 0;
  border-radius: 8px;
  color: #f7fffb;
  background: var(--jade-deep);
  box-shadow: 0 5px 12px rgba(18, 83, 67, 0.16);
  font-size: 8px;
  font-weight: 800;
  white-space: nowrap;
  cursor: pointer;
}

.batch-reply-button svg {
  width: 13px;
  height: 13px;
}

.batch-reply-button:hover:not(:disabled) {
  background: #0d493a;
}

.batch-reply-button:disabled {
  color: #a7aaa3;
  background: #e4e0d7;
  box-shadow: none;
  cursor: wait;
}

.chat-input-row {
  display: flex;
  align-items: flex-end;
  gap: 8px;
}

.chat-input-row textarea {
  flex: 1;
  min-height: 42px;
  max-height: 104px;
  padding: 11px 12px;
  resize: none;
  overflow-y: auto;
  border: 1px solid var(--line-strong);
  border-radius: 13px;
  color: var(--ink);
  background: var(--paper-strong);
  font-size: 11px;
  line-height: 1.55;
  transition:
    border-color 150ms ease,
    box-shadow 150ms ease;
}

.chat-input-row textarea::placeholder {
  color: #aaa398;
}

.chat-input-row textarea:focus {
  border-color: var(--jade);
  outline: 0;
  box-shadow: 0 0 0 3px rgba(28, 117, 97, 0.12);
}

.chat-input-row textarea:disabled {
  color: #8d887f;
  background: #eeeae2;
}

.chat-send {
  display: grid;
  place-items: center;
  flex: 0 0 42px;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 0;
  border-radius: 13px;
  color: #f7fffb;
  background: var(--jade-deep);
  box-shadow: 0 7px 16px rgba(18, 83, 67, 0.18);
  cursor: pointer;
}

.chat-send svg {
  width: 18px;
  height: 18px;
  stroke-width: 2.2;
}

.chat-send:hover:not(:disabled) {
  background: #0d493a;
  transform: translateY(-1px);
}

.chat-send:disabled {
  color: #b2afa6;
  background: #e4e0d7;
  box-shadow: none;
  cursor: not-allowed;
}

.chat-send.is-loading svg {
  animation: spin 900ms linear infinite;
}

.chat-reply-status {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 15px;
  margin: 6px 0 -8px;
  color: var(--jade);
  font-size: 8px;
  font-weight: 700;
}

.reply-pulse {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #2b9b79;
  box-shadow: 0 0 0 0 rgba(43, 155, 121, 0.32);
  animation: reply-pulse 1.3s ease-out infinite;
}

.character-modal {
  position: absolute;
  z-index: 35;
  inset: 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 24px 14px 17px;
  background: rgba(18, 27, 23, 0.48);
  backdrop-filter: blur(4px);
}

.character-modal-card {
  width: 100%;
  max-height: 100%;
  overflow-y: auto;
  padding: 17px;
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: 19px;
  background: var(--paper);
  box-shadow: 0 24px 55px rgba(10, 21, 16, 0.3);
}

.character-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.character-modal-header h2 {
  margin: 0;
  font-size: 18px;
}

.modal-close-button {
  flex: 0 0 36px;
  width: 36px;
  height: 36px;
  border-color: var(--line);
  color: var(--ink);
  background: var(--paper-strong);
  backdrop-filter: none;
}

.modal-close-button:hover {
  background: #eee9df;
}

.character-avatar-editor {
  display: flex;
  align-items: center;
  gap: 13px;
  margin-bottom: 15px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--paper-strong);
}

.character-avatar-preview {
  flex-basis: 62px;
  width: 62px;
  height: 62px;
  font-size: 20px;
}

.character-avatar-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.character-avatar-actions input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.avatar-upload-button,
.clear-avatar-button {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 30px;
  padding: 6px 9px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  color: #3e5149;
  background: var(--paper);
  font-size: 8px;
  font-weight: 750;
  cursor: pointer;
}

.avatar-upload-button svg {
  width: 13px;
  height: 13px;
}

.avatar-upload-button:hover,
.clear-avatar-button:hover {
  border-color: var(--jade);
  color: var(--jade-deep);
}

.clear-avatar-button {
  border-color: transparent;
  color: #877f73;
  background: transparent;
}

.character-avatar-actions .field-help {
  flex-basis: 100%;
  margin-top: 0;
}

.character-modal .field {
  margin-bottom: 14px;
}

.character-modal textarea {
  width: 100%;
  min-height: 104px;
  padding: 11px 13px;
  resize: vertical;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  color: var(--ink);
  background: var(--paper-strong);
  font-size: 11px;
  line-height: 1.6;
}

.character-modal textarea::placeholder {
  color: #aaa398;
}

.character-modal textarea:focus {
  border-color: var(--jade);
  outline: 0;
  box-shadow: 0 0 0 3px rgba(28, 117, 97, 0.12);
}

.character-modal .field.has-error textarea {
  border-color: var(--danger);
}

.character-form-actions {
  display: grid;
  grid-template-columns: minmax(0, 0.75fr) minmax(0, 1.25fr);
  gap: 8px;
  margin-top: 4px;
}

.secondary-button {
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  color: #5f665f;
  background: var(--paper-strong);
  font-size: 11px;
  font-weight: 750;
  cursor: pointer;
}

.secondary-button:hover {
  border-color: var(--jade);
  color: var(--jade-deep);
}

.character-form-actions .primary-button {
  min-height: 48px;
}

.guide-scroll {
  padding: 18px 19px 27px;
}

.guide-hero {
  position: relative;
  min-height: 152px;
  padding: 22px 19px;
  overflow: hidden;
  border-radius: 18px;
  color: #f9fbf8;
  background: #1b4a3d;
}

.guide-hero::after {
  content: "";
  position: absolute;
  right: -48px;
  bottom: -74px;
  width: 180px;
  height: 180px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 50%;
  box-shadow:
    0 0 0 27px rgba(255, 255, 255, 0.045),
    0 0 0 54px rgba(255, 255, 255, 0.025);
}

.guide-number {
  display: inline-block;
  margin-bottom: 23px;
  color: #a9c9bd;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 800;
}

.guide-hero h2 {
  position: relative;
  z-index: 1;
  margin: 0 0 8px;
  font-size: 19px;
}

.guide-hero p {
  position: relative;
  z-index: 1;
  max-width: 285px;
  margin: 0;
  color: #c4d9d2;
  font-size: 10px;
  line-height: 1.62;
}

.guide-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin: 19px 0 0;
  padding: 0;
  list-style: none;
}

.guide-list li {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 14px 1px;
  border-bottom: 1px solid var(--line);
}

.guide-step-icon {
  display: grid;
  place-items: center;
  flex: 0 0 33px;
  width: 33px;
  height: 33px;
  border-radius: 10px;
  color: var(--jade-deep);
  background: var(--jade-soft);
}

.guide-step-icon svg {
  width: 16px;
  height: 16px;
}

.guide-list strong {
  display: block;
  margin: 1px 0 4px;
  font-size: 11px;
}

.guide-list p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 9px;
  line-height: 1.6;
}

.guide-list code {
  padding: 1px 3px;
  border-radius: 4px;
  color: #315247;
  background: #e8e3d9;
  font-family: var(--mono);
  font-size: 8px;
}

.guide-action {
  margin-top: 21px;
}

.toast {
  position: absolute;
  z-index: 100;
  right: 20px;
  bottom: 27px;
  left: 20px;
  padding: 11px 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 11px;
  color: #f8fbf9;
  background: rgba(20, 29, 25, 0.93);
  box-shadow: 0 10px 28px rgba(10, 15, 13, 0.24);
  font-size: 10px;
  line-height: 1.5;
  text-align: center;
  opacity: 0;
  transform: translateY(10px);
  visibility: hidden;
  pointer-events: none;
  transition:
    opacity 160ms ease,
    transform 180ms ease,
    visibility 160ms ease;
}

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

.home-indicator {
  position: absolute;
  z-index: 45;
  bottom: 7px;
  left: 50%;
  width: 116px;
  height: 4px;
  border-radius: 999px;
  background: rgba(23, 32, 28, 0.78);
  transform: translateX(-50%);
  pointer-events: none;
}

.home-view .home-indicator {
  background: rgba(43, 84, 107, 0.34);
}

.device-caption {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0;
  color: #535e58;
  font-size: 10px;
  font-weight: 600;
}

.device-caption svg {
  width: 14px;
  height: 14px;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes typing-dot {
  0%,
  60%,
  100% {
    opacity: 0.35;
    transform: translateY(0);
  }
  30% {
    opacity: 1;
    transform: translateY(-3px);
  }
}

@keyframes reply-pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(43, 155, 121, 0.32);
  }
  70% {
    box-shadow: 0 0 0 5px rgba(43, 155, 121, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(43, 155, 121, 0);
  }
}

@media (max-height: 740px) and (min-width: 601px) {
  .phone-frame {
    min-height: 560px;
    height: calc(100vh - 34px);
    height: calc(100dvh - 34px);
  }

  .device-caption {
    display: none;
  }
}

@media (max-width: 600px), (max-width: 1000px) and (max-height: 500px) {
  html,
  body {
    height: 100%;
    overflow: hidden;
    overscroll-behavior: none;
    background: var(--paper);
  }

  .workspace {
    display: block;
    min-height: 100vh;
    min-height: 100dvh;
    padding: 0;
  }

  .service-warning {
    grid-template-columns: 28px minmax(0, 1fr);
    gap: 9px;
    width: calc(100vw - 20px);
    padding: 11px;
  }

  .service-warning-mark {
    width: 28px;
    height: 28px;
  }

  .service-warning-copy strong {
    font-size: 14px;
  }

  .service-warning-copy p {
    font-size: 12px;
  }

  .service-warning-actions button,
  .service-warning-actions a {
    min-height: 38px;
    font-size: 12px;
  }

  .service-warning-dismiss {
    position: absolute;
    top: 5px;
    right: 5px;
    min-width: 42px;
    min-height: 36px;
    font-size: 11px;
  }

  .phone {
    display: block;
    width: 100%;
    height: 100vh;
    height: 100dvh;
  }

  .phone-frame {
    width: 100%;
    height: 100vh;
    height: 100dvh;
    min-height: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: var(--paper);
    box-shadow: none;
  }

  .phone-frame::before,
  .phone-frame::after {
    display: none;
  }

  .phone-screen {
    border-radius: 0;
    box-shadow: none;
  }

  .phone-screen::after {
    top: 8px;
  }

  .device-caption {
    display: none;
  }

  .status-bar {
    flex-basis: calc(48px + env(safe-area-inset-top, 0px));
    padding: calc(13px + env(safe-area-inset-top, 0px))
      calc(21px + env(safe-area-inset-right, 0px))
      0
      calc(21px + env(safe-area-inset-left, 0px));
  }

  .home-view {
    padding-right: calc(19px + env(safe-area-inset-right, 0px));
    padding-left: calc(19px + env(safe-area-inset-left, 0px));
    padding-bottom: calc(17px + env(safe-area-inset-bottom, 0px));
  }

  .settings-scroll,
  .guide-scroll {
    padding-right: calc(19px + env(safe-area-inset-right, 0px));
    padding-left: calc(19px + env(safe-area-inset-left, 0px));
    padding-bottom: calc(26px + env(safe-area-inset-bottom, 0px));
  }

  .chat-composer {
    padding-bottom: calc(19px + env(safe-area-inset-bottom, 0px));
  }

  .field-label {
    font-size: 13px;
  }

  .field input,
  .character-modal textarea,
  .chat-input-row textarea {
    font-size: 16px;
  }

  .field-help,
  .field-error,
  .connection-intro p,
  .result-message,
  .next-step p,
  .local-data-description,
  .local-data-status p,
  .local-data-status small,
  .privacy-note p {
    font-size: 12px;
    line-height: 1.6;
  }

  .primary-button,
  .secondary-button,
  .local-data-button {
    font-size: 14px;
  }

  .local-data-status strong {
    font-size: 12px;
  }

  .header-status {
    font-size: 11px;
  }

  .message-bubble {
    padding: 11px 13px;
    font-size: 14px;
    line-height: 1.6;
  }

  .chat-empty > p:last-child {
    font-size: 12px;
  }

  .batch-mode-toggle,
  .batch-reply-button {
    min-height: 38px;
    padding: 7px 10px;
    font-size: 11px;
  }

  .pending-reply-count {
    font-size: 10px;
  }

  .chat-input-row textarea {
    min-height: 48px;
    padding-top: 12px;
    padding-bottom: 12px;
  }

  .chat-send {
    flex-basis: 48px;
    width: 48px;
    height: 48px;
  }

  .chat-reply-status {
    font-size: 11px;
  }

  .message-menu summary {
    width: 38px;
    height: 38px;
  }

  .message-menu summary svg {
    width: 18px;
    height: 18px;
  }

  .message-menu-item {
    min-height: 42px;
    padding: 9px 11px;
    font-size: 12px;
  }

  .retraction-copy strong {
    font-size: 12px;
  }

  .retraction-copy p {
    font-size: 11px;
  }

  .regenerate-button,
  .delete-turn-button,
  .retry-button {
    min-height: 40px;
    padding: 8px 11px;
    font-size: 11px;
  }

  .failure-copy strong {
    font-size: 12px;
  }

  .failure-copy p,
  .failure-copy small {
    font-size: 11px;
  }

  .field-action {
    width: 42px;
    height: 42px;
  }

  .character-modal {
    padding-bottom: calc(17px + env(safe-area-inset-bottom, 0px));
  }
}

@media (max-width: 360px) {
  .home-view {
    padding-right: 14px;
    padding-left: 14px;
  }

  .settings-scroll,
  .guide-scroll,
  .chat-scroll {
    padding-right: 15px;
    padding-left: 15px;
  }

  .chat-header,
  .chat-composer {
    padding-right: 12px;
    padding-left: 12px;
  }

  .chat-contact-copy h1 {
    max-width: 150px;
  }

  .app-icon {
    width: 50px;
    height: 50px;
  }

  .app-grid {
    column-gap: 6px;
  }
}

@media (max-height: 500px) and (orientation: landscape) {
  .home-view {
    padding-top: 2px;
    padding-bottom: calc(8px + env(safe-area-inset-bottom, 0px));
  }

  .home-top {
    padding-top: 2px;
    padding-bottom: 8px;
  }

  .home-top h1 {
    font-size: 22px;
  }

  .device-summary {
    padding: 10px 13px;
  }

  .signal-orb {
    flex-basis: 36px;
    width: 36px;
    height: 36px;
  }

  .home-section-heading {
    margin-top: 10px;
    margin-bottom: 8px;
  }

  .app-grid {
    gap: 8px 12px;
  }

  .app-icon {
    width: 46px;
    height: 46px;
  }

  .home-note {
    display: none;
  }

}

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