/* ============ Design tokens ============ */
:root {
  --bg: #f6f3ed; --surface: #ffffff; --surface2: #faf8f4; --ink: #1c1b18; --muted: #6c675e; --line: #e8e2d7;
  --accent: #1f4d3f; --accent-ink: #ffffff; --accent-soft: #e4efe9; --gold: #a8844b;
  --ok: #2b7a58; --ok-soft: #e1f1e9; --warn: #a76a0c; --warn-soft: #fbefd6; --danger: #b13a31; --danger-soft: #f8e3e0;
  --info: #2f6fb0; --info-soft: #e1ecf8;
  --shadow: 0 1px 2px rgba(40, 30, 10, .05), 0 6px 20px rgba(40, 30, 10, .06);
  --radius: 16px; --radius-sm: 10px;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
[data-theme="dark"] {
  --bg: #121110; --surface: #1c1b19; --surface2: #232220; --ink: #f2eee6; --muted: #a29c90; --line: #2f2d29;
  --accent: #86c9ab; --accent-ink: #0f1a15; --accent-soft: #1d2d26; --gold: #d4b07a;
  --ok: #6ec39a; --ok-soft: #1a2c24; --warn: #e0b45c; --warn-soft: #302718; --danger: #ee8a80; --danger-soft: #35201e;
  --info: #7db3ea; --info-soft: #1b2735;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
}

/* ============ Base ============ */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.5 var(--sans); -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4 { font-family: var(--serif); font-weight: 600; letter-spacing: -.01em; margin: 0; line-height: 1.2; }
h1 { font-size: 28px; } h2 { font-size: 20px; } h3 { font-size: 17px; }
p { margin: 0; }
a { color: var(--accent); }
button, input, select, textarea { font: inherit; color: inherit; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.hidden { display: none !important; }
.row { display: flex; align-items: center; gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.spread { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }
.stack > * + * { margin-top: 14px; }
.ico { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.ico.sm { width: 16px; height: 16px; }
.ico.lg { width: 26px; height: 26px; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 55%, transparent); outline-offset: 2px; border-radius: 8px; }

/* ============ Buttons & forms ============ */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 0 20px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--ink); font-weight: 600; cursor: pointer; text-decoration: none; transition: transform .05s, background .15s, border-color .15s; -webkit-tap-highlight-color: transparent; }
.btn:hover { border-color: color-mix(in srgb, var(--ink) 25%, var(--line)); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.danger { color: var(--danger); }
.btn.danger.solid { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn.ghost { background: transparent; }
.btn.sm { min-height: 36px; padding: 0 14px; font-size: 14px; border-radius: 10px; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.iconbtn { width: 44px; height: 44px; display: inline-grid; place-items: center; border-radius: 12px; border: 1px solid transparent; background: transparent; cursor: pointer; color: var(--ink); position: relative; }
.iconbtn:hover { background: var(--surface2); }

.field { display: block; }
.field > .lbl { display: block; font-size: 14px; font-weight: 600; margin-bottom: 6px; }
.field > .hint { display: block; font-size: 13px; color: var(--muted); margin-top: 5px; }
.field .opt { font-weight: 400; color: var(--muted); }
input[type=text], input[type=password], input[type=email], input[type=tel], input[type=number], input[type=date], input[type=time], input[type=search], select, textarea {
  width: 100%; min-height: 48px; padding: 10px 14px; border: 1.5px solid var(--line); border-radius: 12px; background: var(--surface); outline: none; transition: border-color .15s, box-shadow .15s; appearance: none; -webkit-appearance: none;
}
select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none' stroke='%23888' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M1 1.5l5 5 5-5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 38px; }
textarea { min-height: 84px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 16%, transparent); }
input[readonly], input:disabled { background: var(--surface2); color: var(--muted); }
.form-grid { display: grid; gap: 16px; grid-template-columns: 1fr 1fr; }
.form-grid .full { grid-column: 1 / -1; }
@media (max-width: 620px) { .form-grid { grid-template-columns: 1fr; } }
.check { display: flex; align-items: center; gap: 10px; min-height: 44px; cursor: pointer; font-weight: 500; }
.check input { width: 22px; height: 22px; accent-color: var(--accent); flex: none; }
.pwwrap { position: relative; }
.pwwrap input { padding-right: 56px; }
.pwwrap button { position: absolute; right: 4px; top: 4px; height: 40px; padding: 0 12px; border: 0; background: transparent; color: var(--muted); font-weight: 600; font-size: 13px; cursor: pointer; border-radius: 8px; }

.seg { display: inline-flex; padding: 4px; background: var(--surface2); border: 1px solid var(--line); border-radius: 14px; gap: 4px; max-width: 100%; }
.seg button { min-height: 40px; padding: 0 16px; border: 0; background: transparent; border-radius: 10px; font-weight: 600; color: var(--muted); cursor: pointer; display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.seg button.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.dayrow { display: flex; flex-wrap: wrap; gap: 8px; }
.daypill { min-width: 52px; min-height: 44px; padding: 0 12px; border: 1.5px solid var(--line); border-radius: 12px; background: var(--surface); font-weight: 600; cursor: pointer; }
.daypill.on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.switch { display: inline-flex; align-items: center; gap: 12px; cursor: pointer; min-height: 44px; font-weight: 500; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch .track { width: 48px; height: 28px; border-radius: 99px; background: var(--line); position: relative; transition: background .15s; flex: none; }
.switch .track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.3); transition: transform .15s; }
.switch input:checked + .track { background: var(--accent); }
.switch input:checked + .track::after { transform: translateX(20px); }
.switch input:focus-visible + .track { outline: 3px solid color-mix(in srgb, var(--accent) 55%, transparent); outline-offset: 2px; }

/* ============ Cards, chips, bars ============ */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.card.flat { box-shadow: none; }
.card h2, .card h3 { margin-bottom: 4px; }
.sec { margin-top: 28px; }
.sec-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.sec-head p { color: var(--muted); font-size: 14px; margin-top: 2px; }
.grid { display: grid; gap: 14px; }
.cols-auto { grid-template-columns: repeat(auto-fill, minmax(min(210px, 100%), 1fr)); }
.cols-2 { grid-template-columns: repeat(2, 1fr); }
.cols-people { grid-template-columns: repeat(auto-fill, minmax(min(310px, 100%), 1fr)); }
.person { display: block; text-decoration: none; color: inherit; padding: 16px; transition: border-color .15s, transform .1s; } .person:hover { border-color: var(--accent); } .person:active { transform: scale(.99); }
@media (max-width: 720px) { .cols-2 { grid-template-columns: 1fr; } .cols-auto { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 380px) { .cols-auto { grid-template-columns: 1fr; } }

.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 99px; font-size: 12.5px; font-weight: 650; background: var(--surface2); color: var(--muted); border: 1px solid var(--line); white-space: nowrap; }
.chip.ok { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.chip.warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.chip.danger { background: var(--danger-soft); color: var(--danger); border-color: transparent; }
.chip.info { background: var(--info-soft); color: var(--info); border-color: transparent; }
.chip.accent { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; display: inline-block; }

.bar { height: 8px; border-radius: 99px; background: var(--surface2); border: 1px solid var(--line); overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--tc, var(--accent)); border-radius: 99px; }
.notice { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: 14px; background: var(--info-soft); color: var(--ink); border: 1px solid color-mix(in srgb, var(--info) 25%, transparent); }
.notice .ico { color: var(--info); margin-top: 2px; }
.notice.warn { background: var(--warn-soft); border-color: color-mix(in srgb, var(--warn) 30%, transparent); } .notice.warn .ico { color: var(--warn); }
.notice.danger { background: var(--danger-soft); border-color: color-mix(in srgb, var(--danger) 30%, transparent); } .notice.danger .ico { color: var(--danger); }
.notice.ok { background: var(--ok-soft); border-color: color-mix(in srgb, var(--ok) 30%, transparent); } .notice.ok .ico { color: var(--ok); }
.empty { text-align: center; padding: 34px 16px; color: var(--muted); }
.empty .big { font-size: 34px; margin-bottom: 6px; }
.empty b { display: block; color: var(--ink); font-size: 16px; margin-bottom: 4px; }

/* leave-type colours */
.t-CL { --tc: #2f6fb0; } .t-SL { --tc: #c0504d; } .t-EL { --tc: #2b7a58; } .t-ML { --tc: #8a5cb8; } .t-PL { --tc: #6a63c9; }
.t-BL { --tc: #7a7468; } .t-CO { --tc: #178a8a; } .t-LWP { --tc: #c26a1b; } .t-UA { --tc: #a4262c; } .t-WFH { --tc: #a8841f; }
.tchip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 99px; font-size: 12.5px; font-weight: 700; background: color-mix(in srgb, var(--tc) 15%, transparent); color: color-mix(in srgb, var(--tc) 72%, var(--ink)); white-space: nowrap; }

/* avatar */
.avatar { width: 44px; height: 44px; border-radius: 50%; display: inline-grid; place-items: center; font-weight: 700; font-size: 16px; color: #fff; background: var(--accent); flex: none; overflow: hidden; object-fit: cover; letter-spacing: .02em; }
.avatar.sm { width: 34px; height: 34px; font-size: 13px; }
.avatar.xl { width: 104px; height: 104px; font-size: 36px; }
img.avatar { display: block; background: var(--surface2); }

/* tables */
.tablewrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
table.tbl { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.tbl th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 12px 14px; border-bottom: 1px solid var(--line); background: var(--surface2); white-space: nowrap; }
.tbl td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tr.click { cursor: pointer; } .tbl tr.click:hover td { background: var(--surface2); }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ============ App shell ============ */
.app { display: grid; grid-template-columns: 252px minmax(0, 1fr); min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; padding: 22px 16px; border-right: 1px solid var(--line); background: var(--surface); display: flex; flex-direction: column; gap: 6px; }
.brand { display: flex; align-items: center; gap: 12px; padding: 4px 8px 18px; text-decoration: none; color: var(--ink); }
.brand .mark { width: 42px; height: 42px; border-radius: 13px; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; flex: none; }
.brand .mark .ico { width: 26px; height: 26px; stroke-width: 2; }
.brand b { display: block; font-family: var(--serif); font-size: 16.5px; line-height: 1.15; }
.brand span { display: block; font-size: 12.5px; color: var(--muted); }
.nav { display: flex; flex-direction: column; gap: 4px; }
.nav a { display: flex; align-items: center; gap: 12px; min-height: 46px; padding: 0 14px; border-radius: 12px; color: var(--muted); text-decoration: none; font-weight: 600; position: relative; }
.nav a:hover { background: var(--surface2); color: var(--ink); }
.nav a.on { background: var(--accent-soft); color: var(--accent); }
.nav .badge { margin-left: auto; }
.badge { min-width: 22px; height: 22px; padding: 0 7px; border-radius: 99px; background: var(--danger); color: #fff; font-size: 12px; font-weight: 700; display: inline-grid; place-items: center; }
.side .spacer { flex: 1; }
.me { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface2); }
.me b { display: block; font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me .grow span { display: block; font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me > span:first-child { flex: none; display: inline-flex; }
.topbar { display: flex; position: sticky; top: 0; z-index: 30; align-items: center; gap: 10px; padding: 10px 14px; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.topbar .brand { padding: 0; flex: 1; min-width: 0; } .topbar .brand .mark { width: 36px; height: 36px; border-radius: 11px; } .topbar .brand .mark .ico { width: 22px; height: 22px; }
.topbar .brand b { font-size: 15px; } .topbar .brand span { display: none; }
.topbar .tb-right { display: flex; align-items: center; gap: 4px; }
@media (min-width: 881px) {
  .topbar { justify-content: flex-end; padding: 12px 36px 0; background: transparent; backdrop-filter: none; border: 0; position: static; }
  .topbar .brand, .topbar .mobile-only { display: none; }
}
.main { padding: 30px 36px 60px; max-width: 1120px; width: 100%; min-width: 0; }
.app > div { min-width: 0; }
.page-head { margin-bottom: 20px; }
.page-head .sub { color: var(--muted); margin-top: 4px; }
.bottom { display: none; position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; background: var(--surface); border-top: 1px solid var(--line); padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); }
.bottom a, .bottom button { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 2px; min-height: 56px; border: 0; background: transparent; color: var(--muted); text-decoration: none; font-size: 11.5px; font-weight: 650; border-radius: 12px; position: relative; cursor: pointer; }
.bottom a.on { color: var(--accent); background: var(--accent-soft); }
.bottom .badge { position: absolute; top: 2px; left: 54%; min-width: 18px; height: 18px; font-size: 11px; padding: 0 5px; }
@media (max-width: 880px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .side { display: none; } .bottom { display: flex; }
  .main { padding: 18px 16px 110px; }
  h1 { font-size: 24px; }
}

/* ============ Login ============ */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 22px; background:
  radial-gradient(900px 420px at 15% -10%, color-mix(in srgb, var(--accent) 14%, transparent), transparent 60%),
  radial-gradient(700px 380px at 100% 110%, color-mix(in srgb, var(--gold) 16%, transparent), transparent 60%), var(--bg); }
.auth-card { width: 100%; max-width: 420px; background: var(--surface); border: 1px solid var(--line); border-radius: 22px; padding: 32px 28px; box-shadow: var(--shadow); }
.auth-card .brand { justify-content: center; flex-direction: column; text-align: center; gap: 10px; padding-bottom: 6px; }
.auth-card .brand .mark { width: 58px; height: 58px; border-radius: 18px; } .auth-card .brand .mark .ico { width: 36px; height: 36px; }
.auth-card h1 { text-align: center; font-size: 25px; margin-bottom: 4px; }
.auth-card .lead { text-align: center; color: var(--muted); margin-bottom: 22px; }
.auth-foot { text-align: center; margin-top: 18px; font-size: 14px; color: var(--muted); }
.err { color: var(--danger); background: var(--danger-soft); border-radius: 12px; padding: 10px 14px; font-size: 14.5px; font-weight: 500; }
.reqs { display: grid; gap: 6px; margin-top: 4px; font-size: 13.5px; color: var(--muted); }
.reqs .met { color: var(--ok); font-weight: 600; }

/* ============ Specific components ============ */
.hello { font-size: 30px; }
.bal { position: relative; overflow: hidden; }
.bal .k { font-size: 13.5px; font-weight: 650; color: color-mix(in srgb, var(--tc) 72%, var(--ink)); display: flex; align-items: center; gap: 8px; }
.bal .k i { width: 10px; height: 10px; border-radius: 50%; background: var(--tc); display: inline-block; }
.bal .big { font-family: var(--serif); font-size: 42px; line-height: 1; margin: 10px 0 2px; font-weight: 600; }
.bal .big small { font-family: var(--sans); font-size: 14px; color: var(--muted); font-weight: 500; margin-left: 6px; }
.bal .meta { font-size: 13px; color: var(--muted); margin: 8px 0 0; }
.bal .meta .pend { color: var(--warn); font-weight: 600; }
.days { display: flex; gap: 6px; flex-wrap: wrap; }
.days span { min-width: 46px; text-align: center; padding: 7px 0; border-radius: 10px; font-size: 13px; font-weight: 650; border: 1px solid var(--line); color: var(--muted); background: var(--surface2); }
.days span.on { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.pips { display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 0; }
.pips i { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--line); }
.pips i.f { background: var(--tc, var(--gold)); border-color: var(--tc, var(--gold)); }
.item { display: flex; gap: 14px; align-items: flex-start; padding: 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.item + .item { margin-top: 10px; }
.item .when { font-weight: 650; }
.item .why { font-size: 14px; color: var(--muted); margin-top: 3px; }
.list-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.kv { display: grid; grid-template-columns: 150px 1fr; gap: 10px 16px; font-size: 15px; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; font-weight: 550; word-break: break-word; }
@media (max-width: 520px) { .kv { grid-template-columns: 1fr; gap: 0 } .kv dt { margin-top: 10px; font-size: 13px; } }
.lockrow { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; }
.profile-head { display: flex; gap: 22px; align-items: center; flex-wrap: wrap; }
.photo-edit { position: relative; }
.photo-edit .cam { position: absolute; right: -2px; bottom: -2px; width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: var(--accent-ink); border: 3px solid var(--surface); cursor: pointer; }
.money { font-family: var(--serif); font-weight: 600; font-variant-numeric: tabular-nums; }
.paycard .net { font-size: 30px; }
details.how { margin-top: 12px; border-top: 1px dashed var(--line); padding-top: 10px; }
details.how summary { cursor: pointer; font-weight: 600; color: var(--accent); font-size: 14px; min-height: 32px; display: flex; align-items: center; }
details.how table { width: 100%; font-size: 14px; margin-top: 8px; border-collapse: collapse; } details.how td { padding: 5px 0; } details.how td:last-child { text-align: right; font-variant-numeric: tabular-nums; }
details.guide summary { cursor: pointer; font-weight: 650; min-height: 44px; display: flex; align-items: center; justify-content: space-between; }
details.guide ul { margin: 6px 0 4px; padding-left: 20px; color: var(--muted); font-size: 14.5px; } details.guide li { margin: 5px 0; }

/* calendar grid */
.cal { overflow: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); max-height: 70vh; }
.cal table { border-collapse: separate; border-spacing: 0; font-size: 12.5px; }
.cal th, .cal td { border-bottom: 1px solid var(--line); border-right: 1px solid var(--line); text-align: center; min-width: 34px; height: 38px; padding: 0; }
.cal th { background: var(--surface2); font-weight: 600; color: var(--muted); position: sticky; top: 0; z-index: 2; height: 46px; line-height: 1.15; }
.cal th small { display: block; font-weight: 500; font-size: 10.5px; }
.cal .nm { position: sticky; left: 0; z-index: 1; background: var(--surface); text-align: left; padding: 0 12px; min-width: 130px; max-width: 150px; font-weight: 600; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; box-shadow: 1px 0 0 var(--line); }
.cal th.nm { z-index: 3; background: var(--surface2); }
.cal .off { background: repeating-linear-gradient(45deg, transparent 0 5px, color-mix(in srgb, var(--muted) 10%, transparent) 5px 10px); }
.cal .today { box-shadow: inset 0 0 0 2px var(--accent); }
.cal th.today { color: var(--accent); }
.cal .cell { font-weight: 700; font-size: 11px; color: #fff; background: var(--tc); }
.cal .cell.half { background: linear-gradient(135deg, var(--tc) 50%, transparent 50%); color: color-mix(in srgb, var(--tc) 60%, var(--ink)); }
.legend { display: flex; flex-wrap: wrap; gap: 8px 14px; font-size: 13px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; } .legend i { width: 12px; height: 12px; border-radius: 4px; background: var(--tc); }

/* activity feed */
.feed { position: relative; }
.feed-day { font-size: 12.5px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); font-weight: 700; margin: 20px 0 8px; }
.ev { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.ev:last-child { border-bottom: 0; }
.ev .evi { width: 36px; height: 36px; border-radius: 12px; display: grid; place-items: center; background: var(--surface2); color: var(--muted); flex: none; }
.ev .evi.c-leave { background: var(--info-soft); color: var(--info); } .ev .evi.c-salary { background: var(--ok-soft); color: var(--ok); }
.ev .evi.c-security { background: var(--danger-soft); color: var(--danger); } .ev .evi.c-profile { background: var(--accent-soft); color: var(--accent); }
.ev .evi.c-employee, .ev .evi.c-settings { background: var(--warn-soft); color: var(--warn); }
.ev .evi.c-notice { background: var(--info-soft); color: var(--info); }
.ev .t { font-size: 15px; } .ev .m { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 14px; }
.filters .seg { overflow-x: auto; }
.filters input[type=search], .filters select { width: auto; min-width: 180px; min-height: 44px; }
.tile { padding: 16px; } .tile .n { font-family: var(--serif); font-size: 34px; font-weight: 600; line-height: 1.1; } .tile .l { color: var(--muted); font-size: 13.5px; font-weight: 600; }

/* ============ Overlays ============ */
.overlay { position: fixed; inset: 0; z-index: 100; background: rgba(15, 12, 8, .5); display: flex; align-items: center; justify-content: center; padding: 18px; animation: fade .15s; }
.sheet { width: 100%; max-width: 520px; max-height: 92vh; overflow: auto; background: var(--surface); border-radius: 22px; padding: 24px; box-shadow: 0 20px 60px rgba(0, 0, 0, .35); animation: pop .18s; }
.sheet.wide { max-width: 640px; }
.sheet .sh-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.sheet .sh-foot { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; flex-wrap: wrap; }
@media (max-width: 620px) {
  .overlay { align-items: flex-end; padding: 0; }
  .sheet { border-radius: 22px 22px 0 0; max-height: 94vh; padding: 20px 18px calc(20px + env(safe-area-inset-bottom)); animation: slide .22s; }
  .sheet .sh-foot .btn { flex: 1; }
}
@keyframes fade { from { opacity: 0 } } @keyframes pop { from { transform: scale(.97); opacity: 0 } } @keyframes slide { from { transform: translateY(40px); opacity: 0 } }
.toasts { position: fixed; z-index: 200; left: 50%; transform: translateX(-50%); bottom: 90px; display: grid; gap: 8px; width: min(92vw, 440px); pointer-events: none; }
@media (min-width: 881px) { .toasts { bottom: 28px; } }
.toast { pointer-events: auto; padding: 13px 16px; border-radius: 14px; background: var(--ink); color: var(--bg); font-weight: 550; box-shadow: 0 10px 30px rgba(0, 0, 0, .3); animation: pop .18s; display: flex; gap: 10px; align-items: center; }
.toast.err { background: var(--danger); color: #fff; } .toast.ok .ico { color: #7be0ae; }
.pop { position: absolute; z-index: 90; right: 0; top: 50px; width: min(380px, 92vw); max-height: 70vh; overflow: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 20px 50px rgba(0, 0, 0, .25); animation: pop .15s; text-align: left; }
.pop .ph { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--surface); }
.pop .ni { display: block; width: 100%; text-align: left; border: 0; border-bottom: 1px solid var(--line); background: transparent; padding: 13px 16px; cursor: pointer; }
.pop .ni:hover { background: var(--surface2); } .pop .ni.unread { background: color-mix(in srgb, var(--accent) 7%, transparent); }
.pop .ni b { display: flex; align-items: center; gap: 8px; font-size: 14.5px; } .pop .ni b i { width: 8px; height: 8px; border-radius: 50%; background: var(--danger); }
.pop .ni span { display: block; font-size: 13.5px; color: var(--muted); margin-top: 2px; } .pop .ni small { color: var(--muted); font-size: 12px; }
.bellwrap { position: relative; }
.bellwrap .badge { position: absolute; top: 2px; right: 0; min-width: 18px; height: 18px; font-size: 11px; padding: 0 5px; }
.morelist { display: grid; gap: 6px; }
.morelist a, .morelist button { display: flex; align-items: center; gap: 14px; min-height: 52px; padding: 0 14px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); text-decoration: none; color: var(--ink); font-weight: 600; cursor: pointer; width: 100%; font-size: 16px; }
.spinner { width: 22px; height: 22px; border: 3px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin .7s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg) } }
.loading { display: grid; place-items: center; padding: 60px 0; }
.preview { padding: 12px 14px; border-radius: 12px; font-size: 14.5px; background: var(--surface2); border: 1px solid var(--line); }
.preview.ok { background: var(--ok-soft); border-color: transparent; } .preview.bad { background: var(--danger-soft); border-color: transparent; color: var(--danger); } .preview.warn { background: var(--warn-soft); border-color: transparent; }
.copybox { display: flex; gap: 8px; align-items: center; padding: 14px; background: var(--surface2); border: 1px dashed var(--muted); border-radius: 14px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 20px; font-weight: 700; letter-spacing: .04em; justify-content: space-between; }

#print-doc { display: none; }
@media print {
  body.printing-doc > *:not(#print-doc) { display: none !important; }
  body.printing-doc #print-doc { display: block !important; padding: 8mm; font-family: system-ui, Arial, sans-serif; color: #000; background: #fff; }
  #print-doc h1 { font-size: 18pt; margin: 0 0 4px; } #print-doc p { margin: 0 0 14px; font-size: 10.5pt; }
  .slip-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
  .slip { border: 1.5px dashed #555; border-radius: 6px; padding: 10px 12px; break-inside: avoid; font-size: 11pt; line-height: 1.7; }
  .slip b { font-size: 13pt; display: block; line-height: 1.3; } .slip > span { display: block; color: #444; font-size: 9.5pt; margin-bottom: 4px; }
  .slip code { white-space: nowrap; font-family: ui-monospace, Menlo, Consolas, monospace; font-weight: 700; font-size: 12pt; }
  .payslip { max-width: 170mm; margin: 0 auto; border: 1.5px solid #000; padding: 10mm; font-size: 11pt; }
  .payslip h2 { font-size: 16pt; margin: 0; } .payslip table { width: 100%; border-collapse: collapse; margin-top: 8px; }
  .payslip td, .payslip th { padding: 6px 4px; border-bottom: 1px solid #bbb; text-align: left; } .payslip td:last-child, .payslip th:last-child { text-align: right; }
  .payslip .net td { border-top: 2px solid #000; font-size: 13pt; font-weight: 700; }
  .side, .topbar, .bottom, .no-print, .toasts { display: none !important; }
  .app { display: block; } .main { padding: 0; max-width: none; } body { background: #fff; color: #000; }
  .tablewrap, .card { box-shadow: none; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* ---- notices, live board ---- */
.checkcard { display: flex; gap: 16px; align-items: center; justify-content: space-between; flex-wrap: wrap; padding: 18px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); margin-bottom: 14px; }
.checkcard .st { display: flex; gap: 12px; align-items: center; min-width: 0; }
.checkcard .ring { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--surface2); color: var(--muted); }
.checkcard.in .ring { background: var(--ok-soft); color: var(--ok); } .checkcard.done .ring { background: var(--accent-soft); color: var(--accent); } .checkcard.wait .ring { background: var(--warn-soft); color: var(--warn); }
.checkcard h3 { font-size: 17px; } .checkcard p { font-size: 14px; color: var(--muted); margin-top: 2px; }
.btn.big { min-height: 54px; padding: 0 28px; font-size: 17px; }
.statgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 10px; margin-bottom: 14px; }
.stat { padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); } .stat b { display: block; font-family: var(--serif); font-size: 28px; line-height: 1.1; } .stat span { font-size: 12.5px; color: var(--muted); }
.attrow { display: flex; align-items: center; gap: 12px; padding: 12px 4px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.attrow .dt { width: 86px; flex: none; font-weight: 650; } .attrow .dt small { display: block; font-weight: 500; color: var(--muted); font-size: 12.5px; }
.attrow .tm { margin-left: auto; text-align: right; font-size: 14px; color: var(--muted); }
.notice-card { padding: 16px 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); margin-bottom: 12px; }
.notice-card.new { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.notice-card h3 { font-size: 17px; } .notice-card .body { margin-top: 8px; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.55; }
.dot-live { width: 10px; height: 10px; border-radius: 50%; background: var(--muted); display: inline-block; flex: none; } .dot-live.online { background: #2e9d5b; box-shadow: 0 0 0 3px rgba(46,157,91,.2); } .dot-live.away { background: #d9a21b; }
.liverow { display: flex; gap: 12px; align-items: center; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); text-decoration: none; color: inherit; }
.liverow + .liverow { margin-top: 10px; } .liverow .grow { min-width: 0; } .liverow .sub2 { font-size: 13.5px; color: var(--muted); margin-top: 2px; }
.matrix { border-collapse: separate; border-spacing: 0; font-size: 12px; width: max-content; min-width: 100%; } .matrix th, .matrix td { padding: 0; text-align: center; border-bottom: 1px solid var(--line); }
.matrix th { font-weight: 600; color: var(--muted); padding: 6px 0; background: var(--surface); position: sticky; top: 0; } .matrix td.nm, .matrix th.nm { position: sticky; left: 0; background: var(--surface); text-align: left; padding: 8px 10px; min-width: 120px; z-index: 1; font-size: 13.5px; font-weight: 600; border-right: 1px solid var(--line); }
.matrix .c, .matrix th:not(.nm) { min-width: 27px; } .matrix .c { height: 32px; font-weight: 700; cursor: pointer; } .matrix .c.P { color: var(--ok); } .matrix .c.W { color: var(--info, #1f5f9f); } .matrix .c.L { color: var(--warn); } .matrix .c.M { color: var(--danger); } .matrix .c.O, .matrix .c.N { color: var(--line); } .matrix .c.late { background: var(--warn-soft); } .matrix .c.today { outline: 2px solid var(--accent); outline-offset: -2px; border-radius: 4px; }
.timeline { position: relative; padding-left: 22px; } .timeline::before { content: ""; position: absolute; left: 7px; top: 6px; bottom: 6px; width: 2px; background: var(--line); }
.tl { position: relative; padding: 6px 0 10px; } .tl::before { content: ""; position: absolute; left: -20px; top: 11px; width: 10px; height: 10px; border-radius: 50%; background: var(--muted); border: 2px solid var(--bg); } .tl.action::before { background: var(--accent); } .tl.page::before { background: var(--line); }
.tl .t { font-size: 12.5px; color: var(--muted); font-weight: 650; } .tl .x { font-size: 14.5px; } .tl.page .x { color: var(--muted); }
.bars { display: flex; align-items: flex-end; gap: 4px; height: 56px; } .bars i { flex: 1; background: var(--accent); border-radius: 3px 3px 0 0; min-height: 2px; opacity: .85; } .bars i.zero { background: var(--line); }
.bars-l { display: flex; gap: 4px; font-size: 10.5px; color: var(--muted); } .bars-l span { flex: 1; text-align: center; }

/* ============ Sign-in (split layout) ============ */
.auth2 { min-height: 100vh; min-height: 100dvh; display: grid; grid-template-columns: minmax(0, 1fr); background:
  radial-gradient(900px 420px at 15% -10%, color-mix(in srgb, var(--accent) 14%, transparent), transparent 60%),
  radial-gradient(700px 380px at 100% 110%, color-mix(in srgb, var(--gold) 16%, transparent), transparent 60%), var(--bg); }
.auth-main { display: grid; place-items: center; padding: 22px; }
.auth-side { display: none; }
.capswarn { display: block; margin-top: 6px; font-size: 13px; color: var(--warn); font-weight: 650; }
.check { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--muted); cursor: pointer; min-height: 34px; }
.check input { width: 18px; height: 18px; min-height: 0; accent-color: var(--accent); flex: none; }
.optset { border: 0; padding: 0; margin: 0; display: grid; gap: 8px; min-width: 0; }
.optset legend { padding: 0; margin-bottom: 6px; font-weight: 600; font-size: 14px; }
.optrow { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: 12px; cursor: pointer; background: var(--surface); }
.optrow:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.optrow input { width: 18px; height: 18px; min-height: 0; accent-color: var(--accent); flex: none; }
.hp { position: absolute !important; left: -9999px; width: 1px !important; height: 1px !important; opacity: 0; pointer-events: none; }
.helpsteps { padding-left: 22px; display: grid; gap: 10px; color: var(--muted); margin: 0 0 20px; }
.helpsteps code { background: var(--surface2); padding: 1px 6px; border-radius: 6px; font-size: 13px; }
.sent { text-align: center; display: grid; gap: 8px; justify-items: center; padding: 6px 0 10px; }
.sent-ic { width: 58px; height: 58px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; }
.sent-ic .ico { width: 30px; height: 30px; }
.sent b { font-family: var(--serif); font-size: 21px; } .sent p { margin: 0; }
@media (min-width: 900px) {
  .auth2 { grid-template-columns: minmax(380px, 45%) minmax(0, 1fr); }
  .auth-side { display: flex; flex-direction: column; justify-content: space-between; gap: 32px; padding: 48px 52px; color: #fff; position: relative; overflow: hidden;
    background: radial-gradient(900px 520px at -10% -15%, #3a7a66 0%, transparent 62%), radial-gradient(600px 400px at 110% 110%, rgba(168,132,75,.35), transparent 60%), linear-gradient(165deg, #163a30, #1f4d3f 55%, #11302a); }
  .auth-side .as-top { display: flex; align-items: center; gap: 14px; }
  .auth-side .mark { width: 48px; height: 48px; border-radius: 15px; background: rgba(255,255,255,.14); display: grid; place-items: center; }
  .auth-side .mark .ico { width: 30px; height: 30px; color: #fff; }
  .auth-side .as-top b { display: block; font-family: var(--serif); font-size: 21px; line-height: 1.15; }
  .auth-side .as-top span { opacity: .75; font-size: 13.5px; }
  .auth-side h2 { font-size: 36px; line-height: 1.12; max-width: 12em; margin-bottom: 30px; color: #fff; }
  .auth-side ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 18px; }
  .auth-side li { display: flex; gap: 14px; align-items: flex-start; }
  .auth-side li .ico { width: 42px; height: 42px; padding: 10px; border-radius: 13px; background: rgba(255,255,255,.12); flex: none; stroke: #fff; }
  .auth-side li b { display: block; font-size: 15.5px; } .auth-side li span { display: block; opacity: .72; font-size: 14px; }
  .auth-side .as-foot { opacity: .55; font-size: 13px; }
  .auth-brand-m { display: none; }
  .auth-main .auth-card { box-shadow: none; border: 0; background: transparent; padding: 8px 24px; max-width: 440px; }
}

/* ============ Team Hub ============ */
.pre { white-space: pre-wrap; overflow-wrap: anywhere; }
.sr { position: absolute; left: -9999px; }
.btn.small { min-height: 36px; padding: 0 14px; font-size: 14px; border-radius: 10px; }
.badge.inline { position: static; margin-left: 6px; min-width: 20px; height: 20px; font-size: 11.5px; }
.linkbtn { border: 0; background: transparent; color: var(--muted); font-weight: 600; font-size: 13.5px; cursor: pointer; padding: 6px 8px; border-radius: 8px; display: inline-flex; align-items: center; gap: 6px; }
.linkbtn:hover { background: var(--surface2); color: var(--ink); } .linkbtn.tiny { font-size: 12px; padding: 0 4px; }
.hubtabs button { display: inline-flex; align-items: center; justify-content: center; }
.chipset { display: flex; gap: 8px; }
.chipset.wrap { flex-wrap: wrap; margin-top: 6px; }
.chipset button { min-height: 36px; padding: 0 14px; border-radius: 99px; border: 1.5px solid var(--line); background: var(--surface); color: var(--ink); font-weight: 600; font-size: 14px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.chipset button.on { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.composer .cm-top { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.avstack { display: inline-flex; margin-left: auto; align-items: center; }
.avstack .avatar { border: 2px solid var(--surface); margin-left: -8px; } .avstack > span:first-child .avatar { margin-left: 0; }
.avstack .more { margin-left: 6px; font-size: 13px; color: var(--muted); font-weight: 650; }
.hubtoday .ht-online { display: flex; align-items: center; gap: 10px; }
.ht-list { display: grid; gap: 8px; margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--line); }
.ht-item { display: flex; align-items: center; gap: 10px; } .ht-ic { font-size: 22px; } .ht-item .grow { min-width: 0; }
.post.pinned { border-color: var(--gold); box-shadow: 0 0 0 3px color-mix(in srgb, var(--gold) 18%, transparent); }
.p-head { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; } .p-head .grow { min-width: 0; }
.pbody { margin: 6px 0 10px; line-height: 1.55; font-size: 16px; }
.kudos { display: flex; align-items: center; gap: 14px; padding: 14px; border-radius: 14px; background: linear-gradient(135deg, var(--accent-soft), color-mix(in srgb, var(--gold) 16%, var(--surface))); }
.k-badge { width: 52px; height: 52px; border-radius: 16px; background: var(--surface); display: grid; place-items: center; font-size: 28px; flex: none; box-shadow: var(--shadow); }
.k-title { font-weight: 600; line-height: 1.35; } .k-label { color: var(--muted); font-size: 13.5px; margin-top: 2px; }
.poll { display: grid; gap: 8px; margin: 8px 0; }
.po { position: relative; overflow: hidden; display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 46px; padding: 0 14px; border: 1.5px solid var(--line); border-radius: 12px; background: var(--surface); cursor: pointer; text-align: left; font-weight: 600; color: var(--ink); }
.po.mine { border-color: var(--accent); }
.po-fill { position: absolute; inset: 0 auto 0 0; background: var(--accent-soft); transition: width .4s; z-index: 0; }
.po-t, .po-n { position: relative; z-index: 1; } .po-n { color: var(--muted); font-size: 13.5px; }
.p-actions { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.rxrow, .mrx { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.rx { display: inline-flex; align-items: center; gap: 4px; min-height: 32px; padding: 0 10px; border-radius: 99px; border: 1.5px solid var(--line); background: var(--surface); cursor: pointer; font-size: 14px; color: var(--ink); }
.rx b { font-size: 12.5px; color: var(--muted); } .rx.mine { border-color: var(--accent); background: var(--accent-soft); } .rx.mine b { color: var(--accent); }
.rx.add { color: var(--muted); padding: 0 9px; }
.rxpick { display: flex; gap: 4px; flex-wrap: wrap; padding: 8px 0 2px; } .rxpick button { font-size: 22px; border: 0; background: transparent; cursor: pointer; padding: 4px 6px; border-radius: 10px; } .rxpick button:hover { background: var(--surface2); }
.comments { margin-top: 10px; display: grid; gap: 10px; }
.cmt { display: flex; gap: 10px; align-items: flex-start; } .cmt .cb { background: var(--surface2); border-radius: 14px; padding: 8px 12px; min-width: 0; flex: 1; font-size: 14.5px; }
.cmt-form { display: flex; gap: 8px; } .cmt-form input { flex: 1; min-height: 42px; }
.confetti { position: fixed; z-index: 300; pointer-events: none; font-size: 22px; animation: rise 1.3s ease-out forwards; }
@keyframes rise { to { transform: translate(var(--dx), var(--dy)) rotate(40deg); opacity: 0; } }

/* chat */
.chatgrid { display: grid; grid-template-columns: 310px minmax(0, 1fr); gap: 16px; align-items: start; }
.roomlist { padding: 10px; display: grid; gap: 4px; max-height: calc(100dvh - 240px); overflow: auto; }
.rl-head { display: flex; align-items: center; justify-content: space-between; padding: 4px 6px 8px; }
.room { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 14px; text-decoration: none; color: var(--ink); }
.room:hover { background: var(--surface2); } .room.on { background: var(--accent-soft); }
.room .grow { min-width: 0; } .room .grow b, .room .grow span { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.r-av { position: relative; display: inline-flex; flex: none; } .r-av.team { width: 44px; height: 44px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); align-items: center; justify-content: center; }
.r-av.team .ico { width: 24px; height: 24px; }
.r-av i.on { position: absolute; right: 0; bottom: 0; width: 12px; height: 12px; border-radius: 50%; background: #2e9d5b; border: 2px solid var(--surface); }
.threadwrap { min-width: 0; }
.chatempty { padding: 70px 20px; border: 1px dashed var(--line); border-radius: var(--radius); }
.thread { display: flex; flex-direction: column; height: min(72vh, 680px); min-height: 420px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.t-head { display: flex; align-items: center; gap: 12px; padding: 10px 14px 10px 8px; border-bottom: 1px solid var(--line); } .t-head .grow { min-width: 0; } .t-head .grow b { display: block; }
.t-head .back { display: none; }
.t-note { display: flex; gap: 8px; align-items: flex-start; padding: 8px 14px; font-size: 12.5px; color: var(--muted); background: var(--surface2); border-bottom: 1px solid var(--line); } .t-note .ico { width: 16px; height: 16px; flex: none; margin-top: 2px; }
.msgs { flex: 1; overflow-y: auto; padding: 14px 12px; display: flex; flex-direction: column; gap: 4px; overscroll-behavior: contain; }
.daysep { display: flex; justify-content: center; margin: 10px 0 6px; } .daysep span { font-size: 12px; font-weight: 650; color: var(--muted); background: var(--surface2); border-radius: 99px; padding: 3px 12px; }
.msg { display: flex; gap: 8px; align-items: flex-end; max-width: 100%; } .msg.mine { justify-content: flex-end; }
.m-av { width: 34px; flex: none; } .mcol { display: flex; flex-direction: column; max-width: min(78%, 520px); min-width: 0; } .msg.mine .mcol { align-items: flex-end; }
.m-name { font-size: 12px; font-weight: 700; color: var(--accent); margin: 6px 0 2px 4px; }
.bubble { position: relative; padding: 8px 12px 6px; border-radius: 18px; background: var(--surface2); border: 1px solid var(--line); line-height: 1.45; font-size: 15.5px; cursor: pointer; }
.msg.mine .bubble { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); border-bottom-right-radius: 6px; }
.msg:not(.mine) .bubble { border-bottom-left-radius: 6px; }
.bubble.del { background: transparent; border-style: dashed; }
.bubble time { display: block; text-align: right; font-size: 10.5px; opacity: .65; margin-top: 2px; }
.msg.sel .bubble { outline: 3px solid color-mix(in srgb, var(--accent) 35%, transparent); }
.quote { border-left: 3px solid color-mix(in srgb, currentColor 45%, transparent); padding: 2px 8px; margin: 0 0 6px; font-size: 13px; opacity: .85; background: color-mix(in srgb, currentColor 8%, transparent); border-radius: 6px; }
.quote b { margin-right: 4px; }
.mrx { margin-top: 3px; }
.macts { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; padding: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); }
.macts button { border: 0; background: transparent; cursor: pointer; font-size: 19px; padding: 4px 6px; border-radius: 8px; color: var(--ink); display: inline-flex; align-items: center; gap: 4px; }
.macts button:hover { background: var(--surface2); } .macts button:not([data-e]) { font-size: 13px; font-weight: 600; }
.composer-bar { border-top: 1px solid var(--line); padding: 8px 10px calc(8px + env(safe-area-inset-bottom)); background: var(--surface); }
.cb-row { display: flex; align-items: flex-end; gap: 6px; }
.cb-row textarea { flex: 1; min-height: 44px; max-height: 130px; resize: none; padding: 10px 14px; border-radius: 22px; line-height: 1.35; }
.send { width: 46px; height: 46px; border-radius: 50%; border: 0; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; cursor: pointer; flex: none; } .send:disabled { opacity: .5; }
.replybar { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 10px; margin-bottom: 6px; border-left: 3px solid var(--accent); background: var(--surface2); border-radius: 8px; font-size: 13.5px; } .replybar > div { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.emojibar { display: flex; gap: 2px; flex-wrap: wrap; padding: 4px 4px 8px; } .emojibar button { font-size: 22px; border: 0; background: transparent; cursor: pointer; border-radius: 8px; padding: 2px 5px; }
.pplist { display: grid; gap: 6px; max-height: 55vh; overflow: auto; } .pp { display: flex; align-items: center; gap: 12px; text-align: left; padding: 10px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); cursor: pointer; color: var(--ink); } .pp:hover { background: var(--surface2); } .pp .grow { min-width: 0; } .pp .grow b, .pp .grow span { display: block; }
.persons { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.person { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 18px 12px; gap: 2px; } .person b { margin-top: 8px; } .r-av.big .avatar { width: 64px; height: 64px; font-size: 22px; }
@media (max-width: 880px) {
  .hide-m { display: none !important; }
  .chatgrid { grid-template-columns: minmax(0, 1fr); }
  .chatgrid.thread-open .roomlist, .chatgrid:not(.thread-open) .threadwrap { display: none; }
  .roomlist { max-height: none; }
  .thread { height: calc(100dvh - 168px); min-height: 360px; border-radius: 16px; }
  .t-head .back { display: inline-grid; }
  .mcol { max-width: 84%; }
  .bubble { font-size: 16px; }
}
@media (max-width: 520px) { .composer .cm-top > .avatar { display: none; } .composer .chipset { flex-wrap: wrap; } }
@media (max-width: 880px) { .main:has(.thread) { padding-bottom: 88px; } }

/* admin: sign-in help + hub monitor */
.access code, .row code { background: var(--surface2); padding: 1px 6px; border-radius: 6px; font-size: 13px; }
.atrans { max-height: 56vh; min-height: 260px; overflow-y: auto; border: 1px solid var(--line); border-radius: 14px; padding: 8px 12px; background: var(--surface2); }
.amsg { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; border-bottom: 1px solid color-mix(in srgb, var(--line) 60%, transparent); }
.amsg .iconbtn { width: 36px; height: 36px; flex: none; }
.seg { overflow-x: auto; scrollbar-width: none; } .seg::-webkit-scrollbar { display: none; }
.seg button { white-space: nowrap; }
@media (max-width: 420px) { .seg button { padding: 0 12px; } }
.daychart { display: flex; align-items: flex-end; gap: 3px; height: 150px; }
.dc { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: stretch; height: 100%; justify-content: flex-end; gap: 4px; }
.dc-bar { flex: 1; display: flex; flex-direction: column-reverse; justify-content: flex-start; background: var(--surface2); border-radius: 4px 4px 0 0; overflow: hidden; }
.dc-bar i { display: block; width: 100%; } .dc span { font-size: 10px; color: var(--muted); text-align: center; line-height: 1; }
.dc-bar i.p, .lg.p { background: var(--ok); } .dc-bar i.w, .lg.w { background: var(--info); } .dc-bar i.l, .lg.l { background: #d9a21b; } .dc-bar i.m, .lg.m { background: var(--danger); }
.lg { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; }
.tbl .num, .tbl th.num { text-align: right; }
.hubcard { display: flex; align-items: center; gap: 14px; margin-top: 18px; text-decoration: none; color: inherit; padding: 14px 18px; }
.hubcard:hover { border-color: var(--accent); } .hubcard .grow { min-width: 0; }
.hc-ic { width: 44px; height: 44px; border-radius: 14px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; flex: none; }

/* admin: tappable calendar boxes */
.cal td.tap { cursor: pointer; }
.cal td.tap:hover, .cal td.tap:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; background: var(--accent-soft); }

/* ============ Fun & calendars (birthdays, spin wheel, year calendar, holidays) ============ */
.t-LEAVE { --tc: #c26a1b; }
.fall-box { position: fixed; inset: 0; z-index: 400; pointer-events: none; overflow: hidden; }
.fall-box span { position: absolute; top: -40px; animation: fallDown linear forwards; will-change: transform; }
@keyframes fallDown { 0% { transform: translate(0, 0) rotate(0); opacity: 1; } 100% { transform: translate(var(--sway, 0), 112vh) rotate(360deg); opacity: .9; } }
@media (prefers-reduced-motion: reduce) { .fall-box { display: none; } }

.celebrate { display: flex; align-items: center; gap: 16px; padding: 18px 20px; margin-bottom: 18px; border-radius: var(--radius); color: #3a2a00; background: linear-gradient(120deg, #ffe9a8, #ffd0e0 60%, #d8e6ff); border: 1px solid #f3d27a; box-shadow: var(--shadow); }
.celebrate .c-emoji { font-size: 46px; line-height: 1; flex: none; animation: bob 2.2s ease-in-out infinite; }
.celebrate h2 { font-size: 22px; } .celebrate p { margin-top: 4px; line-height: 1.45; overflow-wrap: anywhere; }
[data-theme="dark"] .celebrate { color: #fff3d0; background: linear-gradient(120deg, #4a3a10, #4a1f33 60%, #1d2f55); border-color: #6b5520; }
@keyframes bob { 0%, 100% { transform: translateY(0) rotate(-4deg); } 50% { transform: translateY(-6px) rotate(4deg); } }

.minicards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr)); gap: 14px; margin-top: 18px; }
.minicard { padding: 14px 16px; min-width: 0; }
.minicard h3 { display: flex; align-items: center; gap: 8px; font-size: 16px; margin-bottom: 8px; }
.minilist { display: grid; gap: 8px; }
.mini { display: flex; align-items: center; gap: 10px; min-width: 0; }
.mini .grow b, .mini .grow span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini .tag { flex: none; }
.holdate { flex: none; width: 46px; text-align: center; border-radius: 10px; background: var(--warn-soft); color: var(--warn); padding: 4px 0; line-height: 1.1; font-weight: 700; }
.holdate small { display: block; font-size: 11px; font-weight: 600; text-transform: uppercase; }

.spincard { display: flex; align-items: center; gap: 14px; margin-top: 18px; padding: 14px 18px; text-decoration: none; color: inherit; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow); }
.spincard .sc-ic { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; font-size: 26px; background: var(--accent-soft); flex: none; }
.spincard.open { border-color: #e0a526; background: linear-gradient(120deg, color-mix(in srgb, #ffd45e 28%, var(--surface)), var(--surface)); }
.spincard.open .sc-ic { background: #ffd45e; animation: bob 1.6s ease-in-out infinite; }
.spincard .grow b, .spincard .grow span { display: block; }
.spincard .grow span { overflow-wrap: anywhere; }

/* year calendar */
.ysum { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.yearcal { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(210px, 100%), 1fr)); gap: 14px; }
.ymonth { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 12px 12px 10px; min-width: 0; }
.ymonth h4 { font-size: 15px; margin-bottom: 8px; }
.ydow, .ygrid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 3px; }
.ydow i { font-style: normal; text-align: center; font-size: 10.5px; color: var(--muted); font-weight: 600; }
.ygrid .x { visibility: hidden; }
.ygrid .d { appearance: none; border: 1px solid transparent; background: transparent; color: var(--ink); font-size: 12px; line-height: 1; aspect-ratio: 1; border-radius: 8px; padding: 0; cursor: pointer; display: grid; place-items: center; min-width: 0; }
.ygrid .d:hover { background: var(--surface2); }
.ygrid .d.off { color: var(--muted); background: repeating-linear-gradient(45deg, transparent 0 4px, color-mix(in srgb, var(--muted) 14%, transparent) 4px 8px); }
.ygrid .d.hol { background: var(--warn-soft); color: var(--warn); font-weight: 700; }
.ygrid .d.has { background: var(--tc); color: #fff; font-weight: 700; }
.ygrid .d.has.half { background: linear-gradient(135deg, var(--tc) 50%, color-mix(in srgb, var(--tc) 18%, transparent) 50%); color: var(--ink); }
.ygrid .d.pend { border: 1.5px dashed var(--tc); color: var(--tc); font-weight: 700; }
.ygrid .d.today { box-shadow: 0 0 0 2px var(--accent); }
.ylegend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 14px; font-size: 13px; color: var(--muted); }
.lgd { display: inline-flex; align-items: center; gap: 6px; } .lgd i { width: 12px; height: 12px; border-radius: 4px; background: var(--tc, var(--muted)); display: inline-block; }
.lgd.off i { background: repeating-linear-gradient(45deg, transparent 0 3px, color-mix(in srgb, var(--muted) 40%, transparent) 3px 6px); border: 1px solid var(--line); }
.lgd.holi i { background: var(--warn-soft); border: 1px solid var(--warn); }
.lgd.pend i { background: transparent; border: 1.5px dashed var(--muted); }
.ytip { margin-top: 10px; min-height: 22px; } .ytip.on { color: var(--ink); font-weight: 600; font-size: 14px; }

/* team calendar tweaks (same table as the Admin's) */
.cal .cell.t-LEAVE { background: #c26a1b; } .cal .cell.t-WFH { background: #2f6fb0; }
.cal .cell.half.t-LEAVE, .cal .cell.half.t-WFH { background: linear-gradient(135deg, var(--tc) 50%, transparent 50%); color: var(--ink); }
.cal .hol { background: repeating-linear-gradient(45deg, var(--warn-soft) 0 5px, transparent 5px 10px); }
.cal th.hol { color: var(--warn); }
.cal .nm .me { color: var(--accent); }

/* spin wheel */
.wheelpage { display: grid; gap: 18px; justify-items: center; text-align: center; }
.wheelbox { position: relative; width: min(86vw, 340px); aspect-ratio: 1; margin: 6px auto 0; }
.wheel-rot { width: 100%; height: 100%; border-radius: 50%; box-shadow: 0 10px 30px rgba(0, 0, 0, .22), 0 0 0 8px var(--surface), 0 0 0 10px var(--line); transition: transform 5.2s cubic-bezier(.12, .72, .08, 1); }
.wheel-rot svg { width: 100%; height: 100%; display: block; }
.wheelbox.locked .wheel-rot { filter: grayscale(.9) brightness(.9); opacity: .6; }
.wheel-pin { position: absolute; left: 50%; top: -14px; transform: translateX(-50%); width: 0; height: 0; border-left: 14px solid transparent; border-right: 14px solid transparent; border-top: 30px solid var(--danger); filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .3)); z-index: 3; }
.wheel-hub { position: absolute; left: 50%; top: 50%; width: 64px; height: 64px; margin: -32px 0 0 -32px; border-radius: 50%; background: var(--surface); box-shadow: 0 2px 10px rgba(0, 0, 0, .25); display: grid; place-items: center; font-size: 28px; z-index: 2; }
.wheelnote { max-width: 420px; line-height: 1.5; overflow-wrap: anywhere; }
.spinbtn { min-height: 56px; padding: 0 40px; font-size: 18px; border-radius: 16px; }
.prizelist { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; max-width: 520px; }
.prizelist .tchip { --tc: var(--accent); }
.resultpop { text-align: center; padding: 6px 4px 2px; }
.resultpop .big { font-size: 64px; line-height: 1.1; animation: bob 1.8s ease-in-out infinite; }
.resultpop h2 { margin: 8px 0 6px; overflow-wrap: anywhere; } .resultpop p { line-height: 1.5; overflow-wrap: anywhere; }

/* dates tab */
.datelist { display: grid; gap: 10px; }
.dateitem { display: flex; align-items: center; gap: 12px; padding: 10px 14px; min-width: 0; }
.dateitem .grow b, .dateitem .grow span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dateitem.today { border-color: #e0a526; background: color-mix(in srgb, #ffd45e 18%, var(--surface)); }
.cal-nav { display: flex; align-items: center; gap: 6px; margin-bottom: 14px; flex-wrap: wrap; }
.cal-nav b { font-family: var(--serif); font-size: 20px; min-width: 150px; text-align: center; }

/* simpler chat */
.rl-search { margin: 0 4px 8px; }
.rl-search input { width: 100%; min-height: 44px; border-radius: 22px; padding: 0 16px; }
.room .rtime { flex: none; font-size: 12px; color: var(--muted); align-self: flex-start; margin-top: 2px; }
.room .rmeta { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex: none; }
.room .rmeta .badge { position: static; }
.room .hello { font-size: 12px; font-weight: 700; color: var(--accent); }
.rl-sec { padding: 8px 8px 2px; font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.quickrow { display: flex; gap: 6px; overflow-x: auto; padding: 4px 2px 8px; scrollbar-width: none; } .quickrow::-webkit-scrollbar { display: none; }
.quickrow button { flex: none; border: 1px solid var(--line); background: var(--surface2); border-radius: 18px; padding: 6px 12px; font-size: 14px; cursor: pointer; white-space: nowrap; }
.quickrow button:hover { border-color: var(--accent); background: var(--accent-soft); }
.hibtn { margin-top: 12px; min-height: 52px; padding: 0 28px; font-size: 17px; }

/* ---- Long text safety: long names, unbroken words and long holiday names wrap or shorten instead of spilling out of their box ---- */
h1, h2, h3, h4, b, strong, p, .t, .x, .m, .why, .sub, .sub2, .muted, .small, .kv dd, .ev .t, .ev .m, .tl .x, .notice-card, .item, .liverow, .stat span, .tile .l { overflow-wrap: anywhere; }
.chip { flex: none; max-width: 100%; white-space: normal; overflow-wrap: break-word; text-align: left; }
.profile-head .grow { flex: 1 1 220px; min-width: min(100%, 220px); }
.roomlist { grid-template-columns: minmax(0, 1fr); }
.t-head .grow b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ht-item .grow, .minicard .grow, .spincard .grow, .liverow .grow { overflow-wrap: anywhere; }
#theme-seg { display: flex; width: 100%; }
#theme-seg button { flex: 1 1 0; min-width: 0; justify-content: center; padding: 0 8px; }
/* report chart: show a day number only every 5th bar on small screens so the numbers never collide */
.dc span { position: relative; display: block; height: 10px; }
.dc span em { position: absolute; left: 50%; top: 0; transform: translateX(-50%); font-style: normal; white-space: nowrap; }
@media (max-width: 700px) { .dc:not(:nth-child(5n+1)):not(:last-child) span em { display: none; } }
.stack > .switch, .stack > .field > .stack > .switch { display: flex; }
.tbl td:first-child, .tbl th:first-child { min-width: 140px; }

/* spin wheel countdown */
.wheelclock { margin: 0; padding: 8px 14px; border-radius: 99px; background: var(--surface2); border: 1px solid var(--line); font-size: 14.5px; color: var(--muted); text-align: center; max-width: 100%; }
.wheelclock b { color: var(--ink); font-variant-numeric: tabular-nums; }
.wheelclock.closing { background: var(--warn-soft); border-color: transparent; color: var(--warn); }

/* spin wheel: calm, professional look (no emojis; full wording; the blank slice is empty) */
.wheel-rot { box-shadow: 0 8px 24px rgba(0, 0, 0, .18); }
.wheel-rot svg text { font-family: inherit; }
.wheelbox.locked .wheel-rot { filter: grayscale(1); opacity: .5; }
.wheel-pin { top: -9px; border-left-width: 11px; border-right-width: 11px; border-top-width: 24px; border-top-color: #b8923f; }
.wheel-hub { width: 56px; height: 56px; margin: -28px 0 0 -28px; background: #f7f4ee; color: #17352c; box-shadow: 0 0 0 3px #17352c, 0 2px 8px rgba(0, 0, 0, .25); font-size: 0; }
.wheel-hub::after { content: ""; width: 12px; height: 12px; border-radius: 50%; background: #17352c; }
.wheelbox.locked .wheel-hub::after { display: none; }
.spinbtn { min-height: 52px; padding: 0 32px; font-size: 16px; border-radius: 12px; }
.prizelist { gap: 8px 18px; }
.pz { display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--muted); }
.pz i, .pzdot { width: 12px; height: 12px; border-radius: 3px; flex: none; display: inline-block; border: 1px solid rgba(0, 0, 0, .14); }
.resultpop .rp-bar { display: block; width: 56px; height: 6px; border-radius: 3px; margin: 4px auto 14px; }
.resultpop .rp-k { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.resultpop h2 { font-size: 26px; }
.spincard.open { border-color: var(--accent); background: var(--surface); }
.spincard .sc-ic, .spincard.open .sc-ic { background: var(--accent-soft); color: var(--accent); animation: none; font-size: 0; }
.wheelclock.closing { background: var(--surface2); border: 1px solid var(--line); color: var(--muted); }

/* ============ First sign-in: details step ============ */
.req { color: var(--danger); font-weight: 700; margin-left: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.auth-card.wide { max-width: 520px; }
.steps { display: flex; justify-content: center; align-items: center; gap: 8px; list-style: none; margin: 0 0 18px; padding: 0; font-size: 13px; color: var(--muted); flex-wrap: wrap; }
.steps li { display: flex; align-items: center; gap: 7px; }
.steps li + li::before { content: ''; width: 26px; height: 2px; border-radius: 2px; background: var(--line); margin-right: 2px; }
.steps i { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-style: normal; font-weight: 700; font-size: 12px; background: var(--surface2); border: 1px solid var(--line); color: var(--muted); }
.steps .on { color: var(--ink); font-weight: 600; } .steps .on i { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.steps .done i { background: var(--ok-soft); border-color: var(--ok); color: var(--ok); }
.lockbox { display: grid; gap: 12px; padding: 14px; border-radius: 14px; background: var(--surface2); border: 1px dashed var(--line); }
.lockbox .lbl { display: flex; align-items: center; gap: 6px; }
.lockbox input:disabled { background: var(--line); color: var(--muted); -webkit-text-fill-color: var(--muted); opacity: 1; cursor: not-allowed; }
.ferr { display: block; color: var(--danger); font-size: 13.5px; font-weight: 500; margin-top: 5px; }
.field input[aria-invalid="true"], .field textarea[aria-invalid="true"] { border-color: var(--danger); }
