/* =====================================================================
   LifeLoop Team Hub — "Obsidian & Pearl" premium block theme (B&W)
   ===================================================================== */

/* ---------- THEME TOKENS ---------- */
:root, [data-theme="dark"] {
  --bg: #0a0a0c; --bg-2: #131318;
  --panel-grad: linear-gradient(158deg, #24242b 0%, #1a1a1f 55%, #141418 100%);
  --panel: #1d1d22; --panel-2: #26262d; --slot: #131317;
  --ink: #f5f5f8; --ink-soft: #bcbcc6; --ink-dim: #82828e;
  --line: #000000;
  --bevel-lt: rgba(255,255,255,.10); --bevel-dk: rgba(0,0,0,.62);
  --edge: rgba(255,255,255,.16);
  --btn-grad: linear-gradient(180deg, #43434c 0%, #2d2d34 100%);
  --btn-hover: linear-gradient(180deg, #4d4d57 0%, #34343c 100%);
  --hi-grad: linear-gradient(180deg, #ffffff 0%, #d4d4dc 100%);
  --hi: #f1f1f4; --hi-ink: #0a0a0c;
  --shadow: rgba(0,0,0,.72); --ambient: rgba(0,0,0,.55);
  --grid: rgba(255,255,255,.022); --dust: rgba(255,255,255,.11);
  --lux: linear-gradient(90deg, transparent, rgba(255,255,255,.55), transparent);
}
[data-theme="light"] {
  --bg: #eceae4; --bg-2: #e1ded7;
  --panel-grad: linear-gradient(158deg, #ffffff 0%, #f6f5f1 60%, #efeee9 100%);
  --panel: #fbfbf9; --panel-2: #f0efea; --slot: #e8e6e0;
  --ink: #0c0c0e; --ink-soft: #45454c; --ink-dim: #7c7c84;
  --line: #0b0b0d;
  --bevel-lt: rgba(255,255,255,.95); --bevel-dk: rgba(0,0,0,.16);
  --edge: rgba(255,255,255,.9);
  --btn-grad: linear-gradient(180deg, #ffffff 0%, #dedcd4 100%);
  --btn-hover: linear-gradient(180deg, #ffffff 0%, #e9e7df 100%);
  --hi-grad: linear-gradient(180deg, #2b2b30 0%, #0c0c0e 100%);
  --hi: #0c0c0e; --hi-ink: #f8f7f3;
  --shadow: rgba(0,0,0,.26); --ambient: rgba(0,0,0,.18);
  --grid: rgba(0,0,0,.03); --dust: rgba(0,0,0,.06);
  --lux: linear-gradient(90deg, transparent, rgba(0,0,0,.4), transparent);
}

/* ---------- BASE ---------- */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; min-height: 100vh; position: relative;
  background-color: var(--bg);
  background-image:
    radial-gradient(1200px 620px at 50% -8%, rgba(255,255,255,.05), transparent 60%),
    repeating-linear-gradient(0deg, transparent 0 7px, var(--grid) 7px 8px),
    repeating-linear-gradient(90deg, transparent 0 7px, var(--grid) 7px 8px);
  color: var(--ink);
  font-family: 'Mitr', system-ui, -apple-system, "Segoe UI", sans-serif;
  font-weight: 300; line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  display: flex; flex-direction: column;
}
body::before {
  content: ""; position: fixed; left: -50%; right: -50%; top: -50%; height: 200%;
  z-index: 0; pointer-events: none; opacity: .55;
  background-image:
    radial-gradient(2px 2px at 18% 30%, var(--dust) 50%, transparent 52%),
    radial-gradient(2px 2px at 68% 62%, var(--dust) 50%, transparent 52%),
    radial-gradient(2px 2px at 42% 82%, var(--dust) 50%, transparent 52%),
    radial-gradient(2px 2px at 86% 22%, var(--dust) 50%, transparent 52%);
  background-size: 290px 290px, 330px 330px, 370px 370px, 310px 310px;
  animation: dust 64s linear infinite;
}
@keyframes dust { from { transform: translateY(0); } to { transform: translateY(-330px); } }
@media (prefers-reduced-motion: reduce) { body::before { animation: none; } }

h1, h2, h3 { font-family: 'Mitr', sans-serif; font-weight: 600; letter-spacing: .3px; }
::selection { background: var(--ink); color: var(--bg); }
.px { font-family: 'Press Start 2P', 'VT323', monospace; }
.clickable { cursor: pointer; }

::-webkit-scrollbar { width: 13px; height: 13px; }
::-webkit-scrollbar-track { background: var(--bg-2); }
::-webkit-scrollbar-thumb { background: var(--panel-2); border: 3px solid var(--bg-2); }
::-webkit-scrollbar-thumb:hover { background: var(--ink-dim); }

/* ---------- HEADER ---------- */
.mc-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--panel-grad);
  border-bottom: 4px solid var(--line);
  box-shadow: inset 0 1px 0 var(--edge), 0 5px 0 var(--shadow), 0 18px 30px -18px var(--ambient);
}
.header-inner { max-width: 1200px; margin: 0 auto; display: flex; align-items: center; gap: 14px; padding: 11px 18px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); }
.brand-logo {
  display: grid; place-items: center; width: 58px; height: 44px;
  background: var(--hi-grad); color: var(--hi-ink); border: 3px solid var(--line);
  box-shadow: inset 0 2px 0 rgba(255,255,255,.5), inset -2px -2px 0 var(--bevel-dk), 3px 3px 0 var(--shadow);
  position: relative; overflow: hidden;
}
.brand-logo::after { content: ""; position: absolute; inset: 0; background: linear-gradient(120deg, transparent 40%, rgba(255,255,255,.35) 50%, transparent 60%); }
.brand-text { display: flex; flex-direction: column; line-height: 1; }
.brand-text strong { font-family: 'Press Start 2P', monospace; font-size: 15px; letter-spacing: 1px; }
.brand-text small { font-family: 'Press Start 2P', monospace; font-size: 8px; letter-spacing: 6px; color: var(--ink-soft); margin-top: 5px; }

.mc-nav { display: flex; align-items: center; gap: 5px; margin-left: auto; flex-wrap: wrap; }
.nav-item {
  font-family: 'Mitr', sans-serif; font-weight: 500; font-size: 15px;
  text-decoration: none; color: var(--ink-soft); padding: 8px 13px;
  border: 3px solid transparent; transition: color .12s, background .12s;
}
.nav-item:hover { color: var(--ink); background: var(--panel-2); border-color: var(--line); }
.nav-item.active {
  color: var(--hi-ink); background: var(--hi-grad); border: 3px solid var(--line);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.5), inset -2px -2px 0 var(--bevel-dk);
}
.auth-area { display: flex; align-items: center; gap: 8px; margin-left: 14px; }
.role-badge {
  font-family: 'Mitr', sans-serif; font-weight: 600; font-size: 12px;
  padding: 6px 11px; border: 3px solid var(--line); background: var(--slot);
  color: var(--ink-soft); white-space: nowrap; display: inline-flex; align-items: center; gap: 5px;
  box-shadow: inset 2px 2px 0 var(--bevel-dk);
}
.role-badge::before { content: "◇"; }
.role-badge.role-member { background: var(--panel-2); color: var(--ink); }
.role-badge.role-member::before { content: "◈"; }
.role-badge.role-admin { background: var(--hi-grad); color: var(--hi-ink); }
.role-badge.role-admin::before { content: "★"; }
.nav-toggle { display: none; margin-left: auto; }

/* ---------- BUTTONS ---------- */
.mc-btn {
  font-family: 'Mitr', sans-serif; font-weight: 600; font-size: 14px;
  color: var(--ink); background: var(--btn-grad); border: 3px solid var(--line);
  box-shadow: inset 0 1px 0 var(--edge), inset 3px 3px 0 var(--bevel-lt), inset -3px -3px 0 var(--bevel-dk), 3px 3px 0 var(--shadow);
  padding: 9px 16px; cursor: pointer; user-select: none;
  transition: transform .06s, filter .12s, background .12s;
}
.mc-btn:hover { background: var(--btn-hover); filter: brightness(1.06); }
.mc-btn:active { transform: translate(2px, 2px); box-shadow: inset -3px -3px 0 var(--bevel-lt), inset 3px 3px 0 var(--bevel-dk); }
.mc-btn.primary { background: var(--hi-grad); color: var(--hi-ink); }
.mc-btn.primary:hover { filter: brightness(1.04); }
.mc-btn.danger:hover { background: var(--line); color: var(--hi); }
.mc-btn.icon-btn { padding: 9px 12px; font-size: 16px; line-height: 1; }
.mc-btn.small { font-size: 12px; padding: 6px 11px; box-shadow: inset 0 1px 0 var(--edge), inset 2px 2px 0 var(--bevel-lt), inset -2px -2px 0 var(--bevel-dk), 2px 2px 0 var(--shadow); }
.link-btn { background: none; border: none; cursor: pointer; color: var(--ink-soft); font-family: 'Mitr'; font-size: 13px; font-weight: 500; padding: 4px 2px; border-bottom: 2px solid transparent; }
.link-btn:hover { color: var(--ink); border-bottom-color: var(--ink); }

/* ---------- PANELS ---------- */
.mc-panel {
  background: var(--panel-grad); border: 4px solid var(--line);
  box-shadow: inset 0 2px 0 var(--edge), inset 3px 3px 0 var(--bevel-lt), inset -3px -3px 0 var(--bevel-dk),
              6px 6px 0 var(--shadow), 0 16px 34px -16px var(--ambient);
  padding: 20px; position: relative;
}

/* ---------- LAYOUT ---------- */
.container { max-width: 1200px; width: 100%; margin: 0 auto; padding: 24px 18px 52px; flex: 1; position: relative; z-index: 1; }
.view { display: none; animation: fade .2s ease; }
.view.active { display: block; }
@keyframes fade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.view-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }
.view-title { font-size: 27px; margin: 0; display: flex; align-items: center; gap: 13px; text-shadow: 3px 3px 0 var(--shadow); }
.view-title::before { content: ""; width: 14px; height: 22px; background: var(--hi-grad); border: 2px solid var(--line); box-shadow: 2px 2px 0 var(--shadow); }

/* ---------- HERO / DASHBOARD ---------- */
.hero { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 22px; overflow: hidden; }
.kicker { font-family: 'Press Start 2P'; font-size: 9px; letter-spacing: 3px; color: var(--ink-dim); margin: 0 0 12px; }
.hero h1 { font-family: 'Press Start 2P'; font-size: 24px; margin: 0 0 12px; line-height: 1.4; text-shadow: 3px 3px 0 var(--shadow); }
.hero-sub { margin: 0; color: var(--ink-soft); }
.hero-block {
  font-family: 'Press Start 2P'; font-size: 52px; width: 116px; height: 116px; flex-shrink: 0;
  display: grid; place-items: center; background: var(--hi-grad); color: var(--hi-ink);
  border: 4px solid var(--line); position: relative; overflow: hidden;
  box-shadow: inset 0 2px 0 rgba(255,255,255,.5), inset -3px -3px 0 var(--bevel-dk), 4px 4px 0 var(--shadow);
}
.hero-block::after { content: ""; position: absolute; inset: 0; background: linear-gradient(120deg, transparent 42%, rgba(255,255,255,.4) 50%, transparent 58%); }

.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 22px; }
.stat {
  background: var(--panel-grad); border: 4px solid var(--line);
  box-shadow: inset 0 2px 0 var(--edge), inset 3px 3px 0 var(--bevel-lt), inset -3px -3px 0 var(--bevel-dk), 5px 5px 0 var(--shadow);
  padding: 18px; text-align: center; transition: transform .14s, box-shadow .14s;
}
.stat:hover { transform: translateY(-3px); box-shadow: inset 0 2px 0 var(--edge), inset 3px 3px 0 var(--bevel-lt), inset -3px -3px 0 var(--bevel-dk), 7px 9px 0 var(--shadow), 0 18px 30px -14px var(--ambient); }
.stat .num { font-family: 'Press Start 2P'; font-size: 27px; display: block; margin-bottom: 9px; color: var(--ink); }
@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  .stat .num { background: var(--hi-grad); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
}
.stat .lbl { font-size: 13px; color: var(--ink-soft); }

.dash-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; border-bottom: 3px solid var(--line); padding-bottom: 11px; margin-bottom: 14px; position: relative; }
.panel-head::after { content: ""; position: absolute; left: 0; bottom: -3px; width: 64px; height: 3px; background: var(--lux); }
.panel-head h2 { font-size: 17px; margin: 0; }
.dash-list { display: flex; flex-direction: column; gap: 10px; }
.dash-item { border-left: 4px solid var(--line); background: var(--slot); padding: 10px 13px; transition: transform .1s; }
.dash-item:hover { transform: translateX(3px); }
.dash-item .t { font-weight: 500; font-size: 14px; }
.dash-item .m { font-size: 12px; color: var(--ink-dim); margin-top: 2px; }
.dash-online { display: flex; flex-wrap: wrap; gap: 12px; }
.dash-online .who { display: flex; flex-direction: column; align-items: center; gap: 6px; width: 66px; text-align: center; }
.dash-online .who .avatar { width: 48px; height: 48px; }
.dash-online .who .nm { font-size: 11px; color: var(--ink-soft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; width: 100%; }
.empty { color: var(--ink-dim); font-size: 13px; text-align: center; padding: 18px 0; }

/* ---------- GUEST DASHBOARD ---------- */
.guest-hero { text-align: center; padding: 38px 22px 32px; margin-bottom: 22px; }
.hero-logo-box {
  display: inline-block; background: linear-gradient(160deg, #ffffff, #e9e9ec);
  border: 4px solid var(--line); padding: 20px 24px; margin-bottom: 24px; position: relative; overflow: hidden;
  box-shadow: inset 0 2px 0 rgba(255,255,255,.9), inset -3px -3px 0 rgba(0,0,0,.18), 7px 7px 0 var(--shadow), 0 20px 40px -16px var(--ambient);
}
.hero-logo-box::after { content: ""; position: absolute; inset: 0; background: linear-gradient(118deg, transparent 44%, rgba(255,255,255,.5) 50%, transparent 56%); pointer-events: none; }
.hero-logo { display: block; width: min(340px, 72vw); height: auto; image-rendering: auto; }
.hero-logo-fallback { text-align: center; position: relative; z-index: 1; }
.hero-logo-fallback svg { display: block; margin: 0 auto 8px; width: min(260px, 62vw); height: auto; }
.fallback-word strong { font-family: 'Press Start 2P', monospace; font-size: 24px; color: #141414; letter-spacing: 1px; display: block; }
.fallback-word span { font-family: 'Press Start 2P', monospace; font-size: 10px; letter-spacing: 8px; color: #555; display: block; margin-top: 9px; }
.guest-title { font-family: 'Press Start 2P'; font-size: 22px; margin: 0 0 12px; line-height: 1.45; text-shadow: 3px 3px 0 var(--shadow); }
.guest-tagline { color: var(--ink-soft); margin: 0 auto 22px; max-width: 580px; }
.cta-note { font-size: 13px; color: var(--ink-dim); margin-top: 14px; }
.public-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; margin-bottom: 20px; }
.about-text { color: var(--ink-soft); line-height: 1.75; white-space: pre-wrap; }
.stat-mini { display: flex; flex-direction: column; gap: 12px; }

/* ---------- QUICK ACTIONS ---------- */
.quick-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 22px; }
.quick-actions .mc-btn { flex: 1; min-width: 150px; }

/* ---------- TOOLBAR / INPUTS ---------- */
.toolbar { display: flex; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }
.mc-input {
  font-family: 'Mitr', sans-serif; font-size: 14px; color: var(--ink);
  background: var(--slot); border: 3px solid var(--line);
  box-shadow: inset 3px 3px 0 var(--bevel-dk); padding: 10px 13px; outline: none;
}
.mc-input:focus { box-shadow: inset 3px 3px 0 var(--bevel-dk), 0 0 0 3px var(--ink-dim); }
.mc-input.search { flex: 1; min-width: 180px; }
select.mc-input { cursor: pointer; }
textarea.mc-input { resize: vertical; min-height: 90px; line-height: 1.5; width: 100%; }

/* ---------- MEMBER CARDS ---------- */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(264px, 1fr)); gap: 16px; }
.member-card {
  background: var(--panel-grad); border: 4px solid var(--line);
  box-shadow: inset 0 2px 0 var(--edge), inset 3px 3px 0 var(--bevel-lt), inset -3px -3px 0 var(--bevel-dk), 5px 5px 0 var(--shadow);
  padding: 17px; display: flex; flex-direction: column; gap: 10px; transition: transform .14s, box-shadow .14s;
}
.member-card:hover { transform: translateY(-3px); box-shadow: inset 0 2px 0 var(--edge), inset 3px 3px 0 var(--bevel-lt), inset -3px -3px 0 var(--bevel-dk), 7px 10px 0 var(--shadow), 0 20px 32px -14px var(--ambient); }
.member-top { display: flex; gap: 14px; align-items: center; }
.member-top.clickable:hover .name { text-decoration: underline; }
.avatar { width: 56px; height: 56px; flex-shrink: 0; border: 3px solid var(--line); background: var(--slot); box-shadow: 2px 2px 0 var(--shadow); display: block; }
.avatar.photo { object-fit: cover; }
.member-id .name { font-weight: 600; font-size: 16px; line-height: 1.2; }
.member-id .role { font-size: 12px; color: var(--ink-soft); }
.status { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--ink-soft); margin-top: 4px; }
.status::before { content: ""; width: 12px; height: 12px; border: 2px solid var(--ink); display: inline-block; }
.status.online::before { background: var(--ink); }
.status.away::before { background: linear-gradient(135deg, var(--ink) 0 50%, transparent 50% 100%); }
.status.offline::before { background: transparent; }
.member-bio { font-size: 13px; color: var(--ink-soft); min-height: 20px; }
.member-meta { font-size: 11px; color: var(--ink-dim); border-top: 2px dashed var(--bevel-dk); padding-top: 8px; }
.card-actions { display: flex; gap: 8px; margin-top: auto; }
.card-actions .mc-btn { flex: 1; }

