/* TeamHub — styled to match PrimeAxis Group: monochrome glass, black by default,
   light theme chosen in your profile. Every colour is a token; the light theme only redefines tokens. */
:root {
  color-scheme: dark;
  --bg: #000;
  --ink: #f5f5f7;
  --muted: #a1a1a6;
  --dim: #6e6e73;
  --glass: rgba(255, 255, 255, .055);
  --glass-hi: rgba(255, 255, 255, .09);
  --glass-press: rgba(255, 255, 255, .13);
  --stroke: rgba(255, 255, 255, .1);
  --stroke-hi: rgba(255, 255, 255, .22);
  --card-top: rgba(255, 255, 255, .065);
  --card-bot: rgba(255, 255, 255, .022);
  --card-inset: rgba(255, 255, 255, .07);
  --card-shadow: 0 20px 50px -30px rgba(0, 0, 0, .9);
  --panel: rgba(18, 18, 20, .72);
  --modal: rgba(28, 28, 30, .92);
  --input: rgba(255, 255, 255, .045);
  --input-focus: rgba(255, 255, 255, .07);
  --option-bg: #1c1c1e;
  --header: rgba(0, 0, 0, .66);
  --primary: #f5f5f7;
  --primary-hover: #ffffff;
  --primary-ink: #000;
  --soft: rgba(255, 255, 255, .1);
  --soft-stroke: rgba(255, 255, 255, .26);
  --focus: rgba(255, 255, 255, .85);
  --ring: rgba(255, 255, 255, .14);
  --glow-a: rgba(255, 255, 255, .075);
  --glow-b: rgba(255, 255, 255, .03);
  --mine: rgba(255, 255, 255, .12);
  --ok: #30d158;
  --warn: #ff9f0a;
  --bad: #ff453a;
  --info: #64a8ff;
  --cyan: #64d2ff;
  --neutral: #98989d;
  --gold: #e6c47a;
  --gold-soft: rgba(230, 196, 122, .1);
  --gold-stroke: rgba(230, 196, 122, .38);
  --toast: rgba(40, 40, 44, .86);
  --scrim: rgba(0, 0, 0, .55);
  --font: "Inter", -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
  --mono: "SF Mono", "JetBrains Mono", ui-monospace, Menlo, monospace;
  --r: 20px;
  --r-sm: 12px;
  --blur: saturate(180%) blur(24px);
}
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f5f5f7;
  --ink: #1d1d1f;
  --muted: #515154;
  --dim: #7c7c82;
  --glass: rgba(0, 0, 0, .04);
  --glass-hi: rgba(0, 0, 0, .065);
  --glass-press: rgba(0, 0, 0, .1);
  --stroke: rgba(0, 0, 0, .09);
  --stroke-hi: rgba(0, 0, 0, .2);
  --card-top: rgba(255, 255, 255, .86);
  --card-bot: rgba(255, 255, 255, .7);
  --card-inset: rgba(255, 255, 255, .9);
  --card-shadow: 0 18px 40px -28px rgba(0, 0, 0, .28);
  --panel: rgba(255, 255, 255, .72);
  --modal: rgba(255, 255, 255, .94);
  --input: #ffffff;
  --input-focus: #ffffff;
  --option-bg: #ffffff;
  --header: rgba(245, 245, 247, .74);
  --primary: #1d1d1f;
  --primary-hover: #000000;
  --primary-ink: #ffffff;
  --soft: rgba(0, 0, 0, .07);
  --soft-stroke: rgba(0, 0, 0, .28);
  --focus: rgba(0, 0, 0, .8);
  --ring: rgba(0, 0, 0, .1);
  --glow-a: rgba(255, 255, 255, .9);
  --glow-b: rgba(0, 0, 0, .025);
  --mine: rgba(0, 0, 0, .07);
  --ok: #248a3d;
  --warn: #b25000;
  --bad: #d70015;
  --info: #0066cc;
  --cyan: #0071a4;
  --neutral: #6e6e73;
  --gold: #9a6b12;
  --gold-soft: rgba(154, 107, 18, .07);
  --gold-stroke: rgba(154, 107, 18, .4);
  --toast: rgba(255, 255, 255, .9);
  --scrim: rgba(0, 0, 0, .3);
}

