:root {
  --tr-brand: #592e72;
  --tr-brand-accent: #713495;
  --tr-brand-light: #e3cfef;
  --tr-text: #221b26;
  --tr-muted: #5c6670;
  --tr-bg: #f2f1e9;
  --tr-info-bg: #592e72;
  --tr-info-text: #f2f1e9;
  --tr-option-bg: #ffffff;
  --tr-option-border: #d8d4cc;
  --tr-option-active: #592e72;
  --tr-radius: 14px;
  --tr-font: "IBM Plex Sans", system-ui, -apple-system, sans-serif;
  --tr-heading: "Work Sans", var(--tr-font);
  --tr-serif: "Playfair Display", Georgia, serif;
  --tr-safe-top: env(safe-area-inset-top, 0px);
  --tr-safe-bottom: env(safe-area-inset-bottom, 0px);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: var(--tr-font);
  background: var(--tr-bg);
  color: var(--tr-text);
  -webkit-font-smoothing: antialiased;
}

body.tr-mode-info {
  background: var(--tr-info-bg);
  color: var(--tr-info-text);
}

body.tr-mode-question {
  background: var(--tr-bg);
  color: var(--tr-text);
}

.tr-app {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: calc(1rem + var(--tr-safe-top)) 1.25rem calc(1.5rem + var(--tr-safe-bottom));
}

.tr-progress {
  flex: 0 0 auto;
  text-align: center;
  font-size: 0.875rem;
  color: var(--tr-muted);
  margin-bottom: 0.75rem;
  min-height: 1.25rem;
}

body.tr-mode-info .tr-progress {
  color: rgba(242, 241, 233, 0.7);
}

.tr-screen {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  max-width: 28rem;
  width: 100%;
  margin: 0 auto;
  animation: tr-fade-in 0.22s ease;
}

.tr-screen.tr-exit {
  animation: tr-fade-out 0.15s ease forwards;
}