/* ---------- MEMBER PROFILE ---------- */
#view-member #memberBack { margin-bottom: 14px; }
.mp-header { display: flex; gap: 24px; align-items: flex-start; flex-wrap: wrap; margin-bottom: 18px; }
.mp-avatar { flex-shrink: 0; }
.mp-avatar .avatar { width: 132px; height: 132px; border: 4px solid var(--line); box-shadow: inset 0 2px 0 var(--edge), 5px 5px 0 var(--shadow); }
.mp-info { flex: 1; min-width: 220px; }
.mp-name { font-size: 28px; margin: 0 0 4px; text-shadow: 3px 3px 0 var(--shadow); }
.mp-role { color: var(--ink-soft); font-size: 15px; }
.mp-bio { color: var(--ink-soft); line-height: 1.75; margin: 14px 0; max-width: 580px; }
.mp-meta { font-size: 12px; color: var(--ink-dim); margin-top: 8px; }
.contact-list { display: flex; flex-wrap: wrap; gap: 11px; }
.contact-link {
  display: flex; flex-direction: column; gap: 3px; text-decoration: none; color: var(--ink);
  background: var(--slot); border: 3px solid var(--line);
  box-shadow: inset 2px 2px 0 var(--bevel-lt), inset -2px -2px 0 var(--bevel-dk), 3px 3px 0 var(--shadow);
  padding: 10px 14px; min-width: 150px; transition: transform .1s, filter .1s;
}
a.contact-link:hover { transform: translateY(-2px); filter: brightness(1.08); }
.cl-label { font-family: 'Press Start 2P'; font-size: 8px; letter-spacing: .5px; color: var(--ink-dim); }
.cl-val { font-size: 13px; color: var(--ink); word-break: break-all; }

