/* Kareverse Studio — brand purple #6A0FA3, amber #F59E0B, Chillax (headings) + Inter (text) */
:root {
  --purple: #6A0FA3; --purple-600: #5A0A8C; --purple-50: #F6EEFC; --purple-100: #EBDCF8;
  --amber: #F59E0B; --ink: #1E092B; --ink-2: #4A4458; --muted: #7B7489; --line: #ECE6F2;
  --bg: #F7F5FA; --card: #FFFFFF; --radius: 14px;
  --shadow-sm: 0 1px 2px rgba(30, 9, 43, .06), 0 1px 3px rgba(30, 9, 43, .05);
  --shadow: 0 6px 24px rgba(30, 9, 43, .08);
  --shadow-lg: 0 24px 60px rgba(30, 9, 43, .18);
  --side: 96px; --top: 64px;
  --head: 'Chillax', 'Inter', system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: 'Inter', system-ui, -apple-system, sans-serif; color: var(--ink); background: var(--bg);
       -webkit-font-smoothing: antialiased; font-size: 14px; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
svg.i { width: 20px; height: 20px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8;
        stroke-linecap: round; stroke-linejoin: round; }

/* ── Shell ── */
.shell { display: grid; grid-template-columns: var(--side) minmax(0, 1fr); min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; background: #fff; border-right: 1px solid var(--line);
        display: flex; flex-direction: column; padding: 18px 14px; gap: 4px; }
.side .brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 18px; }
.side .brand img { height: 30px; }
.side .brand b { font-family: var(--head); font-weight: 600; font-size: 13px; color: var(--muted);
                 border-left: 1px solid var(--line); padding-left: 10px; letter-spacing: .02em; }
.create-btn { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%;
              background: var(--purple); color: #fff; border: 0; border-radius: 10px; padding: 11px 14px;
              font-weight: 600; cursor: pointer; box-shadow: 0 4px 14px rgba(106, 15, 163, .3);
              transition: transform .15s, box-shadow .15s, background .15s; margin-bottom: 14px; }
.create-btn:hover { background: var(--purple-600); transform: translateY(-1px); box-shadow: 0 8px 20px rgba(106, 15, 163, .35); }
.nav a, .nav button { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px;
                      color: var(--ink-2); font-weight: 500; width: 100%; background: none; border: 0;
                      cursor: pointer; text-align: left; transition: background .12s, color .12s; }
.nav a:hover, .nav button:hover { background: var(--purple-50); color: var(--purple); }
.nav a.on { background: var(--purple-50); color: var(--purple); font-weight: 600; }
.nav .label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em;
              color: var(--muted); padding: 16px 12px 6px; }