* { box-sizing: border-box; }
html, body, #app { height: 100%; margin: 0; }
html { background: var(--bg); }
body {
  background: var(--bg); color: var(--ink); font-family: var(--font); font-size: 15px; line-height: 1.5; letter-spacing: -.011em;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; transition: background-color .25s, color .25s;
}
body::before {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background: radial-gradient(60% 45% at 50% -10%, var(--glow-a), transparent 70%), radial-gradient(40% 40% at 100% 100%, var(--glow-b), transparent 70%);
}
#app { position: relative; z-index: 1; }
[hidden] { display: none !important; }
h1, h2, h3 { margin: 0; line-height: 1.12; letter-spacing: -.024em; font-weight: 700; }
p { margin: 0 0 10px; }
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--stroke-hi); text-underline-offset: 3px; }
a:hover { text-decoration-color: currentColor; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
.boot { display: grid; place-items: center; height: 100%; color: var(--muted); }
.ic { width: 20px; height: 20px; flex: none; }
.hint { color: var(--dim); font-size: .82rem; }
.error { color: var(--bad); font-size: .86rem; font-weight: 500; min-height: 18px; margin-top: 10px; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--glass-hi); border-radius: 10px; border: 2px solid transparent; background-clip: padding-box; }

/* Buttons — pill shaped, glass */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: 1px solid var(--stroke); background: var(--glass); color: var(--ink);
  -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); border-radius: 999px; padding: 9px 18px; font-weight: 500; font-size: .9rem; line-height: 1.2;
  cursor: pointer; text-decoration: none; transition: background .2s, border-color .2s, transform .1s; white-space: nowrap; }
.btn:hover { background: var(--glass-hi); border-color: var(--stroke-hi); }
.btn:active { transform: scale(.98); background: var(--glass-press); }
.btn.primary { background: var(--primary); border-color: transparent; color: var(--primary-ink); }
.btn.primary:hover { background: var(--primary-hover); }
.btn.danger { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 40%, transparent); }
.btn.small { padding: 6px 13px; font-size: .82rem; }
.btn:disabled { opacity: .4; cursor: not-allowed; }
.btn .ic { width: 16px; height: 16px; }
.icon-btn { border: 0; background: transparent; width: 34px; height: 34px; border-radius: 999px; cursor: pointer; display: inline-grid; place-items: center; color: var(--muted); flex: none; transition: background .2s, color .2s; }
.icon-btn:hover { background: var(--glass-hi); color: var(--ink); }

/* Inputs */
input[type=text], input[type=email], input[type=password], input[type=date], input[type=time], select, textarea {
  width: 100%; border: 1px solid var(--stroke); background: var(--input); border-radius: var(--r-sm); padding: 10px 12px; outline: none;
  transition: border-color .2s, box-shadow .2s, background .2s;
}
input::placeholder, textarea::placeholder { color: var(--dim); }
input:hover, select:hover, textarea:hover { border-color: var(--stroke-hi); }
input:focus, select:focus, textarea:focus { border-color: var(--focus); box-shadow: 0 0 0 4px var(--ring); background: var(--input-focus); }
select option { background: var(--option-bg); color: var(--ink); }
input[type=radio], input[type=checkbox] { accent-color: var(--primary); width: 16px; height: 16px; margin: 0; flex: none; }
label { display: block; font-weight: 500; font-size: .86rem; margin: 14px 0 6px; }
textarea { resize: vertical; }

