/* CraftiPanda Studio — premium Apple-inspired light look.
   Warm-gray canvas, white rounded cards, coral-orange + ink-black pill buttons.
   Brand palette is unchanged; usage refined for depth, hierarchy and polish. */
:root {
  /* ---- Brand colours (unchanged) ---- */
  --bg: #ebebe9;
  --card: #ffffff;
  --text: #17181a;
  --muted: #8b8f98;
  --border: #e9eae7;
  --ink: #161616;            /* black pills */
  --primary: #e8633c;        /* coral orange */
  --primary-soft: #fbe9e2;
  --primary-text: #ffffff;
  --accent: #e8262a;         /* record-dot red */
  --success: #1f9d55;
  --warn-bg: #fff3d6; --warn-text: #8a6100;
  --ok-bg: #e2f6e9; --ok-text: #176b3c;
  --danger: #d64545; --danger-bg: #fdecec; --danger-text: #a32f2f;
  --status-bg: #efeff4; --status-text: #4a4f66;
  --yt: #ff0033; --fb: #1877f2; --ig: #c13584; --tt: #00bcd4;

  /* ---- Refined surfaces & lines ---- */
  --surface-2: #f5f5f3;      /* subtle inset surface */
  --border-soft: #f0f0ee;    /* hairline */
  --nav-bg: rgba(255, 255, 255, .72);

  /* ---- Elevation tiers ---- */
  --shadow-sm: 0 1px 2px rgba(23, 24, 26, .05), 0 1px 1px rgba(23, 24, 26, .04);
  --shadow: 0 1px 2px rgba(23, 24, 26, .04), 0 10px 26px rgba(23, 24, 26, .06);
  --shadow-md: 0 2px 6px rgba(23, 24, 26, .05), 0 18px 40px rgba(23, 24, 26, .10);
  --shadow-lg: 0 12px 48px rgba(23, 24, 26, .18);

  /* ---- Motion & shape ---- */
  --ring: 0 0 0 3px rgba(232, 99, 60, .30);
  --ease: cubic-bezier(.4, 0, .2, 1);
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --dur: .18s;
  --radius: 20px;
  --radius-md: 16px;
  --radius-sm: 12px;
  --radius-xs: 9px;
}
html[data-theme="dark"] {
  --bg: #0e1014;
  --card: #191c24;
  --text: #eceef4;
  --muted: #9aa2b8;
  --border: #2a2f3d;
  --ink: #ffffff;
  --primary-soft: #3a2417;
  --warn-bg: #383014; --warn-text: #ffd479;
  --ok-bg: #143420; --ok-text: #6fe09a;
  --danger-bg: #3a1b1b; --danger-text: #ff9d9d;
  --status-bg: #242a4a; --status-text: #aabaff;
  --surface-2: #20232c;
  --border-soft: #232733;
  --nav-bg: rgba(18, 20, 26, .72);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .35);
  --shadow: 0 2px 10px rgba(0, 0, 0, .45);
  --shadow-md: 0 8px 30px rgba(0, 0, 0, .55);
  --shadow-lg: 0 16px 54px rgba(0, 0, 0, .62);
  --ring: 0 0 0 3px rgba(232, 99, 60, .42);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg); color: var(--text);
  font-size: 16px; line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-feature-settings: "kern" 1, "liga" 1;
}
::selection { background: rgba(232, 99, 60, .22); color: var(--text); }

