/* 2.47.0: Home (public/home.js). Modern Calm: a soft tinted header with the greeting and what needs you now, a row
   of big soft quick actions, then a few big cards (one calm hue each) with room to breathe; one link per card. */
.home {
  --hm-r: 22px;
  --hm-shadow: 0 1px 2px rgba(15, 23, 42, .05), 0 6px 20px rgba(15, 23, 42, .045);
  --hm-shadow-hi: 0 1px 2px rgba(15, 23, 42, .06), 0 12px 32px rgba(15, 23, 42, .09);
  --hm-warn: #B45309; --hm-warn-soft: #FEF3C7; --hm-hot: #B91C1C; --hm-hot-soft: #FEE2E2; --hm-ok: #15803D;
  display: flex; flex-direction: column; gap: 22px; max-width: 1160px; margin-inline: auto; min-width: 0; padding-bottom: 24px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .home { --hm-shadow: 0 1px 2px rgba(0, 0, 0, .35); --hm-shadow-hi: 0 1px 2px rgba(0, 0, 0, .4), 0 10px 28px rgba(0, 0, 0, .3);
    --hm-warn: #FBBF24; --hm-warn-soft: #3A2A0A; --hm-hot: #FCA5A5; --hm-hot-soft: #3B1D1D; --hm-ok: #4ADE80; }
}
:root[data-theme="dark"] .home { --hm-shadow: 0 1px 2px rgba(0, 0, 0, .35); --hm-shadow-hi: 0 1px 2px rgba(0, 0, 0, .4), 0 10px 28px rgba(0, 0, 0, .3);
  --hm-warn: #FBBF24; --hm-warn-soft: #3A2A0A; --hm-hot: #FCA5A5; --hm-hot-soft: #3B1D1D; --hm-ok: #4ADE80; }

/* the header */
.home-hero { display: flex; flex-direction: column; gap: 22px; padding: 30px 34px 26px; border-radius: 28px; border: 1px solid var(--line); box-shadow: var(--hm-shadow);
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 9%, var(--panel)), var(--panel) 88%); min-width: 0; }
.home-hero-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; min-width: 0; }
.home-hello { min-width: 0; }
.home-hello h1 { margin: 0 0 6px; font-size: 30px; line-height: 1.2; letter-spacing: -.01em; font-weight: 650; }
.home-date { margin: 0; color: var(--muted); font-size: 15px; line-height: 1.5; }
.home-heb { white-space: normal; }
.home-summary { margin: 12px 0 0; font-size: 17px; line-height: 1.5; color: var(--ink); min-height: 1.5em; }
.home-sep { color: var(--muted); }
.home-hero-side { display: flex; flex-direction: column; align-items: flex-end; gap: 12px; flex: none; }
.home-hero-side .home-views { margin: 0; }
.home-go { height: 46px; padding: 0 22px; border-radius: 999px; font-size: 15px; font-weight: 600; display: inline-flex; align-items: center; text-decoration: none;
  background: var(--accent); border: 1px solid var(--accent); color: var(--accent-ink); box-shadow: 0 6px 16px color-mix(in srgb, var(--accent) 22%, transparent); }
.home-go:hover, .home-go:focus-visible { background: var(--accent-hover); border-color: var(--accent-hover); color: var(--accent-ink); }

