:root {
  color-scheme: light;
  --ink: #172033;
  --muted: #6b7485;
  --line: #e1e6ef;
  --panel: rgba(255, 255, 255, 0.9);
  --blue: #2563eb;
  --blue-deep: #1748b8;
  --blue-soft: #edf4ff;
  --green: #168568;
  --green-soft: #e9f8f2;
  --danger: #c53a47;
  --shadow: 0 30px 70px rgba(28, 50, 90, 0.13);
  --radius-xl: 30px;
  --radius-lg: 22px;
  --radius-md: 15px;
  font-family:
    "Segoe UI",
    "PingFang SC",
    "Microsoft YaHei",
    system-ui,
    -apple-system,
    sans-serif;
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 7% 4%, rgba(174, 204, 255, 0.52), transparent 28%),
    radial-gradient(circle at 96% 12%, rgba(189, 241, 226, 0.44), transparent 28%),
    linear-gradient(145deg, #f9fbff 0%, #f2f5fa 52%, #eef3f9 100%);
  overflow-x: hidden;
}

button,
input,
textarea {
  font: inherit;
}

button,
a,
summary {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
summary:focus-visible {
  outline: 3px solid rgba(37, 99, 235, 0.24);
  outline-offset: 3px;
}

.ambient {
  position: fixed;
  pointer-events: none;
  border-radius: 999px;
  filter: blur(1px);
  opacity: 0.5;
  z-index: -1;
}

.ambient-one {
  top: 16%;
  left: -170px;
  width: 340px;
  height: 340px;
  background: linear-gradient(135deg, #dbe9ff, rgba(219, 233, 255, 0));
}

.ambient-two {
  right: -150px;
  bottom: 7%;
  width: 420px;
  height: 420px;
  background: linear-gradient(145deg, rgba(190, 242, 225, 0.8), rgba(190, 242, 225, 0));
}

.page-shell {
  width: min(1220px, calc(100% - 38px));
  margin: 0 auto;
  padding: 26px 0 30px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 2px 2px 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--ink);
  font-size: 18px;
  font-weight: 750;
  letter-spacing: -0.02em;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  color: white;
  border-radius: 12px;
  background: linear-gradient(145deg, #3675f5, #1c50cd);
  box-shadow: 0 10px 22px rgba(37, 99, 235, 0.27);
}

.brand-mark svg {
  width: 23px;
  height: 23px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.account-zone {
  display: flex;
  align-items: center;
  gap: 11px;
}

.connection-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 0 13px;
  color: var(--muted);
  border: 1px solid rgba(209, 217, 231, 0.85);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.67);
  font-size: 12px;
  font-weight: 650;
  backdrop-filter: blur(12px);
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #9aa4b6;
  box-shadow: 0 0 0 3px rgba(154, 164, 182, 0.12);
}

.connection-status.is-connected {
  color: var(--green);
  border-color: rgba(31, 157, 121, 0.25);
  background: rgba(237, 250, 245, 0.82);
}

.connection-status.is-connected .status-dot {
  background: #1ca77f;
  box-shadow: 0 0 0 3px rgba(28, 167, 127, 0.14);
}

.quiet-button {
  min-height: 38px;
  padding: 0 16px;
  color: var(--ink);
  border: 1px solid #d9e0eb;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition:
    border-color 160ms ease,
    transform 160ms ease,
    box-shadow 160ms ease;
}

.quiet-button:hover {
  border-color: #b8c7dd;
  box-shadow: 0 8px 20px rgba(50, 72, 110, 0.08);
  transform: translateY(-1px);
}

.quiet-button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  transform: none;
  box-shadow: none;
}

