:root {
  --ink: #14231f;
  --ink-soft: #3d524c;
  --foam: #eef7f3;
  --mist: #d7ebe3;
  --sea: #0f766e;
  --sea-deep: #0b4f4a;
  --sun: #f0b429;
  --danger: #b42318;
  --danger-bg: #fef3f2;
  --radius: 18px;
  --shadow: 0 18px 40px rgba(15, 55, 48, 0.12);
  --font-display: "Bricolage Grotesque", Georgia, serif;
  --font-body: "Manrope", "Segoe UI", sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--foam);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.atmosphere {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(ellipse 80% 55% at 12% 8%, rgba(240, 180, 41, 0.28), transparent 55%),
    radial-gradient(ellipse 70% 50% at 88% 12%, rgba(15, 118, 110, 0.22), transparent 50%),
    radial-gradient(ellipse 60% 45% at 50% 100%, rgba(215, 235, 227, 0.9), transparent 60%),
    linear-gradient(165deg, #f7fbf9 0%, #e4f2ec 42%, #d9ebe4 100%);
  animation: atmosphere-drift 18s ease-in-out infinite alternate;
}

@keyframes atmosphere-drift {
  from { filter: hue-rotate(0deg) saturate(1); transform: scale(1); }
  to { filter: hue-rotate(8deg) saturate(1.05); transform: scale(1.03); }
}

a {
  color: inherit;
  text-decoration: none;
}

/* —— Login —— */
.page-login {
  min-height: 100dvh;
  display: flex;
  align-items: stretch;
}

.login-stage {
  width: min(100%, 440px);
  margin: 0 auto;
  padding: clamp(2rem, 8vw, 3.5rem) 1.25rem 2.5rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1.75rem;
  text-align: center;
}

.login-kicker {
  margin: 0 0 0.65rem;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--sea);
}

.brand {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(3.6rem, 16vw, 5.4rem);
  line-height: 0.92;
  letter-spacing: -0.045em;
  color: var(--sea-deep);
}

.login-lede {
  margin: 0.9rem auto 0;
  max-width: 28ch;
  font-size: 1.05rem;
  color: var(--ink-soft);
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  padding: 1.25rem;
  text-align: left;
  background: rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(15, 118, 110, 0.12);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.form-feedback {
  min-height: 2.75rem;
  display: flex;
  align-items: stretch;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.field-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink-soft);
}

.field input {
  width: 100%;
  padding: 0.9rem 1rem;
  border: 1.5px solid rgba(20, 35, 31, 0.14);
  border-radius: 12px;
  font: inherit;
  font-size: 1rem;
  background: #fff;
  color: var(--ink);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.field input:focus {
  outline: none;
  border-color: var(--sea);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.18);
}

.field input:disabled {
  opacity: 0.55;
}

.form-error {
  margin: 0;
  width: 100%;
  padding: 0.7rem 0.85rem;
  border-radius: 10px;
  background: var(--danger-bg);
  color: var(--danger);
  font-size: 0.92rem;
  font-weight: 600;
}

.form-error.is-empty {
  visibility: hidden;
  background: transparent;
}

.btn-primary {
  appearance: none;
  border: 0;
  border-radius: 12px;
  padding: 0.95rem 1.2rem;
  font: inherit;
  font-weight: 700;
  font-size: 1.05rem;
  color: #fff;
  background: linear-gradient(135deg, var(--sea) 0%, var(--sea-deep) 100%);
  cursor: pointer;
  transition: transform 0.15s ease, filter 0.15s ease;
}

.btn-primary:hover:not(:disabled) {
  filter: brightness(1.06);
  transform: translateY(-1px);
}

.btn-primary:active:not(:disabled) {
  transform: translateY(0);
}

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* —— App shell —— */
.page-app {
  padding-bottom: 5.5rem;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  position: sticky;
  top: 0;
  backdrop-filter: blur(12px);
  background: rgba(238, 247, 243, 0.75);
  border-bottom: 1px solid rgba(15, 118, 110, 0.08);
  z-index: 5;
}

.brand-mark {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.35rem;
  letter-spacing: -0.03em;
  color: var(--sea-deep);
}

.topbar-tag {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--sea);
}

.btn-ghost,
.btn-secondary {
  appearance: none;
  border: 1px solid rgba(15, 118, 110, 0.25);
  background: transparent;
  color: var(--sea-deep);
  border-radius: 12px;
  padding: 0.55rem 0.95rem;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
}

.btn-ghost {
  border-radius: 999px;
}

.btn-ghost:hover,
.btn-secondary:hover {
  background: rgba(15, 118, 110, 0.08);
}

.sheet {
  width: min(100%, 720px);
  margin: 0 auto;
  padding: 1.25rem 1.25rem 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.35rem;
}

.sheet-intro h1,
.home-intro h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 6vw, 2.4rem);
  letter-spacing: -0.03em;
}

.sheet-intro p,
.home-intro p {
  margin: 0.4rem 0 0;
  color: var(--ink-soft);
}

.eyebrow {
  margin: 0 0 0.35rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--sea);
}