@keyframes tr-fade-in {
  from { opacity: 0; transform: translateX(10px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes tr-fade-out {
  from { opacity: 1; transform: translateX(0); }
  to { opacity: 0; transform: translateX(-10px); }
}

.tr-logo {
  height: auto;
  display: block;
}

.tr-logo-vertical {
  width: min(160px, 45vw);
  margin: 0 auto 2.5rem;
}

.tr-logo-small {
  width: min(130px, 38vw);
  height: auto;
}

.tr-logo-intro {
  width: min(96px, 26vw);
  margin: 1.75rem auto 0;
}

.tr-question-chrome {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: 2.5rem 1fr 2.5rem;
  align-items: center;
  max-width: 28rem;
  margin: 0 auto;
  padding: calc(0.75rem + var(--tr-safe-top)) 1.25rem 0.75rem;
  background: var(--tr-bg);
}

.tr-question-chrome[hidden] {
  display: none !important;
}

.tr-question-chrome .tr-logo-small {
  justify-self: center;
  grid-column: 2;
}

.tr-question-chrome .tr-back {
  grid-column: 1;
}

body.tr-has-chrome .tr-app {
  padding-top: calc(3.75rem + var(--tr-safe-top));
}

body.tr-has-chrome .tr-screen {
  justify-content: flex-start;
}

.tr-header-screen {
  text-align: center;
  padding: 2rem 0;
}

.tr-header-screen .tr-logo-vertical {
  margin-bottom: 2.5rem;
}

.tr-intro-line {
  font-family: var(--tr-heading);
  font-size: clamp(1.25rem, 4.5vw, 1.5rem);
  font-weight: 500;
  line-height: 1.35;
  margin: 0;
  color: inherit;
}

.tr-intro-you {
  font-family: var(--tr-serif);
  font-size: clamp(3.5rem, 16vw, 5.5rem);
  font-weight: 700;
  line-height: 1.05;
  margin: 0.35rem 0 0;
  color: inherit;
}

.tr-thanks-serif {
  font-family: var(--tr-serif);
  font-size: clamp(2.5rem, 10vw, 3.25rem);
  font-weight: 700;
  line-height: 1.1;
  margin: 0 0 1.25rem;
  color: inherit;
}

.tr-header-text {
  font-family: var(--tr-heading);
  font-size: clamp(1.5rem, 5vw, 1.875rem);
  font-weight: 500;
  line-height: 1.35;
  margin: 0;
  color: inherit;
}

body.tr-mode-info .tr-header-text,
body.tr-mode-info .tr-closer-text,
body.tr-mode-info .tr-thanks-serif,
body.tr-mode-info .tr-done-title {
  color: var(--tr-info-text);
}

.tr-question-header {
  display: none;
}

.tr-back {
  appearance: none;
  border: none;
  background: transparent;
  color: var(--tr-brand);
  font-size: 1.625rem;
  padding: 0.25rem 0;
  cursor: pointer;
  line-height: 1;
  -webkit-tap-highlight-color: transparent;
}

.tr-back:focus-visible {
  outline: 3px solid var(--tr-brand);
  outline-offset: 2px;
  border-radius: 4px;
}

.tr-question-title {
  font-family: var(--tr-heading);
  font-size: clamp(1.375rem, 4.5vw, 1.75rem);
  font-weight: 600;
  line-height: 1.3;
  margin: 0 0 1.75rem;
}

.tr-closer-text {
  font-size: clamp(1.125rem, 4vw, 1.375rem);
  line-height: 1.55;
  margin: 0 0 2rem;
  color: inherit;
}

body.tr-mode-info .tr-closer-text {
  color: rgba(242, 241, 233, 0.92);
}

.tr-options {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.tr-option {
  appearance: none;
  border: 2px solid var(--tr-option-border);
  background: var(--tr-option-bg);
  border-radius: var(--tr-radius);
  padding: 1.125rem 1.25rem;
  font: inherit;
  font-size: 1.0625rem;
  font-weight: 500;
  text-align: left;
  color: var(--tr-text);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, transform 0.1s;
  -webkit-tap-highlight-color: transparent;
}

.tr-option:active {
  transform: scale(0.98);
}

.tr-option.selected {
  border-color: var(--tr-option-active);
  background: var(--tr-brand-light);
}

.tr-option:focus-visible {
  outline: 3px solid var(--tr-brand);
  outline-offset: 2px;
}

.tr-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.tr-field label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--tr-muted);
  margin-bottom: 0.375rem;
}

.tr-field input {
  width: 100%;
  font: inherit;
  font-size: 1.125rem;
  padding: 0.875rem 1rem;
  border: 2px solid var(--tr-option-border);
  border-radius: var(--tr-radius);
  background: #fff;
}

.tr-field input:focus {
  outline: none;
  border-color: var(--tr-brand);
}

.tr-btn {
  appearance: none;
  border: none;
  border-radius: var(--tr-radius);
  background: var(--tr-brand);
  color: #fff;
  font: inherit;
  font-size: 1.0625rem;
  font-weight: 600;
  padding: 1rem 1.25rem;
  cursor: pointer;
  margin-top: 0.5rem;
  -webkit-tap-highlight-color: transparent;
}

.tr-btn:active:not(:disabled) {
  background: var(--tr-brand-accent);
}

.tr-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.tr-btn-secondary {
  background: transparent;
  color: var(--tr-brand);
  border: 2px solid var(--tr-brand);
}

.tr-date-list,
.tr-time-list {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
  max-height: 50dvh;
  overflow-y: auto;
}

.tr-tz {
  font-size: 0.875rem;
  color: var(--tr-muted);
  margin-bottom: 1rem;
}

.tr-done-title {
  font-family: var(--tr-heading);
  font-size: clamp(1.5rem, 5vw, 1.875rem);
  font-weight: 600;
  margin: 0 0 1rem;
}

.tr-done-text {
  font-size: 1.125rem;
  line-height: 1.55;
  color: var(--tr-muted);
  margin: 0 0 1rem;
}

body.tr-mode-info .tr-done-text {
  color: rgba(242, 241, 233, 0.88);
}

.tr-done-link {
  color: var(--tr-info-text);
  font-weight: 600;
}

.tr-summary {
  background: var(--tr-option-bg);
  border-radius: var(--tr-radius);
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
  font-size: 1rem;
  line-height: 1.6;
}

.tr-error {
  color: #b42318;
  font-size: 0.9375rem;
  margin: 0.75rem 0 0;
}

.tr-loading {
  text-align: center;
  color: var(--tr-muted);
  font-size: 1.125rem;
}

.tr-continue-hint {
  text-align: center;
  font-size: 0.875rem;
  color: var(--tr-muted);
  margin-top: 1rem;
}

body.tr-mode-info .tr-continue-hint {
  color: rgba(242, 241, 233, 0.65);
}