/* Glass surfaces */
.card { background: linear-gradient(180deg, var(--card-top), var(--card-bot)); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  border: 1px solid var(--stroke); border-radius: var(--r); box-shadow: inset 0 1px 0 var(--card-inset), var(--card-shadow); overflow: hidden; }
.card.pad, .pad.card { padding: 22px; }
.pad { padding: 20px 24px; }
.empty { border: 1px dashed var(--stroke-hi); border-radius: var(--r); padding: 32px 20px; text-align: center; color: var(--muted); margin: 8px; }
.side-body .empty { border: 0; }

/* Pills & badges */
.pill { --c: var(--muted); display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 999px; font-size: .74rem; font-weight: 600; white-space: nowrap;
  color: var(--ink); background: var(--soft); border: 1px solid var(--soft-stroke); vertical-align: 1px; }
.pill.off { color: var(--muted); background: var(--glass); border-color: var(--stroke); }
.pill.ext { color: var(--warn); background: color-mix(in srgb, var(--warn) 13%, transparent); border-color: color-mix(in srgb, var(--warn) 30%, transparent); }
.badge { background: var(--ink); color: var(--bg); border-radius: 999px; font-size: .7rem; font-weight: 700; padding: 0 6px; min-width: 18px; text-align: center; line-height: 18px; }
.avatar { width: 32px; height: 32px; border-radius: 50%; display: inline-grid; place-items: center; font-weight: 600; font-size: .72rem; color: var(--ink);
  background: var(--glass-hi); border: 1px solid var(--stroke); flex: none; }
.avatar.sm { width: 26px; height: 26px; font-size: .66rem; }

/* Sign-in */
.auth { min-height: 100%; display: grid; place-items: center; padding: 20px; }
.auth-card { width: 100%; max-width: 400px; padding: 34px 30px; background: linear-gradient(180deg, var(--card-top), var(--card-bot)); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  border: 1px solid var(--stroke); border-radius: 24px; box-shadow: inset 0 1px 0 var(--card-inset), var(--card-shadow); }
.auth-card .logo { display: flex; align-items: center; gap: 12px; font-size: 1.5rem; font-weight: 700; letter-spacing: -.03em; margin-bottom: 8px; }
.auth-card .logo img { width: 40px; height: 40px; }
.auth-card .btn.primary { width: 100%; margin-top: 20px; padding: 12px; font-size: .95rem; }

/* App shell */
/* The app fills the screen exactly; the sidebar and the conversation each scroll on their own. */
.shell { display: grid; grid-template-columns: 72px 300px 1fr; grid-template-rows: minmax(0, 1fr); height: 100%; height: 100dvh; overflow: hidden; }
.shell > * { min-height: 0; }
.rail { background: var(--header); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); display: flex; flex-direction: column; align-items: center;
  padding: 12px 0; gap: 4px; border-right: 1px solid var(--stroke); overflow-y: auto; scrollbar-width: none; }
.rail a { position: relative; width: 60px; padding: 8px 0 6px; display: flex; flex-direction: column; align-items: center; gap: 3px; color: var(--muted); text-decoration: none;
  font-size: .68rem; font-weight: 500; border-radius: 14px; transition: background .2s, color .2s; }
.rail a:hover { background: var(--glass); color: var(--ink); }
.rail a.active { color: var(--ink); background: var(--glass-hi); }
.rail .spacer { flex: 1; }
.rail .badge { position: absolute; top: 3px; right: 9px; }
.rail .rail-logo { padding: 4px 0 10px; }
.rail .rail-logo img { width: 34px; height: 34px; display: block; }

