:root {
  --bg: #f5f5f7;
  --panel: rgba(255, 255, 255, .86);
  --panel-strong: #ffffff;
  --text: #1d1d1f;
  --muted: #6e6e73;
  --line: rgba(0, 0, 0, .12);
  --soft-line: rgba(0, 0, 0, .08);
  --blue: #0071e3;
  --blue-hover: #0077ed;
  --red: #b42318;
  --green: #0b7f45;
  --shadow: 0 18px 44px rgba(0, 0, 0, .08);
  color: var(--text);
  background:
    linear-gradient(180deg, #fbfbfd 0%, var(--bg) 34%, #f0f2f5 100%);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
}

main {
  margin: 0 auto;
  padding: 44px 24px 56px;
  width: min(1040px, 100%);
}

.topbar {
  align-items: end;
  display: flex;
  gap: 24px;
  justify-content: space-between;
  margin-bottom: 22px;
}

h1 {
  font-size: clamp(32px, 5vw, 54px);
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1.05;
  margin: 6px 0 8px;
}

h2 {
  font-size: 18px;
  font-weight: 650;
  letter-spacing: 0;
  margin: 0 0 8px;
}

.eyebrow {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .08em;
  margin: 0;
}

.lede {
  color: var(--muted);
  font-size: 16px;
  line-height: 1.5;
  margin: 0;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--soft-line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  margin: 14px 0;
  padding: 22px;
}

.hidden { display: none; }

.auth-shell {
  align-items: center;
  display: grid;
  gap: 28px;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 420px);
  min-height: calc(100vh - 100px);
}

.auth-copy {
  padding-bottom: 38px;
}

.auth-card {
  margin: 0;
}

.auth-tabs {
  background: #f2f2f4;
  border-radius: 8px;
  display: grid;
  gap: 4px;
  grid-template-columns: 1fr 1fr;
  margin-bottom: 18px;
  padding: 4px;
}

.tab-button {
  background: transparent;
  color: var(--muted);
  min-height: 36px;
}

.tab-button:hover {
  background: rgba(255, 255, 255, .58);
}

.tab-button.active {
  background: #fff;
  box-shadow: 0 1px 6px rgba(0, 0, 0, .08);
  color: var(--text);
}

.form-message {
  color: var(--red);
  font-size: 13px;
  line-height: 1.5;
  margin: 12px 0 0;
  min-height: 20px;
}

.upload-panel form {
  align-items: end;
  display: grid;
  gap: 14px;
  grid-template-columns: minmax(0, 1fr) auto;
}

.field {
  color: var(--text);
  display: grid;
  font-size: 14px;
  font-weight: 600;
  gap: 8px;
  margin-bottom: 16px;
}

.upload-panel .field { margin-bottom: 0; }

input,
textarea,
select {
  appearance: none;
  background: rgba(255, 255, 255, .92);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  font: inherit;
  max-width: 100%;
  min-width: 0;
  outline: none;
  padding: 12px 13px;
  transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
  width: 100%;
}

input:focus,
textarea:focus,
select:focus {
  background: #fff;
  border-color: rgba(0, 113, 227, .62);
  box-shadow: 0 0 0 4px rgba(0, 113, 227, .12);
}

input[type="file"] {
  cursor: pointer;
}

textarea {
  min-height: 190px;
  resize: vertical;
}

button,
.button-link {
  align-items: center;
  background: var(--blue);
  border: 0;
  border-radius: 8px;
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  font: inherit;
  font-weight: 650;
  justify-content: center;
  min-height: 44px;
  padding: 0 18px;
  text-decoration: none;
  transition: background .16s ease, opacity .16s ease, transform .16s ease;
  white-space: nowrap;
}

button:hover,
.button-link:hover {
  background: var(--blue-hover);
}

button:active,
.button-link:active {
  transform: scale(.99);
}

button:disabled {
  cursor: not-allowed;
  opacity: .42;
}

.secondary-button {
  background: #f2f2f4;
  color: var(--text);
  min-height: 36px;
  padding: 0 12px;
}

.secondary-button:hover {
  background: #e9e9ec;
}

.status {
  background: rgba(255, 255, 255, .78);
  border: 1px solid var(--soft-line);
  border-radius: 999px;
  color: var(--muted);
  flex: 0 0 auto;
  font-size: 13px;
  font-weight: 650;
  padding: 8px 12px;
}

.user-strip {
  align-items: center;
  display: flex;
  flex: 0 0 auto;
  gap: 8px;
}

.action-row {
  align-items: center;
  display: flex;
  flex: 0 0 auto;
  gap: 10px;
}

.section-heading {
  align-items: start;
  display: flex;
  gap: 16px;
  justify-content: space-between;
  margin-bottom: 18px;
}

.section-heading p,
.guide-text {
  color: var(--muted);
  line-height: 1.5;
  margin: 0;
}

.guide-text {
  font-size: 13px;
  margin: -4px 0 16px;
}

.guide-text a {
  color: var(--blue);
  font-weight: 650;
  text-decoration: none;
}

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

.gmail-panel {
  align-items: center;
  display: flex;
  gap: 22px;
  justify-content: space-between;
}

.gmail-panel > div {
  min-width: 0;
}

.gmail-panel p {
  color: var(--muted);
  line-height: 1.5;
  margin: 0;
}

.account-list {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.account-row {
  align-items: center;
  background: var(--panel-strong);
  border: 1px solid var(--soft-line);
  border-radius: 8px;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  padding: 12px;
}

.account-row strong,
.account-row span {
  display: block;
}

.account-row strong {
  font-size: 14px;
}

.account-row span {
  color: var(--muted);
  font-size: 13px;
  margin-top: 4px;
  overflow-wrap: anywhere;
}

.summary {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(3, 1fr);
}

.summary div {
  background: var(--panel-strong);
  border: 1px solid var(--soft-line);
  border-radius: 8px;
  padding: 14px;
}

.summary strong,
.summary span {
  display: block;
}

.summary strong {
  font-size: 30px;
  font-weight: 700;
  letter-spacing: 0;
}

.summary span {
  color: var(--muted);
  font-size: 13px;
  margin-top: 4px;
}

.confirm {
  align-items: center;
  color: var(--muted);
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
}

.confirm input {
  accent-color: var(--blue);
  width: auto;
}

.issue {
  background: #fff7f5;
  border: 1px solid #f3c8bf;
  border-radius: 8px;
  color: var(--red);
  margin-top: 14px;
  padding: 12px 14px;
}

.issue p {
  margin: 7px 0 0;
}

.success {
  color: var(--green);
  font-weight: 650;
}

.error {
  color: var(--red);
  font-weight: 650;
}

@media (max-width: 700px) {
  main {
    padding: 28px 16px 42px;
  }

  .topbar,
  .gmail-panel,
  .upload-panel form,
  .account-row,
  .auth-shell,
  .user-strip,
  .action-row,
  .section-heading,
  .form-grid {
    align-items: stretch;
    display: grid;
    grid-template-columns: 1fr;
  }

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

  button,
  .button-link {
    width: 100%;
  }

  .auth-shell {
    min-height: auto;
  }
}
