/* ---------- Tema ----------
   Claro por defecto; oscuro con data-theme="dark" en <html> (Ajustes → Apariencia).
   Todo color sale de estas variables: no escribir colores sueltos más abajo.
   --mix-ink y --cat-pct sirven para escribir texto con el color de una categoría o
   marca: se mezcla con negro en claro y con blanco en oscuro, para que se lea. */
:root {
  color-scheme: light;
  --bg: #f6f6f4;
  --sidebar: #fbfbfa;
  --card: #ffffff;
  --card2: #f2f2ef;
  --border: #e3e3df;
  --text: #1c1c1e;
  --text2: #66666c;
  --accent: #0f7b55;
  --accent-hover: #0b6545;
  --accent-soft: rgba(15, 123, 85, .09);
  --on-accent: #ffffff;
  --danger: #c2372f;
  --danger-soft: rgba(194, 55, 47, .08);
  --warn: #9a5b00;
  --warn-soft: rgba(196, 128, 0, .10);
  --info: #2f68c8;
  --mix-ink: black;
  --cat-pct: 62%;
  --overlay: rgba(28, 28, 30, .32);
  --radius: 10px;
  --shadow: 0 1px 2px rgba(0, 0, 0, .04), 0 8px 24px rgba(0, 0, 0, .08);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .06);
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
:root[data-theme="dark"] {
  --bg: #121214;
  --sidebar: #161618;
  --card: #1a1a1d;
  --card2: #222226;
  --border: #2d2d32;
  --text: #ececee;
  --text2: #a0a0a7;
  --accent: #3cc88d;
  --accent-hover: #55d6a0;
  --accent-soft: rgba(60, 200, 141, .12);
  --on-accent: #0a1610;
  --danger: #ef6b64;
  --danger-soft: rgba(239, 107, 100, .12);
  --warn: #e3a54d;
  --warn-soft: rgba(227, 165, 77, .12);
  --info: #6da5ff;
  --mix-ink: white;
  --cat-pct: 64%;
  --overlay: rgba(0, 0, 0, .55);
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 30px rgba(0, 0, 0, .4);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .35);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: none; background: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- Layout ---------- */
.app { position: relative; z-index: 1; display: flex; height: 100vh; }

.sidebar {
  width: 240px; flex-shrink: 0;
  background: var(--sidebar);
  border-right: 1px solid var(--border);
  padding: 22px 12px;
  display: flex; flex-direction: column; gap: 2px;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 0 10px 22px; }
/* El símbolo trae fondo blanco: va como ícono de app, en un cuadrado redondeado (también en oscuro). */
.brand-logo { width: 36px; height: 36px; border-radius: 9px; display: block; flex-shrink: 0; }
:root[data-theme="dark"] .brand-logo { box-shadow: 0 0 0 1px var(--border); }
.brand-name { font-weight: 700; letter-spacing: 1.5px; font-size: 15px; }

.nav-btn {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: 7px;
  color: var(--text2); font-weight: 500; font-size: 14px;
  transition: background .15s, color .15s; text-align: left;
}
.nav-btn svg { width: 18px; height: 18px; flex-shrink: 0; }
.nav-btn:hover { background: var(--card2); color: var(--text); }
.nav-btn.active { background: var(--card2); color: var(--text); font-weight: 600; }
.nav-btn.active svg { color: var(--accent); }

.tema-btn { margin-top: auto; }
.sidebar-footer { margin-top: 8px; padding: 12px; border-radius: var(--radius); border: 1px solid var(--border); font-size: 12px; color: var(--text2); }
.sidebar-footer b { color: var(--text); display: block; font-size: 18px; font-weight: 600; }

.main { flex: 1; overflow-y: auto; padding: 32px 40px 60px; }
.view { display: none; animation: fadeUp .2s ease; max-width: 1200px; margin: 0 auto; }
.view.active { display: block; }
@keyframes fadeUp { from { opacity: 0; } to { opacity: 1; transform: none; } }

.view-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.eyebrow { color: var(--text2); font-weight: 600; font-size: 12px; letter-spacing: .4px; text-transform: uppercase; margin-bottom: 4px; }
h1 { font-size: 26px; font-weight: 700; line-height: 1.2; letter-spacing: -.3px; }
h2 { font-size: 15px; font-weight: 600; }
.muted { color: var(--text2); }

/* ---------- Components ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}
.card-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }

.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px; border-radius: 7px; min-height: 36px;
  font-weight: 600; font-size: 13.5px; transition: background .15s, border-color .15s, color .15s;
}
.btn svg { width: 16px; height: 16px; }
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-primary:hover { background: var(--accent-hover); }
.btn-ghost { background: var(--card); border: 1px solid var(--border); color: var(--text); box-shadow: var(--shadow-sm); }
.btn-ghost:hover { background: var(--card2); }
.btn-danger { background: var(--danger-soft); color: var(--danger); }
.btn-danger:hover { background: var(--danger); color: var(--on-accent); }
.icon-btn {
  width: 36px; height: 36px; border-radius: 7px;
  display: grid; place-items: center;
  background: var(--card); border: 1px solid var(--border); box-shadow: var(--shadow-sm);
  transition: background .15s, color .15s;
}
.icon-btn:hover { background: var(--card2); }
.icon-btn svg { width: 16px; height: 16px; }

.segmented { display: inline-flex; background: var(--card2); border: 1px solid var(--border); border-radius: 8px; padding: 2px; }
.segmented button { padding: 6px 12px; border-radius: 6px; font-weight: 500; font-size: 13px; color: var(--text2); transition: background .15s, color .15s; }
.segmented button:hover { color: var(--text); }
.segmented button.active { background: var(--card); color: var(--text); font-weight: 600; box-shadow: var(--shadow-sm); }

/* ---------- Dashboard ---------- */
.dash-grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 18px; }
.span-3 { grid-column: span 3; } .span-4 { grid-column: span 4; } .span-5 { grid-column: span 5; }
.span-7 { grid-column: span 7; } .span-8 { grid-column: span 8; } .span-12 { grid-column: span 12; }

.stat { display: flex; flex-direction: column; gap: 4px; }
.stat-value { font-size: 34px; font-weight: 700; }
.stat-label { color: var(--text2); font-size: 13px; font-weight: 600; }