.intro {
  max-width: 720px;
  padding: 62px 4px 38px;
  animation: enter 550ms ease both;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
  color: var(--blue);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.eyebrow-line {
  width: 34px;
  height: 1px;
  background: currentColor;
}

h1 {
  max-width: 760px;
  margin: 0;
  font-size: clamp(42px, 6.9vw, 82px);
  font-weight: 760;
  line-height: 1.02;
  letter-spacing: -0.055em;
}

h1 span {
  color: var(--blue);
}

.lead {
  max-width: 630px;
  margin: 24px 0 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.8;
}

.steps {
  display: flex;
  align-items: center;
  gap: 22px;
  margin-top: 38px;
}

.steps article {
  display: grid;
  grid-template-columns: auto 1fr;
  column-gap: 9px;
  min-width: 126px;
}

.step-number {
  grid-row: 1 / 3;
  padding-top: 2px;
  color: #9aa6b9;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.steps strong {
  font-size: 14px;
}

.steps p {
  margin: 3px 0 0;
  color: #7b8495;
  font-size: 12px;
}

.step-arrow {
  color: #bbc5d3;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 350px;
  gap: 22px;
  align-items: start;
  animation: enter 650ms 80ms ease both;
}

.composer-card,
.status-card,
.success-card,
.tip-card {
  border: 1px solid rgba(218, 225, 236, 0.82);
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(22px);
}

.composer-card {
  padding: clamp(24px, 4vw, 42px);
  border-radius: var(--radius-xl);
}

.card-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 32px;
}

.card-kicker,
.status-card-kicker,
.preview-eyebrow,
.tip-label {
  margin: 0 0 6px;
  color: #8c96a7;
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.card-heading h2,
.status-card h2,
.success-card h2 {
  margin: 0;
  font-size: 26px;
  line-height: 1.2;
  letter-spacing: -0.035em;
}

.calendar-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 11px;
  color: #667085;
  border: 1px solid #e1e6ee;
  border-radius: 999px;
  background: #f8fafc;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.calendar-badge svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
}

.field-block {
  margin-top: 25px;
}

.field-label {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 10px;
}

.field-label label {
  font-size: 14px;
  font-weight: 750;
}

.field-label > span:last-child {
  margin-left: auto;
  color: #9aa4b4;
  font-size: 11px;
  font-weight: 600;
}

.field-index {
  display: inline-grid;
  width: 24px;
  height: 20px;
  place-items: center;
  color: var(--blue);
  border-radius: 6px;
  background: var(--blue-soft);
  font-size: 9px;
  font-weight: 850;
}

input,
select,
textarea {
  width: 100%;
  color: var(--ink);
  border: 1px solid #dce3ee;
  border-radius: var(--radius-md);
  background: rgba(250, 252, 255, 0.86);
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease,
    background 160ms ease;
}

input,
select {
  height: 53px;
  padding: 0 16px;
}

select {
  appearance: none;
  padding-right: 36px;
  background-image:
    linear-gradient(45deg, transparent 50%, #7f8a9c 50%),
    linear-gradient(135deg, #7f8a9c 50%, transparent 50%);
  background-position:
    calc(100% - 16px) 23px,
    calc(100% - 11px) 23px;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}

textarea {
  display: block;
  padding: 13px 15px;
  resize: vertical;
  line-height: 1.6;
}

input::placeholder,
textarea::placeholder {
  color: #a4adbb;
}

input:hover,
select:hover,
textarea:hover {
  border-color: #cbd6e6;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--blue);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.09);
  outline: 0;
}

input[aria-invalid="true"],
select[aria-invalid="true"],
textarea[aria-invalid="true"] {
  border-color: var(--danger);
  box-shadow: 0 0 0 4px rgba(197, 58, 71, 0.08);
}

.time-grid {
  display: grid;
  grid-template-columns: minmax(165px, 1.4fr) minmax(105px, 0.8fr) auto minmax(105px, 0.8fr);
  align-items: end;
  gap: 10px;
}

.compact-field {
  display: grid;
  gap: 6px;
}

.compact-field > span {
  padding-left: 3px;
  color: #8c96a6;
  font-size: 10px;
  font-weight: 700;
}

.time-separator {
  padding-bottom: 17px;
  color: #9aa4b3;
  font-size: 12px;
}

.reminder-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 12px;
  padding: 12px 13px;
  border: 1px solid #e7ebf1;
  border-radius: 14px;
  background: #f9fbfd;
}

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

.reminder-icon {
  display: grid;
  flex: 0 0 auto;
  width: 31px;
  height: 31px;
  place-items: center;
  color: var(--blue);
  border-radius: 9px;
  background: var(--blue-soft);
}

.reminder-icon svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.reminder-copy > span:last-child {
  display: grid;
  gap: 2px;
}

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

.reminder-copy small {
  color: #929cab;
  font-size: 9px;
}

.reminder-control {
  display: grid;
  grid-template-columns: 58px 82px;
  flex: 0 0 auto;
  gap: 6px;
}

.reminder-control input,
.reminder-control select {
  height: 38px;
  border-radius: 10px;
  background-color: #fff;
  font-size: 11px;
}

.reminder-control input {
  padding: 0 9px;
  text-align: center;
}

.reminder-control select {
  padding: 0 24px 0 10px;
  background-position:
    calc(100% - 12px) 16px,
    calc(100% - 7px) 16px;
}

.reminder-error {
  margin-bottom: -10px;
}

.input-with-icon {
  position: relative;
}

.input-with-icon svg {
  position: absolute;
  top: 50%;
  left: 16px;
  width: 18px;
  height: 18px;
  fill: none;
  stroke: #8d99aa;
  stroke-width: 1.8;
  stroke-linecap: round;
  transform: translateY(-50%);
  pointer-events: none;
}

.input-with-icon input {
  padding-left: 45px;
}

.field-error {
  min-height: 16px;
  margin: 7px 0 -8px;
  color: var(--danger);
  font-size: 11px;
}

.more-options {
  margin-top: 24px;
  border-top: 1px solid #edf0f5;
  border-bottom: 1px solid #edf0f5;
}

.more-options summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 17px 2px;
  color: #596476;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  list-style: none;
}