/* Needs you now */
.home-needs-wrap { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.home-needs-title { margin: 0; font-size: 13px; font-weight: 600; color: var(--muted); letter-spacing: .02em; }
.home-needs { display: flex; flex-wrap: wrap; gap: 10px; min-height: 52px; min-width: 0; }
.home-need { display: inline-flex; align-items: center; gap: 10px; padding: 10px 18px 10px 12px; border-radius: 16px; background: var(--panel); border: 1px solid var(--line);
  color: var(--ink); text-decoration: none; transition: box-shadow .15s, border-color .15s; white-space: nowrap; }
.home-need:hover, .home-need:focus-visible { box-shadow: var(--hm-shadow-hi); border-color: color-mix(in srgb, var(--accent) 35%, var(--line)); outline: none; }
.home-need b { font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; }
.home-need-label { color: var(--muted); font-size: 14px; }
.home-need-ico { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 10px; color: var(--accent); background: var(--accent-soft); }
.home-need.warn .home-need-ico { color: var(--hm-warn); background: var(--hm-warn-soft); }
.home-need.hot { border-color: color-mix(in srgb, var(--hm-hot) 30%, var(--line)); }
.home-need.hot .home-need-ico { color: var(--hm-hot); background: var(--hm-hot-soft); }
.home-clear { display: inline-flex; align-items: center; gap: 10px; margin: 0; padding: 12px 18px; border-radius: 16px; background: var(--panel); border: 1px solid var(--line); color: var(--muted); }
.home-clear .ico { color: var(--hm-ok); }

/* quick actions */
.home-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; min-height: 0; }
.home-action { --c: var(--accent); display: flex; align-items: center; gap: 14px; padding: 16px 18px; border-radius: 18px; text-align: start; cursor: pointer; font: inherit; color: var(--ink);
  background: linear-gradient(160deg, color-mix(in srgb, var(--c) 7%, var(--panel)), var(--panel) 75%); border: 1px solid color-mix(in srgb, var(--c) 14%, var(--line)); box-shadow: var(--hm-shadow);
  transition: box-shadow .15s, transform .15s, border-color .15s; min-width: 0; }
