/* Website chrome, home page, tools, auth and admin. Component basics and House Search styles are in style.css. */

body { min-height: 100vh; display: flex; flex-direction: column;
       background:
         radial-gradient(1200px 600px at 85% -10%, color-mix(in srgb, var(--accent) 16%, transparent), transparent 60%),
         radial-gradient(900px 500px at -10% 110%, color-mix(in srgb, var(--accent-2) 10%, transparent), transparent 60%),
         var(--bg);
       background-attachment: fixed; }
main { flex: 1 0 auto; }
a { color: var(--accent); }
h1, h2, h3, h4 { letter-spacing: -.01em; }
.icon { width: 18px; height: 18px; flex: none; }
.icon.chev { width: 14px; height: 14px; opacity: .75; transition: transform .15s; }
.card { background: var(--surface); border-color: var(--line); border-radius: 16px; backdrop-filter: blur(10px); }
.notice { border-color: var(--accent); }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 8px 18px; border-radius: 999px;
       border: 1px solid var(--line); background: var(--surface); color: var(--fg); font: inherit; font-weight: 500;
       text-decoration: none; cursor: pointer; white-space: nowrap; transition: background .15s, border-color .15s, transform .15s, box-shadow .15s; }
.btn:hover { border-color: color-mix(in srgb, var(--accent) 60%, var(--line)); }
.btn.primary { background: var(--grad); border-color: transparent; color: #fff; font-weight: 600;
               box-shadow: 0 6px 24px color-mix(in srgb, var(--accent) 35%, transparent); }
.btn.primary:hover { transform: translateY(-1px); box-shadow: 0 10px 30px color-mix(in srgb, var(--accent) 45%, transparent); }
.btn.outline { background: transparent; border-color: color-mix(in srgb, var(--fg) 30%, transparent); }
.btn.outline:hover { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, transparent); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.ghost:hover { color: var(--fg); }
.btn.lg { padding: 12px 26px; font-size: 1.05rem; }
.btn.sm { padding: 4px 12px; font-size: .82rem; }
.btn.danger { color: var(--danger); }
.btn.danger:hover { border-color: var(--danger); background: color-mix(in srgb, var(--danger) 10%, transparent); }
.btn:disabled { opacity: .6; cursor: progress; }
.icon-btn { display: inline-grid; place-items: center; width: 40px; height: 40px; padding: 0; border-radius: 50%;
            background: transparent; border: 1px solid transparent; color: var(--fg); cursor: pointer; }
.icon-btn:hover, .dropdown.open > .icon-btn { background: var(--surface-2); border-color: var(--line); }
.icon-btn .icon { width: 20px; height: 20px; }

/* ---------- header ---------- */
.site-header { position: sticky; top: 0; z-index: 2000; background: var(--header-bg); backdrop-filter: blur(14px) saturate(140%);
               border-bottom: 1px solid var(--line); }
.header-inner { max-width: 1280px; margin: 0 auto; padding: 12px 24px; display: flex; align-items: center; gap: 24px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--fg); text-decoration: none; font-weight: 600;
         font-size: 1.15rem; letter-spacing: .02em; }