.sidebar { background: var(--panel); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); border-right: 1px solid var(--stroke); display: flex; flex-direction: column; min-width: 0; min-height: 0; overflow: hidden; }
.side-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 12px 10px 18px; }
.side-head h2 { font-size: 1.35rem; letter-spacing: -.03em; }
.side-body { overflow-y: auto; overscroll-behavior: contain; flex: 1; min-height: 0; padding: 0 10px 14px; }
.side-search { padding: 0 10px 10px; }
.side-search input { border-radius: 999px; padding: 8px 14px; }
.item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--r-sm); cursor: pointer; text-decoration: none; color: var(--ink); border: 1px solid transparent; }
.item:hover { background: var(--glass); }
.item.active { background: var(--soft); border-color: var(--soft-stroke); }
.item .grow { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item.unread .grow { font-weight: 700; }
.item .ch-ic { color: var(--dim); width: 16px; display: inline-grid; place-items: center; flex: none; }
.item .ch-ic .ic { width: 15px; height: 15px; }
.group-title { display: flex; align-items: center; justify-content: space-between; font-weight: 600; font-size: .78rem; text-transform: uppercase; letter-spacing: .08em;
  color: var(--muted); padding: 14px 10px 4px; }
.group-title .actions { display: flex; gap: 2px; visibility: hidden; }
.group-title:hover .actions, .group-title:focus-within .actions { visibility: visible; }
.group-title .icon-btn { width: 26px; height: 26px; }
.group-title .icon-btn .ic { width: 15px; height: 15px; }
.channel-item { padding-left: 12px; }

.main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.main-head { display: flex; align-items: center; gap: 10px; padding: 10px 18px; background: var(--header); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  border-bottom: 1px solid var(--stroke); min-height: 60px; }
.main-head h3 { margin: 0; font-size: 1.05rem; font-weight: 600; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: flex; align-items: center; gap: 8px; }
.main-head .sub { color: var(--muted); font-weight: 400; font-size: .86rem; }
.back { display: none; }
.tabs { display: inline-flex; gap: 2px; padding: 3px; border-radius: 999px; background: var(--glass); border: 1px solid var(--stroke); }
.tabs a { padding: 5px 14px; border-radius: 999px; color: var(--muted); text-decoration: none; font-weight: 500; font-size: .84rem; }
.tabs a:hover { color: var(--ink); }
.tabs a.active { background: var(--card-top); color: var(--ink); box-shadow: 0 1px 4px rgba(0, 0, 0, .25), inset 0 0 0 1px var(--stroke); }
.main-body { flex: 1; overflow-y: auto; overscroll-behavior: contain; min-height: 0; }
.welcome { height: 100%; display: grid; place-items: center; color: var(--muted); text-align: center; padding: 24px; }
.welcome img { width: 72px; margin-bottom: 14px; }
.welcome h2 { color: var(--ink); font-size: 1.8rem; letter-spacing: -.035em; margin-bottom: 8px; }
.channel-desc { padding: 10px 24px 0; color: var(--muted); font-size: .86rem; }

/* Messages */
.messages { padding: 18px 22px 10px; display: flex; flex-direction: column; gap: 2px; }
.msg { display: flex; gap: 10px; padding: 4px 8px; border-radius: var(--r-sm); position: relative; }
.msg:hover { background: var(--glass); }
.msg .gutter { width: 32px; flex: none; }
.msg .content { min-width: 0; flex: 1; }
.msg .meta { display: flex; gap: 8px; align-items: baseline; margin-bottom: 2px; }
.msg .meta b { font-size: .88rem; font-weight: 600; }
.msg .meta time, .msg .edited { color: var(--dim); font-size: .75rem; }
.msg .text { white-space: pre-wrap; word-wrap: break-word; overflow-wrap: anywhere; }
.bubble { background: var(--glass); border: 1px solid var(--stroke); padding: 7px 12px; border-radius: 16px; display: inline-block; max-width: 100%; }
.msg.mine .bubble { background: var(--mine); border-color: var(--stroke-hi); }
.msg .tools { position: absolute; right: 8px; top: -12px; display: none; background: var(--modal); border: 1px solid var(--stroke-hi); border-radius: 999px; padding: 2px;
  -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); box-shadow: var(--card-shadow); }
.msg:hover .tools, .msg:focus-within .tools { display: flex; }
.msg .tools .icon-btn { width: 28px; height: 28px; }
.msg .tools .icon-btn .ic { width: 16px; height: 16px; }
/* Announcement channels: messages read as cards */
.announce .msg .bubble { display: block; padding: 14px 16px; border-radius: 16px; background: linear-gradient(180deg, var(--card-top), var(--card-bot));
  box-shadow: inset 0 1px 0 var(--card-inset); font-size: .98rem; }