.ring-wrap { display: flex; align-items: center; gap: 20px; }
.ring { width: 110px; height: 110px; position: relative; flex-shrink: 0; }
.ring svg { transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 10; stroke-linecap: round; }
.ring .bg { stroke: var(--card2); }
.ring .fg { stroke: var(--accent); transition: stroke-dashoffset .8s cubic-bezier(.2,.8,.2,1); }
.ring-label { position: absolute; inset: 0; display: grid; place-items: center; font-size: 24px; font-weight: 700; }

.quote { font-size: 17px; font-weight: 600; line-height: 1.5; }
.quote small { display: block; color: var(--text2); font-weight: 500; font-size: 13px; margin-top: 10px; }

/* ---------- Task item ---------- */
.task-list { display: flex; flex-direction: column; gap: 8px; }
.task {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; border-radius: 8px;
  background: var(--card2); border: 1px solid transparent;
  transition: all .2s; cursor: pointer;
  border-left: 3px solid var(--cat, var(--accent));
}
.task:hover { border-color: var(--border); border-left-color: var(--cat, var(--accent)); }
.task.done .task-title { text-decoration: line-through; color: var(--text2); }
.task-body { flex: 1; min-width: 0; }
.task-title { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.task-meta { font-size: 12px; color: var(--text2); display: flex; flex-wrap: wrap; gap: 2px 8px; align-items: center; }
.prio { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }
.prio.alta { background: var(--danger); } .prio.media { background: var(--warn); } .prio.baja { background: var(--info); }

.check {
  width: 22px; height: 22px; border-radius: 50%;
  border: 2px solid var(--border); flex-shrink: 0;
  display: grid; place-items: center; transition: all .2s;
}
.check:hover { border-color: var(--accent); }
.check.on { background: var(--accent); border-color: var(--accent); animation: pop .3s ease; }
.check.on::after { content: ""; width: 6px; height: 10px; border: solid var(--on-accent); border-width: 0 2.5px 2.5px 0; transform: rotate(45deg) translate(-1px,-1px); }
@keyframes pop { 50% { transform: scale(1.25); } }

.btn-mini { flex-shrink: 0; padding: 5px 10px; border-radius: 8px; font-size: 12px; font-weight: 700; color: var(--accent-hover); background: var(--accent-soft); transition: all .2s; }
.btn-mini:hover { background: var(--accent); color: var(--on-accent); }
.card-late { border-color: color-mix(in srgb, var(--warn) 45%, var(--border)); }
.card-late h2 .muted { font-size: 13px; font-weight: 600; margin-left: 6px; }
.card-acciones { display: flex; gap: 8px; flex-wrap: wrap; }
#card-copia .card-head { flex-wrap: wrap; gap: 10px; }
#card-copia .settings-help { margin: 0; }
.card-bienvenida .settings-help { margin: 0 0 14px; max-width: 70ch; }
.clima-invitacion { font-size: 13.5px; color: var(--text2); margin: 0 0 14px; }
.clima-invitacion-acciones { margin-top: auto; display: flex; flex-wrap: wrap; gap: 8px; }
[hidden] { display: none !important; }

.empty { color: var(--text2); font-size: 14px; text-align: center; padding: 24px 0; }

/* ---------- Calendar ---------- */
.cal-toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.cal-title { font-size: 20px; font-weight: 700; min-width: 190px; text-transform: capitalize; }
.cal-weekdays, .cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.cal-weekdays div { text-align: center; font-size: 12px; font-weight: 700; color: var(--text2); text-transform: uppercase; padding: 8px 0; }
.cal-day {
  min-height: 112px; padding: 8px; border-radius: 8px;
  background: var(--card); border: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 4px;
  cursor: pointer; transition: all .2s; overflow: hidden;
}
.cal-day:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); }
.cal-day.other { opacity: .35; }
.cal-day.today { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.cal-day.today .cal-num { background: var(--accent); color: var(--on-accent); }
.cal-day.drag-over { background: var(--accent-soft); border-style: dashed; border-color: var(--accent); }
.cal-num { font-size: 13px; font-weight: 700; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; }
.chip {
  font-size: 11.5px; font-weight: 600; padding: 3px 7px; border-radius: 6px;
  background: color-mix(in srgb, var(--cat) 20%, transparent);
  color: color-mix(in srgb, var(--cat) var(--cat-pct), var(--mix-ink));
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  cursor: grab;
}
.chip.done { opacity: .45; text-decoration: line-through; }
.chip-more { font-size: 11px; color: var(--text2); padding-left: 4px; }

.cal-grid.week .cal-day { min-height: 420px; }
.cal-layout { display: grid; grid-template-columns: 1fr 320px; gap: 18px; align-items: start; }
.cal-main { min-width: 0; }
.day-panel { position: sticky; top: 0; display: flex; flex-direction: column; gap: 14px; animation: fadeUp .3s ease; }
.day-panel-date { font-size: 13px; color: var(--accent); font-weight: 700; text-transform: uppercase; letter-spacing: 1px; }
.day-panel h2 { font-size: 22px; text-transform: capitalize; }
.day-panel .bar { height: 6px; border-radius: 6px; background: var(--card2); overflow: hidden; }
.day-panel .bar i { display: block; height: 100%; background: var(--accent); transition: width .5s; }
.cal-day.selected { border-color: var(--accent); background: var(--accent-soft); }
.cal-grid.week + * , .cal-layout.week-mode { grid-template-columns: 1fr; }
@media (max-width: 1100px) { .cal-layout { grid-template-columns: 1fr; } .day-panel { position: static; } }
.cal-grid.week .chip { white-space: normal; padding: 6px 8px; font-size: 12.5px; }

/* ---------- Planner ---------- */
.planner { display: grid; grid-template-columns: repeat(7, minmax(180px, 1fr)); gap: 12px; overflow-x: auto; padding-bottom: 8px; }
.planner-col { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; min-height: 60vh; display: flex; flex-direction: column; gap: 8px; transition: all .2s; }
.planner-col.today { border-color: var(--accent); }
.planner-col.drag-over { background: var(--accent-soft); border-style: dashed; border-color: var(--accent); }
.planner-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 6px; }
.planner-head b { text-transform: capitalize; }
.planner-head span { color: var(--text2); font-size: 13px; }
.planner-col.today .planner-head span { color: var(--accent); font-weight: 700; }
.add-inline { display: flex; gap: 6px; margin-top: auto; }
.add-inline input { flex: 1; min-width: 0; background: var(--card2); border: 1px dashed var(--border); border-radius: 7px; padding: 9px 10px; font-size: 13px; outline: none; }
.add-inline input:focus { border-color: var(--accent); border-style: solid; }
.add-task-btn { margin-top: auto; width: 100%; padding: 10px; border-radius: 7px; border: 1px dashed var(--border); color: var(--text2); font-size: 13px; font-weight: 600; transition: all .2s; }
.add-task-btn:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); border-style: solid; }
.task[draggable="true"] { cursor: grab; }
.task.dragging, .chip.dragging { opacity: .4; }