a { color: var(--primary); text-decoration: none; transition: color var(--dur) var(--ease); }
a:hover { text-decoration: underline; }
h1 { font-size: 1.78rem; font-weight: 800; margin: .4rem 0 1.15rem; letter-spacing: -.025em; line-height: 1.18; }
h2 { font-size: 1.12rem; font-weight: 700; margin: 0 0 .85rem; letter-spacing: -.012em; }
h3 { font-size: .98rem; font-weight: 700; margin: 1rem 0 .4rem; letter-spacing: -.01em; }
hr { border: none; border-top: 1px solid var(--border); margin: 1.15rem 0; }
code { background: var(--surface-2); padding: .12em .42em; border-radius: 6px; font-size: .88em; font-family: "SF Mono", ui-monospace, SFMono-Regular, Menlo, monospace; }
.muted { color: var(--muted); } .small { font-size: .85rem; } .center { text-align: center; }
.mt { margin-top: 1.15rem; } .strike { text-decoration: line-through; }
.container { max-width: 1240px; margin: 0 auto; padding: 1.4rem 1.15rem 3rem; animation: pageRise .42s var(--ease-out) both; }
@keyframes pageRise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* Thin, calm scrollbars */
* { scrollbar-width: thin; scrollbar-color: var(--border) transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-thumb { background: var(--border); border-radius: 999px; border: 2px solid transparent; background-clip: content-box; }
*::-webkit-scrollbar-thumb:hover { background: var(--muted); background-clip: content-box; }

/* ---- Nav ---- */
.nav { background: var(--card); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 100; box-shadow: var(--shadow-sm); }
@supports ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .nav { background: var(--nav-bg); -webkit-backdrop-filter: saturate(180%) blur(16px); backdrop-filter: saturate(180%) blur(16px); }
}
.nav-inner { max-width: 1240px; margin: 0 auto; padding: .55rem 1rem; display: flex; align-items: center; gap: .9rem; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: .55rem; font-weight: 800; font-size: 1.16rem; color: var(--text); letter-spacing: -.025em; }
.brand:hover { text-decoration: none; }
.brand-logo { height: 34px; width: 34px; object-fit: contain; background: #fff; border-radius: 10px; padding: 2px; box-shadow: var(--shadow-sm); }
.nav-search input { width: 160px; padding: .42rem .85rem; border-radius: 999px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text); transition: width var(--dur) var(--ease), box-shadow var(--dur) var(--ease), border-color var(--dur) var(--ease); }
.nav-search input:focus { width: 210px; }
.nav-links { display: flex; align-items: center; gap: .12rem; flex: 1; flex-wrap: wrap; }
.nav-links a {
  position: relative; color: var(--muted); font-weight: 600; font-size: .94rem; padding: .42rem .8rem; white-space: nowrap;
  border-radius: 999px; transition: background var(--dur) var(--ease), color var(--dur) var(--ease), transform .08s var(--ease);
}
.nav-links a:hover { color: var(--text); background: var(--surface-2); text-decoration: none; }
.nav-links a.active { color: var(--primary); background: var(--primary-soft); font-weight: 700; }
.nav-links a:active { transform: scale(.95); }
.nav-count { display: inline-block; background: var(--accent); color: #fff; border-radius: 999px; font-size: .66rem; line-height: 1.4; padding: 0 .42rem; font-weight: 800; vertical-align: middle; margin-left: .15rem; box-shadow: 0 1px 3px rgba(232, 38, 42, .4); }
.nav-spacer { flex: 1; }
.nav-burger { display: none; margin-left: auto; background: var(--surface-2); border: 1px solid var(--border); color: var(--text); border-radius: 11px; padding: .35rem .7rem; font-size: 1.15rem; cursor: pointer; transition: background var(--dur) var(--ease), transform .08s var(--ease); }
.nav-burger:active { transform: scale(.92); }
.theme-toggle { background: var(--surface-2); border: 1px solid var(--border); border-radius: 11px; padding: .3rem .6rem; cursor: pointer; font-size: 1rem; transition: background var(--dur) var(--ease), transform .08s var(--ease); }
.theme-toggle:hover { background: var(--primary-soft); }
.theme-toggle:active { transform: scale(.9) rotate(-12deg); }
.link-btn { background: none; border: none; color: var(--muted); cursor: pointer; font: inherit; padding: .42rem .7rem; border-radius: 999px; transition: background var(--dur) var(--ease), color var(--dur) var(--ease); }
.link-btn:hover { color: var(--danger); background: var(--danger-bg); }
.inline-form { display: inline; }
.nav-more { position: relative; }
.nav-dropdown { position: absolute; top: 132%; left: 0; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-md); box-shadow: var(--shadow-lg); padding: .5rem; display: flex; flex-direction: column; gap: .1rem; min-width: 210px; z-index: 60; transform-origin: top left; animation: dropIn .16s var(--ease-out); }
.nav-dropdown[hidden] { display: none; }
.nav-dropdown a { display: block; padding: .5rem .8rem; border-radius: var(--radius-xs); color: var(--text); font-weight: 600; font-size: .92rem; transition: background .12s var(--ease), color .12s var(--ease), padding-left .12s var(--ease); }
.nav-dropdown a:hover { background: var(--primary-soft); color: var(--primary); text-decoration: none; padding-left: 1rem; }
@keyframes dropIn { from { opacity: 0; transform: translateY(-8px) scale(.97); } to { opacity: 1; transform: none; } }
.link-like { background: none; border: none; color: var(--muted); font: inherit; font-weight: 600; cursor: pointer; padding: .42rem .8rem; border-radius: 999px; transition: background var(--dur) var(--ease), color var(--dur) var(--ease); }
.link-like:hover { background: var(--surface-2); color: var(--text); }
.bell { position: relative; font-size: 1.08rem; padding: .35rem .5rem; border-radius: 999px; transition: background var(--dur) var(--ease), transform .08s var(--ease); }
.bell:hover { background: var(--surface-2); text-decoration: none; }
.bell:active { transform: scale(.9); }
.bell-count { position: absolute; top: -3px; right: -4px; background: var(--accent); color: #fff; font-size: .66rem; font-weight: 800; border-radius: 999px; padding: 0 .35rem; min-width: 1.1rem; text-align: center; box-shadow: 0 1px 3px rgba(232, 38, 42, .45); }
.badge-dot { display: inline-block; width: 8px; height: 8px; background: var(--accent); border-radius: 50%; vertical-align: super; }

@media (max-width: 900px) {
  .nav-burger { display: block; }
  .nav-links { display: none; flex-direction: column; align-items: stretch; width: 100%; gap: .1rem; padding: .5rem 0 .3rem; }
  .nav-links.show { display: flex; animation: navDrop .22s var(--ease-out); }
  .nav-links a, .nav-links .link-like, .nav-links .link-btn { width: 100%; padding: .72rem .85rem; font-size: 1rem; border-radius: var(--radius-sm); }
  .nav-spacer { display: none; }
  .nav-search { order: 5; width: 100%; }
  .nav-search input { width: 100%; }
  .nav-search input:focus { width: 100%; }
  .nav-more { width: 100%; }
  .nav-dropdown { position: static; border: none; box-shadow: none; padding: .15rem 0 .15rem .9rem; animation: none; min-width: 0; }
  .bell { width: 100%; }
}
@keyframes navDrop { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

/* ---- Cards / layout ---- */
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.3rem 1.4rem; margin-bottom: 1.25rem; box-shadow: var(--shadow); }
.card h2 { display: flex; align-items: center; gap: .45rem; }
.card h2:first-child { margin-top: 0; }
.card-highlight { border-color: var(--primary); box-shadow: var(--shadow-md), 0 0 0 1px var(--primary) inset; }
.card-danger { border-color: var(--danger); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; align-items: start; }
@media (max-width: 860px) { .grid-2 { grid-template-columns: 1fr; } }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: .4rem; }
.boxed { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: .85rem; background: var(--surface-2); }

/* ---- Stats ---- */
.stat-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.25rem; margin-bottom: 1.25rem; }
@media (max-width: 860px) { .stat-row { grid-template-columns: repeat(2, 1fr); gap: 1rem; } }
.stat { text-align: center; padding: 1.25rem .7rem; }
.stat-num { font-size: 2.05rem; font-weight: 800; letter-spacing: -.035em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat-label { color: var(--muted); font-size: .82rem; font-weight: 600; margin-top: .15rem; }
.stat-danger .stat-num { color: var(--danger); }
.stat-hero { border-color: var(--primary); box-shadow: var(--shadow-md), 0 0 0 1px var(--primary) inset; }
.stat-hero .stat-num { color: var(--primary); }
a.stat-click { display: block; color: inherit; text-decoration: none; transition: transform .16s var(--ease-out), box-shadow .2s var(--ease), border-color .2s var(--ease); }
a.stat-click:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--primary); text-decoration: none; }
a.stat-click:active { transform: translateY(-1px) scale(.99); }