.announce .msg { margin-bottom: 8px; }
.attachment { display: flex; align-items: center; gap: 10px; border: 1px solid var(--stroke); border-radius: var(--r-sm); padding: 9px 12px; margin-top: 4px;
  background: var(--glass); max-width: 360px; text-decoration: none; color: var(--ink); }
.attachment:hover { border-color: var(--stroke-hi); background: var(--glass-hi); }
.attachment .fname { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.preview-img { display: block; max-width: min(360px, 100%); max-height: 280px; border-radius: var(--r-sm); margin-top: 4px; border: 1px solid var(--stroke); }
.day-sep { text-align: center; color: var(--dim); font-size: .74rem; font-weight: 600; text-transform: uppercase; letter-spacing: .1em; margin: 16px 0 8px; display: flex; align-items: center; gap: 12px; }
.day-sep::before, .day-sep::after { content: ""; flex: 1; border-top: 1px solid var(--stroke); }
.load-more { text-align: center; padding: 8px; }

.composer { padding: 8px 18px 16px; }
.composer-box { background: var(--card-top); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); border: 1px solid var(--stroke); border-radius: 22px;
  display: flex; align-items: flex-end; gap: 4px; padding: 5px; box-shadow: var(--card-shadow); }
.composer-box:focus-within { border-color: var(--stroke-hi); box-shadow: 0 0 0 4px var(--ring); }
.composer textarea { border: 0; box-shadow: none !important; resize: none; max-height: 160px; min-height: 38px; background: transparent !important; padding: 9px 6px; }
.composer textarea:focus-visible { outline: none; }
.composer #send { background: var(--primary); color: var(--primary-ink); }
.composer #send:hover { background: var(--primary-hover); }
.upload-progress { font-size: .8rem; color: var(--muted); padding: 4px 6px; }
.readonly-note { display: flex; align-items: center; gap: 10px; justify-content: center; padding: 12px 16px; border-radius: 999px; background: var(--glass);
  border: 1px solid var(--stroke); color: var(--muted); font-size: .86rem; }
.readonly-note .ic { width: 16px; height: 16px; }

/* Tables */
.table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.table th, .table td { text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--stroke); vertical-align: middle; }
.table th { font-size: .7rem; text-transform: uppercase; letter-spacing: .1em; color: var(--dim); font-weight: 600; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: var(--glass); }
.row-actions { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }
.toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 14px; flex-wrap: wrap; }
.toolbar .grow { flex: 1; }
.toolbar input, .toolbar select { border-radius: 999px; padding: 8px 14px; }

