.txw-app {
  min-height: 100%;
  background: #f2f2f7;
  color: #111111;
}

.txw-app__scroll {
  min-height: 100%;
  padding: 0 0 28px;
}

.txw-nav {
  position: sticky;
  top: 0;
  z-index: 5;
  display: grid;
  grid-template-columns: minmax(72px, auto) 1fr minmax(72px, auto);
  align-items: center;
  min-height: 44px;
  padding: 8px 14px 6px;
  background: rgba(242, 242, 247, 0.82);
  border-bottom: 0.5px solid rgba(60, 60, 67, 0.18);
  backdrop-filter: saturate(1.8) blur(18px);
  -webkit-backdrop-filter: saturate(1.8) blur(18px);
}

.txw-nav__back {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  justify-self: start;
  padding: 4px 0;
  border: none;
  background: transparent;
  color: #007aff;
  font-size: 17px;
  font-weight: 400;
  cursor: pointer;
}

.txw-nav__back-icon {
  font-size: 28px;
  line-height: 1;
  transform: translateX(2px);
}

.txw-nav__back-text {
  display: none;
}

.txw-nav__center {
  text-align: center;
  font-size: 17px;
  font-weight: 600;
  color: #111111;
}

.txw-nav__spacer {
  display: block;
  min-width: 72px;
}

.txw-hero {
  display: grid;
  gap: 14px;
  padding: 10px 20px 8px;
}

.txw-hero__copy {
  display: grid;
  gap: 0;
}

.txw-hero__eyebrow {
  display: none;
}

.txw-hero__title {
  margin: 6px 0 0;
  color: #000000;
  font-size: 34px;
  line-height: 1.15;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.txw-hero__text {
  display: none;
}

.txw-summary-list {
  display: none;
}

.txw-summary-item {
  display: none;
}

.txw-summary-item__label {
  display: none;
}

.txw-summary-item__value {
  display: none;
}

.txw-group {
  margin-top: 22px;
}

.txw-group:first-of-type {
  margin-top: 8px;
}

.txw-group__title {
  margin: 0 20px 8px;
  color: #6d6d72;
  font-size: 13px;
  line-height: 1.35;
  font-weight: 400;
  letter-spacing: 0.01em;
  text-transform: uppercase;
}

.txw-list {
  margin: 0 16px;
  overflow: hidden;
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 0 0 0.5px rgba(60, 60, 67, 0.16);
}

.txw-row {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-width: 0;
  padding: 11px 16px;
  background: #ffffff;
}

.txw-row + .txw-row {
  box-shadow: inset 0 0.5px 0 rgba(60, 60, 67, 0.12);
}

.txw-api-log-list {
  overflow: hidden;
}

.txw-api-log-list__scroll {
  height: 260px;
  max-height: 260px;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.txw-api-log-panel .txw-api-log-list__scroll {
  height: 220px;
  max-height: 220px;
}

.txw-api-log-response {
  display: block;
  margin-top: 6px;
  padding: 8px 10px;
  max-height: 120px;
  overflow-y: auto;
  border-radius: 10px;
  background: #f2f2f7;
  color: #3a3a3c;
  white-space: pre-wrap;
  word-break: break-word;
}

.txw-api-log-list__scroll + .txw-row--actions {
  box-shadow: inset 0 0.5px 0 rgba(60, 60, 67, 0.12);
}

.txw-row--form,
.txw-row--actions {
  align-items: stretch;
}

.txw-row--toggle,
.txw-row--info {
  align-items: center;
}

.txw-row__main {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.txw-row__title {
  color: #111111;
  font-size: 17px;
  line-height: 1.35;
  font-weight: 400;
}

.txw-row__desc {
  color: #8e8e93;
  font-size: 13px;
  line-height: 1.45;
}

.txw-row__value {
  flex-shrink: 0;
  max-width: 42%;
  color: #8e8e93;
  font-size: 15px;
  line-height: 1.35;
  text-align: right;
  word-break: break-word;
}

.txw-field {
  display: grid;
  gap: 8px;
  min-width: 0;
  width: 100%;
}

.txw-field--stacked {
  width: 100%;
}

.txw-field__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.txw-field__label {
  color: #8e8e93;
  font-size: 13px;
  line-height: 1.35;
}

.txw-input,
.txw-select {
  width: 100%;
  min-width: 0;
  height: 42px;
  padding: 0 14px;
  border: none;
  border-radius: 12px;
  background: #f2f2f7;
  color: #111111;
  font-size: 15px;
  line-height: 1;
}

.settings-page--voice-config textarea.txw-input,
.settings-page--image-generation-config textarea.txw-input {
  height: auto;
  min-height: 52px;
  padding: 10px 14px;
  line-height: 1.45;
  resize: vertical;
}

.txw-input[type="number"] {
  padding-right: 10px;
}

.txw-input::placeholder {
  color: #aeaeb2;
  opacity: 1;
}

.txw-select {
  padding-right: 38px;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238e8e93' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
}

.txw-input:focus,
.txw-select:focus {
  outline: none;
  box-shadow: 0 0 0 2px rgba(0, 122, 255, 0.15);
}

.settings-page--voice-config #voiceConfigReferenceAudioRow {
  padding-top: 9px;
  padding-bottom: 11px;
}

.settings-page--voice-config #voiceConfigReferenceAudioRow .txw-field {
  gap: 7px;
}

.settings-page--voice-config #voiceConfigReferenceAudioFile {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  min-height: 42px;
  padding: 7px 10px;
  border: none;
  border-radius: 12px;
  background: #f2f2f7;
  color: #111111;
  font-size: 14px;
  line-height: 28px;
}