/* ---------- Habits ---------- */
.habit-list { display: flex; flex-direction: column; gap: 12px; }
.habit {
  display: grid; grid-template-columns: 52px 1fr auto; gap: 16px; align-items: center;
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px;
}
.habit-icon { width: 52px; height: 52px; border-radius: 6px; background: var(--card2); display: grid; place-items: center; font-size: 26px; }
.habit-name { font-weight: 700; font-size: 16px; display: flex; align-items: center; gap: 10px; }
.streak { font-size: 12px; font-weight: 700; color: var(--warn); background: var(--warn-soft); padding: 3px 8px; border-radius: 999px; }
.habit-week { display: flex; gap: 6px; margin-top: 10px; }
.hday { display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 10.5px; color: var(--text2); font-weight: 600; }
.hday button { width: 30px; height: 30px; border-radius: 6px; background: var(--card2); border: 1px solid var(--border); transition: all .2s; }
.hday button:hover { border-color: var(--accent); }
.hday button.on { background: var(--accent); border-color: var(--accent); }
.hday.is-today { color: var(--accent); }
.heatmap { display: grid; grid-template-rows: repeat(7, 11px); grid-auto-flow: column; gap: 3px; }
.heatmap i { width: 11px; height: 11px; border-radius: 3px; background: var(--card2); }
.heatmap i.on { background: var(--accent); }
.habit-actions { display: flex; flex-direction: column; align-items: flex-end; gap: 10px; }

.dash-habit { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 8px; background: var(--card2); cursor: pointer; transition: all .2s; }
.dash-habit:hover { }
.dash-habit .emoji { font-size: 20px; }
.dash-habit span.name { flex: 1; font-weight: 600; font-size: 14px; }

/* ---------- Notas ---------- */
.notes-toolbar { display: flex; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; align-items: center; }
.search { flex: 1; min-width: 200px; background: var(--card); border: 1px solid var(--border); border-radius: 8px; padding: 11px 14px; outline: none; }
.search:focus { border-color: var(--accent); }
#note-filter { overflow-x: auto; max-width: 100%; }
#note-filter button { white-space: nowrap; }
.notes-grid { columns: 280px; column-gap: 16px; }
.note {
  break-inside: avoid; margin-bottom: 16px;
  background: color-mix(in srgb, var(--nc) 10%, var(--card));
  border: 1px solid color-mix(in srgb, var(--nc) 35%, var(--border));
  border-radius: var(--radius); padding: 18px; cursor: pointer;
  transition: all .2s; animation: fadeUp .3s ease;
}
.note:hover { box-shadow: var(--shadow); border-color: var(--nc); }
.note-head { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.note h3 { font-size: 16px; font-weight: 700; }
.note-body { color: var(--text2); font-size: 14px; white-space: pre-wrap; word-break: break-word; max-height: 220px; overflow: hidden; }
.note-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 14px; font-size: 12px; color: var(--text2); }
.tag { font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 999px; background: color-mix(in srgb, var(--cat) 16%, transparent); color: color-mix(in srgb, var(--cat) var(--cat-pct), var(--mix-ink)); }
.note-modal { max-width: 560px; }
.note-title-input { width: 100%; background: none; border: none; outline: none; font-size: 22px; font-weight: 700; margin-bottom: 10px; }
.note-body-input { width: 100%; min-height: 220px; background: var(--card2); border: 1px solid var(--border); border-radius: 8px; padding: 14px; outline: none; resize: vertical; margin-bottom: 14px; line-height: 1.6; }
.note-body-input:focus { border-color: var(--accent); }
.color-pick { display: flex; gap: 8px; padding-top: 4px; }
.color-pick button { width: 30px; height: 30px; border-radius: 50%; background: var(--c); border: 2px solid transparent; transition: transform .2s; }
.color-pick button.on { border-color: var(--text); transform: scale(1.15); }

/* ---------- Marketing ---------- */
.mk-filter { background: var(--card2); border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; font-weight: 600; font-size: 14px; outline: none; max-width: 220px; }
.mk-filter:focus { border-color: var(--accent); }
.mk-tabs { margin-bottom: 20px; overflow-x: auto; max-width: 100%; scrollbar-width: none; }
.mk-tabs button { white-space: nowrap; }
.mk-empty { margin-bottom: 16px; padding: 20px; }
.mk-hint { font-size: 13px; margin: 10px 0 16px; }

.kanban { display: grid; grid-template-columns: repeat(6, minmax(175px, 1fr)); gap: 12px; overflow-x: auto; padding-bottom: 8px; }
.kanban-col { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px; min-height: 55vh; display: flex; flex-direction: column; gap: 8px; transition: all .2s; }
.kanban-col.drag-over { background: var(--accent-soft); border-style: dashed; border-color: var(--accent); }
.kanban-col[data-estado="publicado"] .kanban-head b { color: var(--accent); }
.kanban-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; font-size: 14px; }
.kanban-head span { font-size: 12px; font-weight: 700; color: var(--text2); background: var(--card2); border-radius: 999px; padding: 2px 8px; }

.mk-card { background: var(--card2); border-radius: 8px; padding: 11px 12px; border-left: 3px solid var(--cat); cursor: grab; transition: all .2s; display: flex; flex-direction: column; gap: 5px; }
.mk-card:hover { box-shadow: var(--shadow); }
.mk-card.done .mk-card-title { color: var(--text2); }
.mk-card.dragging { opacity: .4; }
.mk-card-title { font-weight: 600; font-size: 14px; line-height: 1.3; word-break: break-word; }
.mk-card-meta { font-size: 12px; color: var(--text2); }
.mk-card-foot { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 11.5px; color: var(--text2); }
.mk-card-foot:empty { display: none; }
.mk-pill { font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--card); border: 1px solid var(--border); color: var(--text2); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mk-brand { font-weight: 700; color: color-mix(in srgb, var(--cat) var(--cat-pct), var(--mix-ink)); }