.logo-mark { width: 32px; height: 32px; }
.site-nav { flex: 1; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.nav-links { list-style: none; display: flex; gap: 4px; margin: 0 0 0 16px; padding: 0; }
.nav-links > li > a, .nav-link { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 999px;
       color: var(--muted); text-decoration: none; background: none; border: 0; font: inherit; cursor: pointer; }
.nav-links > li > a:hover, .nav-link:hover, .dropdown.open > .nav-link, .nav-links [aria-current], .nav-link[data-current] { color: var(--fg); }
.nav-actions { display: flex; align-items: center; gap: 8px; }
.nav-toggle { display: none; margin-left: auto; }

/* dropdown menus (Tools, settings) */
.dropdown { position: relative; }
.menu { position: absolute; top: calc(100% + 8px); left: 0; min-width: 240px; padding: 8px; border-radius: 14px;
        background: var(--surface-solid); border: 1px solid var(--line); box-shadow: var(--shadow);
        display: none; flex-direction: column; gap: 2px; z-index: 10; }
.dropdown.open > .menu { display: flex; }
@media (hover: hover) and (min-width: 901px) {
  .dropdown:not(.settings):not(.notifications):hover > .menu { display: flex; }
  .dropdown:not(.settings):not(.notifications):hover > .nav-link .chev { transform: rotate(180deg); }
  /* invisible bridge so the pointer can travel from the button to the menu */
  .dropdown:not(.settings):not(.notifications) > .menu::before { content: ""; position: absolute; left: 0; right: 0; top: -10px; height: 10px; }
}
.dropdown.open > .nav-link .chev { transform: rotate(180deg); }
.menu-item { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 10px; color: var(--fg);
             text-decoration: none; }
.menu-item:hover, .submenu:hover > .has-sub, .submenu.open > .has-sub { background: var(--surface-2); }
.menu-item .icon { color: var(--accent); }
.menu-item.has-sub span { flex: 1; }
.menu-item.muted-item { color: var(--muted); font-size: .9rem; border-top: 1px solid var(--line); border-radius: 0 0 10px 10px; margin-top: 4px; padding-top: 10px; }
.submenu { position: relative; }
.menu.sub { top: -8px; left: calc(100% + 6px); min-width: 300px; }
.submenu:hover > .menu.sub, .submenu.open > .menu.sub, .submenu:focus-within > .menu.sub { display: flex; }
.menu.sub::before { content: ""; position: absolute; top: 0; bottom: 0; left: -10px; width: 10px; }
.tool-item { align-items: flex-start; }
.tool-item span { display: flex; flex-direction: column; gap: 2px; }
.tool-item small { color: var(--muted); font-size: .8rem; line-height: 1.35; }

.settings-menu { left: auto; right: 0; min-width: 250px; padding: 14px; gap: 8px; }
.notif-menu { left: auto; right: 0; min-width: 280px; padding: 14px; gap: 8px; }
.notif-empty { margin: 4px 0 2px; font-size: .92rem; }
.menu-label { margin: 2px 0 0; font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.segmented { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; border-radius: 12px; background: var(--surface-2); }
.segmented button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 7px 8px; border-radius: 9px;
                    border: 0; background: transparent; color: var(--muted); cursor: pointer; font: inherit; }
.segmented button[aria-checked="true"] { background: var(--surface-solid); color: var(--fg); box-shadow: 0 1px 4px rgba(0,0,0,.15); }
.segmented .icon { width: 16px; height: 16px; }
.flags { display: flex; gap: 8px; }
.flag-btn { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 6px; border-radius: 12px;
            border: 1px solid var(--line); background: transparent; color: var(--fg); cursor: pointer; font: inherit; font-size: .85rem; }
.flag-btn[aria-checked="true"] { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); }
.flag { width: 36px; height: 24px; border-radius: 4px; box-shadow: 0 0 0 1px rgba(0,0,0,.12); }

/* ---------- page shell ---------- */
.page { max-width: 1280px; padding: 32px 24px; width: 100%; }
.page.narrow { max-width: 460px; padding-top: 56px; }
.page-head { margin: 0 0 20px; }
.page-head h1 { font-size: 2rem; font-weight: 600; margin: 0 0 4px; }
.site-footer { padding: 28px 24px; text-align: center; color: var(--muted); font-size: .85rem; border-top: 1px solid var(--line); margin-top: 40px; }
.eyebrow { margin: 0 0 10px; font-size: .85rem; text-transform: uppercase; letter-spacing: .16em; color: var(--muted); font-weight: 500; }
.ok-msg { color: var(--ok); margin: 0; }

