/* Ritmo — visão geral, calendário e biblioteca */

/* ---------- hero ---------- */
.hero {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  background:
    radial-gradient(120% 160% at 96% -20%, #ffe2cd 0%, transparent 52%),
    radial-gradient(90% 130% at -10% 120%, #ece4d4 0%, transparent 60%),
    var(--surface);
  padding: 28px 30px;
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(300px, 0.72fr);
  gap: 26px;
  min-height: 278px;
  box-shadow: var(--shadow-xs);
}
[data-theme="dark"] .hero {
  background:
    radial-gradient(120% 160% at 96% -20%, #382114 0%, transparent 52%),
    radial-gradient(90% 130% at -10% 120%, #1f1d18 0%, transparent 60%),
    var(--surface);
}
.hero-glow {
  position: absolute;
  width: 360px; height: 360px;
  right: -100px; top: -180px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(242, 106, 46, 0.28), transparent 64%);
  filter: blur(8px);
  pointer-events: none;
}
.hero-orbit {
  position: absolute;
  right: 28px; bottom: -96px;
  width: 270px; height: 270px;
  border: 1px dashed rgba(242, 106, 46, 0.26);
  border-radius: 50%;
  pointer-events: none;
}
.hero-orbit::after {
  content: "";
  position: absolute; inset: 26px;
  border-radius: 50%;
  border: 1px solid rgba(242, 106, 46, 0.14);
}
.hero-copy { position: relative; z-index: 1; display: flex; flex-direction: column; justify-content: space-between; gap: 16px; }
.hero h1 {
  font-size: clamp(34px, 4vw, 50px);
  font-weight: 800;
  line-height: 0.98;
  letter-spacing: -0.052em;
  max-width: 18ch;
  margin-top: 11px;
}
.hero h1 .serif-i {
  position: relative;
  display: inline-block;
  font-size: 1.04em;
  color: var(--ink);
  padding-right: 0.02em;
}
.nb { white-space: nowrap; }
.hero h1 .serif-i::after {
  content: "";
  position: absolute; left: 2%; right: 0; bottom: 0.06em;
  height: 0.055em;
  background: var(--accent);
  border-radius: 99px;
  transform: rotate(-1.1deg);
  opacity: 0.9;
}
.hero .lede { font-size: 13px; color: var(--muted); max-width: 48ch; margin-top: 11px; line-height: 1.55; }
.hero .lede strong { color: var(--ink); font-weight: 800; }
.hero-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 18px; }
.hero-meta { display: flex; align-items: center; gap: 9px; font-size: 10.5px; color: var(--faint); margin-top: 16px; flex-wrap: wrap; }
.hero-meta .dot-sep { width: 3px; height: 3px; border-radius: 50%; background: var(--line-strong); }

.pulse {
  position: relative;
  background: var(--ink);
  color: var(--paper);
  border-radius: 22px;
  padding: 17px 18px 14px;
  display: flex; flex-direction: column;
  min-height: 220px;
  overflow: hidden;
  box-shadow: 0 22px 40px -30px rgba(23, 22, 19, 0.9);
}
.pulse::after {
  content: "";
  position: absolute; right: -70px; bottom: -130px;
  width: 250px; height: 250px; border-radius: 50%;
  background: radial-gradient(circle, rgba(242, 106, 46, 0.42), transparent 64%);
  pointer-events: none;
}
.pulse-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; position: relative; z-index: 1; }
.pulse-label {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 9px; font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase;
  color: color-mix(in srgb, var(--paper) 58%, transparent);
}
.pulse-wave { display: inline-flex; align-items: flex-end; gap: 1.5px; height: 11px; }
.pulse-wave i { width: 2px; background: var(--accent); border-radius: 2px; display: block; }
.pulse-wave i:nth-child(1) { height: 4px; }
.pulse-wave i:nth-child(2) { height: 8px; }
.pulse-wave i:nth-child(3) { height: 11px; }
.pulse-wave i:nth-child(4) { height: 6px; }
.pulse-wave i:nth-child(5) { height: 9px; }
.pulse-badge {
  font-size: 9.5px; font-weight: 800;
  background: rgba(255, 255, 255, 0.09);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px; padding: 4px 8px;
  display: inline-flex; align-items: center; gap: 5px;
}
.pulse-badge .i { width: 11px; height: 11px; color: var(--accent); }
.weekbars { display: flex; gap: 7px; align-items: flex-end; height: 104px; margin: 15px 0 10px; position: relative; z-index: 1; }
.wb-col {
  flex: 1; height: 100%;
  display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 5px;
  border-radius: 8px;
  padding: 3px 0;
}
.wb-bar {
  width: 100%; max-width: 25px;
  border-radius: 5px 5px 2px 2px;
  background: rgba(255, 253, 248, 0.13);
  min-height: 4px;
  transition: background 0.2s, height 0.5s cubic-bezier(0.2, 0.7, 0.2, 1);
  flex: none;
}
.wb-col.has .wb-bar { background: rgba(255, 253, 248, 0.34); }
.wb-col.is-today .wb-bar { background: var(--accent); }
.wb-day {
  font-size: 8px; font-weight: 800; letter-spacing: 0.04em;
  text-transform: uppercase;
  color: color-mix(in srgb, var(--paper) 48%, transparent);
  white-space: nowrap;
}
.wb-col.is-today .wb-day { color: var(--accent); }
.wb-col.has .wb-day { color: color-mix(in srgb, var(--paper) 78%, transparent); }
.wb-count { font-size: 8px; font-weight: 700; color: color-mix(in srgb, var(--paper) 40%, transparent); height: 10px; }
.wb-col.has .wb-count { color: color-mix(in srgb, var(--paper) 65%, transparent); }
.pulse-foot {
  margin-top: auto;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  padding-top: 11px;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  font-size: 10px; color: color-mix(in srgb, var(--paper) 58%, transparent);
  position: relative; z-index: 1;
}
.pulse-foot a { color: var(--paper); font-weight: 800; display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.pulse-foot a .i { width: 12px; height: 12px; color: var(--accent); }
.pulse-foot a:hover { color: var(--accent); }

/* ---------- KPIs ---------- */
.kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-top: 16px; }
.kpi {
  position: relative;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 17px 17px 14px;
  display: flex; flex-direction: column; gap: 9px;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}
.kpi:hover { transform: translateY(-2px); box-shadow: var(--shadow-sm); border-color: var(--line-strong); }
.kpi-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.kpi-label { font-size: 10.5px; font-weight: 700; color: var(--muted); white-space: nowrap; }
.kpi-icon {
  width: 29px; height: 29px; border-radius: 9px;
  display: grid; place-items: center;
  background: color-mix(in srgb, var(--kpi-color, var(--accent)) 12%, var(--surface));
  color: var(--kpi-color, var(--accent));
}
.kpi-icon .i { width: 15px; height: 15px; }
.kpi-value { font-size: clamp(25px, 2.4vw, 30px); font-weight: 800; line-height: 1; letter-spacing: -0.05em; font-variant-numeric: tabular-nums; }
.kpi-value small { font-size: 12px; font-weight: 700; color: var(--muted); letter-spacing: 0; }
.kpi-foot { display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; margin-top: auto; }
.kpi-deltas { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.kpi-since { font-size: 9px; color: var(--faint); font-weight: 600; white-space: nowrap; }
.kpi .spark { width: 82px; height: 29px; flex: none; }

/* ---------- home ---------- */
.home-grid { display: grid; grid-template-columns: minmax(0, 1.52fr) minmax(300px, 0.7fr); gap: 16px; margin-top: 16px; align-items: start; }
.home-side { display: flex; flex-direction: column; gap: 16px; min-width: 0; }

.up-list { display: flex; flex-direction: column; gap: 2px; margin: 12px -8px -7px; }
.up-item {
  display: grid;
  grid-template-columns: 54px 50px minmax(0, 1fr) auto 15px;
  align-items: center;
  gap: 11px;
  padding: 8px;
  border-radius: 14px;
  width: 100%;
  text-align: left;
  transition: background 0.15s;
}
.up-item:hover { background: var(--surface-2); }
.up-when { display: flex; flex-direction: column; gap: 1px; line-height: 1.1; }
.up-day { font-size: 8px; font-weight: 800; letter-spacing: 0.09em; text-transform: uppercase; color: var(--faint); }
.up-time { font-size: 12.5px; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.up-thumb { width: 50px; height: 50px; border-radius: 11px; }
.up-main { min-width: 0; }
.up-title { display: block; font-size: 12.5px; font-weight: 800; letter-spacing: -0.012em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.up-meta { display: flex; align-items: center; gap: 5px; margin-top: 2px; font-size: 10px; color: var(--muted); min-width: 0; }
.up-meta .client-dot { width: 5px; height: 5px; }
.up-meta span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.up-meta .mid-dot { color: var(--line-strong); }
.up-side { display: flex; align-items: center; gap: 9px; }
.up-chevron { color: var(--faint); display: grid; place-items: center; }
.up-chevron .i { width: 14px; height: 14px; }
.up-empty { padding: 22px 6px 14px; }

.approval-mini-list { display: flex; flex-direction: column; gap: 2px; margin: 11px -8px 0; }
.approval-mini {
  display: flex; align-items: center; gap: 10px;
  width: 100%; padding: 8px;
  border-radius: 12px;
  text-align: left;
  transition: background 0.15s;
}
.approval-mini:hover { background: var(--surface-2); }
.approval-mini .thumb { width: 38px; height: 38px; border-radius: 9px; }
.approval-mini-copy { min-width: 0; flex: 1; }
.approval-mini-title { font-size: 11.5px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.approval-mini-meta { font-size: 9.5px; color: var(--muted); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.approval-mini .status { height: 20px; padding: 0 7px; font-size: 9px; }
.approval-mini-count {
  font-size: 9px; font-weight: 800;
  background: var(--tone-purple-bg); color: var(--tone-purple-fg);
  padding: 3px 7px; border-radius: 999px;
}

.insight {
  position: relative;
  overflow: hidden;
  background: linear-gradient(150deg, #fff6ed 0%, #ffe7d4 100%);
  border-color: #f3d2b8;
  padding: 18px;
}
[data-theme="dark"] .insight { background: linear-gradient(150deg, #2b1c12 0%, #20130c 100%); border-color: #45301f; }
.insight .eyebrow { color: var(--accent-text); }
.insight-big { font-size: 25px; font-weight: 800; letter-spacing: -0.045em; line-height: 1.05; margin-top: 9px; }
.insight-big .serif-i { font-size: 1.12em; }
.insight p { font-size: 11px; line-height: 1.5; color: var(--ink-2); margin-top: 6px; max-width: 30ch; }
.insight .btn { margin-top: 13px; height: 34px; font-size: 11px; }
.insight-orb {
  position: absolute; right: -34px; top: -38px;
  width: 116px; height: 116px; border-radius: 50%;
  border: 1px dashed rgba(242, 106, 46, 0.45);
  pointer-events: none;
}
.insight-orb::after {
  content: ""; position: absolute; inset: 22px;
  border-radius: 50%; border: 1px solid rgba(242, 106, 46, 0.24);
}
.insight-orb i {
  position: absolute; width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent);
}
.insight-orb i:nth-child(1) { left: 6px; top: 44px; }
.insight-orb i:nth-child(2) { right: 19px; bottom: 22px; width: 5px; height: 5px; opacity: 0.7; }

/* ---------- calendário ---------- */
.cal-layout { display: grid; grid-template-columns: minmax(0, 1fr) 344px; gap: 16px; align-items: start; }
.cal-card { padding: 0; overflow: hidden; }
.cal-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 17px 20px 15px; flex-wrap: wrap; }
.cal-title { display: flex; align-items: baseline; gap: 8px; }
.cal-title h2 { font-size: 24px; font-weight: 800; letter-spacing: -0.04em; line-height: 1; }
.cal-title h2 .serif-i { font-size: 1.08em; }
.cal-title span { font-size: 12px; color: var(--muted); font-weight: 700; }
.cal-tools { display: flex; align-items: center; gap: 5px; }
.cal-nav { display: flex; align-items: center; gap: 2px; border: 1px solid var(--line); border-radius: 10px; padding: 2px; background: var(--surface); }
.cal-nav button { width: 28px; height: 26px; border-radius: 7px; display: grid; place-items: center; color: var(--muted); }
.cal-nav button:hover { background: var(--surface-2); color: var(--ink); }
.cal-nav .i { width: 15px; height: 15px; }
.cal-today { margin-left: 4px; }
.cal-weekdays {
  display: grid; grid-template-columns: repeat(7, minmax(0, 1fr));
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
}
.cal-weekdays span {
  padding: 7px 8px;
  font-size: 9px; font-weight: 800; letter-spacing: 0.13em; text-transform: uppercase;
  color: var(--muted); text-align: center;
}
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.cal-cell {
  position: relative;
  min-height: 112px;
  padding: 6px 6px 8px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  transition: background 0.14s;
}
.cal-cell:nth-child(7n) { border-right: 0; }
.cal-cell:nth-last-child(-n + 7) { border-bottom: 0; }
.cal-cell.is-weekend { background: color-mix(in srgb, var(--surface-2) 62%, transparent); }
.cal-cell.is-out { background: color-mix(in srgb, var(--paper) 55%, transparent); }
.cal-cell.is-out .cal-daynum, .cal-cell.is-out .cal-post { opacity: 0.42; }
.cal-cell:hover { background: var(--surface-2); }
.cal-cell.is-selected { box-shadow: inset 0 0 0 2px var(--ink); z-index: 1; border-radius: 2px; }
.cal-day { display: flex; align-items: center; justify-content: space-between; gap: 4px; margin-bottom: 3px; }
.cal-daynum {
  width: 23px; height: 23px; border-radius: 50%;
  display: grid; place-items: center;
  font-size: 11px; font-weight: 700;
  color: var(--ink-2);
}
.cal-cell.is-today .cal-daynum { background: var(--accent); color: var(--accent-ink); font-weight: 800; }
.cal-day-add {
  width: 19px; height: 19px; border-radius: 6px;
  display: grid; place-items: center;
  color: var(--faint);
  opacity: 0; transition: opacity 0.14s, background 0.14s;
}
.cal-cell:hover .cal-day-add { opacity: 1; }
.cal-day-add:hover { background: var(--surface); color: var(--ink); }
.cal-day-add .i { width: 13px; height: 13px; }
.cal-post {
  display: flex; align-items: center; gap: 5px;
  width: 100%;
  padding: 3px 5px;
  border-radius: 6px;
  background: color-mix(in srgb, var(--pc, var(--accent)) 9%, var(--surface));
  border-left: 2.5px solid var(--pc, var(--accent));
  margin-top: 3px;
  text-align: left;
  min-width: 0;
  transition: filter 0.14s, transform 0.14s;
}
.cal-post:hover { filter: brightness(0.97); transform: translateX(1px); }
.cal-post time { font-size: 8.5px; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; flex: none; }
.cal-post .cal-post-title {
  flex: 1 1 auto; min-width: 0;
  font-size: 9.5px; font-weight: 700; color: var(--ink-2);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cal-post .cal-post-dot { width: 4px; height: 4px; border-radius: 50%; background: var(--pc); flex: none; }
.cal-post.is-published .cal-post-title { color: var(--muted); }
.cal-more { font-size: 8.5px; font-weight: 800; color: var(--muted); padding: 2px 5px 0; display: block; text-align: left; }
.cal-legend {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 11px 20px;
  border-top: 1px solid var(--line);
  background: var(--surface-2);
}
.cal-legend span { display: inline-flex; align-items: center; gap: 5px; font-size: 9px; font-weight: 700; color: var(--muted); }
.cal-legend i { width: 6px; height: 6px; border-radius: 50%; }

.day-panel { padding: 0; overflow: hidden; position: sticky; top: 94px; }
.day-hero {
  padding: 20px 20px 16px;
  background: linear-gradient(160deg, var(--surface-2), var(--surface));
  border-bottom: 1px solid var(--line);
  position: relative; overflow: hidden;
}
.day-hero .eyebrow { color: var(--accent-text); }
.day-hero-date { display: flex; align-items: flex-end; gap: 10px; margin-top: 3px; }
.day-hero-date strong { font-family: var(--serif); font-size: 54px; line-height: 0.82; font-weight: 400; letter-spacing: -0.03em; }
.day-hero-date span { font-size: 12px; color: var(--muted); font-weight: 700; padding-bottom: 3px; }
.day-hero-count { font-size: 11px; color: var(--muted); margin-top: 10px; }
.day-list { padding: 8px; display: flex; flex-direction: column; gap: 2px; max-height: 340px; overflow: auto; }
.day-item { display: flex; gap: 9px; padding: 8px; border-radius: 11px; text-align: left; width: 100%; align-items: center; }
.day-item:hover { background: var(--surface-2); }
.day-item .thumb { width: 42px; height: 42px; border-radius: 9px; }
.day-item-copy { min-width: 0; flex: 1; }
.day-item-time { font-size: 9px; font-weight: 800; color: var(--faint); letter-spacing: 0.04em; }
.day-item-title { font-size: 11.5px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.day-item-meta { display: flex; align-items: center; gap: 5px; margin-top: 2px; }
.day-panel .card-foot { margin: 0; padding: 12px 16px; background: var(--surface); position: sticky; bottom: 0; }
.month-summary { margin-top: 16px; }
.month-summary-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 11.5px; }
.month-summary-row:last-child { border-bottom: 0; }
.month-summary-row .left { display: flex; align-items: center; gap: 7px; color: var(--ink-2); font-weight: 600; }
.month-summary-row .left i { width: 7px; height: 7px; border-radius: 50%; }
.month-summary-row strong { font-size: 12px; font-weight: 800; font-variant-numeric: tabular-nums; }
.month-progress { height: 6px; border-radius: 99px; background: var(--surface-2); overflow: hidden; margin: 10px 0 2px; display: flex; }
.month-progress i { height: 100%; }

/* ---------- biblioteca ---------- */
.lib-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.lib-tabs { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.lib-tab {
  display: inline-flex; align-items: center; gap: 6px;
  height: 32px; padding: 0 11px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  font-size: 11px; font-weight: 700;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.lib-tab:hover { color: var(--ink); border-color: var(--line-strong); }
.lib-tab.is-active { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.lib-tab .count {
  min-width: 17px; height: 16px; padding: 0 4px;
  display: inline-grid; place-items: center;
  border-radius: 99px; background: var(--surface-2);
  font-size: 9px; font-weight: 800; color: var(--muted);
}
.lib-tab.is-active .count { background: rgba(255, 255, 255, 0.15); color: var(--paper); }
.lib-tools { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.lib-search {
  display: flex; align-items: center; gap: 8px;
  height: 34px; padding: 0 10px;
  border-radius: 10px; border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  min-width: 210px;
}
.lib-search:focus-within { border-color: var(--ink); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 16%, transparent); }
.lib-search .i { width: 15px; height: 15px; }
.lib-search input { border: 0; background: transparent; outline: none; width: 100%; font-size: 11.5px; color: var(--ink); }
.lib-search input::placeholder { color: var(--faint); }
.lib-filter {
  height: 34px; padding: 0 10px;
  border: 1px solid var(--line); border-radius: 10px;
  background: var(--surface); color: var(--muted);
  font-size: 11px; font-weight: 700;
}

.lib-card { padding: 0; overflow: hidden; }
.lib-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 116px 138px 124px 112px 36px;
  gap: 12px;
  padding: 11px 18px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
  font-size: 8.5px; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; color: var(--faint);
}
.lib-head span:nth-child(1) { padding-left: 56px; }
.lib-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 116px 138px 124px 112px 36px;
  gap: 12px;
  align-items: center;
  padding: 10px 18px;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  transition: background 0.14s;
  position: relative;
}
.lib-row:last-child { border-bottom: 0; }
.lib-row:hover { background: var(--surface-2); }
.lib-post { display: flex; align-items: center; gap: 10px; min-width: 0; }
.lib-post .thumb { width: 42px; height: 42px; border-radius: 10px; }
.lib-post-copy { min-width: 0; }
.lib-title { font-size: 12.5px; font-weight: 800; letter-spacing: -0.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lib-sub { display: flex; align-items: center; gap: 5px; margin-top: 1px; font-size: 9.5px; color: var(--muted); min-width: 0; }
.lib-sub span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lib-cell { font-size: 10.5px; color: var(--muted); min-width: 0; }
.lib-date { display: flex; flex-direction: column; gap: 0; line-height: 1.3; }
.lib-date strong { font-size: 11px; color: var(--ink-2); font-weight: 800; }
.lib-date span { font-size: 9.5px; color: var(--faint); }
.lib-metric { font-size: 12px; font-weight: 800; color: var(--ink); font-variant-numeric: tabular-nums; }
.lib-metric small { display: block; font-size: 8.5px; font-weight: 600; color: var(--faint); letter-spacing: 0.02em; }
.lib-row-actions { display: grid; place-items: center; }
.lib-row-actions .icon-btn { width: 30px; height: 30px; border-radius: 8px; }
.lib-row-actions .icon-btn .i { width: 16px; height: 16px; }
.lib-empty { padding: 50px 20px; }
.lib-foot { padding: 11px 18px; border-top: 1px solid var(--line); background: var(--surface-2); display: flex; justify-content: space-between; gap: 10px; font-size: 10px; color: var(--muted); }
.lib-mobile-meta { display: none; }

@media (max-width: 1280px) {
  .home-grid { grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.72fr); }
  .cal-layout { grid-template-columns: minmax(0, 1fr) 312px; }
  .lib-head, .lib-row { grid-template-columns: minmax(0, 1fr) 96px 120px 112px 96px 32px; gap: 10px; }
}
@media (max-width: 1080px) {
  .hero { grid-template-columns: minmax(0, 1.3fr) minmax(270px, 0.7fr); padding: 24px; gap: 18px; }
  .hero h1 { font-size: clamp(32px, 4.2vw, 42px); }
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .home-grid { grid-template-columns: 1fr; }
  .home-side { display: grid; grid-template-columns: 1fr 1fr; align-items: stretch; }
  .cal-layout { grid-template-columns: 1fr; }
  .day-panel { position: static; }
  .day-list { max-height: none; }
  .lib-head { display: none; }
  .lib-row { grid-template-columns: minmax(0, 1fr) auto; gap: 10px 12px; padding: 12px 14px; }
  .lib-row > .lib-cell, .lib-row > .lib-metric { display: none; }
  .lib-row-actions { grid-row: 1; grid-column: 2; }
  .lib-mobile-meta { display: flex; align-items: center; gap: 8px; grid-column: 1 / -1; padding-left: 52px; margin-top: -4px; flex-wrap: wrap; }
  .lib-mobile-meta .lib-date { flex-direction: row; gap: 4px; align-items: center; }
  .lib-mobile-meta .lib-date span { display: none; }
  .lib-mobile-meta .lib-metric { font-size: 10.5px; }
  .lib-mobile-meta .lib-metric small { display: inline; font-size: 8.5px; margin-left: 3px; }
}
@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; padding: 22px; gap: 18px; border-radius: 22px; min-height: 0; }
  .hero h1 { font-size: clamp(31px, 8vw, 40px); max-width: 14ch; }
  .hero .lede { font-size: 12px; max-width: 38ch; }
  .hero-actions .btn { height: 38px; font-size: 12px; }
  .hero-meta { margin-top: 13px; font-size: 9.5px; }
  .pulse { min-height: 190px; padding: 15px 16px 13px; }
  .weekbars { height: 78px; margin: 13px 0 8px; }
  .hero-orbit { display: none; }
  .kpi-grid { gap: 10px; margin-top: 12px; }
  .kpi { border-radius: 16px; padding: 14px; }
  .kpi-value { font-size: 24px; }
  .kpi .spark { width: 62px; height: 24px; }
  .kpi-label { font-size: 9.5px; }
  .home-side { grid-template-columns: 1fr; }
  .up-item { grid-template-columns: 48px 44px minmax(0, 1fr) 12px; gap: 9px; }
  .up-side { display: none; }
  .up-thumb { width: 44px; height: 44px; }
  .up-time { font-size: 11.5px; }
  .up-title { font-size: 12px; }
  .up-meta { font-size: 9.5px; }
  .cal-toolbar { padding: 14px; gap: 10px; }
  .cal-title h2 { font-size: 20px; }
  .cal-tools { width: 100%; justify-content: space-between; }
  .cal-cell { min-height: 66px; padding: 4px; }
  .cal-daynum { width: 19px; height: 19px; font-size: 9.5px; }
  .cal-post { padding: 2px 3px; gap: 3px; border-left-width: 2px; }
  .cal-post time { display: none; }
  .cal-post .cal-post-title { display: none; }
  .cal-post .cal-post-dot { width: 5px; height: 5px; }
  .cal-cell .cal-more { display: none; }
  .cal-day-add { display: none; }
  .cal-weekdays span { font-size: 8px; padding: 6px 2px; letter-spacing: 0.06em; }
  .cal-legend { padding: 10px 14px; }
  .day-hero { padding: 16px; }
  .day-hero-date strong { font-size: 44px; }
  .lib-top { align-items: flex-start; flex-direction: column; gap: 10px; }
  .lib-tools { width: 100%; }
  .lib-search { flex: 1; min-width: 0; }
  .lib-tabs { overflow-x: auto; flex-wrap: nowrap; width: 100%; padding-bottom: 2px; scrollbar-width: none; }
  .lib-tabs::-webkit-scrollbar { display: none; }
  .lib-tab { flex: none; }
  .lib-row { padding: 12px; border-radius: 0; }
  .lib-mobile-meta { padding-left: 52px; }
}

/* KPIs em telas estreitas: sparkline abaixo das variações, sem sobrepor texto */
@media (max-width: 480px) {
  .kpi-foot { flex-direction: column; align-items: stretch; gap: 5px; }
  .kpi .spark { width: 100%; height: 21px; }
  .kpi-since { white-space: normal; }
}