/* Calendar */
.cal-head { display: flex; align-items: center; gap: 6px; }
.week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 1px; background: var(--stroke); border: 1px solid var(--stroke); border-radius: var(--r); overflow: hidden; min-height: 60vh; }
.day { background: var(--panel); padding: 10px; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.day.today { background: color-mix(in srgb, var(--glass-hi) 100%, var(--panel)); }
.day-label { font-size: .74rem; color: var(--dim); display: flex; justify-content: space-between; align-items: center; text-transform: uppercase; letter-spacing: .08em; font-weight: 600; }
.day-label b { font-size: 1.3rem; color: var(--ink); letter-spacing: -.03em; text-transform: none; margin-left: 4px; }
.day.today .day-label b { background: var(--primary); color: var(--primary-ink); border-radius: 999px; padding: 0 8px; }
.event { --c: var(--neutral); border: 1px solid color-mix(in srgb, var(--c) 30%, transparent); border-left: 3px solid var(--c); background: color-mix(in srgb, var(--c) 10%, var(--glass));
  border-radius: 10px; padding: 6px 8px; cursor: pointer; font-size: .74rem; text-align: left; width: 100%; color: var(--muted); display: flex; flex-direction: column; gap: 1px; }
.event b { display: block; font-size: .84rem; color: var(--ink); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.event span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.event.allday { background: color-mix(in srgb, var(--c) 24%, var(--glass)); }
.event:hover { filter: brightness(1.15); }
/* Month view */
.month { border: 1px solid var(--stroke); border-radius: var(--r); overflow: hidden; }
.mhead { display: grid; grid-template-columns: repeat(7, 1fr); background: var(--panel); border-bottom: 1px solid var(--stroke); }
.mhead div { padding: 8px 10px; font-size: .7rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--dim); }
.mgrid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 1px; background: var(--stroke); }
.mday { background: var(--panel); min-height: 108px; padding: 6px; display: flex; flex-direction: column; gap: 3px; cursor: pointer; min-width: 0; }
.mday.other { opacity: .45; }
.mday:hover { background: color-mix(in srgb, var(--glass-hi) 100%, var(--panel)); }
.mnum { font-size: .8rem; font-weight: 600; width: 24px; height: 24px; display: grid; place-items: center; border-radius: 999px; }
.mday.today .mnum { background: var(--primary); color: var(--primary-ink); }
.mev { --c: var(--neutral); text-align: left; font-size: .74rem; padding: 2px 6px; border-radius: 6px; border: 0; border-left: 3px solid var(--c); cursor: pointer;
  background: color-mix(in srgb, var(--c) 14%, transparent); color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mmore { border: 0; background: none; color: var(--muted); font-size: .72rem; text-align: left; cursor: pointer; padding: 2px 6px; }
.mmore:hover { color: var(--ink); }
/* Tags */
.tagpill { --c: var(--neutral); display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 999px; font-size: .74rem; font-weight: 600; white-space: nowrap;
  color: var(--c); background: color-mix(in srgb, var(--c) 13%, transparent); border: 1px solid color-mix(in srgb, var(--c) 30%, transparent); }
.tagpill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.tag-filters { display: flex; flex-direction: column; gap: 2px; padding: 0 4px; }
.tag-filter { display: flex !important; align-items: center; gap: 10px; margin: 0 !important; padding: 6px 8px; border-radius: 10px; cursor: pointer; font-weight: 500 !important; font-size: .88rem !important; }
.tag-filter:hover { background: var(--glass); }
.tag-filter .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--c); flex: none; }
.tag-filter:has(input:not(:checked)) { opacity: .5; }
.tag-filter .icon-btn { margin-left: auto; width: 26px; height: 26px; }
.tag-filter .icon-btn .ic { width: 14px; height: 14px; }
.cal-row { cursor: default; padding: 4px 6px; }
.cal-row .grow-l { display: flex; align-items: center; gap: 10px; margin: 0; flex: 1; min-width: 0; cursor: pointer; font-weight: 500; font-size: .9rem; }
.cal-row .grow { white-space: normal; }
.swatches { display: flex; gap: 8px; flex-wrap: wrap; }
.sw { margin: 0 !important; cursor: pointer; }
.sw input { position: absolute; opacity: 0; pointer-events: none; }
.sw span { display: block; width: 30px; height: 30px; border-radius: 50%; background: var(--c); border: 2px solid transparent; box-shadow: inset 0 0 0 2px var(--bg); }
.sw input:checked + span { border-color: var(--ink); }
.sw input:focus-visible + span { outline: 2px solid var(--focus); outline-offset: 2px; }
.check-row { display: flex !important; align-items: center; gap: 10px; font-weight: 500; }
.dt { display: flex; gap: 6px; }
.dt input[type=time] { max-width: 120px; }
.only-sm { display: none !important; }
.add-day { opacity: 0; }
.day:hover .add-day { opacity: 1; }

/* Modal */
.modal-backdrop { position: fixed; inset: 0; background: var(--scrim); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); display: grid; place-items: center; padding: 16px; z-index: 50;
  animation: fade .15s ease-out; }