.mk-cal-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.mk-cal { display: flex; flex-direction: column; gap: 6px; }
.mk-week { display: grid; grid-template-columns: repeat(7, 1fr); grid-auto-rows: auto; column-gap: 6px; row-gap: 3px; }
.mk-day { background: var(--card); border: 1px solid var(--border); border-radius: 8px; cursor: pointer; transition: border-color .2s; }
.mk-day:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); }
.mk-day.other, .mk-day-num.other, .mk-day-list.other { opacity: .4; }
.mk-day.today { border-color: var(--accent); }
.mk-day.drag-over, .mk-day-list.drag-over, .mk-day-num.drag-over { background: var(--accent-soft); }
.mk-day-num { padding: 8px 8px 2px; font-size: 13px; font-weight: 700; cursor: pointer; z-index: 1; }
.mk-day-num.today .dia-num { background: var(--accent); color: var(--on-accent); border-radius: 50%; width: 24px; height: 24px; display: inline-grid; place-items: center; }
.mk-day-list { display: flex; flex-direction: column; gap: 3px; padding: 2px 6px 8px; min-height: 52px; cursor: pointer; z-index: 1; }
.mk-bar { z-index: 2; margin: 0; padding: 3px 8px; font-size: 11.5px; font-weight: 700; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  background: color-mix(in srgb, var(--cat) 30%, var(--card)); color: color-mix(in srgb, var(--cat) var(--cat-pct), var(--mix-ink)); border-radius: 0; }
.mk-bar.start { border-top-left-radius: 7px; border-bottom-left-radius: 7px; margin-left: 4px; }
.mk-bar.end { border-top-right-radius: 7px; border-bottom-right-radius: 7px; margin-right: 4px; }
.mk-bar.done { opacity: .5; }
.mk-bar:hover { background: color-mix(in srgb, var(--cat) 45%, var(--card)); }

.mk-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 14px; }
.mk-grid.ideas { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.mk-camp { background: var(--card); border: 1px solid var(--border); border-top: 3px solid var(--cat); border-radius: var(--radius); padding: 16px; cursor: pointer; transition: all .2s; display: flex; flex-direction: column; gap: 8px; }
.mk-camp:hover { border-color: color-mix(in srgb, var(--cat) 50%, var(--border)); border-top-color: var(--cat); }
.mk-camp-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.mk-camp h3 { font-size: 16px; font-weight: 700; line-height: 1.3; word-break: break-word; }
.mk-sub { font-size: 12.5px; color: var(--text2); }
.mk-line { font-size: 13px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.mk-camp .bar { height: 6px; border-radius: 6px; background: var(--card2); overflow: hidden; }
.mk-camp .bar i { display: block; height: 100%; background: var(--cat); transition: width .5s; }
.mk-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.mk-estado { flex-shrink: 0; font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 999px; background: var(--card2); color: var(--text2); }
.mk-estado.activa { background: var(--accent-soft); color: var(--accent); }
.mk-estado.pausada { background: var(--warn-soft); color: var(--warn); }
.mk-estado.terminada { opacity: .6; }
.mk-pct { font-size: 20px; font-weight: 700; color: color-mix(in srgb, var(--cat) var(--cat-pct), var(--mix-ink)); }
.mk-obj.vencido .mk-plazo { color: var(--danger); font-weight: 700; }

.mk-idea-form { display: flex; gap: 10px; }
.mk-idea-form input { flex: 1; min-width: 0; background: var(--card); border: 1px solid var(--border); border-radius: 8px; padding: 12px 14px; outline: none; }
.mk-idea-form input:focus { border-color: var(--accent); }

.modal.modal-wide { max-width: 620px; }
.row > .field { min-width: 0; }
.field select, .field input { width: 100%; min-width: 0; }
.label-hint { text-transform: none; letter-spacing: 0; font-weight: 500; }
.field label.sub { font-size: 11px; }
.row-4 { grid-template-columns: 1.4fr 1fr 1fr 1fr; }
.smart { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 6px; background: var(--accent); color: var(--on-accent); font-weight: 700; margin-right: 4px; }
.day-pick.chip-pick button { width: auto; padding: 0 12px; white-space: nowrap; }
.inline-new { display: flex; align-items: center; gap: 8px; margin: -4px 0 14px; padding: 8px; border-radius: 8px; border: 1px dashed var(--accent); }
.inline-new input[type="color"] { width: 28px; height: 28px; flex-shrink: 0; border: none; border-radius: 50%; padding: 0; background: none; cursor: pointer; }
.inline-new input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }
.inline-new input[type="color"]::-webkit-color-swatch { border: none; border-radius: 50%; }
.inline-new input:not([type="color"]) { flex: 1; min-width: 0; background: var(--card2); border: 1px solid var(--border); border-radius: 7px; padding: 9px 12px; outline: none; }
.inline-new input:not([type="color"]):focus { border-color: var(--accent); }
.inline-new .btn { padding: 8px 12px; font-size: 13px; }
.a-tasks, .c-acciones { display: flex; flex-direction: column; gap: 6px; }
.a-tasks-empty { font-size: 13px; }
.a-task { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 7px; background: var(--card2); font-size: 14px; }
.a-task .check { width: 20px; height: 20px; }
.a-task-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.a-task.done .a-task-title { text-decoration: line-through; color: var(--text2); }
.a-task-del { font-size: 18px; color: var(--text2); padding: 0 4px; }
.a-task-del:hover { color: var(--danger); }
.a-task-new { display: flex; gap: 8px; margin-top: 6px; }
.a-task-new input { flex: 1; min-width: 0; background: var(--card2); border: 1px solid var(--border); border-radius: 7px; padding: 10px 12px; outline: none; }
.a-task-new input[type="date"] { flex: 0 0 150px; }
.a-task-new input:focus { border-color: var(--accent); }
.c-accion { display: flex; justify-content: space-between; gap: 10px; padding: 9px 12px; border-radius: 7px; background: var(--card2); font-size: 14px; text-align: left; }
.c-accion:hover { outline: 1px solid var(--accent); }
.c-accion span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.c-accion .muted { flex-shrink: 0; font-size: 12px; }
#c-acciones-box .btn { margin-top: 8px; justify-content: center; }

/* ---------- Horas y cronómetro ---------- */
.crono-btn { flex-shrink: 0; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; color: var(--text2); background: var(--card); border: 1px solid var(--border); transition: all .2s; }
.crono-btn:hover { color: var(--accent); border-color: var(--accent); }
.crono-btn svg { width: 16px; height: 16px; }
.crono-btn.on { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.crono-btn.on svg { width: 12px; height: 12px; }
.task.corriendo { border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); }
.tiempo { overflow-wrap: anywhere; }
.tiempo.over { color: var(--warn); font-weight: 700; }
#stat-horas.warn { color: var(--warn); }
.carga { display: flex; align-items: center; gap: 8px; font-size: 11.5px; color: var(--text2); margin: -2px 0 6px; }
.carga-bar { flex: 1; height: 4px; border-radius: 4px; background: var(--card2); overflow: hidden; }
.carga-bar i { display: block; height: 100%; background: var(--accent); }
.carga.over { color: var(--warn); font-weight: 700; }
.carga.over .carga-bar i { background: var(--warn); }
.crono-pill { position: fixed; right: 24px; bottom: 24px; z-index: 45; display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 14px; border-radius: 999px;
  background: var(--card2); border: 1px solid var(--accent); box-shadow: var(--shadow); max-width: min(440px, calc(100vw - 32px)); }
.crono-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: var(--accent); flex-shrink: 0; }
.crono-title { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; text-align: left; }
.crono-title:hover { color: var(--accent); }
#crono-time { font-variant-numeric: tabular-nums; font-size: 14px; }
.crono-stop { width: 32px; height: 32px; border-radius: 50%; background: var(--accent); color: var(--on-accent); flex-shrink: 0; display: grid; place-items: center; }
.crono-stop svg { width: 12px; height: 12px; }
.crono-q { font-size: 14px; color: var(--text2); margin: -8px 0 16px; line-height: 1.5; }
.crono-q b { color: var(--text); }