/* ---------- NEWS ---------- */
.news-feed { display: flex; flex-direction: column; gap: 16px; }
.news-card {
  background: var(--panel-grad); border: 4px solid var(--line);
  box-shadow: inset 0 2px 0 var(--edge), inset 3px 3px 0 var(--bevel-lt), inset -3px -3px 0 var(--bevel-dk), 5px 5px 0 var(--shadow);
  padding: 19px; position: relative; transition: transform .12s, box-shadow .12s;
}
.news-card:hover { transform: translateY(-2px); box-shadow: inset 0 2px 0 var(--edge), inset 3px 3px 0 var(--bevel-lt), inset -3px -3px 0 var(--bevel-dk), 6px 8px 0 var(--shadow), 0 16px 30px -14px var(--ambient); }
.news-card.pinned { border-left-width: 10px; }
.news-head { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 8px; }
.news-title { font-size: 19px; font-weight: 600; margin: 0; flex: 1; }
.badge { font-family: 'Press Start 2P'; font-size: 8px; letter-spacing: 1px; background: var(--hi-grad); color: var(--hi-ink); border: 2px solid var(--line); padding: 6px 8px; white-space: nowrap; box-shadow: 2px 2px 0 var(--shadow); }
.pin-flag { font-size: 13px; color: var(--ink-soft); margin-left: 6px; }
.news-meta { font-size: 12px; color: var(--ink-dim); margin-bottom: 11px; display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.news-body { font-size: 14px; color: var(--ink); white-space: pre-wrap; line-height: 1.7; }
.news-foot { display: flex; gap: 8px; margin-top: 15px; flex-wrap: wrap; }
.vis-tag { font-size: 11px; border: 2px solid var(--line); padding: 2px 7px; color: var(--ink-soft); white-space: nowrap; }
.vis-tag.internal { background: var(--ink); color: var(--bg); }
.scope-tag { font-size: 10px; border: 2px solid var(--line); padding: 2px 7px; white-space: nowrap; background: var(--slot); color: var(--ink-soft); }
.scope-tag.proj { background: var(--hi-grad); color: var(--hi-ink); }

/* ---------- PROJECTS ---------- */
.project-card {
  background: var(--panel-grad); border: 4px solid var(--line);
  box-shadow: inset 0 2px 0 var(--edge), inset 3px 3px 0 var(--bevel-lt), inset -3px -3px 0 var(--bevel-dk), 5px 5px 0 var(--shadow);
  padding: 17px; display: flex; flex-direction: column; gap: 11px; cursor: pointer; transition: transform .14s, box-shadow .14s;
}
.project-card:hover { transform: translateY(-4px); box-shadow: inset 0 2px 0 var(--edge), inset 3px 3px 0 var(--bevel-lt), inset -3px -3px 0 var(--bevel-dk), 8px 11px 0 var(--shadow), 0 22px 34px -14px var(--ambient); }
.project-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.project-name { font-size: 18px; font-weight: 600; line-height: 1.25; }
.pstatus { font-family: 'Press Start 2P'; font-size: 7px; letter-spacing: .5px; white-space: nowrap; padding: 6px 8px; border: 2px solid var(--line); box-shadow: 2px 2px 0 var(--shadow); }
.pstatus.active { background: var(--hi-grad); color: var(--hi-ink); }
.pstatus.paused { background: var(--slot); color: var(--ink-soft); }
.pstatus.done { background: var(--ink); color: var(--bg); }
.project-desc { font-size: 13px; color: var(--ink-soft); line-height: 1.6; min-height: 18px; }
.progress { display: flex; flex-direction: column; gap: 5px; }
.progress-bar { height: 15px; background: var(--slot); border: 2px solid var(--line); position: relative; overflow: hidden; box-shadow: inset 2px 2px 0 var(--bevel-dk); }
.progress-fill { height: 100%; background: var(--hi-grad); background-image: repeating-linear-gradient(45deg, transparent 0 5px, rgba(0,0,0,.14) 5px 10px); }
.progress-label { font-size: 11px; color: var(--ink-dim); display: flex; justify-content: space-between; }
.project-foot { font-size: 11px; color: var(--ink-dim); display: flex; gap: 12px; flex-wrap: wrap; border-top: 2px dashed var(--bevel-dk); padding-top: 9px; }
.member-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { font-size: 11px; border: 2px solid var(--line); padding: 3px 8px; background: var(--slot); color: var(--ink-soft); }

/* project detail */
#view-project #projectBack { margin-bottom: 14px; }
.pd-header { margin-bottom: 18px; }
.pd-titlerow { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.pd-title { font-size: 25px; margin: 0; text-shadow: 3px 3px 0 var(--shadow); }
.pd-desc { color: var(--ink-soft); line-height: 1.75; white-space: pre-wrap; margin: 6px 0 14px; }
.pd-meta { display: flex; gap: 18px; flex-wrap: wrap; font-size: 13px; color: var(--ink-soft); margin: 14px 0; }
.pd-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.pd-section { margin-top: 24px; }
.pd-section > h2 { font-size: 18px; border-bottom: 3px solid var(--line); padding-bottom: 10px; margin: 0 0 15px; display: flex; justify-content: space-between; align-items: center; gap: 10px; }

/* ---------- TASK BOARD ---------- */
.board { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; align-items: start; }
.board-col { padding: 15px; }
.col-head { font-size: 15px; margin: 0 0 12px; display: flex; align-items: center; justify-content: space-between; border-bottom: 3px solid var(--line); padding-bottom: 10px; }
.col-head .count { font-family: 'Press Start 2P'; font-size: 11px; background: var(--slot); border: 2px solid var(--line); padding: 4px 7px; }
.col-body { display: flex; flex-direction: column; gap: 10px; min-height: 30px; }
.task-card { background: var(--slot); border: 3px solid var(--line); box-shadow: inset 0 1px 0 var(--edge), 3px 3px 0 var(--shadow); padding: 12px; transition: transform .1s; }
.task-card:hover { transform: translateY(-2px); }
.task-card .tt { font-weight: 500; font-size: 14px; }
.task-card .td { font-size: 12px; color: var(--ink-soft); margin-top: 4px; white-space: pre-wrap; }
.task-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 11px; }
.task-tags { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.tag { font-size: 10px; border: 2px solid var(--line); padding: 2px 6px; color: var(--ink-soft); }
.tag.prio-สูง { background: var(--ink); color: var(--bg); }
.tag.prio-กลาง { background: var(--panel-2); }
.task-ctrl { display: flex; gap: 4px; }
.task-ctrl .mc-btn { padding: 4px 8px; font-size: 12px; box-shadow: inset 2px 2px 0 var(--bevel-lt), inset -2px -2px 0 var(--bevel-dk), 2px 2px 0 var(--shadow); }
.task-card.done .tt { text-decoration: line-through; color: var(--ink-dim); }

/* ---------- SETTINGS ---------- */
.settings-block { margin-bottom: 18px; }
.settings-block h2 { margin: 0 0 13px; font-size: 18px; border-bottom: 3px solid var(--line); padding-bottom: 9px; }
.field-label { display: block; font-size: 13px; color: var(--ink-soft); margin: 12px 0 6px; font-weight: 500; }
.settings-block .mc-input { width: 100%; max-width: 440px; }
.settings-actions { display: flex; gap: 10px; margin-top: 16px; flex-wrap: wrap; }
.muted { color: var(--ink-soft); font-size: 13px; }
.muted.note { font-size: 12px; color: var(--ink-dim); margin-top: 10px; border-top: 2px dashed var(--bevel-dk); padding-top: 10px; }
.about p { margin: 0 0 8px; }

/* ---------- MODAL ---------- */
.modal-overlay { position: fixed; inset: 0; z-index: 100; background: rgba(0,0,0,.78); display: grid; place-items: center; padding: 16px; animation: fade .12s ease; }
.modal-overlay[hidden] { display: none; }
.modal { width: 100%; max-width: 540px; max-height: 90vh; overflow: auto; padding: 0; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 15px 19px; border-bottom: 4px solid var(--line); background: var(--panel-2); }
.modal-head h2 { margin: 0; font-size: 18px; }
.modal-body { padding: 19px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 15px 19px; border-top: 4px solid var(--line); background: var(--panel-2); }
.modal.confirm { max-width: 430px; }
.field { margin-bottom: 14px; }
.field:last-child { margin-bottom: 0; }
.field label { display: block; font-size: 13px; font-weight: 500; color: var(--ink-soft); margin-bottom: 6px; }
.field .mc-input { width: 100%; }
.field-check { display: flex; align-items: center; gap: 10px; cursor: pointer; margin-bottom: 0; }
.field-check input { width: 20px; height: 20px; accent-color: var(--ink); }
.field-info { font-size: 13px; color: var(--ink-soft); background: var(--slot); border-left: 4px solid var(--line); padding: 11px 13px; margin: 0 0 14px; line-height: 1.55; }
.checks { display: flex; flex-direction: column; gap: 7px; max-height: 168px; overflow: auto; border: 3px solid var(--line); padding: 11px; background: var(--slot); box-shadow: inset 2px 2px 0 var(--bevel-dk); }
.img-pick { display: flex; gap: 14px; align-items: flex-start; }
.img-preview { width: 88px; height: 88px; flex-shrink: 0; border: 3px solid var(--line); background: var(--slot); display: grid; place-items: center; overflow: hidden; box-shadow: inset 2px 2px 0 var(--bevel-dk); }
.img-preview img { width: 100%; height: 100%; object-fit: cover; }
.img-preview .muted { font-size: 10px; text-align: center; padding: 4px; }
.img-controls { flex: 1; display: flex; flex-direction: column; gap: 8px; }
.img-controls input[type=file] { font-family: 'Mitr'; font-size: 12px; color: var(--ink-soft); max-width: 100%; }

/* ---------- TOASTS ---------- */
.toast-wrap { position: fixed; right: 16px; bottom: 16px; z-index: 200; display: flex; flex-direction: column; gap: 10px; }
.toast { background: var(--hi-grad); color: var(--hi-ink); border: 3px solid var(--line); box-shadow: 4px 4px 0 var(--shadow), 0 12px 24px -10px var(--ambient); padding: 12px 17px; font-size: 14px; font-weight: 500; animation: slideIn .18s ease; max-width: 320px; }
@keyframes slideIn { from { transform: translateX(20px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------- FOOTER ---------- */
.mc-footer { border-top: 4px solid var(--line); background: var(--panel-grad); text-align: center; padding: 17px; font-size: 12px; color: var(--ink-dim); display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; position: relative; z-index: 1; box-shadow: inset 0 2px 0 var(--edge); }
.mc-footer .dot { opacity: .5; }

/* ---------- RESPONSIVE ---------- */
@media (max-width: 920px) {
  .dash-grid { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .board { grid-template-columns: 1fr; }
  .public-grid { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .nav-toggle { display: block; }
  .mc-nav { display: none; position: absolute; top: 100%; left: 0; right: 0; flex-direction: column; align-items: stretch; gap: 0; background: var(--panel-grad); border-bottom: 4px solid var(--line); box-shadow: 0 6px 0 var(--shadow); padding: 8px; margin: 0; z-index: 60; }
  .mc-nav.open { display: flex; }
  .nav-item { border: 3px solid transparent; }
  .auth-area { margin-left: auto; }
  .guest-title { font-size: 16px; }
  .brand-text strong { font-size: 13px; }
}
@media (max-width: 460px) {
  .role-badge { display: none; }
  .stat-grid { grid-template-columns: 1fr; }
  .view-title { font-size: 22px; }
}