.modal { background: var(--modal); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); border: 1px solid var(--stroke-hi); border-radius: 24px; width: 100%; max-width: 540px;
  max-height: 90vh; overflow: auto; box-shadow: inset 0 1px 0 var(--card-inset), 0 30px 80px -20px rgba(0, 0, 0, .6); padding: 26px 28px; animation: pop .18s ease-out; }
.modal h3 { margin: 0 0 6px; font-size: 1.3rem; letter-spacing: -.025em; }
.modal p { color: var(--muted); }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 22px; flex-wrap: wrap; }
.modal-actions .left { margin-right: auto; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98); } }
@media (prefers-reduced-motion: reduce) { .modal, .modal-backdrop { animation: none; } body { transition: none; } }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.grid3 { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 0 12px; }
.checklist { max-height: 210px; overflow: auto; border: 1px solid var(--stroke); border-radius: var(--r-sm); padding: 4px; background: var(--input); }
.checklist label { display: flex; align-items: center; gap: 10px; font-weight: 400; margin: 0; padding: 6px 8px; border-radius: 8px; cursor: pointer; font-size: .9rem; }
.checklist label:hover { background: var(--glass); }
.checklist .trow { display: flex; align-items: center; gap: 4px; }
.checklist .trow > label:first-child { flex: 1; min-width: 0; }
.checklist .own-l { color: var(--muted); font-size: .8rem; gap: 6px; padding: 6px 10px; border-radius: 999px; }
.checklist .own-l:has(input:checked) { color: var(--ink); background: var(--soft); }
.secret { font-family: var(--mono); background: var(--glass); border: 1px solid var(--stroke); padding: 10px 12px; border-radius: var(--r-sm); font-size: .95rem; user-select: all; word-break: break-all; }
.detail-row { display: flex; gap: 10px; margin: 9px 0; font-size: .92rem; }
.detail-row span:first-child { color: var(--dim); width: 90px; flex: none; }
.radios { display: flex; flex-direction: column; gap: 6px; }
.radio { display: flex !important; gap: 12px; align-items: flex-start; font-weight: 400 !important; margin: 0 !important; padding: 10px 12px; border: 1px solid var(--stroke);
  border-radius: var(--r-sm); cursor: pointer; background: var(--glass); }
.radio:hover { border-color: var(--stroke-hi); }
.radio:has(input:checked) { border-color: var(--soft-stroke); background: var(--soft); }
.radio input { margin-top: 3px; }
.notif-box { border: 1px solid var(--stroke); border-radius: var(--r-sm); padding: 12px 14px; background: var(--glass); }

/* Theme picker (as on PrimeAxis Group) */
.themes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.theme-opt { display: flex; flex-direction: column; gap: 8px; padding: 8px; border-radius: 14px; border: 1px solid var(--stroke); background: var(--glass); cursor: pointer;
  text-align: left; color: var(--ink); font-weight: 500; font-size: .84rem; }