.section-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.15rem;
  letter-spacing: -0.02em;
}

.section-lede {
  margin: 0.35rem 0 0.85rem;
  color: var(--ink-soft);
  font-size: 0.95rem;
}

.sheet-section,
.detail-block {
  padding: 1rem 0 0.25rem;
  border-top: 1px solid rgba(15, 118, 110, 0.12);
}

.home-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem;
}

.stat {
  padding: 1rem 1.05rem;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.58);
  border: 1px solid rgba(15, 118, 110, 0.1);
}

.stat.span-2 {
  grid-column: 1 / -1;
}

.stat h2 {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--sea);
}

.stat-value {
  margin: 0.35rem 0 0;
  font-family: var(--font-display);
  font-size: 1.85rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--ink);
}

.stat-value.tight {
  font-size: 1.45rem;
}

.stat-hint {
  margin: 0.25rem 0 0;
  font-size: 0.88rem;
  color: var(--ink-soft);
}

.stat-hint.muted {
  opacity: 0.75;
  font-size: 0.78rem;
}

.banner-ok {
  margin: 0;
  padding: 0.75rem 0.9rem;
  border-radius: 12px;
  background: rgba(15, 118, 110, 0.12);
  color: var(--sea-deep);
  font-weight: 600;
  font-size: 0.92rem;
}

.banner-err {
  margin: 0;
  padding: 0.75rem 0.9rem;
  border-radius: 12px;
  background: rgba(185, 28, 28, 0.1);
  color: #9f1239;
  font-weight: 600;
  font-size: 0.92rem;
}

.stack-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.fieldset {
  margin: 0;
  padding: 1rem 0 0.25rem;
  border: 0;
  border-top: 1px solid rgba(15, 118, 110, 0.12);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.fieldset legend {
  padding: 0;
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.field select,
.field textarea,
.field input[type="text"],
.field input[type="url"],
.field input[type="number"],
.field input[type="password"] {
  width: 100%;
  padding: 0.9rem 1rem;
  border: 1.5px solid rgba(20, 35, 31, 0.14);
  border-radius: 12px;
  font: inherit;
  font-size: 1rem;
  background: #fff;
  color: var(--ink);
}

.field select:focus,
.field input:focus {
  outline: none;
  border-color: var(--sea);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.18);
}

.field-hint {
  font-size: 0.8rem;
  color: var(--ink-soft);
}

.check,
.chip {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 0.95rem;
}

.chip-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem 0.85rem;
}

.chip span,
.check span {
  color: var(--ink);
}

.job-list,
.slot-list,
.analytics-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.job-row,
.analytics-row,
.slot-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.95rem 1rem;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid rgba(15, 118, 110, 0.1);
}

.job-title,
.analytics-niche,
.slot-when {
  margin: 0;
  font-weight: 700;
  font-size: 0.98rem;
}

.job-meta,
.analytics-meta,
.slot-meta {
  margin: 0.2rem 0 0;
  font-size: 0.82rem;
  color: var(--ink-soft);
}

.job-pct {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--sea-deep);
}

.empty-hint {
  color: var(--ink-soft);
  padding: 0.5rem 0;
}

.progress-track {
  margin-top: 0.75rem;
  height: 8px;
  border-radius: 999px;
  background: rgba(15, 118, 110, 0.12);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--sea), var(--sun));
  border-radius: inherit;
  transition: width 0.4s ease;
}

.mobile-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 0.15rem;
  padding: 0.45rem 0.35rem calc(0.45rem + env(safe-area-inset-bottom));
  background: rgba(247, 251, 249, 0.92);
  backdrop-filter: blur(14px);
  border-top: 1px solid rgba(15, 118, 110, 0.12);
}

.mobile-nav__link {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 2.75rem;
  border-radius: 12px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: var(--ink-soft);
  text-align: center;
  padding: 0.35rem 0.15rem;
}

.mobile-nav__link.is-active {
  color: var(--sea-deep);
  background: rgba(15, 118, 110, 0.12);
}

/* —— Motion —— */
.anim-fade-up {
  animation: fade-up 0.7s ease both;
}

.anim-brand {
  animation: brand-in 0.9s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.anim-rise {
  animation: rise-in 0.75s ease both;
}

.anim-shake {
  animation: shake 0.4s ease;
}

.delay-1 { animation-delay: 0.12s; }
.delay-2 { animation-delay: 0.22s; }

@keyframes fade-up {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes brand-in {
  from { opacity: 0; transform: translateY(18px) scale(0.96); letter-spacing: 0.02em; }
  to { opacity: 1; transform: translateY(0) scale(1); letter-spacing: -0.04em; }
}

@keyframes rise-in {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}

@media (prefers-reduced-motion: reduce) {
  .atmosphere,
  .anim-fade-up,
  .anim-brand,
  .anim-rise,
  .anim-shake {
    animation: none !important;
  }
}

@media (min-width: 720px) {
  .login-stage {
    width: min(100%, 520px);
  }

  .brand {
    font-size: 5.6rem;
  }
}