.home-action:hover, .home-action:focus-visible { box-shadow: var(--hm-shadow-hi); border-color: color-mix(in srgb, var(--c) 35%, var(--line)); transform: translateY(-1px); outline: none; }
.home-action-ico { flex: none; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 14px; color: var(--c); background: color-mix(in srgb, var(--c) 13%, var(--panel)); }
.home-action-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.home-action-text b { font-size: 15.5px; font-weight: 600; }
.home-action-text small { color: var(--muted); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.home-routines:empty, .home-actions:empty { display: none; }
.home-routines { display: flex; flex-direction: column; gap: 12px; }
.home-routines > .panel { margin: 0; border-radius: 18px; }

/* the cards */
.home-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.home-col { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.home-card, .home-setup { --c: var(--accent); display: flex; flex-direction: column; gap: 14px; padding: 22px 24px; border-radius: var(--hm-r); background: var(--panel); border: 1px solid var(--line); box-shadow: var(--hm-shadow); min-width: 0; }
.home-card-head { display: flex; align-items: center; gap: 10px; }
.home-card-head h2 { margin: 0; font-size: 17px; font-weight: 600; flex: 1; min-width: 0; }
.home-card-ico { flex: none; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 11px; color: var(--c); background: color-mix(in srgb, var(--c) 12%, var(--panel)); }
.home-card-body { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.home-card-link { align-self: flex-start; display: inline-flex; align-items: center; gap: 4px; color: var(--c); font-weight: 600; font-size: 14px; text-decoration: none; }
.home-card-link:hover { text-decoration: underline; }
.home-sub { margin: 0; font-size: 13px; font-weight: 600; color: var(--muted); }
.home-quiet, .home-hint { margin: 0; color: var(--muted); font-size: 14.5px; line-height: 1.5; }
.home-hint { font-size: 13px; }

/* skeletons: soft bars until the data comes */
.home-skel { display: flex; flex-direction: column; gap: 10px; }
.home-skel i, .home-skel-line { display: block; height: 14px; border-radius: 8px; background: linear-gradient(90deg, var(--sunk), color-mix(in srgb, var(--sunk) 40%, var(--panel)), var(--sunk)); background-size: 200% 100%; animation: home-shimmer 1.4s ease-in-out infinite; }
.home-skel i:nth-child(2) { width: 82%; } .home-skel i:nth-child(3) { width: 58%; }
.home-skel-line { width: 260px; max-width: 70%; height: 16px; margin-top: 4px; }
@keyframes home-shimmer { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }
@media (prefers-reduced-motion: reduce) { .home-skel i, .home-skel-line { animation: none; } }

/* rows */
.home-rows { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.home-rows li { border-bottom: 1px solid var(--line); }
.home-rows li:last-child { border-bottom: 0; }
.home-rows a { display: flex; align-items: center; gap: 12px; padding: 11px 4px; color: var(--ink); text-decoration: none; border-radius: 10px; min-width: 0; }
.home-rows a:hover, .home-rows a:focus-visible { background: var(--sunk); outline: none; }
.home-row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.home-row-main b { font-weight: 600; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.home-row-sub { color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.home-pill { flex: none; display: inline-flex; align-items: center; font-size: 12px; padding: 3px 10px; border-radius: 999px; background: var(--sunk); color: var(--muted); white-space: nowrap; }
.home-pill.warn { background: var(--hm-warn-soft); color: var(--hm-warn); font-weight: 600; }
.home-pill.hot { background: var(--hm-hot-soft); color: var(--hm-hot); font-weight: 600; }
.home-pill.accent { background: color-mix(in srgb, var(--c) 12%, var(--panel)); color: var(--c); font-weight: 600; }

/* Today's three */
.home-three { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.home-three li { display: flex; align-items: flex-start; gap: 12px; padding: 12px 14px; border-radius: 14px; background: color-mix(in srgb, var(--c) 5%, var(--panel)); border: 1px solid color-mix(in srgb, var(--c) 10%, var(--line)); }
.home-three-n { flex: none; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: color-mix(in srgb, var(--c) 14%, var(--panel)); color: var(--c); font-weight: 700; font-size: 13px; }
.home-three-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; font-size: 15.5px; font-weight: 500; overflow-wrap: anywhere; }
.home-three-text small { color: var(--muted); font-size: 13px; font-weight: 400; }
.home-three li.done .home-three-text > span { text-decoration: line-through; color: var(--muted); }
.home-three li.done .home-three-n { background: color-mix(in srgb, var(--hm-ok) 15%, var(--panel)); color: var(--hm-ok); }
.home-three li.suggested { border-style: dashed; background: var(--panel); }
.home-capture { display: flex; align-items: center; gap: 8px; padding: 4px 4px 4px 14px; border-radius: 999px; background: var(--sunk); border: 1px solid var(--line); }
[dir="rtl"] .home-capture { padding: 4px 14px 4px 4px; }
.home-capture:focus-within { border-color: var(--accent-bright); box-shadow: var(--focus); }
.home-capture-ico { flex: none; color: var(--muted); }
.home-capture-input { flex: 1; min-width: 0; border: 0 !important; background: transparent !important; box-shadow: none !important; height: 38px; padding: 0 !important; font-size: 15px; }
.home-capture-btn { flex: none; border-radius: 999px; height: 36px; padding: 0 16px; }

/* the phone, my numbers */
.home-phone-now { display: flex; }
.home-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 10px; }
.home-stat { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border-radius: 14px; background: color-mix(in srgb, var(--ink) 4.5%, var(--panel)); min-width: 0; }
.home-stat b { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.2; }
.home-stat span { color: var(--muted); font-size: 13px; line-height: 1.35; }
.home-stat small { color: var(--muted); font-size: 12px; }
.home-phone-now .home-stat { flex: 1; flex-direction: row; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; padding: 16px 18px; background: color-mix(in srgb, var(--c) 7%, var(--panel)); }
.home-phone-now .home-stat b { font-size: 34px; }
.home-phone-now .home-stat span { font-size: 15px; color: var(--ink); }
.home-phone-now .home-stat small { flex-basis: 100%; }
.home-stat.warn b { color: var(--hm-warn); }
.home-stat.hot b { color: var(--hm-hot); }
.home-stat.ok b { color: var(--hm-ok); }
.home-sc .sc-desk { border-radius: 14px; }
.home-doc-btn { align-self: flex-start; border-radius: 999px; }

/* the company */
.home-potw, .home-onb { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; border-radius: 14px; color: var(--ink); text-decoration: none; background: color-mix(in srgb, var(--c) 6%, var(--panel)); border: 1px solid color-mix(in srgb, var(--c) 12%, var(--line)); }
.home-potw:hover, .home-onb:hover { border-color: color-mix(in srgb, var(--c) 35%, var(--line)); }
.home-potw small, .home-onb small { color: var(--muted); font-size: 12.5px; }
.home-potw b { font-size: 15px; overflow-wrap: anywhere; }
.home-onb > span:first-child { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.home-bar { display: block; height: 8px; border-radius: 999px; background: color-mix(in srgb, var(--c) 12%, var(--panel)); overflow: hidden; margin-top: 4px; }
.home-bar i { display: block; height: 100%; border-radius: inherit; background: var(--c); }

/* finish setting up (admins, only when something essential is missing) */
.home-setup { --c: var(--hm-warn); background: linear-gradient(160deg, color-mix(in srgb, var(--c) 6%, var(--panel)), var(--panel) 70%); }
.home-setup-slot:empty { display: none; }
.home-setup-slot { order: 0; }
.home-setup .home-row-main b { white-space: normal; }
.home-setup .home-row-sub { white-space: normal; }

/* frequent pages, what's new */
.home-frequent { display: flex; flex-direction: column; gap: 10px; }
.home-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.home-chip { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px; background: var(--panel); border: 1px solid var(--line); color: var(--ink); text-decoration: none; font-size: 14px; }
.home-chip:hover { border-color: color-mix(in srgb, var(--accent) 35%, var(--line)); }
.home-chip .ico { color: var(--muted); }
.home-news { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 12px; padding: 14px 4px 0; border-top: 1px solid var(--line); color: var(--muted); font-size: 13.5px; }
.home-news:empty { display: none; }
.home-news-ver { font-weight: 600; color: var(--ink); }
.home-news-text { flex: 1 1 320px; min-width: 0; }
.home-news a { color: var(--accent); text-decoration: none; font-weight: 600; }

/* the rail's Home (under the logo) */
.rail-home { margin-bottom: 6px !important; }
.rail-home .rail-ico { color: var(--accent); }

/* a phone: one column; what needs you scrolls sideways */
@media (max-width: 860px) {
  .home { gap: 16px; }
  .home-hero { padding: 22px 18px 18px; border-radius: 22px; gap: 16px; }
  .home-hero-top { flex-direction: column; }
  .home-hero-side { align-items: stretch; width: 100%; }
  .home-hero-side .home-views { align-self: flex-start; }
  .home-go { justify-content: center; }
  .home-hello h1 { font-size: 24px; }
  .home-summary { font-size: 16px; }
  .home-needs { flex-wrap: nowrap; overflow-x: auto; scroll-snap-type: x proximity; margin-inline: -18px; padding: 2px 18px 6px; scrollbar-width: none; }
  .home-needs::-webkit-scrollbar { display: none; }
  .home-need { scroll-snap-align: start; flex: none; }
  .home-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .home-action { flex-direction: column; align-items: flex-start; gap: 10px; padding: 14px; }
  .home-action-text small { white-space: normal; }
  .home-action:last-child:nth-child(odd) { grid-column: 1 / -1; flex-direction: row; align-items: center; }
  .home-grid { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .home-col { display: contents; }
  .home-card-three { order: 1; } .home-card-phone { order: 2; } .home-card-convs { order: 3; } .home-card-numbers { order: 4; } .home-card-company { order: 5; }
  .home-card, .home-setup { padding: 18px; border-radius: 18px; }
}