/* ---------- hero ---------- */
.home-main { display: block; }
.hero { position: relative; overflow: hidden; min-height: calc(100vh - 65px); display: flex; align-items: center;
        background:
          radial-gradient(900px 700px at 78% 40%, rgba(147, 51, 234, .45), transparent 60%),
          radial-gradient(700px 500px at 100% 0%, rgba(56, 189, 248, .30), transparent 60%),
          radial-gradient(600px 600px at 60% 100%, rgba(236, 72, 153, .22), transparent 60%),
          linear-gradient(180deg, #05041a 0%, #0b0828 100%);
        color: #f6f4ff; isolation: isolate; }
.hero.has-image { background: linear-gradient(90deg, rgba(5,4,26,.92) 0%, rgba(5,4,26,.65) 45%, rgba(5,4,26,.25) 100%), var(--hero-image) center / cover no-repeat, #05041a; }
.hero-bg { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.hero.has-image .hero-bg { display: none; }
.orb { position: absolute; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #c084fc, #4c1d95 60%, #1e1048); box-shadow: 0 0 40px rgba(168,85,247,.35); opacity: .85; }
.orb-1 { width: 74px; height: 74px; left: 56%; top: 16%; }
.orb-2 { width: 48px; height: 48px; left: 44%; bottom: 8%; background: radial-gradient(circle at 35% 30%, #f0abfc, #7e22ce 60%, #2e1065); }
.orb-3 { width: 18px; height: 18px; right: 8%; top: 70%; background: radial-gradient(circle at 35% 30%, #7dd3fc, #2563eb 70%); }
.planet { position: absolute; width: 760px; height: 760px; left: -420px; bottom: -560px; border-radius: 50%;
          background: radial-gradient(circle at 60% 25%, #f472b6 0%, #c026d3 25%, #6d28d9 55%, #1e1b4b 80%);
          box-shadow: 0 0 120px rgba(236,72,153,.45), inset -40px -40px 120px rgba(0,0,0,.5); opacity: .9; }
.hero-inner { width: 100%; max-width: 1280px; margin: 0 auto; padding: 72px 24px; display: grid; grid-template-columns: 1.05fr 1fr; gap: 32px; align-items: center; }
.hero-copy h1 { font-size: clamp(2.3rem, 5vw, 4.2rem); line-height: 1.06; font-weight: 600; margin: 0 0 22px; letter-spacing: -.02em;
                background: linear-gradient(180deg, #ffffff 30%, #d9d3ff 100%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero .eyebrow { color: #e9e4ff; letter-spacing: .2em; }
.hero .lead { font-size: 1.15rem; color: #c9c2ec; max-width: 560px; margin: 0 0 32px; }
.hero-cta { display: flex; gap: 14px; flex-wrap: wrap; }
.hero .btn.outline { color: #fff; border-color: rgba(255,255,255,.4); }
.hero-mark { display: inline-flex; flex-direction: column; gap: 3px; margin-bottom: 28px; }
.hero-mark i { display: block; height: 6px; border-radius: 6px; background: linear-gradient(90deg, #c084fc, #f0abfc); }
.hero-mark i:nth-child(1) { width: 26px; margin-left: 7px; } .hero-mark i:nth-child(2) { width: 38px; margin-left: 1px; }
.hero-mark i:nth-child(3) { width: 40px; opacity: .85; } .hero-mark i:nth-child(4) { width: 28px; margin-left: 6px; opacity: .7; }

/* light theme: a pale sky behind the same glass cards (an uploaded image keeps its dark overlay) */
[data-theme="light"] .hero:not(.has-image) {
  background:
    radial-gradient(900px 700px at 78% 40%, rgba(168, 85, 247, .30), transparent 60%),
    radial-gradient(700px 500px at 100% 0%, rgba(56, 189, 248, .25), transparent 60%),
    radial-gradient(600px 600px at 60% 100%, rgba(236, 72, 153, .18), transparent 60%),
    linear-gradient(180deg, #faf8ff 0%, #efe9ff 100%);
  color: var(--fg); }
[data-theme="light"] .hero:not(.has-image) h1 { background: linear-gradient(180deg, #1a1540 30%, #4c1d95 100%); -webkit-background-clip: text; background-clip: text; }
[data-theme="light"] .hero:not(.has-image) .eyebrow { color: #4c1d95; }
[data-theme="light"] .hero:not(.has-image) .lead { color: var(--muted); }
[data-theme="light"] .hero:not(.has-image) .btn.outline { color: var(--fg); border-color: color-mix(in srgb, var(--fg) 30%, transparent); }
[data-theme="light"] .hero:not(.has-image) .planet { opacity: .55; }

/* isometric glass cards */
.hero-art { position: relative; height: 560px; perspective: 1600px; }
.iso { position: absolute; inset: 0; transform: rotateX(52deg) rotateZ(-38deg) translate(40px, -40px); transform-style: preserve-3d; }
.glass { position: absolute; border-radius: 22px; padding: 18px; color: #fff;
         background: linear-gradient(145deg, rgba(255,255,255,.16), rgba(255,255,255,.04));
         border: 1px solid rgba(255,255,255,.22); box-shadow: 0 40px 80px rgba(10,0,40,.6), inset 0 1px 0 rgba(255,255,255,.25);
         backdrop-filter: blur(8px); }
.card-a { width: 230px; height: 300px; left: 40px; top: 210px; background: linear-gradient(150deg, rgba(91,33,182,.55), rgba(30,27,75,.55)); }
.card-b { width: 270px; height: 270px; left: 170px; top: -10px; display: grid; place-items: center;
          background: linear-gradient(150deg, rgba(76,29,149,.55), rgba(15,23,42,.55)); transform: translateZ(60px); }
.card-c { width: 250px; height: 330px; left: 400px; top: 120px; background: linear-gradient(160deg, rgba(219,39,119,.55), rgba(124,58,237,.55)); }
.card-d { width: 190px; height: 150px; left: 330px; top: 410px; background: linear-gradient(140deg, rgba(236,72,153,.85), rgba(168,85,247,.7)); transform: translateZ(30px); }
.mini-head { display: flex; gap: 5px; margin-bottom: 12px; } .mini-head span { width: 8px; height: 8px; border-radius: 50%; background: rgba(255,255,255,.5); }
.mini-photo { height: 110px; border-radius: 12px; margin-bottom: 14px; background: linear-gradient(135deg, #38bdf8 0%, #818cf8 50%, #c084fc 100%); opacity: .85; }
.mini-line { height: 9px; border-radius: 6px; background: rgba(255,255,255,.35); margin: 0 0 10px; }
.mini-line.hl { background: linear-gradient(90deg, #22d3ee, #a78bfa); height: 7px; }
.w50 { width: 50%; } .w60 { width: 60%; } .w70 { width: 70%; } .w80 { width: 80%; } .w90 { width: 90%; }
.mini-price { font-weight: 700; font-size: 1.3rem; margin: 2px 0 10px; }
.mini-tags { display: flex; gap: 6px; } .mini-tags b { font-size: .7rem; font-weight: 600; padding: 2px 8px; border-radius: 99px; background: rgba(255,255,255,.18); }
.mini-tags b.g { background: rgba(74,222,128,.35); }
.ring { position: absolute; width: 180px; height: 180px; border-radius: 50%; border: 2px solid rgba(56,189,248,.7); box-shadow: 0 0 30px rgba(56,189,248,.5), inset 0 0 30px rgba(56,189,248,.35); }
.swirl { width: 120px; height: 160px; border-radius: 60% 40% 55% 45% / 55% 45% 55% 45%;
         background: conic-gradient(from 200deg, #38bdf8, #6366f1, #a855f7, #ec4899, #38bdf8);
         filter: blur(1px) drop-shadow(0 0 30px rgba(99,102,241,.8)); transform: translateZ(70px) rotate(25deg); animation: float 7s ease-in-out infinite; }
.bars { display: flex; align-items: flex-end; gap: 10px; height: 110px; margin-top: 24px; }
.bars i { flex: 1; border-radius: 6px 6px 2px 2px; background: linear-gradient(180deg, #f0abfc, rgba(255,255,255,.25)); }
.big-num { font-size: 3rem; font-weight: 700; line-height: 1; margin: 6px 0 14px; } .big-num small { font-size: 1.2rem; }
@keyframes float { 0%, 100% { transform: translateZ(70px) rotate(25deg) translateY(0); } 50% { transform: translateZ(70px) rotate(32deg) translateY(-14px); } }
@media (prefers-reduced-motion: reduce) { .swirl { animation: none; } }

/* ---------- sections ---------- */
.section { padding: 80px 24px; }
.section-inner { max-width: 1280px; margin: 0 auto; }
.section-title { font-size: 2rem; font-weight: 600; margin: 0 0 8px; }
.section-lead { color: var(--muted); margin: 0 0 32px; font-size: 1.05rem; }
.category { margin-bottom: 32px; }
.category-title { display: flex; align-items: center; gap: 10px; font-size: 1.15rem; font-weight: 500; margin: 0 0 14px; color: var(--muted); }
.category-title a { color: inherit; text-decoration: none; } .category-title a:hover { color: var(--fg); }
.category-title .icon { color: var(--accent); width: 22px; height: 22px; }
.tool-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; }
.tool-card { position: relative; display: flex; flex-direction: column; gap: 6px; padding: 22px; border-radius: 18px;
             background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); overflow: hidden; }
.tool-card::after { content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; background: var(--grad); opacity: .9; }
.tool-card h4 { margin: 6px 0 0; font-size: 1.2rem; font-weight: 600; }
.tool-card p { margin: 0 0 12px; color: var(--muted); flex: 1; }
.tool-icon { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; color: #fff; background: var(--grad); }
.tool-icon .icon { width: 24px; height: 24px; }
.tool-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.status { font-size: .85rem; color: var(--muted); }
.status.ok { color: var(--ok); } .status.bad { color: var(--danger); }
.how { background: linear-gradient(180deg, transparent, color-mix(in srgb, var(--accent) 6%, transparent)); }
.steps { list-style: none; padding: 0; margin: 28px 0 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.steps li { padding: 24px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); }
.steps h3 { margin: 12px 0 6px; font-size: 1.1rem; font-weight: 600; } .steps p { margin: 0; color: var(--muted); }
.step-n { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--grad); color: #fff; font-weight: 600; }

/* ---------- auth & account ---------- */
.auth-card { padding: 28px; }
.auth-card h1 { font-size: 1.7rem; font-weight: 600; }
.auth-card .btn.primary { width: 100%; padding: 11px; }
.account-grid { display: grid; grid-template-columns: 1fr 380px; gap: 24px; align-items: start; }
.account-grid h2 { font-size: 1.2rem; font-weight: 600; margin: 0 0 12px; }

/* ---------- admin ---------- */
.tabs { display: inline-flex; gap: 4px; padding: 4px; border-radius: 14px; background: var(--surface-2); margin-bottom: 18px; }
.tabs button { border: 0; background: transparent; color: var(--muted); padding: 8px 18px; border-radius: 10px; cursor: pointer; font: inherit; font-weight: 500; }
.tabs button[aria-selected="true"] { background: var(--surface-solid); color: var(--fg); box-shadow: 0 1px 4px rgba(0,0,0,.15); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.card-head h2 { margin: 0; }
label.inline { flex-direction: row; align-items: center; gap: 8px; } label.inline select { width: auto; }
#users td { vertical-align: top; white-space: normal; } #users td:first-child { white-space: nowrap; }
.grants { display: flex; flex-direction: column; gap: 6px; }
.grant { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row-actions { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.pill { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: .8rem; font-weight: 600; background: var(--chip); }
.pill.ok { background: color-mix(in srgb, var(--ok) 18%, transparent); color: var(--ok); }
.pill.bad { background: color-mix(in srgb, var(--danger) 16%, transparent); color: var(--danger); }
.pill.status-active { background: color-mix(in srgb, var(--accent-3) 18%, transparent); color: var(--accent-3); }
.pill.status-redeemed { background: color-mix(in srgb, var(--ok) 18%, transparent); color: var(--ok); }
.pill.status-revoked, .pill.status-expired { color: var(--muted); }
.used-tokens { display: flex; flex-direction: column; gap: 4px; font-size: .88rem; }
.used-tokens code, #tokens code { font-size: .85rem; }
details.fold > summary { cursor: pointer; font-weight: 600; font-size: .88rem; width: max-content; }
details.fold[open] > summary { margin-bottom: 8px; }
td.tk-note { white-space: normal; min-width: 160px; color: var(--muted); }
.bg-preview { height: 220px; border-radius: 14px; margin: 12px 0 16px; border: 1px solid var(--line); display: grid; place-items: center; color: #d9d3ff;
              background: radial-gradient(400px 300px at 75% 40%, rgba(147,51,234,.5), transparent 60%), linear-gradient(180deg, #05041a, #0b0828); }
.bg-preview[style*="--hero-image"] { background: linear-gradient(90deg, rgba(5,4,26,.85), rgba(5,4,26,.2)), var(--hero-image) center / cover no-repeat; }
.bg-form { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.bg-form input[type=file] { width: auto; max-width: 100%; }

/* ---------- House Search inside the site ---------- */
.tool-page .search-form, .tool-page #results-section { max-width: 1280px; }
.leaflet-container { border-radius: 12px; }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .hero-inner { grid-template-columns: 1fr; }
  .orb-1, .orb-2 { display: none; }
  .hero-art { height: 420px; margin-top: -20px; }
  .iso { transform: rotateX(52deg) rotateZ(-38deg) translate(0, -60px) scale(.8); }
}
@media (max-width: 900px) {
  .header-inner { flex-wrap: wrap; padding: 10px 16px; gap: 12px; }
  .nav-toggle { display: inline-grid; }
  .site-nav { display: none; flex-basis: 100%; flex-direction: column; align-items: stretch; padding: 8px 0 12px; }
  body.nav-open .site-nav { display: flex; }
  .nav-links { flex-direction: column; margin: 0; }
  .nav-actions { flex-wrap: wrap; }
  .menu { position: static; box-shadow: none; margin-top: 4px; }
  .menu.sub { position: static; min-width: 0; margin: 2px 0 6px 18px; }
  .menu.sub::before, .dropdown > .menu::before { display: none; }
  .submenu:hover > .menu.sub { display: none; }
  .submenu.open > .menu.sub { display: flex; }
  .settings-menu, .notif-menu { min-width: 0; }
  .steps { grid-template-columns: 1fr; }
  .account-grid { grid-template-columns: 1fr; }
  .page { padding: 20px 16px; }
  .section { padding: 56px 16px; }
  .hero-inner { padding: 48px 16px; }
}
@media (max-width: 560px) {
  .hero-art { height: 320px; }
  .iso { transform: rotateX(52deg) rotateZ(-38deg) translate(-40px, -80px) scale(.6); }
  .tool-grid { grid-template-columns: 1fr; }
  .planet { width: 480px; height: 480px; left: -300px; bottom: -380px; }
}
.hero.has-image .hero-art { visibility: hidden; }

/* admin: invite with one token per tool */
.invite-tools { border: 1px solid var(--line, #d0d7de); border-radius: 8px; padding: 10px 14px; display: grid; gap: 10px; }
.invite-tool { display: grid; grid-template-columns: minmax(160px, 1.2fr) repeat(2, minmax(140px, 1fr)); gap: 10px; align-items: end; }
.invite-tool label.check { flex-direction: row; align-items: center; gap: 6px; }
.new-codes { list-style: none; padding: 0; display: grid; gap: 4px; }
.new-codes code { word-break: break-all; }
@media (max-width: 640px) { .invite-tool { grid-template-columns: 1fr; } }

/* news */
.news-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 16px; max-width: 820px; }
.news-item { padding: 22px 24px; margin: 0; }
.news-item h2 { margin: 2px 0 8px; font-size: 1.2rem; font-weight: 600; }
.news-item time { font-size: .82rem; color: var(--muted); letter-spacing: .02em; }
.news-body { margin: 0; white-space: pre-line; color: var(--fg); line-height: 1.55; }
.news-form textarea { min-height: 120px; resize: vertical; }
.news-form .check { flex-direction: row; align-items: center; gap: 8px; align-self: flex-start; }
.news-form .check input { width: auto; margin: 0; }
.news-form .form-actions { display: flex; gap: 10px; flex-wrap: wrap; }
#news-admin td { vertical-align: top; white-space: normal; }
#news-admin td.news-text { min-width: 260px; max-width: 520px; color: var(--muted); white-space: pre-line; }

/* groups */
.group-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.group-card { display: block; color: var(--fg); text-decoration: none; padding: 20px 22px; margin: 0; }
.group-card:hover { border-color: color-mix(in srgb, var(--accent) 60%, var(--line)); }
.group-card h2 { margin: 0 0 6px; font-size: 1.15rem; font-weight: 600; }
.group-card p { margin: 0 0 8px; }
.group-meta { display: flex; align-items: center; gap: 8px; }
.group-head h1 { margin-top: 4px; }
.group-head .news-body { color: var(--muted); max-width: 820px; }
.group-form textarea { resize: vertical; }
.group-form .form-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
#members td, #invites td, #pool td, #given td { vertical-align: middle; }
.row-actions.give select { width: auto; min-width: 200px; padding: 4px 8px; }
.pill.invite-pending { background: color-mix(in srgb, var(--accent-3) 18%, transparent); color: var(--accent-3); }
.pill.invite-accepted { background: color-mix(in srgb, var(--ok) 18%, transparent); color: var(--ok); }
.pill.invite-expired, .pill.invite-cancelled { color: var(--muted); }
#invite-link { word-break: break-all; white-space: normal; font-size: .85rem; }
.card h3 { font-size: 1rem; margin: 18px 0 6px; font-weight: 600; }
.inline-form { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; margin-bottom: 12px; }
.inline-form label { flex: 1 1 280px; max-width: 460px; }

/* group cork board */
.board-card .card-head { margin-bottom: 12px; }
.cork { position: relative; display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 22px 18px; align-items: start;
        padding: 26px 20px; border-radius: 12px; min-height: 180px; border: 8px solid #6b4423;
        background: radial-gradient(circle at 20% 30%, rgba(0,0,0,.08) 1px, transparent 2px) 0 0 / 9px 9px,
                    radial-gradient(circle at 70% 60%, rgba(255,255,255,.08) 1px, transparent 2px) 0 0 / 13px 13px, #b88651;
        box-shadow: inset 0 2px 10px rgba(0,0,0,.35); }
.cork-empty { grid-column: 1 / -1; margin: 40px 0; text-align: center; color: #3b2612; font-weight: 500; }
.note { position: relative; color: #2b2410; background: #fff3a8; border-radius: 2px; padding: 0; transform: rotate(var(--tilt, 0deg));
        box-shadow: 0 6px 14px rgba(0,0,0,.28); transition: transform .15s, box-shadow .15s; }
.note::before { content: ""; position: absolute; top: -7px; left: 50%; width: 14px; height: 14px; margin-left: -7px; border-radius: 50%;
                background: radial-gradient(circle at 35% 35%, #ff8a8a, #c0262d 70%); box-shadow: 0 2px 3px rgba(0,0,0,.4); }
.note.c1 { background: #ffd1dc; } .note.c2 { background: #c9e8ff; } .note.c3 { background: #d4f5c9; }
.note:hover { transform: rotate(0deg) translateY(-2px); box-shadow: 0 10px 20px rgba(0,0,0,.3); }
.note.open { transform: rotate(0deg) scale(1.03); z-index: 2; box-shadow: 0 14px 30px rgba(0,0,0,.35); }
.note-head { display: block; width: 100%; text-align: left; background: none; border: 0; color: inherit; padding: 18px 14px 14px;
             font: inherit; font-weight: 600; font-size: 1.02rem; line-height: 1.3; cursor: pointer; overflow-wrap: anywhere; }
.note-head small { display: block; font-weight: 400; font-size: .78rem; opacity: .7; margin-top: 4px; }
.note-body { padding: 0 14px 12px; font-size: .9rem; }
.note-body p { margin: 0 0 8px; }
.note-desc { white-space: pre-line; overflow-wrap: anywhere; }
.note-meta { display: grid; gap: 2px; font-size: .82rem; opacity: .85; margin-bottom: 8px; overflow-wrap: anywhere; }
.reactions { display: flex; flex-wrap: wrap; gap: 4px; margin: 6px 0 8px; }
.reactions button { border: 1px solid rgba(0,0,0,.15); background: rgba(255,255,255,.55); color: #2b2410; border-radius: 999px; padding: 1px 8px; font-size: .85rem; cursor: pointer; }
.reactions button[aria-pressed="true"] { background: #fff; border-color: #6b4423; font-weight: 600; }
.reactions .more { opacity: .8; }
.note-actions { display: flex; gap: 6px; }
.note-actions button { background: none; border: 0; padding: 0; color: #6b4423; text-decoration: underline; cursor: pointer; font-size: .82rem; }
.note-actions button.danger { color: #a3122a; }
.note-form { border: 1px solid var(--line); border-radius: 12px; padding: 14px; margin-bottom: 14px; display: grid; gap: 10px; }
.note-form h3 { margin: 0; }
.note-form textarea { resize: vertical; }
.note-form-row { display: grid; grid-template-columns: 160px 120px 1fr; gap: 10px; }
.note-form .form-actions { display: flex; gap: 10px; }
.board-log { list-style: none; margin: 0; padding: 0; max-height: 320px; overflow-y: auto; font-size: .88rem; display: grid; gap: 4px; }
.board-log li { display: flex; gap: 10px; padding: 4px 0; border-bottom: 1px solid var(--line); }
.board-log time { color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.board-log .act-deleted { color: var(--muted); }
@media (max-width: 640px) { .note-form-row { grid-template-columns: 1fr 1fr; } .note-form-row label:last-child { grid-column: 1 / -1; } .cork { grid-template-columns: 1fr 1fr; padding: 20px 12px; gap: 18px 12px; } }
.my-name { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.board-card.locked .cork { opacity: .55; pointer-events: none; }

/* board: labels, pinned, past notes, comments */
.note.c-general { background: #fff3a8; } .note.c-urgent { background: #ffc4c4; } .note.c-event { background: #c9e8ff; } .note.c-info { background: #d4f5c9; }
.note.pinned::before { background: radial-gradient(circle at 35% 35%, #ffe58a, #c99a06 70%); width: 16px; height: 16px; margin-left: -8px; }
.note.is-past { opacity: .7; filter: saturate(.6); }
.pin-mark { font-size: .85em; }
.note-label { display: inline-block; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 6px; opacity: .75; }
.label-urgent { color: #a3122a; opacity: 1; }
.cal-link { color: #6b4423; font-weight: 600; }
.comments { border-top: 1px dashed rgba(0,0,0,.2); padding-top: 6px; margin-bottom: 8px; display: grid; gap: 6px; }
.comment { font-size: .84rem; position: relative; padding-right: 16px; }
.comment p { margin: 1px 0 0; white-space: pre-line; overflow-wrap: anywhere; }
.comment .c-time { font-size: .74rem; opacity: .65; }
.comment .c-del { position: absolute; right: 0; top: 0; background: none; border: 0; padding: 0 2px; color: #a3122a; cursor: pointer; font-size: 1rem; line-height: 1; }
.comment-form { display: flex; gap: 4px; }
.comment-form input { flex: 1; min-width: 0; padding: 4px 8px; font-size: .84rem; background: rgba(255,255,255,.7); color: #2b2410; border-color: rgba(0,0,0,.2); }
.comment-form button { padding: 4px 10px; font-size: .8rem; background: #6b4423; color: #fff; border: 0; border-radius: 8px; }
.board-filters { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.chip-btn { border: 1px solid var(--line); background: var(--surface-2); color: var(--fg); border-radius: 999px; padding: 4px 12px; font-size: .85rem; cursor: pointer; }
.chip-btn[aria-pressed="true"] { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 18%, transparent); font-weight: 600; }
.chip-btn::before { content: ""; display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; vertical-align: 0; background: var(--sw, transparent); }
.chip-btn[data-filter=""]::before { display: none; }
.swatch-general { --sw: #f4dc52; } .swatch-urgent { --sw: #ff7a7a; } .swatch-event { --sw: #6cb8f5; } .swatch-info { --sw: #7fd36b; }
.past-notes { margin-top: 14px; }
.past-notes summary { cursor: pointer; font-weight: 600; margin-bottom: 8px; }
.cork.past { min-height: 0; border-width: 6px; }
.note-form-row { grid-template-columns: 140px 160px 120px 1fr; }
@media (max-width: 640px) { .note-form-row { grid-template-columns: 1fr 1fr; } }
/* bell */
#notif-btn { position: relative; }
.notif-badge { position: absolute; top: 4px; right: 4px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 999px; background: var(--accent-2);
               color: #fff; font-size: .68rem; font-weight: 700; line-height: 17px; text-align: center; }
.notif-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; max-height: 360px; overflow-y: auto; }
.notif-list a { display: grid; gap: 2px; padding: 8px 10px; border-radius: 10px; color: var(--fg); text-decoration: none; font-size: .9rem; }
.notif-list a:hover { background: var(--surface-2); }
.notif-list small { color: var(--muted); font-size: .78rem; }
.notif-list li.unread a { background: color-mix(in srgb, var(--accent) 12%, transparent); }

/* House Search: offer to continue the last search (kept 1 hour) */
.resume h2 { margin: 0 0 4px; }
.resume p { margin: 0 0 12px; }
.resume-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.news-auto { margin-top: 10px; font-size: .88rem; }
.news-auto summary { cursor: pointer; }
.news-auto h3 { margin: 8px 0 4px; font-size: 1rem; font-weight: 600; }