.hs-wrap { overflow-x: auto; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); }
.hs-tabla { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 560px; }
.hs-tabla th { text-align: left; font-size: 11.5px; font-weight: 700; color: var(--text2); text-transform: uppercase; letter-spacing: .5px; padding: 14px 16px 10px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.hs-tabla td { padding: 12px 16px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.hs-tabla tbody tr { border-left: 3px solid var(--cat); }
.hs-tabla tfoot td { font-weight: 700; border-bottom: none; }
.hs-marca { font-weight: 700; }
.hs-bar { height: 4px; border-radius: 4px; background: var(--card2); margin-top: 6px; width: 140px; overflow: hidden; }
.hs-bar i { display: block; height: 100%; background: var(--cat); }
.hs-over { color: var(--warn); font-weight: 700; }
.hs-ok { color: var(--accent); font-weight: 700; }
.hs-hon { display: inline-flex; align-items: center; gap: 4px; color: var(--text2); }
.hs-hon input { width: 110px; background: var(--card2); border: 1px solid var(--border); border-radius: 6px; padding: 6px 8px; outline: none; color: var(--text); }
.hs-hon input:focus { border-color: var(--accent); }
.a-task-new input[type="number"] { flex: 0 0 90px; }
.a-task-new #t-time-h { flex: 1 1 auto; }

/* ---------- Ajustes ---------- */
.settings-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 18px; align-items: start; }
.settings-help { font-size: 13px; margin: -8px 0 14px; }
.cat-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.cat-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; background: var(--card2); }
.cat-row input[type="color"], .cat-new input[type="color"] { width: 30px; height: 30px; border: none; border-radius: 50%; padding: 0; background: none; cursor: pointer; flex-shrink: 0; }
.cat-row input[type="color"]::-webkit-color-swatch-wrapper, .cat-new input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }
.cat-row input[type="color"]::-webkit-color-swatch, .cat-new input[type="color"]::-webkit-color-swatch { border: none; border-radius: 50%; }
.cat-name { flex: 1; min-width: 0; background: none; border: 1px solid transparent; border-radius: 8px; padding: 6px 8px; font-weight: 600; outline: none; }
.cat-name:hover { border-color: var(--border); }
.cat-name:focus { border-color: var(--accent); background: var(--card); }
.cat-uses { font-size: 12px; white-space: nowrap; }
.cat-row .icon-btn { width: 32px; height: 32px; }
.cat-row .icon-btn:hover:not(:disabled) { border-color: var(--danger); color: var(--danger); }
.cat-row .icon-btn:disabled { opacity: .3; cursor: not-allowed; }
.cat-move { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 10px 12px; margin-top: -4px; border-radius: 8px; border: 1px dashed var(--danger); font-size: 13px; }
.cat-move select { background: var(--card2); border: 1px solid var(--border); border-radius: 6px; padding: 7px 10px; }
.cat-move .btn { padding: 7px 12px; font-size: 13px; }
.cat-new { display: flex; align-items: center; gap: 10px; }
.cat-new input:not([type="color"]) { flex: 1; min-width: 0; background: var(--card2); border: 1px solid var(--border); border-radius: 7px; padding: 10px 12px; outline: none; }
.cat-new input:not([type="color"]):focus { border-color: var(--accent); }

.backup-last { font-size: 14px; font-weight: 600; margin-bottom: 14px; }
.backup-last.warn { color: var(--warn); }
.backup-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.backup-confirm { margin-top: 16px; padding: 14px; border-radius: 8px; border: 1px dashed var(--warn); font-size: 14px; display: flex; flex-direction: column; gap: 10px; }

