:root {
  --ink: #16324f;
  --ink-strong: #0e263e;
  --ink-soft: #52677b;
  --paper: #f7f8f5;
  --surface: #ffffff;
  --line: #dbe2df;
  --mint: #44d19d;
  --mint-dark: #197b5d;
  --amber: #f5b844;
  --coral: #e86452;
  --sky: #dcecf5;
  --radius-lg: 22px;
  --radius-md: 16px;
  --shadow: 0 16px 40px rgba(22, 50, 79, 0.1);
  font-family: "DM Sans", system-ui, sans-serif;
  color: var(--ink);
  background: var(--paper);
}

* { box-sizing: border-box; }
body { min-width: 320px; margin: 0; background: var(--paper); color: var(--ink); }
button, input, select, textarea { font: inherit; }
button { border: 0; cursor: pointer; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid rgba(68, 209, 157, 0.5); outline-offset: 2px; }
.noscript { padding: 32px; text-align: center; }

.app-shell { width: min(100%, 850px); min-height: 100vh; margin: auto; padding: max(18px, env(safe-area-inset-top)) 16px calc(100px + env(safe-area-inset-bottom)); }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 22px; }
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand img { width: 43px; height: 43px; border-radius: 13px; object-fit: cover; box-shadow: 0 7px 18px rgba(22, 50, 79, 0.17); }
.brand-name, h1, h2, h3 { font-family: "Manrope", sans-serif; letter-spacing: -0.035em; }
.brand-name { margin: 0; color: var(--ink-strong); font-size: 1.08rem; font-weight: 800; }
.brand-subline { margin: 1px 0 0; color: var(--ink-soft); font-size: 0.74rem; }
.icon-button { width: 44px; height: 44px; display: inline-grid; place-items: center; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 14px; font-size: 1.15rem; }

.screen-heading { margin: 8px 0 18px; }
.eyebrow { margin: 0 0 4px; color: var(--mint-dark); font-size: 0.72rem; font-weight: 800; letter-spacing: 0.11em; text-transform: uppercase; }
h1 { margin: 0; font-size: clamp(1.72rem, 7vw, 2.35rem); line-height: 1.06; }
.heading-copy { margin: 7px 0 0; color: var(--ink-soft); line-height: 1.45; }