/* ---- Badges ---- */
.badge { display: inline-flex; align-items: center; gap: .25rem; padding: .16rem .62rem; border-radius: 999px; font-size: .75rem; font-weight: 700; line-height: 1.45; white-space: nowrap; background: var(--surface-2); border: 1px solid var(--border); letter-spacing: .005em; }
.badge-ok { background: var(--ok-bg); color: var(--ok-text); border-color: transparent; }
.badge-warn { background: var(--warn-bg); color: var(--warn-text); border-color: transparent; }
.badge-danger { background: var(--danger-bg); color: var(--danger-text); border-color: transparent; }
.badge-status { background: var(--status-bg); color: var(--status-text); border-color: transparent; }
.badge-format { background: var(--primary-soft); color: var(--primary); border-color: transparent; }
.badge-prio-low { background: var(--ok-bg); color: var(--ok-text); border-color: transparent; }
.badge-prio-normal { background: var(--status-bg); color: var(--status-text); border-color: transparent; }
.badge-prio-high { background: var(--warn-bg); color: var(--warn-text); border-color: transparent; }
.badge-prio-urgent { background: var(--danger-bg); color: var(--danger-text); border-color: transparent; }
.badge-platform-youtube { background: var(--yt); color: #fff; border-color: transparent; }
.badge-platform-facebook { background: var(--fb); color: #fff; border-color: transparent; }
.badge-platform-instagram { background: var(--ig); color: #fff; border-color: transparent; }
.badge-platform-tiktok { background: var(--tt); color: #fff; border-color: transparent; }
.badge-pub-none { background: var(--surface-2); color: var(--muted); }
.badge-pub-planned { background: var(--status-bg); color: var(--status-text); border-color: transparent; }
.badge-pub-scheduled { background: var(--warn-bg); color: var(--warn-text); border-color: transparent; }
.badge-pub-uploaded { background: var(--ok-bg); color: var(--ok-text); border-color: transparent; }
.badge-row { display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: 1.15rem; }
.score-pill { background: var(--primary); color: #fff; padding: .16rem .68rem; border-radius: 999px; font-weight: 800; box-shadow: 0 2px 8px rgba(232, 99, 60, .3); }
.stars { color: #e8a913; letter-spacing: 1px; }

/* ---- Presence ---- */
.dot, .presence-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: .3rem; background: var(--border); transition: background var(--dur) var(--ease), box-shadow var(--dur) var(--ease); }
.dot-green, .presence-dot[data-status="online"] { background: var(--success); box-shadow: 0 0 0 3px rgba(31, 157, 85, .22); }
.presence-dot[data-status="idle"] { background: #e8a913; box-shadow: 0 0 0 3px rgba(232, 169, 19, .2); }

/* ---- Forms ---- */
label { display: block; font-weight: 600; font-size: .88rem; margin-bottom: .25rem; color: var(--text); }
input, select, textarea {
  width: 100%; padding: .68rem .9rem; margin-top: .25rem;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface-2); color: var(--text); font: inherit; line-height: 1.4;
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease), background var(--dur) var(--ease);
  -webkit-appearance: none; appearance: none;
}
input::placeholder, textarea::placeholder { color: var(--muted); opacity: .85; }
input:hover, select:hover, textarea:hover { border-color: var(--muted); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); background: var(--card); box-shadow: var(--ring); }
textarea { min-height: 6.5rem; resize: vertical; }
select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='none' stroke='%238b8f98' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round' d='M2.5 4.5 6 8l3.5-3.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right .85rem center; background-size: 12px; padding-right: 2.3rem;
}
/* Restore native checkbox/radio rendering (the rule above sets appearance:none for
   text fields & selects) so the check mark shows and many can be ticked at once. */
input[type="checkbox"], input[type="radio"] { -webkit-appearance: auto; appearance: auto; width: 1.05rem; height: 1.05rem; accent-color: var(--primary); cursor: pointer; }
input[type="file"] { padding: .5rem .7rem; cursor: pointer; }
input[type="date"], input[type="datetime-local"], input[type="time"] { min-height: 2.65rem; }
.stack > * + * { margin-top: 1rem; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; align-items: end; }
.form-row label { margin-bottom: 0; }
@media (max-width: 640px) { .form-row { grid-template-columns: 1fr; } }
.form-actions, .btn-row { display: flex; gap: .6rem; flex-wrap: wrap; margin-top: .7rem; align-items: center; }
.check-group { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: .75rem .95rem; background: var(--surface-2); }
.check-group legend { font-weight: 700; font-size: .88rem; padding: 0 .35rem; }
.check { display: flex; align-items: center; gap: .55rem; font-weight: 500; margin: .3rem 0; cursor: pointer; }
.check input { width: auto; margin: 0; }
.check-row { display: flex; gap: 1.1rem; flex-wrap: wrap; }
.note-form { display: flex; gap: .55rem; margin-bottom: 1rem; }
.note-form input { flex: 1; margin-top: 0; }
.filter-row { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; }
.filter-row input, .filter-row select { width: auto; margin-top: 0; flex: 1; min-width: 140px; }
.totp-input { font-size: 1.6rem; letter-spacing: .4em; text-align: center; font-variant-numeric: tabular-nums; }
.qr { display: block; margin: .6rem 0; border-radius: var(--radius-sm); background: #fff; padding: 8px; box-shadow: var(--shadow-sm); }

/* ---- Buttons ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
  padding: .62rem 1.3rem; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--border); background: var(--card); color: var(--text);
  font: inherit; font-weight: 650; font-size: .95rem; line-height: 1.2; text-decoration: none;
  box-shadow: var(--shadow-sm);
  transition: transform .12s var(--ease-out), box-shadow var(--dur) var(--ease), background var(--dur) var(--ease), border-color var(--dur) var(--ease), filter var(--dur) var(--ease);
  -webkit-user-select: none; user-select: none;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); box-shadow: var(--shadow-md); border-color: var(--muted); }
.btn:active { transform: translateY(0) scale(.97); box-shadow: var(--shadow-sm); }
.btn:focus-visible { outline: none; box-shadow: var(--ring); }
.btn:disabled, .btn[disabled], .btn.is-loading { opacity: .6; cursor: not-allowed; transform: none; box-shadow: var(--shadow-sm); filter: saturate(.85); }
.btn-primary { background: linear-gradient(135deg, #ef7048, var(--primary) 52%, #d9542e); border-color: transparent; color: #fff; box-shadow: 0 2px 10px rgba(232, 99, 60, .32); }
.btn-primary:hover { box-shadow: 0 6px 20px rgba(232, 99, 60, .42); border-color: transparent; }
.btn-dark { background: var(--ink); border-color: var(--ink); color: var(--card); }
.btn-dark:hover { border-color: var(--ink); }
.btn-success { background: var(--success); border-color: transparent; color: #fff; box-shadow: 0 2px 10px rgba(31, 157, 85, .3); }
.btn-danger { background: var(--danger); border-color: transparent; color: #fff; box-shadow: 0 2px 10px rgba(214, 69, 69, .3); }
.btn-warn { background: var(--warn-bg); border-color: transparent; color: var(--warn-text); }
.btn-ghost { background: transparent; border-color: transparent; box-shadow: none; color: var(--text); }
.btn-ghost:hover { background: var(--surface-2); box-shadow: none; }
.btn-secondary { background: var(--surface-2); }
.btn-big { font-size: 1.1rem; padding: .9rem 1.7rem; width: 100%; }
.btn-block { width: 100%; }
.btn-small { padding: .32rem .75rem; font-size: .84rem; border-radius: 999px; gap: .3rem; }
.btn.is-loading { position: relative; color: transparent !important; }
.btn.is-loading::after { content: ""; position: absolute; width: 1.05em; height: 1.05em; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .6s linear infinite; color: #fff; }

/* ---- Spinner / skeleton utilities ---- */
.spinner { display: inline-block; width: 1.2em; height: 1.2em; border: 2px solid var(--border); border-top-color: var(--primary); border-radius: 50%; animation: spin .6s linear infinite; vertical-align: -.2em; }
@keyframes spin { to { transform: rotate(360deg); } }
.skeleton { position: relative; overflow: hidden; background: var(--surface-2); border-radius: var(--radius-sm); }
.skeleton::after { content: ""; position: absolute; inset: 0; transform: translateX(-100%); background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .55), transparent); animation: shimmer 1.4s infinite; }
html[data-theme="dark"] .skeleton::after { background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .07), transparent); }
@keyframes shimmer { 100% { transform: translateX(100%); } }

