:root {
  color-scheme: light;
  --bg: #f3f4f0;
  --surface: #ffffff;
  --ink: #171915;
  --muted: #6c7169;
  --line: #e2e5de;
  --brand: #ff315a;
  --brand-dark: #d91e44;
  --soft: #f7f8f5;
  --warning: #fff3cc;
  --warning-ink: #674e00;
  --success: #e4f7ea;
  --success-ink: #15572c;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
}

button, input, textarea, select { font: inherit; }
button { cursor: pointer; }

.hidden { display: none !important; }
.shell { width: min(1180px, calc(100% - 32px)); margin: 0 auto; padding: 34px 0 80px; }

.login-card {
  width: min(430px, 100%);
  margin: 12vh auto 0;
  padding: 34px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--surface);
  box-shadow: 0 20px 60px rgba(30, 34, 25, 0.08);
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 50px;
  height: 50px;
  border-radius: 15px;
  background: var(--ink);
  color: white;
  font-weight: 800;
}

h1, h2, h3, p { margin-top: 0; }
.login-card h1 { margin: 22px 0 8px; }
.login-card > p { color: var(--muted); }
label { display: block; margin: 24px 0 8px; font-size: 14px; font-weight: 650; }

input, textarea, select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: white;
  color: var(--ink);
  padding: 12px 14px;
  outline: none;
}
input:focus, textarea:focus, select:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(255, 49, 90, 0.12); }
textarea { min-height: 130px; resize: vertical; line-height: 1.45; }

.button, form button {
  border: 0;
  border-radius: 12px;
  background: var(--brand);
  color: white;
  padding: 12px 18px;
  font-weight: 750;
}
.button:hover, form button:hover { background: var(--brand-dark); }
form button { width: 100%; margin-top: 14px; }
.button.secondary { background: white; color: var(--ink); border: 1px solid var(--line); }
.button.secondary:hover { background: var(--soft); }
.button.small { padding: 9px 12px; font-size: 13px; }
.button:disabled { cursor: not-allowed; opacity: .5; }

.topbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 28px; }
.topbar h1 { margin-bottom: 0; font-size: clamp(30px, 4vw, 46px); letter-spacing: -0.04em; }
.eyebrow { margin-bottom: 5px; color: var(--muted); font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }

.notice, .warning-item {
  margin-bottom: 14px;
  padding: 13px 16px;
  border-radius: 12px;
  font-size: 14px;
}
.notice { background: var(--success); color: var(--success-ink); }
.notice.error { background: #fee5e9; color: #8f1630; }
.warning-item { background: var(--warning); color: var(--warning-ink); }

.section-block {
  margin-top: 22px;
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--surface);
}
.section-heading { display: flex; justify-content: space-between; gap: 20px; align-items: flex-start; margin-bottom: 20px; }
.section-heading h2 { margin-bottom: 5px; font-size: 24px; letter-spacing: -0.025em; }
.section-heading p:not(.step) { margin-bottom: 0; color: var(--muted); }
.step { display: grid; place-items: center; width: 27px; height: 27px; margin-bottom: 12px; border-radius: 50%; background: var(--ink); color: white; font-size: 13px; font-weight: 800; }

.account-grid, .draft-grid { display: grid; gap: 15px; }
.account-grid { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.draft-grid { grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); }
.empty-state { display: block; padding: 26px; border-radius: 15px; background: var(--soft); color: var(--muted); text-align: center; }

.account-card, .draft-card, .send-row { border: 1px solid var(--line); border-radius: 16px; background: var(--soft); }
.account-card { padding: 18px; }
.account-head { display: flex; align-items: center; gap: 12px; }
.avatar { width: 46px; height: 46px; border-radius: 50%; object-fit: cover; background: var(--line); }
.avatar-fallback { display: grid; place-items: center; font-weight: 800; }
.account-card h3 { margin: 0 0 4px; font-size: 16px; }
.account-card p { margin: 0; color: var(--muted); font-size: 13px; }
.account-card label { margin-top: 16px; }

.draft-card { overflow: hidden; background: white; }
.draft-preview { width: 100%; aspect-ratio: 9 / 12; object-fit: cover; object-position: top; background: var(--soft); }
.draft-body { padding: 18px; }
.draft-meta { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.pill { padding: 5px 8px; border-radius: 999px; background: var(--soft); color: var(--muted); font-size: 12px; }
.draft-card h3 { margin-bottom: 6px; font-size: 18px; line-height: 1.25; }
.draft-account { color: var(--muted); font-size: 13px; }
.draft-card label { margin-top: 14px; }
.manual-note { margin: 14px 0; color: var(--muted); font-size: 13px; line-height: 1.4; }
.draft-card .button { width: 100%; }

.send-list { display: grid; gap: 10px; }
.send-row { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 16px; padding: 15px; }
.send-row h3 { margin: 0 0 5px; font-size: 15px; }
.send-row p { margin: 0; color: var(--muted); font-size: 13px; }
.status { display: inline-flex; margin-left: 6px; padding: 3px 7px; border-radius: 999px; background: white; color: var(--ink); font-size: 11px; font-weight: 750; }
.error-text { min-height: 20px; margin: 10px 0 0 !important; color: #a51c3a !important; font-size: 13px; }

@media (max-width: 680px) {
  .shell { width: min(100% - 20px, 1180px); padding-top: 18px; }
  .section-block { padding: 18px; border-radius: 18px; }
  .section-heading { display: grid; }
  .section-heading .button { width: 100%; }
  .send-row { grid-template-columns: 1fr; }
}