.summary-grid { display: grid; gap: 12px; grid-template-columns: 1.1fr 0.9fr; }
.summary-card { min-height: 126px; padding: 17px; overflow: hidden; position: relative; border-radius: var(--radius-lg); box-shadow: var(--shadow); }
.summary-card.primary { color: white; background: var(--ink); }
.summary-card.primary::after { width: 142px; height: 142px; position: absolute; right: -46px; bottom: -64px; border: 28px solid rgba(68, 209, 157, 0.85); border-radius: 50%; content: ""; }
.summary-card.secondary { background: #fff4db; color: #8a5711; }
.summary-label { margin: 0; font-size: 0.75rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; opacity: 0.82; }
.summary-value { margin: 12px 0 3px; font-family: "Manrope", sans-serif; font-size: clamp(1.55rem, 6vw, 2.05rem); font-weight: 800; letter-spacing: -0.05em; }
.summary-detail { position: relative; z-index: 1; margin: 0; font-size: 0.83rem; opacity: 0.82; }

.section { margin-top: 27px; }
.section-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 11px; }
.section-row h2 { margin: 0; font-size: 1.13rem; }
.text-button { padding: 6px 0; color: var(--mint-dark); background: transparent; font-size: 0.87rem; font-weight: 800; }
.job-list, .tool-list { display: grid; gap: 10px; }
.job-card, .tool-card { width: 100%; padding: 15px; display: grid; align-items: center; gap: 13px; text-align: left; color: inherit; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-md); box-shadow: 0 5px 16px rgba(22, 50, 79, 0.045); transition: transform 160ms cubic-bezier(0.23, 1, 0.32, 1), box-shadow 160ms cubic-bezier(0.23, 1, 0.32, 1); }
.job-card { grid-template-columns: auto minmax(0, 1fr) auto; }
.job-card:active, .tool-card:active, .primary-button:active, .soft-button:active { transform: scale(0.975); }
.job-date { width: 47px; min-height: 52px; padding: 7px 4px; display: grid; place-items: center; align-content: center; color: white; background: var(--ink); border-radius: 14px; }
.job-date strong { font-family: "Manrope", sans-serif; font-size: 1.2rem; line-height: 1; }
.job-date span { margin-top: 3px; font-size: 0.62rem; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase; }
.job-card-main { min-width: 0; }
.job-title { margin: 0; overflow: hidden; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.job-meta { margin: 4px 0 0; overflow: hidden; color: var(--ink-soft); font-size: 0.81rem; text-overflow: ellipsis; white-space: nowrap; }
.job-price { margin: 0; font-family: "Manrope", sans-serif; font-size: 0.94rem; font-weight: 800; text-align: right; }
.badge { display: inline-flex; align-items: center; justify-content: center; min-height: 22px; margin-top: 5px; padding: 3px 7px; border-radius: 999px; font-size: 0.65rem; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase; }
.badge.paid, .badge.done { color: #116348; background: #ddf8ec; }
.badge.unpaid { color: #925e06; background: #fff0cf; }
.badge.open { color: #31546d; background: var(--sky); }

.quick-actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; }
.quick-action { min-height: 99px; padding: 13px 9px; display: grid; place-items: center; align-content: center; gap: 7px; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-md); }
.quick-action span { font-size: 1.36rem; }
.quick-action strong { font-size: 0.76rem; text-align: center; }

.bottom-nav { position: fixed; right: 0; bottom: 0; left: 0; z-index: 20; padding: 8px max(12px, env(safe-area-inset-right)) calc(8px + env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left)); background: rgba(247, 248, 245, 0.92); border-top: 1px solid rgba(219, 226, 223, 0.9); backdrop-filter: blur(16px); }
.bottom-nav-inner { width: min(100%, 850px); margin: auto; display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; }
.nav-button { min-height: 48px; display: grid; place-items: center; align-content: center; gap: 2px; color: var(--ink-soft); background: transparent; border-radius: 13px; font-size: 0.66rem; font-weight: 700; }
.nav-button span { font-size: 1.16rem; line-height: 1; }
.nav-button.active { color: var(--ink); background: #e7f5ef; }

.floating-add { position: fixed; right: max(18px, env(safe-area-inset-right)); bottom: calc(78px + env(safe-area-inset-bottom)); z-index: 25; width: 58px; height: 58px; display: grid; place-items: center; color: var(--ink-strong); background: var(--mint); border-radius: 20px; box-shadow: 0 12px 25px rgba(25, 123, 93, 0.28); font-size: 2rem; font-weight: 400; }

.search { width: 100%; min-height: 50px; padding: 0 15px; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 14px; }
.filter-row { display: flex; gap: 8px; margin: 12px 0; overflow-x: auto; scrollbar-width: none; }
.filter { white-space: nowrap; padding: 8px 12px; color: var(--ink-soft); background: var(--surface); border: 1px solid var(--line); border-radius: 999px; font-size: 0.78rem; font-weight: 800; }
.filter.active { color: var(--ink-strong); background: #ddf8ec; border-color: #b8ead3; }

.tool-card { grid-template-columns: 42px minmax(0, 1fr) auto; }
.tool-icon { width: 42px; height: 42px; display: grid; place-items: center; background: #e7f5ef; border-radius: 13px; font-size: 1.15rem; }
.tool-title { margin: 0; font-weight: 800; }
.tool-copy { margin: 3px 0 0; color: var(--ink-soft); font-size: 0.78rem; line-height: 1.35; }
.chevron { color: var(--ink-soft); font-size: 1.2rem; }

.empty { padding: 28px 22px; text-align: center; background: var(--surface); border: 1px dashed #b8c9c2; border-radius: var(--radius-lg); }
.empty-icon { font-size: 2rem; }
.empty h3 { margin: 7px 0 4px; font-size: 1.05rem; }
.empty p { margin: 0; color: var(--ink-soft); font-size: 0.87rem; line-height: 1.45; }

.modal-layer { position: fixed; inset: 0; z-index: 50; display: grid; align-items: end; background: rgba(14, 38, 62, 0.45); }
.modal { max-height: min(91dvh, 800px); padding: 20px 18px calc(20px + env(safe-area-inset-bottom)); overflow: auto; background: var(--paper); border-radius: 26px 26px 0 0; box-shadow: 0 -20px 55px rgba(14, 38, 62, 0.24); }
.modal-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 17px; }
.modal-header h2 { margin: 0; font-size: 1.35rem; }
.modal-header p { margin: 5px 0 0; color: var(--ink-soft); font-size: 0.82rem; line-height: 1.4; }
.close-button { flex: 0 0 auto; width: 36px; height: 36px; display: grid; place-items: center; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 12px; font-size: 1.1rem; }
.form-grid { display: grid; gap: 13px; }
.form-grid.two { grid-template-columns: 1fr 1fr; }
.field { display: grid; gap: 6px; }
.field label { color: var(--ink); font-size: 0.77rem; font-weight: 800; }
.field input, .field select, .field textarea { width: 100%; min-height: 47px; padding: 11px 12px; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.field textarea { min-height: 96px; resize: vertical; }
.form-divider { height: 1px; margin: 8px 0; background: var(--line); }
.form-actions { display: grid; grid-template-columns: 1fr auto; gap: 10px; margin-top: 20px; }
.primary-button, .soft-button, .danger-button { min-height: 49px; padding: 0 16px; border-radius: 14px; font-weight: 800; }
.primary-button { color: var(--ink-strong); background: var(--mint); }
.soft-button { color: var(--ink); background: var(--surface); border: 1px solid var(--line); }
.danger-button { color: white; background: var(--coral); }
.action-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 9px; }
.action-grid .primary-button, .action-grid .soft-button { min-height: 54px; font-size: 0.82rem; }
.detail-card { margin: 0 0 14px; padding: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-md); }
.detail-card h3 { margin: 0 0 8px; font-size: 0.95rem; }
.detail-line { margin: 5px 0; color: var(--ink-soft); font-size: 0.85rem; line-height: 1.45; }
.detail-price { margin: 12px 0 0; font-family: "Manrope", sans-serif; font-size: 1.45rem; font-weight: 800; letter-spacing: -0.04em; }
.notice { padding: 12px; color: #31546d; background: #eaf4f9; border-radius: 13px; font-size: 0.81rem; line-height: 1.45; }
.privacy-notice { padding: 13px; color: #456076; background: #eef3f5; border-radius: 14px; font-size: 0.8rem; line-height: 1.45; }
.muted { color: var(--ink-soft); }
.install-hint { margin: 12px 0 0; color: var(--ink-soft); font-size: 0.76rem; line-height: 1.45; }

@media (min-width: 720px) {
  .app-shell { padding-inline: 26px; }
  .modal-layer { align-items: center; padding: 24px; }
  .modal { width: min(100%, 650px); max-height: 88dvh; margin: auto; border-radius: 26px; }
  .floating-add { right: calc((100vw - min(100vw, 850px)) / 2 + 25px); }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; } }