/* ---- Tables ---- */
.table-wrap { overflow-x: auto; border-radius: var(--radius-sm); }
table { width: 100%; border-collapse: collapse; font-size: .92rem; font-variant-numeric: tabular-nums; }
th { text-align: left; color: var(--muted); font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
th, td { padding: .68rem .7rem; border-bottom: 1px solid var(--border-soft); vertical-align: top; }
thead th { border-bottom: 1px solid var(--border); }
tbody tr { transition: background .12s var(--ease); }
tbody tr:hover { background: var(--surface-2); }
tr:last-child td { border-bottom: none; }
table.compact th, table.compact td { padding: .38rem .55rem; }
.row-today { background: var(--status-bg); }
.row-muted { opacity: .55; }
table.matrix td.matrix-cell { min-width: 150px; }
table.matrix tbody tr:hover { background: transparent; }
.cell-menu summary { cursor: pointer; color: var(--primary); font-weight: 700; list-style: none; }
.cell-menu summary::-webkit-details-marker { display: none; }
.pub-assets summary { cursor: pointer; color: var(--primary); font-weight: 600; margin-top: .3rem; }
.pub-assets .stack > div { display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; }
.thumb-row { display: flex; gap: .6rem; flex-wrap: wrap; margin-top: .4rem; }
.thumb-item { display: flex; flex-direction: column; align-items: center; gap: .25rem; }
.thumb-prev { width: 104px; height: 60px; object-fit: cover; border-radius: var(--radius-xs); border: 1px solid var(--border); cursor: pointer; display: block; transition: transform .16s var(--ease-out), border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease); }
.thumb-prev:hover { border-color: var(--primary); transform: scale(1.04); box-shadow: var(--shadow); }
.thumb-dl { padding: .15rem .5rem; font-size: .78rem; }
.cell-menu .stack, .cell-menu form { margin-top: .5rem; }

/* ---- Lists ---- */
.plain-list { list-style: none; padding: 0; margin: 0; }
.plain-list li { padding: 0; margin: 0; }
/* Every list item is a clean card-row (soft surface, rounded, spacing, hover) so all
   dashboard + page sections share one consistent card-based look. */
.row-line { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap;
  background: var(--surface-2); border: 1px solid var(--border-soft); border-radius: var(--radius-sm);
  padding: .65rem .85rem; margin-bottom: .5rem;
  transition: border-color .12s var(--ease), box-shadow .12s var(--ease), background .12s var(--ease); }
.row-line:hover { background: var(--card); border-color: var(--primary); box-shadow: var(--shadow-sm); }
.row-line:last-child { margin-bottom: 0; }
.note-item { border-bottom: 1px solid var(--border-soft); padding: .55rem 0; }
.note-item:last-child { border-bottom: none; }
.log-list { max-height: 320px; overflow-y: auto; }
.prewrap { white-space: pre-wrap; word-break: break-word; }
.notif-unread { background: var(--primary-soft); border-radius: var(--radius-xs); padding: .55rem .65rem !important; }

/* ---- Kanban ---- */
.board { display: flex; gap: 1rem; overflow-x: auto; padding-bottom: 1.2rem; align-items: flex-start; }
.board-col { min-width: 240px; width: 240px; flex-shrink: 0; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); padding: .8rem; }
.board-col-title { margin: 0 0 .65rem; font-size: .74rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; display: flex; align-items: center; gap: .4rem; }
.board-col-title .count { background: var(--card); border: 1px solid var(--border); border-radius: 999px; padding: 0 .5rem; font-size: .72rem; }
.board-col-cards { min-height: 40px; }
.board-col.drag-over { outline: 2px dashed var(--primary); outline-offset: -4px; background: var(--primary-soft); }
.board-card { display: block; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: .75rem; margin-bottom: .65rem; color: var(--text); cursor: grab; box-shadow: var(--shadow-sm); transition: transform .14s var(--ease-out), box-shadow var(--dur) var(--ease), border-color var(--dur) var(--ease); }
.board-card:hover { text-decoration: none; border-color: var(--primary); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.board-card:active { cursor: grabbing; }
.board-card.dragging { opacity: .5; transform: rotate(1.5deg) scale(1.02); box-shadow: var(--shadow-lg); }
.board-card-title { font-weight: 700; margin-bottom: .35rem; line-height: 1.32; }
.board-card-meta { display: flex; gap: .35rem; flex-wrap: wrap; margin-bottom: .3rem; }
.card-overdue { border-left: 4px solid var(--danger); }

/* ---- Calendar grid ---- */
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; }
.cal-head { font-size: .72rem; text-transform: uppercase; color: var(--muted); text-align: center; padding: .2rem 0; font-weight: 700; letter-spacing: .04em; }
.cal-cell { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-xs); min-height: 86px; padding: .3rem; font-size: .8rem; overflow: hidden; transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease); }
.cal-cell:hover { border-color: var(--muted); box-shadow: var(--shadow-sm); }
.cal-empty { background: transparent; border: none; }
.cal-empty:hover { box-shadow: none; }
.cal-today { outline: 2px solid var(--primary); outline-offset: -1px; }
.cal-date { font-weight: 700; color: var(--muted); }
.cal-item { display: block; margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .68rem; cursor: pointer; padding: 1px 4px; border-radius: 5px; background: var(--primary-soft); color: var(--primary); }
.cal-done { opacity: .55; text-decoration: line-through; }
@media (max-width: 700px) { .cal-cell { min-height: 56px; } .cal-item { font-size: .58rem; } }