.nav .dot { width: 22px; height: 22px; border-radius: 6px; display: grid; place-items: center; color: #fff; flex: none; }
.nav .dot svg.i { width: 14px; height: 14px; stroke-width: 2.2; }
.side .grow { flex: 1; }
.me { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 12px; border: 1px solid var(--line); }
.me .meta { min-width: 0; flex: 1; }
.me .meta b { display: block; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me .meta span { display: block; font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: linear-gradient(135deg, var(--purple), #9B4DDB);
          color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 13px; flex: none; overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.icon-btn { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 10px; border: 0;
            background: transparent; cursor: pointer; color: var(--ink-2); }
.icon-btn:hover { background: var(--purple-50); color: var(--purple); }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 20; height: var(--top); display: flex; align-items: center; gap: 14px;
          padding: 0 28px; background: rgba(247, 245, 250, .85); backdrop-filter: saturate(1.4) blur(10px); }
.search { flex: 1; max-width: 560px; display: flex; align-items: center; gap: 10px; background: #fff;
          border: 1px solid var(--line); border-radius: 12px; padding: 0 14px; height: 42px; box-shadow: var(--shadow-sm); }
.search input { border: 0; outline: 0; flex: 1; font: inherit; background: transparent; color: var(--ink); }
.search:focus-within { border-color: #C9A6EA; box-shadow: 0 0 0 4px rgba(106, 15, 163, .08); }
.topbar .mobile-brand { display: none; }
.content { padding: 8px 28px 48px; max-width: 1320px; width: 100%; }

/* ── Hero ── */
.hero { position: relative; overflow: hidden; min-width: 0; border-radius: 22px; padding: 40px 36px 30px; color: #fff;
        background: radial-gradient(1200px 400px at 85% -10%, rgba(245, 158, 11, .45), transparent 60%),
                    radial-gradient(800px 380px at 0% 120%, rgba(155, 77, 219, .9), transparent 60%),
                    linear-gradient(120deg, #4B0877 0%, #6A0FA3 45%, #8C2FC9 100%);
        box-shadow: var(--shadow); }
.hero::after { content: ''; position: absolute; inset: 0; pointer-events: none;
               background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Ccircle cx='2' cy='2' r='1.2' fill='white' fill-opacity='.12'/%3E%3C/svg%3E"); }
.hero h1 { font-family: var(--head); font-weight: 600; font-size: 34px; letter-spacing: -.01em; margin: 0 0 6px; text-align: center; }
.hero p { margin: 0 auto 26px; text-align: center; opacity: .88; font-size: 15px; max-width: 560px; }
.quick { position: relative; z-index: 1; display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; }
.quick a { display: flex; flex-direction: column; align-items: center; gap: 10px; width: 96px; padding: 6px 0;
           border-radius: 14px; transition: transform .18s; }
.quick a:hover { transform: translateY(-4px); }
.quick a:hover .tile { box-shadow: 0 14px 28px rgba(20, 0, 40, .35), inset 0 1px 0 rgba(255,255,255,.45); }
.quick span:last-child { font-size: 12.5px; font-weight: 600; text-align: center; line-height: 1.25; text-shadow: 0 1px 2px rgba(0,0,0,.15); }

/* ── Sections & cards ── */
.section-head { display: flex; align-items: baseline; justify-content: space-between; margin: 34px 0 14px; gap: 12px; }
.section-head h2 { font-family: var(--head); font-weight: 600; font-size: 21px; margin: 0; }
.section-head a { color: var(--purple); font-weight: 600; font-size: 13px; }
.tools { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.tool-card { background: var(--card); border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line);
             box-shadow: var(--shadow-sm); display: flex; flex-direction: column; transition: transform .18s, box-shadow .18s; }
.tool-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.tool-card .art { height: 170px; position: relative; overflow: hidden; display: flex; justify-content: center; align-items: flex-end;
                  background: linear-gradient(160deg, var(--tint, #F6EEFC), #fff); }
.tool-card .art img { width: 68%; border-radius: 8px 8px 0 0; box-shadow: 0 -2px 18px rgba(30, 9, 43, .14);
                      transform: translateY(14px); transition: transform .25s; }
.tool-card:hover .art img { transform: translateY(4px); }
.tool-card .body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.tool-card h3 { margin: 0; font-family: var(--head); font-weight: 600; font-size: 17px; display: flex; align-items: center; gap: 8px; }
.tool-card p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
.tool-card .go { margin-top: 10px; align-self: flex-start; font-weight: 600; color: var(--purple); font-size: 13px;
                 display: inline-flex; align-items: center; gap: 6px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.chip { font-size: 12px; padding: 5px 10px; border-radius: 999px; background: var(--purple-50); color: var(--purple);
        font-weight: 500; border: 1px solid transparent; transition: border-color .12s, background .12s; }
.chip:hover { border-color: #C9A6EA; background: #fff; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 18px; }
.design { position: relative; background: var(--card); border-radius: 12px; border: 1px solid var(--line);
          overflow: hidden; box-shadow: var(--shadow-sm); transition: box-shadow .18s, transform .18s; }
.design:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.design .thumb { aspect-ratio: 1 / 1; background: #F1EDF6; display: grid; place-items: center; overflow: hidden; }
.design .thumb img { width: 100%; height: 100%; object-fit: cover; object-position: top; display: block; }
.design .thumb .ph { width: 54%; aspect-ratio: 210 / 297; background: #fff; border-radius: 4px; box-shadow: var(--shadow-sm);
                     display: grid; place-items: center; color: #C9B8DB; }
.design .info { padding: 10px 12px 12px; }
.design .info b { display: block; font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.design .info span { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 6px; margin-top: 3px; }
.badge { font-size: 10.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; padding: 2px 6px;
         border-radius: 5px; color: #fff; }
.design .actions { position: absolute; top: 8px; right: 8px; display: flex; gap: 6px; opacity: 0; transition: opacity .15s; }
.design:hover .actions, .design:focus-within .actions { opacity: 1; }
.design .actions button, .design .actions a { width: 32px; height: 32px; border-radius: 8px; border: 0; cursor: pointer;
          background: rgba(255, 255, 255, .95); box-shadow: var(--shadow-sm); display: grid; place-items: center; color: var(--ink-2); }
.design .actions button:hover, .design .actions a:hover { color: var(--purple); }
.design .actions svg.i { width: 16px; height: 16px; }
.empty { background: #fff; border: 1px dashed #D8CBE6; border-radius: var(--radius); padding: 40px 20px; text-align: center; color: var(--muted); }
.empty b { display: block; color: var(--ink); font-family: var(--head); font-size: 17px; font-weight: 600; margin-bottom: 4px; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.filters a { padding: 7px 14px; border-radius: 999px; border: 1px solid var(--line); background: #fff; font-weight: 500; font-size: 13px; color: var(--ink-2); }
.filters a.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.page-title { font-family: var(--head); font-weight: 600; font-size: 28px; margin: 8px 0 18px; }

/* ── Modal / sheet ── */
.modal { position: fixed; inset: 0; z-index: 100; background: rgba(30, 9, 43, .45); backdrop-filter: blur(3px);
         display: none; align-items: center; justify-content: center; padding: 20px; }
.modal.open { display: flex; animation: fade .15s ease-out; }
.sheet { background: #fff; border-radius: 20px; box-shadow: var(--shadow-lg); width: min(860px, 100%); max-height: 90vh;
         overflow: auto; padding: 24px; animation: rise .2s ease-out; }
.sheet.small { width: min(420px, 100%); text-align: center; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.sheet-head h2 { font-family: var(--head); font-weight: 600; font-size: 22px; margin: 0; }
.pick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.pick a { border: 1px solid var(--line); border-radius: 14px; padding: 16px; display: flex; flex-direction: column; gap: 8px;
          transition: border-color .15s, box-shadow .15s, transform .15s; }
.pick a:hover { border-color: #C9A6EA; box-shadow: var(--shadow); transform: translateY(-2px); }
.pick .ic { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; color: #fff; }
.pick b { font-family: var(--head); font-weight: 600; font-size: 16px; }
.pick p { margin: 0; font-size: 12.5px; color: var(--muted); line-height: 1.5; }
.pick .need { font-size: 12px; color: var(--ink-2); background: var(--bg); border-radius: 8px; padding: 8px 10px; line-height: 1.45; }
.sub-pick { margin-top: 18px; }
.sub-pick h4 { margin: 0 0 8px; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.qr { display: inline-block; padding: 12px; border-radius: 14px; border: 1px solid var(--line); margin: 6px 0 10px; min-height: 100px; }
.qr svg { display: block; width: 220px; height: 220px; }
.muted { color: var(--muted); font-size: 13px; line-height: 1.55; }
.toast { position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 20px); opacity: 0; z-index: 200;
         background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 12px; box-shadow: var(--shadow-lg);
         display: flex; align-items: center; gap: 10px; font-weight: 500; transition: opacity .2s, transform .2s; pointer-events: none; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast a { color: #E7C9FF; font-weight: 600; pointer-events: auto; }
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { transform: translateY(12px); opacity: 0; } }

/* ── Mobile ── */
.bottom-nav { display: none; }
@media (max-width: 900px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  body { overflow-x: hidden; }
  .side { display: none; }
  .topbar { padding: 0 16px; gap: 10px; }
  .topbar .mobile-brand { display: block; height: 26px; }
  .content { padding: 4px 16px 96px; }
  .hero { padding: 28px 16px 22px; border-radius: 18px; }
  .hero h1 { font-size: 24px; }
  .hero p { font-size: 13.5px; margin-bottom: 18px; }
  .quick { flex-wrap: nowrap; overflow-x: auto; justify-content: flex-start; padding-bottom: 4px; scrollbar-width: none; }
  .quick::-webkit-scrollbar { display: none; }
  .quick a { flex: none; width: 80px; }
  .quick .tile { width: 54px; height: 54px; border-radius: 17px; }
  .tools { grid-template-columns: minmax(0, 1fr); }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .design .actions { opacity: 1; }
  .pick { grid-template-columns: 1fr; }
  .modal { align-items: flex-end; padding: 0; }
  .sheet { border-radius: 20px 20px 0 0; max-height: 88vh; padding: 20px 16px calc(20px + env(safe-area-inset-bottom)); }
  .bottom-nav { display: grid; grid-template-columns: repeat(4, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
                background: rgba(255, 255, 255, .96); backdrop-filter: blur(10px); border-top: 1px solid var(--line);
                padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); }
  .bottom-nav a, .bottom-nav button { display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 11px;
                font-weight: 500; color: var(--muted); background: none; border: 0; padding: 4px 0; cursor: pointer; }
  .bottom-nav .on { color: var(--purple); }
  .bottom-nav .plus { width: 46px; height: 34px; border-radius: 12px; color: #fff; display: grid; place-items: center;
                      background: linear-gradient(145deg, #9B4DDB, #6A0FA3 55%, #4B0877); box-shadow: 0 6px 14px rgba(106,15,163,.35); }
  .toast { bottom: 84px; }
}

/* ── App-icon tiles (one colour per design type) ── */
.tile { --g1: #8C2FC9; --g2: #5A0A8C; position: relative; display: grid; place-items: center; flex: none;
        width: 60px; height: 60px; border-radius: 19px; color: #fff;
        background: linear-gradient(145deg, var(--g1), var(--g2));
        box-shadow: 0 8px 18px rgba(20, 0, 40, .25), inset 0 1px 0 rgba(255,255,255,.45);
        transition: box-shadow .18s, transform .18s; overflow: hidden; }
.tile::before { content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
                background: radial-gradient(120% 70% at 30% 0%, rgba(255,255,255,.38), transparent 55%); }
.tile svg.i { position: relative; width: 28px; height: 28px; stroke-width: 1.9; }
.tile.sm { width: 42px; height: 42px; border-radius: 13px; box-shadow: 0 4px 10px rgba(20,0,40,.16), inset 0 1px 0 rgba(255,255,255,.4); }
.tile.sm svg.i { width: 21px; height: 21px; }
.tile.xs { width: 30px; height: 30px; border-radius: 9px; box-shadow: 0 3px 8px rgba(20,0,40,.15), inset 0 1px 0 rgba(255,255,255,.4); }
.tile.xs svg.i { width: 16px; height: 16px; stroke-width: 2.1; }
.k-caregiver     { --g1: #A855F7; --g2: #6A0FA3; }
.k-genie         { --g1: #FBBF24; --g2: #EA7A0B; }
.k-documents     { --g1: #34D399; --g2: #0E7C66; }
.k-care-plan     { --g1: #F472B6; --g2: #BE185D; }
.k-exercise-plan { --g1: #2DD4BF; --g2: #0F766E; }
.k-physio-plan   { --g1: #60A5FA; --g2: #1D4ED8; }
.k-doctor-visit  { --g1: #38BDF8; --g2: #0369A1; }
.k-consultation  { --g1: #818CF8; --g2: #4338CA; }
.k-visit-summary { --g1: #FB923C; --g2: #C2410C; }
.k-home-visit    { --g1: #4ADE80; --g2: #15803D; }
.k-proposal      { --g1: #C084FC; --g2: #7E22CE; }
.pick .tile { width: 46px; height: 46px; border-radius: 14px; }
.pick .tile svg.i { width: 23px; height: 23px; }

/* ── Canva-style rail ── */
.rail { align-items: center; padding: 16px 8px 14px; gap: 6px;
        background: linear-gradient(180deg, #FFFFFF 0%, #FBF8FE 100%);
        border-right: 1px solid var(--line); box-shadow: 1px 0 0 rgba(255,255,255,.6) inset; }
.rail .mark { display: grid; place-items: center; width: 52px; height: 52px; margin-bottom: 10px; border-radius: 16px;
              transition: transform .2s; }
.rail .mark:hover { transform: rotate(-8deg) scale(1.05); }
.rail .mark img { width: 46px; height: 46px; display: block; }
.rail-create { display: flex; flex-direction: column; align-items: center; gap: 6px; background: none; border: 0;
               cursor: pointer; padding: 4px 0 10px; width: 100%; }
.rc-btn { width: 50px; height: 50px; border-radius: 16px; display: grid; place-items: center; color: #fff;
          background: linear-gradient(145deg, #9B4DDB, #6A0FA3 55%, #4B0877);
          box-shadow: 0 10px 22px rgba(106, 15, 163, .38), inset 0 1px 0 rgba(255,255,255,.4);
          transition: transform .18s, box-shadow .18s; }
.rc-btn svg.i { width: 26px; height: 26px; stroke-width: 2.4; }
.rail-create:hover .rc-btn { transform: translateY(-2px) rotate(90deg); box-shadow: 0 14px 28px rgba(106, 15, 163, .45), inset 0 1px 0 rgba(255,255,255,.4); }
.rail-create .rl { color: var(--purple); font-weight: 700; }
.rail-nav { display: flex; flex-direction: column; align-items: center; gap: 4px; width: 100%; }
.rail-nav a, .rail-plain { position: relative; display: flex; flex-direction: column; align-items: center; gap: 5px; width: 100%;
                          padding: 7px 0; border-radius: 14px; background: none; border: 0; cursor: pointer; color: var(--ink-2); }
.rl { font-size: 11px; font-weight: 600; letter-spacing: .01em; line-height: 1.1; text-align: center; }
.ri { width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center; transition: background .15s, color .15s; }
.ri svg.i { width: 22px; height: 22px; }
.rail-nav a:hover .ri, .rail-plain:hover .ri { background: var(--purple-50); color: var(--purple); }
.rail-nav a.on .ri { background: linear-gradient(145deg, #F3E8FD, #E7D4FA); color: var(--purple); box-shadow: inset 0 0 0 1px #DCC3F4; }
.rail-nav a.on .rl { color: var(--purple); }
.rail-nav a.on::before { content: ''; position: absolute; left: -8px; top: 14px; width: 4px; height: 28px; border-radius: 0 4px 4px 0; background: var(--purple); }
.rail-nav .tool-link .tile { transition: transform .18s, box-shadow .18s; }
.rail-nav .tool-link:hover .tile { transform: translateY(-2px); box-shadow: 0 8px 16px rgba(20,0,40,.22), inset 0 1px 0 rgba(255,255,255,.45); }
.rail-sep { width: 36px; height: 1px; background: var(--line); margin: 8px 0; }
.me-wrap { position: relative; }
.me-btn { background: none; border: 0; padding: 3px; border-radius: 50%; cursor: pointer; box-shadow: 0 0 0 2px #fff, 0 0 0 4px #E7D4FA; transition: box-shadow .15s; }
.me-btn:hover { box-shadow: 0 0 0 2px #fff, 0 0 0 4px #B98BE3; }
.me-btn .avatar { width: 38px; height: 38px; }
.avatar.lg { width: 44px; height: 44px; font-size: 16px; }
.me-pop { position: absolute; left: calc(100% + 14px); bottom: 0; width: 260px; background: #fff; border-radius: 16px;
          box-shadow: var(--shadow-lg); border: 1px solid var(--line); padding: 14px; display: none; z-index: 60; }
.me-pop.open { display: block; animation: rise .15s ease-out; }
.me-head { display: flex; gap: 12px; align-items: center; padding-bottom: 12px; border-bottom: 1px solid var(--line); margin-bottom: 8px; }
.me-head b { display: block; font-size: 14px; }
.me-head span { display: block; font-size: 12px; color: var(--muted); word-break: break-all; }
.me-out { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border: 0; background: none; border-radius: 10px;
          cursor: pointer; font-weight: 600; color: var(--ink-2); }
.me-out:hover { background: #FDECEC; color: #9B1C1C; }
.topbar .mobile-brand { height: 34px; }