.theme-opt:hover { border-color: var(--stroke-hi); }
.theme-opt.on { border-color: var(--focus); box-shadow: 0 0 0 3px var(--ring); }
.swatch { height: 46px; border-radius: 8px; border: 1px solid rgba(128, 128, 128, .3); position: relative; overflow: hidden; }
.swatch.dark { background: #000; }
.swatch.light { background: #f5f5f7; }
.swatch.system { background: linear-gradient(90deg, #000 50%, #f5f5f7 50%); }
.swatch::after { content: ""; position: absolute; left: 8px; right: 8px; bottom: 8px; height: 14px; border-radius: 5px; }
.swatch.dark::after { background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .16); }
.swatch.light::after { background: #fff; border: 1px solid rgba(0, 0, 0, .1); }
.swatch.system::after { background: linear-gradient(90deg, rgba(255, 255, 255, .14) 50%, #fff 50%); border: 1px solid rgba(128, 128, 128, .25); }

/* Notifications banner */
.banner { display: flex; gap: 10px; align-items: flex-start; background: var(--soft); border: 1px solid var(--soft-stroke); border-radius: var(--r-sm); padding: 12px; margin: 0 0 10px; font-size: .84rem; }
.banner > .ic { margin-top: 1px; width: 18px; height: 18px; }
.banner-actions { display: flex; gap: 6px; margin-top: 10px; }

/* Get the app */
.app-page { max-width: 760px; margin: 0 auto; padding: 36px 22px 60px; display: flex; flex-direction: column; gap: 22px; }
.app-hero { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 14px; padding: 10px 0 6px; }
.app-hero img { width: 84px; height: 84px; filter: drop-shadow(0 20px 40px rgba(0, 0, 0, .5)); }
.app-hero h1 { font-size: clamp(2rem, 6vw, 3rem); letter-spacing: -.045em; background: linear-gradient(180deg, var(--ink) 30%, var(--dim) 100%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.app-hero p { color: var(--muted); max-width: 46ch; font-size: 1.05rem; }
.platforms { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 14px; }
.platform { padding: 20px; display: flex; flex-direction: column; gap: 10px; }
.platform h3 { font-size: 1.02rem; display: flex; align-items: center; gap: 8px; }
.platform ol { margin: 0; padding-left: 18px; color: var(--muted); font-size: .88rem; display: flex; flex-direction: column; gap: 4px; }
.platform.here { border-color: var(--soft-stroke); box-shadow: 0 0 0 3px var(--ring), var(--card-shadow); }
.installed { display: flex; align-items: center; gap: 8px; justify-content: center; color: var(--ok); font-weight: 600; }

#toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%) translateY(16px); z-index: 60; max-width: calc(100% - 32px);
  padding: 10px 18px; border-radius: 999px; font-size: .88rem; font-weight: 500; color: var(--ink); background: var(--toast); border: 1px solid var(--stroke-hi);
  -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); box-shadow: 0 16px 40px rgba(0, 0, 0, .3); opacity: 0; pointer-events: none; transition: .2s; }
#toast.show { opacity: 1; transform: translateX(-50%); }

/* Phones */
@media (max-width: 760px) {
  .only-sm { display: revert !important; }
  .mday { min-height: 70px; padding: 4px; }
  .mev { font-size: .66rem; padding: 1px 4px; }
  .shell { grid-template-columns: 1fr; grid-template-rows: minmax(0, 1fr) auto; }
  .rail { overflow: visible; }
  .rail { order: 2; flex-direction: row; justify-content: space-around; border-right: 0; border-top: 1px solid var(--stroke); padding: 4px 4px calc(4px + env(safe-area-inset-bottom)); }
  .rail .spacer, .rail .rail-logo { display: none; }
  .rail a { width: auto; flex: 1; max-width: 76px; }
  .shell > .sidebar, .shell > .main { grid-row: 1; grid-column: 1; min-height: 0; }
  .sidebar { border-right: 0; padding-top: env(safe-area-inset-top); }
  .main-head { padding-top: calc(10px + env(safe-area-inset-top)); }
  .shell.show-main > .sidebar { display: none; }
  .shell:not(.show-main) > .main { display: none; }
  .back { display: inline-grid; }
  .week { grid-template-columns: 1fr; min-height: 0; }
  .day { flex-direction: row; flex-wrap: wrap; align-items: flex-start; }
  .day-label { width: 100%; }
  .event { width: auto; flex: 1 1 100%; }
  .add-day { opacity: 1; }
  .grid2, .grid3 { grid-template-columns: 1fr; }
  .hide-sm { display: none !important; }
  .messages { padding: 12px 8px 8px; }
  .composer { padding: 6px 8px 10px; }
  .msg .tools { position: static; box-shadow: none; border: 0; background: transparent; align-self: flex-start; opacity: .6; display: flex; }
  .modal { padding: 22px 20px; border-radius: 22px; }
  .group-title .actions { visibility: visible; }
  .tabs a { padding: 5px 10px; }
}