/* ---------- Modal ---------- */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 50;
  background: var(--overlay);
  display: none; align-items: center; justify-content: center; padding: 20px;
}
.modal-backdrop.open { display: flex; animation: fade .2s ease; }
@keyframes fade { from { opacity: 0; } }
.modal {
  width: 100%; max-width: 480px;
  background: var(--card); border: 1px solid var(--border); border-radius: 8px;
  padding: 26px; box-shadow: var(--shadow);
  animation: modalIn .18s ease-out;
}
@keyframes modalIn { from { opacity: 0; transform: translateY(6px); } }
.modal h2 { margin-bottom: 20px; font-size: 20px; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label { font-size: 12px; font-weight: 700; color: var(--text2); text-transform: uppercase; letter-spacing: .5px; }
.field input, .field select, .field textarea {
  background: var(--card2); border: 1px solid var(--border); border-radius: 7px;
  padding: 11px 13px; outline: none; transition: border-color .2s;
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--accent); }
.field textarea { resize: vertical; min-height: 70px; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 8px; }
.modal-actions .btn-danger { margin-right: auto; }
/* Selector de íconos de hábito, agrupado. Botones de 44px: se tocan bien en celular. */
.emoji-pick { display: flex; flex-direction: column; gap: 10px; }
.ico-grupo > span { display: block; font-size: 11px; font-weight: 600; color: var(--text2); text-transform: uppercase; letter-spacing: .4px; margin-bottom: 6px; }
.ico-fila { display: flex; flex-wrap: wrap; gap: 6px; }
.emoji-pick button { width: 44px; height: 44px; border-radius: 8px; background: var(--card2); border: 1px solid var(--border); display: grid; place-items: center; color: var(--text2); font-size: 20px; transition: border-color .15s, color .15s; }
.emoji-pick button:hover { color: var(--text); }
.emoji-pick button.on { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.ico-habito { width: 22px; height: 22px; }
.habit-icon { color: var(--accent); }
.habit-icon .ico-habito { width: 28px; height: 28px; }
.dash-habit .emoji { display: inline-grid; place-items: center; color: var(--accent); }
.dash-habit .ico-habito { width: 20px; height: 20px; }
.day-pick { display: flex; gap: 6px; flex-wrap: wrap; }
.day-pick button { width: 44px; height: 36px; border-radius: 7px; background: var(--card2); border: 1px solid var(--border); font-size: 12px; font-weight: 700; color: var(--text2); transition: all .2s; }
.day-pick button.on { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.series-opt { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text2); margin: 4px 0 12px; cursor: pointer; }
.series-opt input { accent-color: var(--accent); width: 16px; height: 16px; }
.rep { color: var(--accent); font-weight: 700; }
.modal { max-height: calc(100vh - 40px); overflow-y: auto; }
.modal-actions { flex-wrap: wrap; }

.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translate(-50%, 12px);
  background: var(--text); color: var(--card); box-shadow: var(--shadow);
  padding: 10px 16px; border-radius: 8px; font-weight: 500; font-size: 13.5px;
  opacity: 0; transition: opacity .2s, transform .2s; z-index: 60; pointer-events: none;
  max-width: calc(100vw - 32px);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Mobile ---------- */
.fab { display: none; }
@media (max-width: 900px) {
  .sidebar {
    position: fixed; bottom: 0; left: 0; right: 0; width: auto; height: 70px; z-index: 40;
    flex-direction: row; justify-content: space-around; align-items: center;
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
    border-right: none; border-top: 1px solid var(--border);
  }
  .brand, .sidebar-footer, .tema-btn, .nav-en-mas { display: none; }
  .nav-btn { flex-direction: column; gap: 4px; font-size: 11px; padding: 8px 1px; flex: 1; min-width: 0; text-align: center; white-space: nowrap; }
  .sidebar .nav-mas { display: flex; } /* .sidebar: le gana al display:none de más abajo */
  /* El orden de la barra no es el del HTML (que es el de la computadora). */
  #nav-dashboard { order: 1; } #nav-planner { order: 2; } #nav-calendar { order: 3; } #nav-marketing { order: 4; } #nav-mas { order: 5; }
  .main { padding: 22px 16px 100px; }
  h1 { font-size: 26px; }
  .dash-grid > * { grid-column: span 12; }
  .cal-day { min-height: 64px; padding: 4px; }
  .cal-day .chip { display: none; }
  .cal-day .chip-more { display: none; }
  .cal-day .dots { display: flex; }
  .cal-grid.week { grid-template-columns: 1fr; }
  .cal-grid.week .cal-day { min-height: 80px; }
  .cal-grid.week .chip { display: block; }
  .cal-weekdays.week { display: none; }
  .planner { grid-template-columns: repeat(7, 78vw); scroll-snap-type: x mandatory; }
  .planner-col { scroll-snap-align: start; }
  .habit { grid-template-columns: 44px 1fr; }
  .habit-icon { width: 44px; height: 44px; font-size: 22px; }
  .habit-actions { grid-column: span 2; flex-direction: row; justify-content: space-between; align-items: center; }
  .row { grid-template-columns: 1fr; }
  .row-4 { grid-template-columns: 1fr 1fr; }
  .kanban { grid-template-columns: repeat(6, 80vw); scroll-snap-type: x mandatory; }
  .kanban-col { scroll-snap-align: start; min-height: 40vh; }
  .mk-day-num { padding: 4px 4px 0; font-size: 11px; }
  .mk-day-list { padding: 2px 2px 4px; min-height: 30px; }
  .mk-day-list .chip { font-size: 0; padding: 0; height: 6px; border-radius: 3px; background: var(--cat); }
  .mk-bar { font-size: 9.5px; padding: 2px 4px; }
  .mk-week { column-gap: 3px; }
  .a-task-new { flex-wrap: wrap; }
  .a-task-new input[type="date"] { flex: 1 1 130px; }
  .a-task-new input[type="number"] { flex: 1 1 80px; }
  .crono-pill { right: 16px; left: 16px; bottom: 82px; max-width: none; }
}
.dots { display: none; gap: 3px; flex-wrap: wrap; }
.dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--cat); }
.mk-cal-title { font-size: 20px; font-weight: 700; min-width: 190px; }

/* ---------- Íconos chicos en línea (reemplazan emojis) ---------- */
.tiempo svg, .ico-mk svg, .ico-pin svg { width: 12px; height: 12px; vertical-align: -2px; margin-right: 3px; }
.ico-mk, .ico-pin { color: var(--text2); display: inline-flex; }
.ico-pin svg { width: 14px; height: 14px; margin: 0; }

/* Con 5 botones los nombres entran hasta en 320px; solo se achican un poco. */
@media (max-width: 359px) {
  .nav-btn { font-size: 10px; letter-spacing: -.2px; }
}

/* ---------- «Más» del celular ---------- */
.nav-mas { display: none; }
.hoja-fondo { position: fixed; inset: 0; z-index: 45; background: var(--overlay); display: flex; align-items: flex-end; animation: fade .2s ease; }
.hoja-fondo[hidden] { display: none; }
.hoja {
  width: 100%; background: var(--card); border-top: 1px solid var(--border);
  border-radius: 16px 16px 0 0; box-shadow: var(--shadow);
  padding: 8px 12px calc(12px + env(safe-area-inset-bottom));
  display: flex; flex-direction: column; gap: 2px; animation: subir .2s ease;
}
.hoja:focus { outline: none; }
@keyframes subir { from { transform: translateY(24px); opacity: 0; } }
.hoja-tirador { width: 36px; height: 4px; border-radius: 2px; background: var(--border); margin: 2px auto 8px; }
.hoja-item {
  display: flex; align-items: center; gap: 14px; min-height: 48px; padding: 0 12px;
  border-radius: 10px; font-size: 15px; font-weight: 500; color: var(--text); text-align: left;
}
.hoja-item svg { width: 20px; height: 20px; color: var(--text2); flex-shrink: 0; }
.hoja-item:hover, .hoja-item.active { background: var(--card2); }
.hoja-item.active { font-weight: 600; }
.hoja-item.active svg { color: var(--accent); }
@media (min-width: 901px) { .hoja-fondo { display: none !important; } }