.settings-page--voice-config #voiceConfigReferenceAudioFile::file-selector-button {
  height: 28px;
  margin: 0 10px 0 0;
  padding: 0 12px;
  border: none;
  border-radius: 8px;
  background: #ffffff;
  color: #007aff;
  font-size: 14px;
  line-height: 28px;
  box-shadow: 0 0 0 0.5px rgba(60, 60, 67, 0.18);
  cursor: pointer;
}

.settings-page--voice-config #voiceConfigReferenceAudioFile::-webkit-file-upload-button {
  height: 28px;
  margin: 0 10px 0 0;
  padding: 0 12px;
  border: none;
  border-radius: 8px;
  background: #ffffff;
  color: #007aff;
  font-size: 14px;
  line-height: 28px;
  box-shadow: 0 0 0 0.5px rgba(60, 60, 67, 0.18);
  cursor: pointer;
}

.settings-page--voice-config #voiceConfigReferenceAudioFile:focus {
  outline: none;
  box-shadow: 0 0 0 2px rgba(0, 122, 255, 0.15);
}

.settings-page--voice-config #voiceConfigReferenceAudioStatus {
  display: block;
  min-height: 18px;
  color: #8e8e93;
  font-size: 13px;
  line-height: 1.35;
}

.txw-toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 51px;
  min-width: 51px;
  height: 31px;
}

.txw-toggle__control {
  position: absolute;
  inset: 0;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.txw-toggle__slider {
  position: relative;
  width: 51px;
  height: 31px;
  border-radius: 999px;
  background: #d1d1d6;
  transition: background-color 0.2s ease;
  pointer-events: none;
}

.txw-toggle__slider::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 27px;
  height: 27px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.18);
  transition: transform 0.22s ease;
}

.txw-toggle__control:checked + .txw-toggle__slider {
  background: #34c759;
}

.txw-toggle__control:checked + .txw-toggle__slider::after {
  transform: translateX(20px);
}

.txw-toggle__control:focus + .txw-toggle__slider {
  box-shadow: 0 0 0 3px rgba(52, 199, 89, 0.16);
}

.txw-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  width: 100%;
}

.txw-actions--two-columns,
.txw-actions--three-columns {
  flex-direction: row;
  flex-wrap: nowrap;
}

.txw-actions--two-columns .txw-button,
.txw-actions--three-columns .txw-button {
  flex: 1 1 0;
  min-width: 0;
  padding-left: 8px;
  padding-right: 8px;
  white-space: nowrap;
}

.txw-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 104px;
  height: 38px;
  padding: 0 16px;
  border: none;
  border-radius: 10px;
  background: #007aff;
  color: #ffffff;
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
}

.txw-button--small {
  min-width: 0;
  height: 28px;
  padding: 0 10px;
  border-radius: 8px;
  font-size: 12px;
}

.txw-button--secondary {
  background: #f2f2f7;
  color: #007aff;
}

.txw-button--danger {
  background: #fff1f0;
  color: #ff3b30;
}

.txw-button:hover {
  filter: brightness(0.98);
}

.txw-button:active {
  filter: brightness(0.94);
}

.txw-chip,
.txw-chip--accent,
.txw-panel,
.txw-panel__header,
.txw-panel__title,
.txw-panel__text,
.txw-panel__badge,
.txw-inline-select,
.txw-inline-select__label,
.txw-form-layout,
.txw-form-layout--single,
.txw-form-card,
.txw-section-heading,
.txw-section-heading__title,
.txw-section-heading__text,
.txw-grid,
.txw-grid--single,
.txw-field--full,
.txw-toggle-card,
.txw-toggle-card__copy,
.txw-toggle-card__label,
.txw-toggle-card__hint,
.txw-stat-grid,
.txw-stat-card,
.txw-stat-card__label,
.txw-stat-card__value,
.txw-group-sections,
.txw-group-panel,
.txw-group-panel__header,
.txw-group-panel__title,
.txw-group-panel__list,
.txw-group-button {
  box-sizing: border-box;
}

@media (max-width: 720px) {
  .txw-summary-list {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  .txw-app__scroll {
    padding-bottom: 20px;
  }

  .txw-nav {
    padding-left: 12px;
    padding-right: 12px;
  }

  .txw-hero {
    padding-left: 16px;
    padding-right: 16px;
  }

  .txw-group__title {
    margin-left: 16px;
    margin-right: 16px;
  }

  .txw-list {
    margin-left: 12px;
    margin-right: 12px;
  }

  .txw-row {
    padding-left: 14px;
    padding-right: 14px;
  }

  .txw-hero__title {
    font-size: 32px;
  }

  .txw-actions {
    flex-direction: column;
  }

  .txw-actions--two-columns,
  .txw-actions--three-columns {
    flex-direction: row;
  }

  .txw-button {
    width: 100%;
    min-width: 0;
  }

  .txw-actions--two-columns .txw-button,
  .txw-actions--three-columns .txw-button {
    width: auto;
  }

  .txw-actions--three-columns .txw-button {
    font-size: 13px;
    padding-left: 6px;
    padding-right: 6px;
  }

  .txw-field__header {
    flex-direction: column;
    align-items: flex-start;
  }
}

@supports (padding: env(safe-area-inset-bottom)) {
  .txw-nav {
    padding-top: calc(8px + env(safe-area-inset-top));
    padding-left: calc(14px + env(safe-area-inset-left));
    padding-right: calc(14px + env(safe-area-inset-right));
  }

  .txw-app__scroll {
    padding-bottom: calc(28px + env(safe-area-inset-bottom));
  }
}
