:root {
  color-scheme: light;
  --navy: #07184f;
  --blue: #0f67ed;
  --violet: #8b22ed;
  --ink: #162341;
  --muted: #6f7a94;
  --line: #e2e8f3;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: radial-gradient(circle at 90% 0, #e8f2ff, transparent 34%), #f5f7fc; }
button, input, textarea, select { font: inherit; }
.hidden { display: none !important; }
.shell { width: min(680px, 100%); min-height: 100vh; margin: auto; padding: max(16px, env(safe-area-inset-top)) 18px max(30px, env(safe-area-inset-bottom)); }
.app-header { display: flex; align-items: center; justify-content: space-between; min-height: 58px; }
.brand { display: flex; align-items: center; gap: 10px; }
.brand img { width: 40px; height: 40px; border-radius: 12px; box-shadow: 0 8px 24px rgba(15, 103, 237, .16); }
.brand strong, .brand span { display: block; }
.brand strong { color: var(--navy); font-size: 24px; line-height: 1; }
.brand span { margin-top: 3px; color: #7c88a0; font-size: 8px; font-weight: 850; letter-spacing: .13em; }
.icon-button { width: 42px; height: 42px; border: 1px solid var(--line); border-radius: 13px; color: var(--navy); background: #fff; font-size: 22px; }
.hero { padding: 54px 4px 24px; }
.hero span, .section-title span, .quota-card span, .service-card > span, .wallet-balance > div > span, .greeting > div > span { color: var(--blue); font-size: 10px; font-weight: 900; letter-spacing: .13em; }
.hero h1 { max-width: 480px; margin: 9px 0 12px; color: var(--navy); font-size: clamp(34px, 9vw, 54px); line-height: 1.02; letter-spacing: -.04em; }
.hero p { margin: 0; color: var(--muted); font-size: 16px; line-height: 1.55; }
.card { border: 1px solid rgba(221, 229, 243, .9); border-radius: 22px; background: rgba(255, 255, 255, .93); box-shadow: 0 18px 50px rgba(20, 48, 113, .09); }
.form-card { display: grid; gap: 14px; padding: 22px; }
label { display: grid; gap: 7px; }
label > span { color: #66738d; font-size: 11px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
input, textarea, select { width: 100%; border: 1px solid #dbe3f1; border-radius: 13px; padding: 12px 13px; outline: none; color: var(--navy); background: #f9fbff; }
input:focus, textarea:focus, select:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(15, 103, 237, .11); }
textarea { resize: vertical; line-height: 1.45; }
.primary { min-height: 48px; border: 0; border-radius: 14px; padding: 0 18px; color: #fff; background: linear-gradient(100deg, var(--blue), #1559d4 60%, var(--violet)); box-shadow: 0 12px 28px rgba(15, 103, 237, .22); font-weight: 800; }
button:disabled { opacity: .58; }
.error { margin: 0; color: #bd2942; font-size: 13px; }
.greeting { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 34px 3px 18px; }
.greeting h1 { margin: 5px 0 3px; color: var(--navy); font-size: 30px; letter-spacing: -.025em; }
.greeting p { margin: 0; color: var(--muted); }
.online-pill { margin-top: 5px; border-radius: 999px; padding: 7px 10px; color: #087452; background: #dcf8ed; font-size: 9px; font-weight: 900; letter-spacing: .08em; }
.quota-card, .service-card, .create-card { padding: 20px; }
.service-card { display: grid; gap: 7px; }
.service-card strong { color: var(--navy); font-size: 22px; }
.service-card small { color: var(--muted); line-height: 1.45; }
.quota-card > div:first-child { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.quota-card strong { color: var(--navy); font-size: 25px; }
.quota-card small { display: block; margin-top: 6px; color: var(--muted); }
.track { height: 7px; margin-top: 15px; overflow: hidden; border-radius: 999px; background: #e8edf6; }
.track span { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--blue), var(--violet)); transition: width .25s; }
.create-card { display: grid; gap: 14px; margin-top: 14px; }
.section-title h2 { margin: 4px 0 0; color: var(--navy); font-size: 21px; }
.function-picker { display: grid; gap: 9px; }
.function-picker > div:first-child { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.function-picker > div:first-child > span { color: var(--blue); font-size: 10px; font-weight: 900; letter-spacing: .11em; }
.function-picker > div:first-child > small { color: var(--muted); font-size: 10px; }
.function-list { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.function-button { display: grid; gap: 4px; min-height: 78px; border: 1px solid #dbe3f1; border-radius: 14px; padding: 12px; color: var(--navy); background: #f9fbff; text-align: left; }
.function-button strong { font-size: 13px; }
.function-button small { color: var(--muted); font-size: 10px; line-height: 1.35; }
.function-button.selected { border-color: var(--blue); background: #edf5ff; box-shadow: 0 0 0 2px rgba(15, 103, 237, .1); }
.function-button.selected strong { color: var(--blue); }
.task-options { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tasks-section { padding: 28px 2px 6px; }
.task-list { display: grid; gap: 10px; margin-top: 13px; }
.task-card { display: grid; gap: 10px; padding: 15px; border: 1px solid var(--line); border-radius: 17px; background: #fff; }
.task-card header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.task-card strong { color: var(--navy); line-height: 1.3; }
.task-card small { color: var(--muted); }
.status { flex: 0 0 auto; border-radius: 999px; padding: 6px 8px; color: #52617b; background: #edf1f8; font-size: 9px; font-weight: 900; text-transform: uppercase; }
.status.completed { color: #087452; background: #dcf8ed; }
.status.running { color: #075fbd; background: #e0efff; }
.status.awaiting_approval { color: #7136a6; background: #f0e4ff; }
.status.failed, .status.dead_letter { color: #b3263d; background: #ffe7eb; }
.task-actions { display: flex; gap: 8px; }
.task-actions button { min-height: 38px; flex: 1; border: 1px solid #dbe3f1; border-radius: 11px; color: #43516d; background: #f8faff; font-weight: 750; }
.task-actions .approve { color: #fff; border-color: var(--blue); background: var(--blue); }
.task-empty { padding: 30px 15px; border: 1px dashed #d5dfef; border-radius: 16px; color: var(--muted); text-align: center; }
.owner-section { padding: 28px 2px 0; }
.wallet-card, .team-card { margin-top: 13px; padding: 20px; }
.wallet-balance { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.wallet-balance strong { display: block; margin-top: 4px; color: var(--navy); font-size: 25px; }
.safe-pill { border-radius: 999px; padding: 7px 9px; color: #5d3a8e; background: #f1e7ff; font-size: 8px; font-weight: 900; letter-spacing: .06em; }
.wallet-card > p { margin: 14px 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
.package-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; }
.package-button { display: grid; gap: 4px; min-height: 76px; border: 1px solid #dbe3f1; border-radius: 14px; padding: 12px 9px; color: var(--navy); background: #f8faff; text-align: left; }
.package-button strong { font-size: 13px; }
.package-button span { color: var(--blue); font-size: 11px; font-weight: 850; }
.package-button small { color: var(--muted); font-size: 10px; font-weight: 750; }
.purchase-history { display: grid; gap: 8px; margin-top: 16px; }
.purchase-row, .team-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; border-top: 1px solid var(--line); padding-top: 11px; }
.purchase-row div, .team-row div { display: grid; gap: 3px; }
.purchase-row small, .team-row small, .team-form > small { color: var(--muted); }
.resume-payment { width: fit-content; border: 0; padding: 3px 0; color: var(--blue); background: transparent; font-size: 10px; font-weight: 850; }
.purchase-status { border-radius: 999px; padding: 6px 8px; color: #9a6010; background: #fff2d9; font-size: 8px; font-weight: 900; text-transform: uppercase; }
.purchase-status.paid { color: #087452; background: #dcf8ed; }
.team-list { display: grid; gap: 10px; }
.team-row:first-child { border-top: 0; padding-top: 0; }
.team-row > span { color: #52617b; font-size: 10px; font-weight: 850; }
details { margin-top: 18px; border-top: 1px solid var(--line); padding-top: 15px; }
summary { color: var(--blue); cursor: pointer; font-weight: 800; }
.team-form { display: grid; gap: 12px; margin-top: 15px; }
.logout { display: block; margin: 30px auto 0; border: 0; color: #b52a42; background: transparent; font-weight: 750; }
.toast { position: fixed; right: 18px; bottom: max(18px, env(safe-area-inset-bottom)); left: 18px; max-width: 600px; margin: auto; border-radius: 14px; padding: 13px 15px; color: #fff; background: var(--navy); box-shadow: 0 18px 50px rgba(7, 24, 79, .25); text-align: center; }

@media (max-width: 420px) {
  .function-list { grid-template-columns: 1fr; }
  .task-options { grid-template-columns: 1fr; }
  .greeting { align-items: flex-start; flex-direction: column; }
  .package-grid { grid-template-columns: 1fr; }
}