.more-options summary::-webkit-details-marker {
  display: none;
}

.more-options summary::after {
  content: "+";
  color: #8f9bab;
  font-size: 19px;
  font-weight: 400;
}

.more-options[open] summary::after {
  content: "−";
}

.more-options summary span {
  margin-left: 7px;
  color: #a0a9b7;
  font-size: 10px;
  font-weight: 600;
}

.more-options textarea {
  margin: 0 0 17px;
}

.preview {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 26px;
  padding: 17px;
  border: 1px solid #dce7fa;
  border-left: 4px solid var(--blue);
  border-radius: 17px;
  background: linear-gradient(110deg, #f7faff, #f3f8ff);
}

.preview-date {
  display: grid;
  min-width: 54px;
  padding-right: 15px;
  place-items: center;
  border-right: 1px solid #d7e3f7;
}

.preview-date strong {
  color: var(--blue);
  font-size: 24px;
  line-height: 1;
}

.preview-date span {
  margin-top: 5px;
  color: #7787a1;
  font-size: 9px;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

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

.preview-copy strong {
  display: block;
  overflow: hidden;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.preview-copy p {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin: 5px 0 0;
  color: #748095;
  font-size: 11px;
}

.preview-divider {
  color: #b9c2cf;
}

.primary-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  height: 56px;
  margin-top: 22px;
  color: #fff;
  border: 0;
  border-radius: 16px;
  background: linear-gradient(135deg, #2d70f3, #1c50ce);
  box-shadow: 0 16px 28px rgba(37, 99, 235, 0.22);
  font-size: 14px;
  font-weight: 750;
  cursor: pointer;
  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    filter 160ms ease;
}

.primary-button:hover:not(:disabled) {
  box-shadow: 0 20px 34px rgba(37, 99, 235, 0.28);
  filter: saturate(1.06);
  transform: translateY(-1px);
}

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

.primary-button:disabled {
  cursor: wait;
  opacity: 0.78;
}

.primary-button svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

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

.is-submitting .button-spinner {
  display: block;
}

.is-submitting .primary-button svg {
  display: none;
}

.form-message {
  min-height: 19px;
  margin-top: 12px;
  color: var(--danger);
  font-size: 12px;
  line-height: 1.5;
  text-align: center;
}

.privacy-note {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 6px;
  margin: 7px 0 0;
  color: #8f99aa;
  font-size: 10px;
  line-height: 1.5;
  text-align: center;
}

.privacy-note svg {
  flex: 0 0 auto;
  width: 13px;
  height: 13px;
  margin-top: 1px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.side-panel {
  display: grid;
  gap: 16px;
  position: sticky;
  top: 22px;
}

.status-card,
.success-card {
  position: relative;
  overflow: hidden;
  padding: 25px;
  border-radius: var(--radius-lg);
}

.status-card::after {
  content: "";
  position: absolute;
  top: -60px;
  right: -60px;
  width: 140px;
  height: 140px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(214, 232, 255, 0.72), transparent 70%);
}

.status-card-icon {
  display: grid;
  width: 48px;
  height: 48px;
  margin-bottom: 18px;
  place-items: center;
  border: 1px solid #dbe5f3;
  border-radius: 15px;
  background: #f7faff;
}

.status-card-icon span {
  width: 13px;
  height: 13px;
  border: 3px solid var(--blue);
  border-radius: 50%;
  box-shadow: 0 0 0 5px rgba(37, 99, 235, 0.1);
}

.status-card.is-ready .status-card-icon span {
  border-color: var(--green);
  background: var(--green);
  box-shadow: 0 0 0 5px rgba(22, 133, 104, 0.12);
}

.status-card h2,
.success-card h2 {
  font-size: 21px;
}

.status-card p:last-child,
.success-card p {
  margin: 11px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.75;
}

.success-card {
  color: #0f5f4c;
  border-color: #cbeadd;
  background:
    radial-gradient(circle at 95% 8%, rgba(177, 235, 215, 0.54), transparent 30%),
    rgba(246, 255, 251, 0.94);
}

.success-card[hidden] {
  display: none;
}

.success-icon {
  display: grid;
  width: 48px;
  height: 48px;
  margin-bottom: 18px;
  place-items: center;
  color: #fff;
  border-radius: 50%;
  background: var(--green);
  font-size: 23px;
  font-weight: 700;
  box-shadow: 0 10px 24px rgba(22, 133, 104, 0.2);
}

.success-card a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 19px;
  color: #08755d;
  font-size: 12px;
  font-weight: 750;
  text-decoration: none;
}

.success-card a:hover {
  text-decoration: underline;
}

.tip-card {
  padding: 22px;
  border-radius: var(--radius-lg);
  box-shadow: 0 16px 45px rgba(28, 50, 90, 0.08);
}

.tip-card blockquote {
  margin: 10px 0 0;
  color: #5d6879;
  font-family: Georgia, "Songti SC", serif;
  font-size: 15px;
  line-height: 1.7;
}

.tip-card span {
  color: var(--blue-deep);
  font-weight: 650;
}

footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 34px 4px 0;
  color: #8f98a8;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 20;
  max-width: min(380px, calc(100vw - 44px));
  padding: 14px 17px;
  color: #fff;
  border-radius: 13px;
  background: #1d2939;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.23);
  font-size: 12px;
  line-height: 1.5;
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition:
    opacity 180ms ease,
    transform 180ms ease;
}

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

.toast.is-error {
  background: #8e2633;
}

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

@keyframes enter {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

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

  .side-panel {
    position: static;
    grid-template-columns: 1fr 1fr;
  }

  .status-card,
  .success-card {
    grid-row: span 2;
  }
}

@media (max-width: 680px) {
  .page-shell {
    width: min(100% - 24px, 620px);
    padding-top: 16px;
  }

  .topbar {
    align-items: flex-start;
    padding-bottom: 20px;
  }

  .account-zone {
    align-items: flex-end;
    flex-direction: column;
  }

  .connection-status {
    min-height: 29px;
    padding: 0 10px;
    font-size: 10px;
  }

  .quiet-button {
    min-height: 34px;
    padding: 0 12px;
    font-size: 11px;
  }

  .intro {
    padding: 42px 3px 29px;
  }

  h1 {
    font-size: clamp(38px, 12vw, 58px);
  }

  .lead {
    margin-top: 18px;
    font-size: 14px;
    line-height: 1.75;
  }

  .steps {
    gap: 9px;
    margin-top: 26px;
  }

  .steps article {
    min-width: 0;
    flex: 1;
  }

  .step-arrow {
    flex: 0 0 auto;
  }

  .step-number,
  .steps p {
    display: none;
  }

  .steps strong {
    font-size: 12px;
  }

  .composer-card {
    padding: 22px 18px;
    border-radius: 24px;
  }

  .card-heading {
    margin-bottom: 24px;
  }

  .calendar-badge {
    padding: 7px 9px;
    font-size: 9px;
  }

  .time-grid {
    grid-template-columns: 1fr 1fr;
  }

  .compact-field:first-child {
    grid-column: 1 / -1;
  }

  .time-separator {
    display: none;
  }

  .reminder-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .reminder-control {
    width: 100%;
    grid-template-columns: 1fr 1fr;
  }

  .side-panel {
    grid-template-columns: 1fr;
  }

  .status-card,
  .success-card {
    grid-row: auto;
  }

  footer {
    padding-bottom: 8px;
  }
}

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