/* ---------- Clima ---------- */
.cielo { width: 16px; height: 16px; flex-shrink: 0; color: var(--text2); }
.card-clima { display: flex; flex-direction: column; }
.clima-hoy { display: flex; align-items: center; gap: 12px; }
.clima-hoy .cielo { width: 40px; height: 40px; color: var(--text); }
.clima-hoy b { display: block; font-size: 30px; font-weight: 600; line-height: 1; }
.clima-hoy span { font-size: 13px; color: var(--text2); }
.clima-extra { font-size: 12.5px; margin-top: 12px; }
.clima-pie { margin-top: auto; padding-top: 12px; display: flex; justify-content: space-between; gap: 8px; font-size: 11px; color: var(--text2); }
.clima-pie a { color: var(--text2); }
.clima-dia { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; color: var(--text2); white-space: nowrap; }
.planner-clima { margin: -2px 0 6px; }
.mk-day-num { display: flex; align-items: center; justify-content: space-between; gap: 4px; }
.mk-day-num .clima-dia { font-size: 10.5px; font-weight: 500; min-width: 0; overflow: hidden; }
.mk-day-num .dia-num { flex-shrink: 0; }
.mk-day-num .cielo { width: 13px; height: 13px; }
.clima-resultados { display: flex; flex-direction: column; gap: 6px; margin: 10px 0; }
.clima-resultados:empty { display: none; }
.clima-acciones { margin-top: 12px; }
@media (max-width: 900px) {
  .mk-day-num .clima-dia { display: none; }
}

/* ---------- Objetivos en el Escritorio ---------- */
.obj-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 10px; }
.obj-list .empty { grid-column: 1 / -1; }
.obj-row { display: flex; flex-direction: column; gap: 8px; padding: 12px 14px; border-radius: 8px; background: var(--card2); text-align: left; border-left: 3px solid var(--cat); transition: background .15s; }
.obj-row:hover { background: color-mix(in srgb, var(--card2) 85%, var(--text)); }
.obj-top { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.obj-nombre { font-weight: 600; font-size: 14px; line-height: 1.3; }
.obj-top b { font-size: 14px; color: var(--text2); flex-shrink: 0; }
.obj-row .bar { height: 5px; border-radius: 5px; background: var(--border); overflow: hidden; }
.obj-row .bar i { display: block; height: 100%; background: var(--cat); }
.obj-pie { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--text2); }
.obj-row.vencido .obj-plazo { color: var(--danger); font-weight: 600; }
.obj-row.cumplido .obj-plazo { color: var(--accent); font-weight: 600; }
.btn-link { grid-column: 1 / -1; justify-self: start; font-size: 13px; font-weight: 600; color: var(--accent); padding: 4px 0; }
.btn-link:hover { text-decoration: underline; }

/* ---------- Gráficos ----------
   Reglas de la skill dataviz: columnas finas (≤24px) con punta de 4px y base recta, ejes de una línea
   fina y lisa, texto siempre en colores de texto (nunca el color de la serie), 2px de separación entre
   tramos apilados, y la columna entera (no solo la barra) como zona de hover y foco. */