/* ---- Embeds / clips ---- */
.drive-embed { width: 100%; aspect-ratio: 16/9; border: 1px solid var(--border); border-radius: var(--radius-sm); background: #000; }
.drive-embed.tall { aspect-ratio: 16/10; }
/* Click-to-load Drive preview poster (a plain button styled as a media tile) */
.embed-lazy { display: flex; align-items: center; justify-content: center; padding: 0; cursor: pointer;
  background-size: cover; background-position: center; background-repeat: no-repeat; position: relative; overflow: hidden; }
.embed-lazy::before { content: ''; position: absolute; inset: 0; background: rgba(0,0,0,.35); transition: background .15s var(--ease-out); }
.embed-lazy:hover::before { background: rgba(0,0,0,.18); }
.embed-play { position: relative; z-index: 1; color: #fff; font-weight: 600; background: rgba(0,0,0,.55);
  padding: .55rem 1rem; border-radius: 999px; box-shadow: var(--shadow); backdrop-filter: blur(2px); }
.filter-bar { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.filter-bar input[type=search], .filter-bar input[type=text] { flex: 1 1 200px; min-width: 150px; }
.filter-bar select { flex: 0 1 auto; }

/* ---- Team hub: per-person cards ---- */
.people-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 1rem; }
.person-card { display: block; text-decoration: none; color: inherit; transition: transform .12s var(--ease-out), box-shadow .12s var(--ease-out); }
.person-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.person-card.dim { opacity: .55; }
.person-head { display: flex; align-items: center; gap: .7rem; }
.person-avatar { width: 42px; height: 42px; border-radius: 50%; background: var(--primary, #f47b20); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 1.1rem; flex: 0 0 auto; }
.person-avatar.inline { width: 32px; height: 32px; font-size: .95rem; vertical-align: middle; }
.person-head > div:nth-child(2) { flex: 1 1 auto; min-width: 0; }
.donut { width: 56px; height: 56px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.donut span { width: 40px; height: 40px; border-radius: 50%; background: var(--bg, #fff); display: flex; align-items: center; justify-content: center; font-size: .72rem; font-weight: 700; }
.person-tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: .4rem; margin: .8rem 0; }
.ptile { background: var(--bg-soft, #f5f5f7); border-radius: 10px; padding: .45rem .3rem; text-align: center; }
.ptile.warn { background: #fff3e0; } .ptile.danger { background: #fde8e8; } .ptile.ok { background: #e7f6ee; }
.pt-num { display: block; font-size: 1.15rem; font-weight: 700; line-height: 1.1; }
.pt-label { display: block; font-size: .64rem; color: var(--muted); text-transform: uppercase; letter-spacing: .02em; }
.person-bars { display: grid; gap: .45rem; }
.pbar-row { display: grid; grid-template-columns: 1fr 90px 34px; align-items: center; gap: .5rem; }
.pbar-row .progress { margin: 0; }
.progress-fill.alt { background: var(--accent, #e8262a); }
.stat-warn .stat-num { color: var(--primary, #f47b20); }
.stat-ok .stat-num { color: var(--success, #1f9d55); }
.text-danger { color: var(--accent, #e8262a); }

/* ---- Projects status summary cards (Team-card style) ---- */
.status-ico { font-size: 1.25rem; }
.status-ico.warn { background: var(--primary, #f47b20); }
.status-ico.danger { background: var(--accent, #e8262a); }
.status-ico.ok { background: var(--success, #1f9d55); }
.status-card.warn { border-left: 4px solid var(--primary, #f47b20); }
.status-card.danger { border-left: 4px solid var(--accent, #e8262a); }
.status-card.ok { border-left: 4px solid var(--success, #1f9d55); }
.status-card-foot { margin-top: .9rem; display: flex; align-items: baseline; gap: .5rem; }
.big-count { font-size: 2.1rem; font-weight: 800; letter-spacing: -.03em; line-height: 1; }
.proj-card-head { min-width: 0; }
.proj-card-badges { margin: .7rem 0 0; }
.proj-card.is-overdue { border-left: 4px solid var(--accent, #e8262a); }
.mt-xs { margin-top: .15rem; }
.section-h { font-size: 1.12rem; font-weight: 700; margin: 1.4rem 0 .2rem; letter-spacing: -.012em; }
/* Per-account destination cards (Publishing) + login detail blocks */
.dest-list { display: grid; gap: .6rem; margin-top: .7rem; }
.dest-card { border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); padding: .75rem .85rem; display: grid; gap: .5rem; transition: border-color .12s var(--ease), box-shadow .12s var(--ease); }
.dest-card:hover { border-color: var(--primary); box-shadow: var(--shadow-sm); }
.dest-head { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.dest-head strong { margin-right: auto; }
.dest-login { display: grid; gap: .2rem; }
.dest-login .muted { font-weight: 600; }

/* ---- Shared page summary tiles (Team-style stat strip atop the main pages) ---- */
.summary-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: .8rem; margin-bottom: 1.25rem; }
.sum-tile { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: .85rem 1rem; box-shadow: var(--shadow-sm); display: flex; flex-direction: column; gap: .15rem; text-decoration: none; color: inherit; transition: transform .12s var(--ease-out), box-shadow .12s var(--ease-out); }
a.sum-tile:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: var(--primary); }
.sum-tile .st-num { font-size: 1.7rem; font-weight: 800; line-height: 1.05; }
.sum-tile .st-label { font-size: .7rem; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); font-weight: 600; }
.sum-tile.warn { border-left: 4px solid var(--primary, #f47b20); }
.sum-tile.danger { border-left: 4px solid var(--accent, #e8262a); }
.sum-tile.danger .st-num { color: var(--accent, #e8262a); }
.sum-tile.ok { border-left: 4px solid var(--success, #1f9d55); }
.sum-tile.ok .st-num { color: var(--success, #1f9d55); }

/* Soft-card look for list items inside cards (Approvals / Upscale), with a gentle hover */
.note-item { background: var(--surface-2); border: 1px solid var(--border-soft); border-bottom: 1px solid var(--border-soft); border-radius: var(--radius-sm); padding: .75rem .85rem; margin-bottom: .6rem; transition: box-shadow .12s var(--ease-out), border-color .12s var(--ease-out); }
.note-item:hover { border-color: var(--primary); box-shadow: var(--shadow-sm); }
.note-item:last-child { border-bottom: 1px solid var(--border-soft); }

/* ---- App-wide tactile polish: any clickable card/tile lifts on hover and presses on click,
   so every dashboard, page, project card, media item and list row feels part of one system ---- */
a.card, a.stat, .card-link {
  color: inherit; text-decoration: none;
  transition: transform .14s var(--ease-out), box-shadow .18s var(--ease), border-color .18s var(--ease);
}
a.card:hover, a.stat:hover, .card-link:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: var(--primary); text-decoration: none; }
a.card:active, a.stat:active, .card-link:active { transform: translateY(0) scale(.995); box-shadow: var(--shadow-sm); }
.board-card:active { transform: translateY(0) scale(.99); box-shadow: var(--shadow-sm); }
.person-card:active, .sum-tile:active { transform: translateY(0) scale(.995); }
/* Clickable list rows / note items that wrap a link get a pointer + gentle press */
.row-line:active, .note-item:active { transform: scale(.997); }
/* Respect reduced-motion preferences across all the above */
@media (prefers-reduced-motion: reduce) {
  a.card, a.stat, .card-link, .board-card, .person-card, .sum-tile, .btn { transition: none; }
  a.card:hover, a.stat:hover, .card-link:hover, .board-card:hover, .person-card:hover { transform: none; }
}
.clip-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 1100px) { .clip-grid { grid-template-columns: 1fr; } }
.clip-card { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: .9rem; background: var(--surface-2); }
.clip-pinned { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary) inset; }
.clip-head { display: flex; gap: .5rem; align-items: center; margin-bottom: .5rem; }
.clip-comment { padding: .3rem 0; border-top: 1px dashed var(--border); }

/* ---- Inventory / misc ---- */
.inv-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: .8rem; }
@media (max-width: 700px) { .inv-grid { grid-template-columns: repeat(2, 1fr); } }
.inv-cell { text-align: center; padding: .9rem .4rem; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); transition: transform .14s var(--ease-out), box-shadow var(--dur) var(--ease); }
.inv-cell:hover { transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.inv-num { font-size: 1.75rem; font-weight: 800; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.inv-platform { margin-bottom: .35rem; }
.template-chip { display: inline-flex; align-items: center; gap: .2rem; }

/* ---- Countdown timers ---- */
.cd { display: inline-flex; align-items: center; gap: .4rem; vertical-align: middle; }
.cd-ring { flex-shrink: 0; }
.cd-track { stroke: var(--border); }
.cd-bar { transition: stroke-dashoffset 1s linear, stroke .3s ease; }
.cd-label { font-size: .8rem; font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; }
.cd.green  .cd-bar { stroke: #1f9d55; } .cd.green  .cd-label { color: #1f9d55; }
.cd.orange .cd-bar { stroke: #e8a913; } .cd.orange .cd-label { color: #b07d00; }
.cd.red    .cd-bar { stroke: var(--danger); } .cd.red .cd-label { color: var(--danger); }
.cd.over   .cd-bar { stroke: var(--danger); } .cd.over .cd-label { color: var(--danger); }
.cd.blink  .cd-bar { stroke: var(--danger); } .cd.blink .cd-label { color: var(--danger); }
.cd.blink  { animation: cdblink 1s steps(1) infinite; }
@keyframes cdblink { 50% { opacity: .25; } }
.cd.paused .cd-bar { stroke: var(--muted); } .cd.paused .cd-label { color: var(--muted); }
.cd-big .cd-label { font-size: 1.05rem; }

/* Urgent-deadline chip in the notice bar */
.notice-deadline { gap: .55rem; }
.notice-deadline.cd-orange { background: var(--warn-bg); border-color: var(--warn-text); color: var(--warn-text); }
.notice-deadline.cd-red { background: var(--danger-bg); border-color: var(--danger); color: var(--danger-text); }

/* ---- Daily goal card ---- */
.goal-card { border-color: var(--primary); box-shadow: var(--shadow-md), 0 0 0 1px var(--primary) inset; }
.goal-card.goal-met { border-color: var(--success); box-shadow: var(--shadow-md), 0 0 0 1px var(--success) inset; }
.goal-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.goal-row { display: flex; align-items: center; gap: 1.2rem; flex-wrap: wrap; margin: .4rem 0 .6rem; }
.goal-big { font-size: 2.6rem; font-weight: 800; letter-spacing: -.035em; line-height: 1; font-variant-numeric: tabular-nums; }
.goal-big .muted { font-size: 1.4rem; }
.goal-progress { height: 16px; }

/* ---- Dashboard charts ---- */
.chart-box { position: relative; height: 260px; }
@media (max-width: 600px) { .chart-box { height: 220px; } }

/* ---- Inline media previews ---- */
.inline-preview { width: 100%; margin-top: .6rem; flex-basis: 100%; animation: fadeIn .25s var(--ease-out); }
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.preview-video { width: 100%; max-height: 62vh; border-radius: var(--radius-sm); background: #000; box-shadow: var(--shadow); }
.preview-img { max-width: 100%; max-height: 62vh; border-radius: var(--radius-sm); border: 1px solid var(--border); display: block; box-shadow: var(--shadow); }
.preview-frame { width: 100%; height: 72vh; border: 1px solid var(--border); border-radius: var(--radius-sm); background: #fff; box-shadow: var(--shadow); }

/* ---- Notification bar ---- */
.notice-bar { display: flex; gap: .6rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
.notice-chip {
  display: inline-flex; align-items: center; gap: .45rem; padding: .5rem 1.05rem;
  background: var(--card); border: 1px solid var(--border); border-radius: 999px;
  color: var(--text); font-weight: 600; box-shadow: var(--shadow-sm);
  transition: transform .14s var(--ease-out), box-shadow var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.notice-chip:hover { text-decoration: none; transform: translateY(-2px); box-shadow: var(--shadow-md); }
.notice-live { background: var(--danger-bg); border-color: var(--danger); color: var(--danger-text); animation: pulse 1.6s infinite; }
.chat-zero { color: var(--success); font-size: .75rem; font-weight: 800; vertical-align: middle; }

/* ---- Flash / banner ---- */
.flash { padding: .85rem 1.1rem; border-radius: var(--radius-sm); margin-bottom: 1.25rem; font-weight: 600; box-shadow: var(--shadow-sm); display: flex; align-items: center; gap: .5rem; animation: flashIn .3s var(--ease-out); }
@keyframes flashIn { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: none; } }
.flash-success { background: var(--ok-bg); color: var(--ok-text); }
.flash-error { background: var(--danger-bg); color: var(--danger-text); }
.flash-warn { background: var(--warn-bg, #fff4e5); color: var(--warn-text, #7a4a00); border: 1px solid var(--warn-border, #f0c27a); }
.announcement-banner { background: linear-gradient(120deg, var(--primary-soft), var(--card)); border: 1px solid var(--primary); color: var(--text); border-radius: var(--radius); padding: .95rem 1.15rem; margin-bottom: 1.25rem; display: flex; justify-content: space-between; gap: 1rem; align-items: center; flex-wrap: wrap; box-shadow: var(--shadow-sm); }

/* ---- Auth ---- */
.auth-wrap { display: flex; justify-content: center; padding-top: 7vh; }
.auth-card { width: 100%; max-width: 410px; padding: 2rem 1.9rem; box-shadow: var(--shadow-lg); }
.auth-logo { display: block; height: 88px; margin: 0 auto .6rem; background: #fff; border-radius: 20px; padding: 10px; box-shadow: var(--shadow); }
.branding-row { display: flex; gap: 1rem; align-items: flex-start; flex-wrap: wrap; }
.branding-preview { height: 80px; width: 80px; object-fit: contain; background: #fff; border-radius: 16px; padding: 8px; box-shadow: var(--shadow-sm); }
.auth-title { text-align: center; margin-bottom: .15rem; }

/* ---- Progress / clock ---- */
.progress { height: 12px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px; overflow: hidden; }
.progress-fill { height: 100%; background: linear-gradient(90deg, var(--primary), var(--accent)); border-radius: 999px; transition: width .5s var(--ease-out); }
.clock-status { font-size: 1.15rem; font-weight: 700; }

/* ---- Team rows ---- */
.emp-row { border-bottom: 1px solid var(--border-soft); padding: .6rem 0; }
.emp-row summary { cursor: pointer; display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; list-style: none; }
.emp-row summary::-webkit-details-marker { display: none; }
.emp-edit { padding: .85rem 0 .4rem; }
.emp-inactive summary { opacity: .55; }
.edit-hint { margin-left: auto; color: var(--primary); font-weight: 600; font-size: .82rem; white-space: nowrap; opacity: .8; }
.emp-row summary:hover .edit-hint { opacity: 1; text-decoration: underline; }
.emp-row[open] .edit-hint { opacity: .5; }

/* ---- Chat ---- */
.chat-layout { display: grid; grid-template-columns: 270px 1fr; gap: 1.25rem; align-items: start; }
@media (max-width: 860px) { .chat-layout { grid-template-columns: 1fr; } .chat-side { order: 2; } }
.chat-chan { display: flex; justify-content: space-between; align-items: center; padding: .45rem .6rem; border-radius: var(--radius-xs); color: var(--text); font-weight: 600; transition: background .12s var(--ease), color .12s var(--ease); }
.chat-chan.active, .chat-chan:hover { background: var(--primary-soft); color: var(--primary); text-decoration: none; }
.unread-badge { background: var(--accent); color: #fff; border-radius: 999px; font-size: .7rem; padding: 0 .42rem; font-weight: 800; }
.chat-main { display: flex; flex-direction: column; min-height: 70vh; }
.chat-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.chat-search { width: 180px; }
.chat-messages { flex: 1; overflow-y: auto; max-height: 56vh; padding: .5rem 0; display: flex; flex-direction: column; gap: .55rem; }
.chat-msg { max-width: 82%; background: var(--surface-2); border: 1px solid var(--border); border-radius: 16px; padding: .55rem .8rem; box-shadow: var(--shadow-sm); animation: fadeIn .2s var(--ease-out); }
.chat-msg.mine { align-self: flex-end; background: var(--primary-soft); border-color: transparent; }
.chat-msg-body { white-space: pre-wrap; word-break: break-word; }
.chat-img { max-width: 240px; border-radius: var(--radius-xs); margin-top: .3rem; }
.chat-file { display: inline-block; margin-top: .3rem; padding: .4rem .7rem; border: 1px solid var(--border-soft); border-radius: var(--radius-sm); background: var(--surface-2, rgba(0,0,0,.04)); font-size: .85rem; text-decoration: none; }
.chat-file:hover { text-decoration: underline; }

/* ---- Dashboard cheers (celebration / encouragement) ---- */
.cheer-overlay { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; background: rgba(0,0,0,.4); padding: 1rem; animation: flashIn .25s var(--ease-out); }
.cheer-overlay.cheer-hide { opacity: 0; transition: opacity .35s ease; }
.cheer-canvas { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.cheer-cards { position: relative; display: flex; flex-direction: column; gap: 1rem; width: 100%; max-width: 420px; }
.cheer-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-md); box-shadow: var(--shadow-lg); padding: 1.7rem 1.4rem; text-align: center; animation: cheerPop .4s var(--ease-out); }
.cheer-card h2 { margin: .3rem 0 .5rem; }
.cheer-card.celebrate { border-top: 5px solid var(--ok-text, #2e7d32); }
.cheer-card.revise { border-top: 5px solid var(--warn-border, #f0c27a); }
.cheer-card.note { border-top: 5px solid var(--primary, #3ca0e8); }
.cheer-emoji { font-size: 3rem; line-height: 1; }
.cheer-emoji.cheer-sad { display: inline-block; animation: cheerShake .7s var(--ease-out); }
.cheer-encourage { font-weight: 700; margin-top: .6rem; }
.cheer-close { margin-top: .9rem; }
@keyframes cheerPop { from { transform: scale(.82); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes cheerShake { 0%,100%{transform:rotate(0)} 20%{transform:rotate(-9deg)} 40%{transform:rotate(8deg)} 60%{transform:rotate(-5deg)} 80%{transform:rotate(3deg)} }
@media (prefers-reduced-motion: reduce) { .cheer-card, .cheer-emoji.cheer-sad { animation: none; } }
.chat-embed { max-width: 340px; }
.chat-input { display: flex; gap: .5rem; margin-top: .6rem; align-items: center; }
.chat-input input { flex: 1; margin-top: 0; }
.attach-btn { cursor: pointer; font-size: 1.2rem; background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px; padding: .3rem .6rem; transition: background var(--dur) var(--ease), transform .08s var(--ease); }
.attach-btn:hover { background: var(--primary-soft); }
.attach-btn:active { transform: scale(.92); }
.attach-btn.recording { background: var(--danger-bg); border-color: var(--danger); animation: pulse 1.2s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 6px rgba(214, 69, 69, .18); } }
.ticks { font-size: .75rem; color: var(--muted); margin-left: .4rem; letter-spacing: -1px; vertical-align: baseline; }
.ticks.read { color: var(--primary); }
.chat-audio { width: 260px; margin-top: .3rem; display: block; }
.chat-video { max-width: 300px; border-radius: var(--radius-sm); margin-top: .3rem; display: block; }
.typing { min-height: 1.2em; }

/* ---- Docs ---- */
.docs-layout { display: grid; grid-template-columns: 260px 1fr; gap: 1.25rem; align-items: start; }
@media (max-width: 860px) { .docs-layout { grid-template-columns: 1fr; } }
.docs-niche { margin-top: .6rem; text-transform: uppercase; font-size: .7rem !important; letter-spacing: .05em; }
.active-link { font-weight: 800; color: var(--primary); }
.docs-body { font-size: 1rem; }

/* ---- Meetings ---- */
.jitsi-frame { width: 100%; height: 70vh; border: none; border-radius: var(--radius-sm); background: #000; }
.meet-tools { display: flex; flex-wrap: wrap; gap: .5rem; margin: .75rem 0 .4rem; }
.meet-tool { font-size: .82rem; background: var(--surface-2, rgba(0,0,0,.04)); border: 1px solid var(--border-soft); border-radius: 999px; padding: .3rem .7rem; white-space: nowrap; }

/* ---- Heatmap ---- */
.heatmap { overflow-x: auto; }
.heat-row { display: flex; align-items: center; gap: 3px; margin-bottom: 3px; }
.heat-name { width: 70px; flex-shrink: 0; font-size: .78rem; font-weight: 700; }
.heat-cell { width: 16px; height: 16px; border-radius: 4px; background: var(--surface-2); border: 1px solid var(--border); }

/* ---- Files ---- */
.file-name { word-break: break-all; max-width: 320px; display: inline-block; }
.file-thumb { height: 44px; width: 70px; object-fit: cover; border-radius: var(--radius-xs); border: 1px solid var(--border); }
.content-preview { max-width: 100%; max-height: 60vh; border-radius: var(--radius-sm); border: 1px solid var(--border); }
video.drive-embed { object-fit: contain; }
.upload-form input[type=file] { background: var(--card); }
.upload-progress { margin-top: .6rem; display: flex; align-items: center; gap: .8rem; }
.upload-progress .progress { flex: 1; }

/* ---- Dashboard hero (greeting band) ---- */
.hero { display: flex; justify-content: space-between; align-items: center; gap: 1.4rem; flex-wrap: wrap; padding: 1.7rem 1.8rem; background: linear-gradient(120deg, var(--primary-soft) 0%, var(--card) 58%); border: 1px solid var(--border); }
.hero-left { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.hero-daycircle {
  width: 86px; height: 86px; border-radius: 50%; border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 2.1rem; font-weight: 800; letter-spacing: -.03em; background: var(--card); box-shadow: var(--shadow);
  font-variant-numeric: tabular-nums;
}
.hero-datetext { line-height: 1.25; color: var(--muted); font-weight: 600; border-right: 1px solid var(--border); padding-right: 1.2rem; }
.hero-datetext strong { color: var(--text); font-size: 1.05rem; }
.hero-right { text-align: right; }
.hero-greet { font-size: 2.05rem; font-weight: 800; letter-spacing: -.035em; }
.hero-sub { font-size: 1.15rem; color: var(--muted); font-weight: 600; }
@media (max-width: 860px) { .hero { padding: 1.3rem 1.3rem; } .hero-right { text-align: left; } .hero-greet { font-size: 1.55rem; } }

/* ---- Touch refinements ---- */
@media (max-width: 640px) {
  h1 { font-size: 1.5rem; }
  .card { padding: 1.1rem 1.1rem; border-radius: var(--radius-md); }
  .btn { padding: .68rem 1.25rem; }
  .btn-small { padding: .4rem .8rem; }
}

/* ---- Motion preference ---- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}

/* ---- Delete-message button ---- */
.msg-del { background: none; border: none; cursor: pointer; color: var(--muted); font-size: .82rem; opacity: .4; padding: 0 .15rem; vertical-align: baseline; transition: opacity .12s var(--ease), color .12s var(--ease); }
.chat-msg:hover .msg-del { opacity: 1; }
.msg-del:hover { color: var(--danger); }

/* ---- Timed confirmation modal ---- */
.tc-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.5); display: flex; align-items: center; justify-content: center; z-index: 2000; animation: fadeIn .15s var(--ease-out); }
.tc-box { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-md); box-shadow: var(--shadow-lg); padding: 1.5rem 1.4rem; max-width: 400px; width: 90%; text-align: center; }
.tc-msg { font-weight: 600; line-height: 1.5; margin-bottom: 1.1rem; }
.tc-actions { display: flex; gap: .6rem; justify-content: center; }
.tc-ok:disabled { opacity: .6; cursor: not-allowed; }

/* ---- Voice call overlay ---- */
.call-overlay { position: fixed; right: 1.1rem; bottom: 1.1rem; z-index: 1000; }
.call-overlay[hidden] { display: none; }
.call-box { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-md); box-shadow: var(--shadow-lg); padding: 1rem 1.1rem; min-width: 230px; text-align: center; animation: dropIn .18s var(--ease-out); }
.call-title { font-weight: 800; font-size: 1.05rem; letter-spacing: -.01em; }
.call-status { color: var(--muted); font-weight: 600; margin: .35rem 0 .7rem; font-variant-numeric: tabular-nums; }
.call-actions { display: flex; gap: .5rem; justify-content: center; flex-wrap: wrap; }

/* ---- Live meeting participant roster ---- */
.mtg-roster { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: .6rem; }
.mtg-att { display: flex; align-items: center; gap: .6rem; padding: .6rem .7rem; border: 1px solid var(--border); border-radius: var(--radius-sm, 12px); background: var(--card); }
.mtg-av { flex: 0 0 auto; width: 38px; height: 38px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-weight: 800; font-size: .82rem; color: #fff; background: linear-gradient(135deg, var(--brand, #6c4cf1), #9b6cff); }
.mtg-att-meta { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; flex: 1 1 auto; }
.mtg-att-meta strong { font-size: .92rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---- Lightweight toast (ring accept/decline feedback for the host) ---- */
.cp-toast { position: fixed; left: 50%; bottom: 1.4rem; transform: translate(-50%, 1.5rem); z-index: 1100;
  background: var(--card); color: var(--text, inherit); border: 1px solid var(--border); border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg); padding: .7rem 1.1rem; font-weight: 600; opacity: 0; transition: opacity .3s var(--ease-out), transform .3s var(--ease-out); }
.cp-toast.in { opacity: 1; transform: translate(-50%, 0); }

/* ---- Print ---- */
@media print {
  .nav, .no-print, .btn, form, .theme-toggle { display: none !important; }
  body { background: #fff; color: #000; }
  .card { box-shadow: none; border: 1px solid #ccc; break-inside: avoid; }
}