.graf { display: flex; flex-direction: column; gap: 8px; min-width: 0; margin: 0; }
.graf-cab { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.graf-titulo { font-size: 13px; font-weight: 600; }
.graf-sub { font-size: 12px; color: var(--text2); }
.graf-plot { position: relative; height: 140px; padding: 20px 0 0 40px; }
.graf-cols { position: relative; height: 100%; display: flex; align-items: flex-end; gap: 2px; }
.graf-eje { position: absolute; left: 0; right: 0; height: 0; border-top: 1px solid var(--border); pointer-events: none; }
.graf-eje span { position: absolute; right: calc(100% + 6px); top: -7px; font-size: 10.5px; color: var(--text2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.graf-col { position: relative; flex: 1; min-width: 0; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; border-radius: 6px; cursor: default; }
.graf-col:hover, .graf-col:focus-visible { background: color-mix(in srgb, var(--card2) 70%, transparent); }
.graf-col:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.graf-barra, .graf-pila { width: min(24px, 64%); border-radius: 4px 4px 0 0; flex-shrink: 0; } /* sin achicarse: el número de arriba usa el espacio libre del gráfico */
.graf-val { flex-shrink: 0; }
/* En los extremos el número puede ser más ancho que la columna: se alinea hacia adentro para no salirse. */
.graf-col:first-child .graf-val, .graf-eje + .graf-col .graf-val { align-self: flex-start; }
.graf-col:last-child .graf-val { align-self: flex-end; }
.graf-barra { background: color-mix(in srgb, var(--accent) 38%, var(--card)); }
.graf-col.destacada .graf-barra { background: var(--accent); }
.graf-pila { display: flex; flex-direction: column-reverse; gap: 2px; overflow: hidden; }
.graf-pila i { display: block; min-height: 2px; flex-basis: 0; }
.graf-val { font-size: 11.5px; font-weight: 600; color: var(--text); margin-bottom: 4px; white-space: nowrap; }
.graf-x { display: flex; gap: 2px; padding-left: 40px; }
.graf-x span { flex: 1; min-width: 0; text-align: center; font-size: 11px; color: var(--text2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.graf-leyenda { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12px; color: var(--text2); }
.graf-leyenda span::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 2px; background: var(--s); margin-right: 6px; vertical-align: -1px; }
.graf-tabla summary { font-size: 12px; color: var(--text2); cursor: pointer; width: max-content; }
.graf-tabla summary:hover { color: var(--text); }
.graf-tabla table { margin-top: 8px; border-collapse: collapse; font-size: 12px; width: 100%; display: block; overflow-x: auto; }
.graf-tabla th, .graf-tabla td { padding: 4px 10px 4px 0; text-align: left; white-space: nowrap; border-bottom: 1px solid var(--border); font-variant-numeric: tabular-nums; }
.graf-tabla th { color: var(--text2); font-weight: 600; }
.graf-globo { position: fixed; z-index: 70; pointer-events: none; background: var(--card); border: 1px solid var(--border); box-shadow: var(--shadow); border-radius: 8px; padding: 8px 10px; font-size: 12px; display: flex; flex-direction: column; gap: 3px; max-width: 260px; }
.graf-globo-cabeza b { display: block; font-size: 14px; }
.graf-globo-cabeza span, .graf-globo-fila span { color: var(--text2); }
.graf-globo-fila { display: flex; align-items: center; gap: 6px; }
.graf-globo-fila i { width: 10px; height: 2px; border-radius: 1px; flex-shrink: 0; }
.graf-globo-fila b { font-weight: 600; }
.graf-par { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; }
.habits-grafico { margin-bottom: 14px; }
.habit-pct { font-size: 12px; font-weight: 500; color: var(--text2); }
.hs-grafico { margin-bottom: 14px; }
.obj-linea { width: 100%; height: 40px; overflow: visible; }
.obj-linea polyline { fill: none; stroke: var(--cat); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.obj-linea-meta { stroke: var(--border); stroke-width: 1; }
@media (max-width: 900px) {
  .graf-par { grid-template-columns: 1fr; gap: 22px; }
  .graf-x span { font-size: 10px; }
}

/* Botón de borrar que pide un segundo toque (cuando se perderían horas o historial). */
.btn-danger.armado { background: var(--danger); color: var(--on-accent); }
.clima-viejo { font-size: 11.5px; color: var(--warn); margin-top: 6px; }

/* Foto propia del hábito: cuadrada, recortada al centro. */
.ico-img { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; display: block; }
.emoji-pick button .ico-img { border-radius: 7px; }
.habit-icon { overflow: hidden; }
.dash-habit .emoji .ico-img { width: 24px; height: 24px; border-radius: 6px; }
.emoji-pick .ico-subir { border-style: dashed; color: var(--text2); }
.emoji-pick .ico-subir svg { width: 20px; height: 20px; }
.emoji-pick .ico-subir:hover { color: var(--accent); border-color: var(--accent); }

/* ---------- Perfil ---------- */
.avatar { width: 30px; height: 30px; border-radius: 50%; flex-shrink: 0; display: grid; place-items: center; overflow: hidden;
  background: var(--accent-soft); color: var(--accent); font-size: 12px; font-weight: 700; letter-spacing: .3px; }
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar svg { width: 60%; height: 60%; }
/* La foto junto al saludo del Escritorio: es el único lugar donde se ve en celular. */
.saludo { display: flex; align-items: center; gap: 14px; min-width: 0; }
.avatar-saludo { width: 52px; height: 52px; font-size: 18px; border: 1px solid var(--border); transition: border-color .15s; }
.avatar-saludo:hover { border-color: var(--accent); }
@media (max-width: 900px) { .avatar-saludo { width: 44px; height: 44px; font-size: 16px; } }
.avatar-grande { width: 88px; height: 88px; font-size: 28px; cursor: pointer; border: 1px solid var(--border); }
.avatar-grande:hover { border-color: var(--accent); }
.perfil-chip { margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 7px; text-align: left; transition: background .15s; }
.perfil-chip:hover { background: var(--card2); }
.perfil-nombre { font-size: 14px; font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tema-btn { margin-top: 2px; }
.perfil-edit { display: flex; gap: 18px; align-items: center; }
.perfil-campos { flex: 1; min-width: 0; }
.perfil-campos .field { margin-bottom: 10px; }
@media (max-width: 900px) { .perfil-chip { display: none; } }
@media (max-width: 420px) { .perfil-edit { flex-direction: column; align-items: flex-start; } }

/* ---------- Tamaño táctil: 44px en pantallas de dedo ----------
   Lo mínimo que recomiendan Apple (44) y Google (48) para tocar sin errarle. Solo con
   dedo o pantalla angosta: con mouse, botones de 44px quedan pesados sin necesidad.
   El círculo de tildar y el del cronómetro no crecen a la vista (romperían las listas):
   crece la zona que responde al toque, con un ::before transparente alrededor. */
@media (pointer: coarse), (max-width: 900px) {
  .btn, .add-task-btn { min-height: 44px; }
  .icon-btn, .cat-row .icon-btn { width: 44px; height: 44px; }
  .segmented button { min-height: 44px; }
  input:not([type="checkbox"]):not([type="radio"]):not([type="color"]):not([type="file"]), select { min-height: 44px; }
  .cat-row input[type="color"], .cat-new input[type="color"], .inline-new input[type="color"] { width: 44px; height: 44px; }
  button.check, .crono-btn { position: relative; }
  button.check::before, .crono-btn::before { content: ""; position: absolute; inset: -11px; }
  .crono-btn::before { inset: -7px; }
  /* Los 7 días de un hábito: a 44px de ancho no entran en 375px. Toque de 36×44, todo el
     lugar de cada día (30px + 6px de separación) sin pisar al de al lado. */
  .hday button { position: relative; }
  .hday button::before { content: ""; position: absolute; inset: -7px -3px; }
}

/* ---------- Ver una tarea o una acción ---------- */
.detalle h2 { margin-bottom: 14px; overflow-wrap: anywhere; }
.detalle h2.hecho { text-decoration: line-through; color: var(--text2); }
.detalle .eyebrow { margin-bottom: 4px; }
.detalle-filas { display: grid; grid-template-columns: max-content 1fr; gap: 8px 14px; margin: 0 0 16px; font-size: 14px; }
.detalle-filas dt { color: var(--text2); }
.detalle-filas dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.detalle-filas .punto { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--cat); margin-right: 6px; vertical-align: 0; }
.detalle-bloque { margin: 0 0 16px; }
.detalle-bloque h3 { font-size: 12px; font-weight: 600; color: var(--text2); text-transform: uppercase; letter-spacing: .4px; margin: 0 0 6px; }
.detalle-texto { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14px; line-height: 1.5; background: var(--card2); border: 1px solid var(--border); border-radius: 7px; padding: 10px 12px; margin: 0; }
.detalle-lista { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 4px; font-size: 14px; }
.detalle-lista li.hecho { color: var(--text2); text-decoration: line-through; }
.detalle-lista li::before { content: "○ "; color: var(--text2); }
.detalle-lista li.hecho::before { content: "✓ "; color: var(--accent); text-decoration: none; }
