/* =========================================================
   THEME TOKENS — Duolingo-style
   White paper canvas, flat "sticker" components with 2px borders.
   Green = progress / primary action. Blue = interactive / secondary.
   No shadows, no gradients, no blur.
   ========================================================= */
:root{
  --color-eager-green: #58cc02;
  --color-storybook-green: #d7ffb8;
  --color-fresh-leaf: #a5ed6e;
  --color-spark-blue: #1cb0f6;
  --color-night-ink: #000437;

  --radius-sm: 12px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 16px;

  /* Substitutes for Duolingo's custom faces: Feather -> Nunito (display),
     DIN/duolingo-sans -> Nunito Sans (body, subheadings). */
  --font-display: 'Nunito', 'Nunito Sans', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-body: 'Nunito Sans', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;

  --hm-cell: 16px;
  --hm-gap: 4px;
  --hm-radius: 5px;
  --hm-label-col: 30px;

  --sidebar-width: 248px;
  --content-max: 980px;
}

/* ---------- LIGHT (default) ---------- */
[data-theme="light"]{
  color-scheme: light;

  --bg:            #ffffff;
  --sidebar-bg:    #ffffff;
  --surface:       #ffffff;
  --surface-2:     #f7f7f7;
  --surface-hover: #f0f0f0;
  --border:        #e5e5e5;
  --border-soft:   #e5e5e5;
  --border-strong: #afafaf;

  --text:          #4b4b4b;   /* Charcoal */
  --text-muted:    #777777;   /* Pencil Gray */
  --text-faint:    #afafaf;   /* Faded Gray */

  --accent:        #58cc02;   /* Eager Green */
  --accent-strong: #4db300;
  --accent-soft:   #d7ffb8;   /* Storybook Green */
  --on-accent:     #ffffff;
  --link:          #1cb0f6;   /* Spark Blue */
  --link-soft:     #ddf4ff;
  --danger:        #ff4b4b;
  --danger-soft:   #ffdfe0;

  --level-0: #e5e5e5;
  --level-1: #d7ffb8;
  --level-2: #a5ed6e;
  --level-3: #58cc02;
  --level-4: #46a302;
  --level-5: #2f7d00;

  --tooltip-bg:    #4b4b4b;
  --tooltip-text:  #ffffff;
  --overlay:       rgba(0,0,0,0.45);
}

/* ---------- DARK ---------- */
[data-theme="dark"]{
  color-scheme: dark;

  --bg:            #131f24;
  --sidebar-bg:    #131f24;
  --surface:       #172329;
  --surface-2:     #202f36;
  --surface-hover: #2a3a42;
  --border:        #37464f;
  --border-soft:   #2a3942;
  --border-strong: #52656d;

  --text:          #e5e5e5;
  --text-muted:    #afafaf;
  --text-faint:    #777777;

  --accent:        #58cc02;
  --accent-strong: #61e002;
  --accent-soft:   rgba(88,204,2,0.16);
  --on-accent:     #ffffff;
  --link:          #1cb0f6;
  --link-soft:     rgba(28,176,246,0.16);
  --danger:        #ff6b6b;
  --danger-soft:   rgba(255,75,75,0.16);

  --level-0: #243239;
  --level-1: #2f5a1f;
  --level-2: #3f7f12;
  --level-3: #58cc02;
  --level-4: #7fe033;
  --level-5: #a5ed6e;

  --tooltip-bg:    #2a3a42;
  --tooltip-text:  #e5e5e5;
  --overlay:       rgba(0,0,0,0.6);
}

*{ box-sizing: border-box; }

body{
  margin:0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 500;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  transition: background-color .2s ease, color .2s ease;
}

::selection{ background: var(--accent-soft); color: var(--text); }
a{ color: var(--link); }
button{ font-family: inherit; }

/* =========================================================
   LAYOUT: SIDEBAR + CONTENT SHELL
   ========================================================= */
.shell{
  display: flex;
  min-height: 100vh;
}

.sidebar{
  width: var(--sidebar-width);
  flex-shrink: 0;
  background: var(--sidebar-bg);
  border-right: 2px solid var(--border);
  padding: 28px 18px;
  display: flex;
  flex-direction: column;
  gap: 28px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.brand{
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 6px;
}
.brand-mark{ font-size: 20px; }
.brand-name{
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.4;
}
.brand-name strong{
  display: block;
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 800;
  color: var(--accent);
  margin-top: 1px;
}

.side-nav{
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.side-link{
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
  background: transparent;
  border: 2px solid transparent;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.053em;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease, color .15s ease;
}
.side-icon{ font-size: 18px; width: 22px; text-align: center; }
.side-link:hover{ background: var(--surface-2); color: var(--text); }
.side-link.active{
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--text);
}

.sidebar-footer{
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.theme-toggle{
  background: var(--surface);
  border: 2px solid var(--border);
  color: var(--text);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  text-align: left;
  transition: border-color .15s ease;
}
.theme-toggle:hover{ border-color: var(--border-strong); }

.sidebar-io{ display: flex; gap: 8px; }
.sidebar-io .btn{ flex: 1; padding: 7px 6px; letter-spacing: 0.02em; }

.content{
  flex: 1;
  min-width: 0;
  padding: 36px 40px 96px;
  max-width: var(--content-max);
}

/* =========================================================
   CONTENT HEADER
   ========================================================= */
.content-header{
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.content-header h1{
  margin: 0 0 4px;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 48px;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--accent);
}

.subtitle{
  margin: 0;
  font-size: 16px;
  color: var(--text-muted);
}

/* =========================================================
   CARDS
   ========================================================= */
.card{
  background: var(--surface);
  border: 2px solid var(--border-soft);
  border-radius: var(--radius-lg);
  padding: 24px;
}

.card-label{
  margin: 0 0 16px;
  font-size: 14px;
  font-weight: 700;
  color: var(--text-muted);
}

.card-title{
  margin: 0 0 4px;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 20px;
  line-height: 1.3;
  color: var(--text);
}

.card-subtitle{
  margin: 0;
  font-size: 15px;
  color: var(--text-muted);
}

/* =========================================================
   QUICK CARDS
   ========================================================= */
.quick-cards{
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 28px;
}

.quick-card{
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px 24px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.quick-card-mission{ background: var(--accent-soft); border-color: var(--accent); }

.quick-card-text h3{
  margin: 0 0 4px;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 20px;
}
.quick-card-text p{
  margin: 0 0 14px;
  font-size: 15px;
  color: var(--text-muted);
  max-width: 30ch;
}
.quick-card-art{
  font-size: 28px;
  opacity: 0.85;
  flex-shrink: 0;
}

.btn.btn-card{
  background: var(--surface);
  color: var(--link);
  border: 2px solid var(--border-strong);
  border-radius: var(--radius-md);
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  cursor: pointer;
}
.btn.btn-card:hover{ background: var(--link-soft); border-color: var(--link); }

.progress-track{
  width: 100%;
  max-width: 320px;
  height: 16px;
  border-radius: 999px;
  background: var(--surface);
  border: 2px solid var(--border);
  overflow: hidden;
  margin-bottom: 12px;
}
.progress-fill{
  height: 100%;
  background: var(--accent);
  border-radius: 999px;
  transition: width .2s ease;
}

/* =========================================================
   BUTTONS
   ========================================================= */
.btn{
  border: 2px solid transparent;
  border-radius: var(--radius-md);
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.053em;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease, border-color .15s ease;
  white-space: nowrap;
}
.btn:active{ transform: translateY(1px); }

.btn-primary{ background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn-primary:hover{ background: var(--accent-strong); border-color: var(--accent-strong); }

.btn-ghost{
  background: transparent;
  color: var(--link);
  border: 2px solid var(--border-strong);
}
.btn-ghost:hover{ background: var(--link-soft); border-color: var(--link); }

.btn-danger{ background: var(--danger-soft); color: var(--danger); }

.btn-sm{ padding: 7px 12px; font-size: 12.5px; letter-spacing: 0.04em; }

/* =========================================================
   HEATMAP
   ========================================================= */
.heatmap-card{ margin-bottom: 20px; }

.heatmap-head{
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.heatmap-scroll{ overflow-x: auto; padding-bottom: 4px; }

.heatmap{
  display: inline-grid;
  grid-template-rows: 18px repeat(7, var(--hm-cell));
  gap: var(--hm-gap);
}

.hm-month-label{
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  align-self: end;
  white-space: nowrap;
}

.hm-day-label{
  font-size: 11px;
  color: var(--text-faint);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 6px;
}

.cell{
  width: var(--hm-cell);
  height: var(--hm-cell);
  border-radius: var(--hm-radius);
  background: var(--level-0);
  cursor: pointer;
  transition: outline-color .1s ease, transform .1s ease;
  outline: 1px solid transparent;
  outline-offset: -1px;
}
.cell:hover{ outline-color: rgba(128,128,128,0.5); transform: scale(1.08); }
.cell.empty-pad{ background: transparent; cursor: default; }
.cell.empty-pad:hover{ transform: none; }
.cell.future{ background: transparent; border: 2px dashed var(--border-soft); cursor: default; }
.cell.future:hover{ transform: none; }

.cell.level-0{ background: var(--level-0); }
.cell.level-1{ background: var(--level-1); }
.cell.level-2{ background: var(--level-2); }
.cell.level-3{ background: var(--level-3); }
.cell.level-4{ background: var(--level-4); }
.cell.level-5{ background: var(--level-5); }

.legend{
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: var(--text-faint);
  flex-shrink: 0;
}
.legend .cell{ width: 13px; height: 13px; cursor: default; }
.legend .cell:hover{ outline-color: transparent; transform: none; }

/* =========================================================
   HISTORY CHART
   ========================================================= */
.history-card{ margin-bottom: 32px; }

.history-chart-wrap{ width: 100%; }
.history-chart-wrap svg{ width: 100%; height: auto; display: block; overflow: visible; }

.hc-grid-line{ stroke: var(--border); stroke-width: 1; stroke-dasharray: 3 4; }
.hc-axis-label{ fill: var(--text-faint); font-family: var(--font-body); font-size: 11px; }
.hc-area{ fill: var(--accent-soft); }
.hc-line{
  fill: none;
  stroke: var(--accent);
  stroke-width: 3.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* =========================================================
   TAB PANELS
   ========================================================= */
.tab-panel{ display: none; }
.tab-panel.active{ display: block; }

#panel-month > .card, #panel-year > .card, #panel-vocab > .card{ margin-bottom: 20px; }
.card .stat-grid{ margin-bottom: 0; }

/* =========================================================
   PERIOD NAV
   ========================================================= */
.period-nav{
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  margin-bottom: 20px;
}
.period-nav h2{
  margin: 0;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 32px;
  line-height: 1.2;
  color: var(--text);
  min-width: 240px;
  text-align: center;
}
.nav-btn{
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 2px solid var(--border-strong);
  background: var(--surface);
  color: var(--text-muted);
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color .15s ease, color .15s ease;
}
.nav-btn:hover{ color: var(--link); border-color: var(--link); background: var(--link-soft); }

/* =========================================================
   STATS
   ========================================================= */
.stat-grid{
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}
.stat-grid-3{ grid-template-columns: repeat(3, 1fr); }

.stat-box{
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.stat-value{
  font-family: var(--font-body);
  font-size: 28px;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
  color: var(--text);
}
.stat-name{ font-size: 13px; font-weight: 700; color: var(--text-muted); }

/* =========================================================
   BAR CHART
   ========================================================= */
.bar-chart{ display: flex; flex-direction: column; margin-bottom: 8px; }

.bars-row{
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 140px;
  border-bottom: 1px solid var(--border-soft);
  padding-bottom: 2px;
}
.labels-row{ display: flex; gap: 3px; margin-top: 6px; }

.bar-col{
  flex: 1;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  height: 100%;
  min-width: 0;
}
.bar{
  width: 100%;
  max-width: 18px;
  background: var(--level-2);
  border-radius: 6px 6px 0 0;
  min-height: 2px;
  transition: background .15s ease;
}
.bar-col:hover .bar{ background: var(--level-3); }
.bar-col.is-today .bar{ background: var(--level-3); }

.label-col{
  flex: 1;
  min-width: 0;
  text-align: center;
  font-size: 9.5px;
  color: var(--text-faint);
}

.bar-chart-year .bars-row{ height: 160px; }
.bar-chart-year .bar{ max-width: 28px; }
.bar-chart-year .label-col{ font-size: 11px; }

/* =========================================================
   TYPE BREAKDOWN
   ========================================================= */
.type-list{ display: flex; flex-direction: column; gap: 10px; }
.type-row{ display: flex; align-items: center; gap: 12px; font-size: 14px; font-weight: 700; }
.type-row .type-name{ width: 140px; color: var(--text-muted); flex-shrink: 0; }
.type-row .type-bar-track{
  flex: 1;
  height: 12px;
  background: var(--surface-2);
  border-radius: 999px;
  overflow: hidden;
}
.type-row .type-bar-fill{ display: block; height: 100%; background: var(--accent); border-radius: 999px; }
.type-row .type-value{ width: 90px; white-space: nowrap; text-align: right; color: var(--text-faint); flex-shrink: 0; }
.empty-note{ color: var(--text-faint); font-size: 13px; margin: 0; }

/* =========================================================
   MONTH TABLE (year view)
   ========================================================= */
.month-table{ display: flex; flex-direction: column; }
.month-row{
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 4px;
  border-bottom: 1px solid var(--border-soft);
  font-size: 13.5px;
}
.month-row:last-child{ border-bottom: none; }
.month-row .m-name{ color: var(--text-muted); }
.month-row .m-value{ color: var(--text); font-weight: 500; }
.month-row.is-current .m-name{ color: var(--accent); font-weight: 800; }

/* =========================================================
   MODALS
   ========================================================= */
.modal-overlay{
  position: fixed;
  inset: 0;
  background: var(--overlay);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 100;
}
.modal-overlay.open{ display: flex; }

.modal{
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  width: 100%;
  max-width: 420px;
  max-height: 88vh;
  overflow-y: auto;
}

.modal-head{
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}
.modal-head h3{
  margin: 0;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 22px;
  color: var(--text);
}
.modal-close{
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  padding: 4px;
}
.modal-close:hover{ color: var(--text); }

.field{ display: block; margin-bottom: 14px; }
.field span{ display: block; font-size: 12.5px; color: var(--text-muted); margin-bottom: 6px; }
.field span em{ color: var(--text-faint); font-style: normal; }

.field input, .field select{
  width: 100%;
  background: var(--surface-2);
  border: 2px solid var(--border);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 9px 10px;
  font-size: 14px;
  font-family: inherit;
}
.field input:focus, .field select:focus{ outline: none; border-color: var(--link); background: var(--surface); }

.field-row{ display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field-row-3{ grid-template-columns: 1fr 1fr 1fr; }

.field-error{ color: var(--danger); font-size: 12.5px; margin: -6px 0 10px; min-height: 1em; }

.modal-actions{ display: flex; justify-content: flex-end; gap: 10px; margin-top: 8px; }

/* day modal */
.day-total{
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 32px;
  line-height: 1.2;
  margin: 0 0 16px;
}
.day-entries{ display: flex; flex-direction: column; gap: 8px; margin-bottom: 18px; }
.day-entry{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
}
.day-entry-info{ min-width: 0; }
.day-entry-type{ font-size: 13.5px; font-weight: 500; color: var(--text); }
.day-entry-note{ font-size: 12px; color: var(--text-faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.day-entry-time{ font-size: 13px; color: var(--text-muted); white-space: nowrap; }
.day-entry-actions{ display: flex; gap: 6px; flex-shrink: 0; }
.icon-btn{
  background: none;
  border: none;
  color: var(--text-faint);
  cursor: pointer;
  font-size: 13px;
  padding: 4px 6px;
  border-radius: 4px;
}
.icon-btn:hover{ color: var(--text); background: var(--surface-hover); }
.icon-btn.danger:hover{ color: var(--danger); }

/* =========================================================
   TOOLTIP
   ========================================================= */
.tooltip{
  position: fixed;
  pointer-events: none;
  background: var(--tooltip-bg);
  border: 2px solid var(--tooltip-bg);
  color: var(--tooltip-text);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  line-height: 1.4;
  z-index: 200;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity .1s ease, transform .1s ease;
  max-width: 200px;
}
.tooltip.visible{ opacity: 1; transform: translateY(0); }
.tooltip strong{ display: block; margin-bottom: 2px; font-weight: 800; }
.tooltip span{ color: var(--tooltip-text); opacity: 0.8; }

/* =========================================================
   MISSION CARD (daily goal, turned into an action)
   ========================================================= */
.quick-card-text-full{ width: 100%; }

.mission-count{
  margin: 0 0 10px;
  font-size: 12.5px;
  color: var(--text-muted);
  font-weight: 500;
}

.mission-suggestion{
  margin: 0 0 14px;
  font-size: 12.5px;
  color: var(--text-muted);
}

/* =========================================================
   NOVIDADES (channel news)
   ========================================================= */
.quick-card-news{ display: block; }

.news-head{
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.news-head h3{ margin: 0; }

.news-list{
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 14px;
  max-height: 150px;
  overflow-y: auto;
}

.news-item{
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  font-size: 12.5px;
  padding: 6px 0;
  border-bottom: 1px solid var(--border-soft);
}
.news-item:last-child{ border-bottom: none; }
.news-item-main{ min-width: 0; }
.news-item-channel{ font-weight: 600; color: var(--text); }
.news-item-title{
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 26ch;
}
.news-item-meta{ font-size: 11px; color: var(--text-faint); }
.news-badge{
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 800;
  padding: 1px 8px;
  border: 2px solid currentColor;
  border-radius: 12px;
  white-space: nowrap;
  background: transparent;
}
.news-badge-new{ color: var(--link); }
.news-badge-ok{ color: var(--text-muted); border-color: var(--border-strong); }
.news-badge-error{ color: var(--danger); }

/* =========================================================
   WATCH CARD (para assistir / recomendado)
   ========================================================= */
.watch-card{ margin-bottom: 20px; }

.watch-card-actions{
  display: flex;
  gap: 8px;
  flex-shrink: 0;
  flex-wrap: wrap;
}

.btn-dice{ font-weight: 600; }

.watch-list{ display: flex; flex-direction: column; gap: 14px; }
.watch-list-modal{ max-height: 340px; overflow-y: auto; padding-right: 4px; }

.watch-item{
  display: flex;
  gap: 14px;
  padding: 12px;
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  align-items: flex-start;
}

.watch-thumb{
  width: 96px;
  height: 96px;
  border-radius: var(--radius-sm);
  background: var(--surface-hover);
  background-size: cover;
  background-position: center;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  color: var(--text-faint);
}

.watch-info{ min-width: 0; flex: 1; }
.watch-title{
  font-size: 14px;
  font-weight: 600;
  margin: 0 0 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.watch-channel{ font-size: 12.5px; color: var(--text-muted); margin: 0 0 6px; }
.watch-meta{
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 12px;
  color: var(--text-faint);
  margin-bottom: 10px;
}
.watch-meta span{ white-space: nowrap; }
.watch-actions{ display: flex; gap: 8px; flex-wrap: wrap; }
.watch-actions .btn{ padding: 7px 12px; font-size: 12.5px; }
.watch-item.is-watched{ opacity: 0.55; }
.watch-item-remove{ margin-left: auto; flex-shrink: 0; }

/* =========================================================
   CHOOSE FOR ME MODAL
   ========================================================= */
.choose-card{
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px;
  margin-bottom: 4px;
}
.choose-title{ font-size: 16px; font-weight: 700; margin: 0 0 10px; }
.choose-meta{ font-size: 13px; color: var(--text-muted); margin: 0 0 4px; }

/* =========================================================
   CHANNELS / WATCHLIST MODAL EXTRAS
   ========================================================= */
.modal-wide{ max-width: 560px; }
.modal-hint{ font-size: 12.5px; color: var(--text-muted); margin: 0 0 14px; }
.modal-hint code{
  background: var(--surface-2);
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 11.5px;
}

.inline-form{
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.inline-form input{
  flex: 1;
  min-width: 140px;
  background: var(--surface-2);
  border: 2px solid var(--border);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 9px 10px;
  font-size: 13.5px;
  font-family: inherit;
}
.inline-form input:focus{ outline: none; border-color: var(--link); }

.watchlist-form{ border-bottom: 1px solid var(--border-soft); padding-bottom: 16px; margin-bottom: 4px; }

.field-checkbox{ display: flex; flex-direction: column; justify-content: flex-end; }
.field-checkbox input{ width: 18px; height: 18px; accent-color: var(--accent); }

.channel-list{ display: flex; flex-direction: column; gap: 8px; max-height: 300px; overflow-y: auto; }
.channel-row{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
}
.channel-row-main{ min-width: 0; }
.channel-row-name{ font-weight: 600; font-size: 13.5px; }
.channel-row-status{ font-size: 11.5px; color: var(--text-faint); }
.channel-row-actions{ display: flex; gap: 6px; flex-shrink: 0; }

/* =========================================================
   WORDS
   ========================================================= */
.card-label-row{
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}
.card-label-row .card-label{ margin: 0; }
.mini-stat{ font-size: 12.5px; color: var(--text-muted); }
.word-actions{ display: flex; gap: 8px; }

.word-list{ display: flex; flex-wrap: wrap; gap: 8px; }
.word-chip{
  background: var(--surface-2);
  border: 2px solid var(--border-soft);
  border-radius: 12px;
  padding: 7px 12px;
  font-size: 12.5px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.word-chip strong{ font-weight: 800; }
.word-chip-remove{
  background: none;
  border: none;
  color: var(--text-faint);
  cursor: pointer;
  font-size: 13px;
  line-height: 1;
  padding: 0;
}
.word-chip-remove:hover{ color: var(--danger); }

/* =========================================================
   MILESTONES
   ========================================================= */
.milestone-list{ display: flex; flex-direction: column; gap: 8px; }
.milestone-row{
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13.5px;
  padding: 4px 0;
}
.milestone-mark{
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  flex-shrink: 0;
}
.milestone-row.unlocked .milestone-mark{ background: var(--accent); color: var(--on-accent); }
.milestone-row.unlocked .milestone-label{ color: var(--text); }
.milestone-row:not(.unlocked) .milestone-mark{ border: 2px solid var(--border); color: transparent; }
.milestone-row:not(.unlocked) .milestone-label{ color: var(--text-faint); }

/* =========================================================
   MONTH DETAILED ENTRY LIST
   ========================================================= */
.entry-list{ display: flex; flex-direction: column; gap: 6px; max-height: 320px; overflow-y: auto; }
.entry-row{
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border-soft);
}
.entry-row:last-child{ border-bottom: none; }
.entry-row-date{ color: var(--text-faint); width: 42px; flex-shrink: 0; }
.entry-row-type{ color: var(--text-muted); width: 110px; flex-shrink: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.entry-row-note{ flex: 1; min-width: 0; color: var(--text-faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.entry-row-time{ color: var(--text); font-weight: 500; flex-shrink: 0; }

/* =========================================================
   TEXTAREA (analysis modal)
   ========================================================= */
.field textarea{
  width: 100%;
  background: var(--surface-2);
  border: 2px solid var(--border);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 9px 10px;
  font-size: 13.5px;
  font-family: inherit;
  resize: vertical;
  line-height: 1.5;
}
.field textarea:focus{ outline: none; border-color: var(--link); background: var(--surface); }

/* =========================================================
   LEARN CARD (🧠 aprenda com o que você assistiu)
   ========================================================= */
.learn-card{ margin-bottom: 20px; }
.learn-card .card-title{ margin-bottom: 8px; }

/* =========================================================
   ENTRY ROW ANALYSIS BADGE
   ========================================================= */
.entry-row-badge{
  font-size: 11px;
  font-weight: 600;
  color: var(--text-faint);
  background: var(--surface-hover);
  padding: 2px 8px;
  border-radius: 12px;
  flex-shrink: 0;
}
.entry-analyze{
  font-size: 11.5px;
  font-weight: 600;
  color: var(--link);
  flex-shrink: 0;
  white-space: nowrap;
}
.entry-analyze:hover{ background: var(--link-soft); }

/* =========================================================
   FILTER CHIPS (vocabulário)
   ========================================================= */
.filter-chips{
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 18px;
}
.filter-chip{
  background: var(--surface);
  border: 2px solid var(--border);
  color: var(--text-muted);
  border-radius: 12px;
  padding: 6px 13px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
.filter-chip:hover{ color: var(--text); border-color: var(--border-strong); }
.filter-chip.active{ background: var(--accent-soft); color: var(--text); border-color: var(--accent); }

/* =========================================================
   VOCAB LIST
   ========================================================= */
.vocab-list{ display: flex; flex-direction: column; gap: 10px; }
.vocab-row{
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 14px;
}
.vocab-select{ margin-top: 4px; width: 16px; height: 16px; accent-color: var(--accent); flex-shrink: 0; }
.vocab-main{ flex: 1; min-width: 0; }
.vocab-word-line{
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 14.5px;
  margin-bottom: 4px;
}
.vocab-base{ font-size: 11.5px; color: var(--text-faint); display: flex; align-items: center; gap: 4px; }
.vocab-base-input{
  background: var(--surface);
  border: 2px solid var(--border);
  color: var(--text);
  border-radius: 4px;
  padding: 2px 6px;
  font-size: 11.5px;
  width: 90px;
}
.vocab-meaning{ font-size: 13px; color: var(--text-muted); margin-bottom: 4px; }
.vocab-meaning em{ color: var(--text-faint); font-style: normal; }
.vocab-sentence{ font-size: 12.5px; color: var(--text-faint); margin-bottom: 6px; }
.vocab-source{ color: var(--text-faint); }
.vocab-meta{ display: flex; gap: 12px; font-size: 11.5px; color: var(--text-faint); }
.vocab-status{
  background: var(--surface);
  border: 2px solid var(--border);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 6px 8px;
  font-size: 12px;
  flex-shrink: 0;
}

/* =========================================================
   SUGGESTED WORDS MODAL
   ========================================================= */
#suggestList{ display: flex; flex-direction: column; gap: 16px; max-height: 400px; overflow-y: auto; margin-bottom: 8px; }
.suggest-row{
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px;
}
.suggest-check{
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  font-size: 14px;
  cursor: pointer;
}
.suggest-include{ width: 16px; height: 16px; accent-color: var(--accent); }

/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (max-width: 880px){
  .shell{ flex-direction: column; }
  .sidebar{
    width: 100%;
    height: auto;
    position: static;
    flex-direction: row;
    align-items: center;
    padding: 14px 16px;
    gap: 16px;
    overflow-x: auto;
  }
  .brand{ padding: 0; }
  .brand-name{ display: none; }
  .side-nav{ flex-direction: row; }
  .side-link{ white-space: nowrap; }
  .sidebar-footer{ margin-top: 0; flex-direction: row; margin-left: auto; }
  .sidebar-io{ display: none; }
  .content{ padding: 24px 16px 80px; max-width: 100%; }
}

@media (max-width: 720px){
  .stat-grid{ grid-template-columns: repeat(2, 1fr); }
  .stat-grid-3{ grid-template-columns: repeat(2, 1fr); }
  .quick-cards{ grid-template-columns: 1fr; }
  .content-header h1{ font-family: var(--font-body); font-weight: 800; font-size: 32px; }
}

@media (max-width: 480px){
  .content-header{ align-items: flex-start; }
  .btn-primary{ width: 100%; text-align: center; }
  .period-nav h2{ min-width: 0; font-size: 18px; }
  .watch-item{ flex-direction: column; }
  .watch-thumb{ width: 100%; height: 160px; }
  .watch-card-actions{ width: 100%; }
  .watch-card-actions .btn{ flex: 1; }
  .entry-row{ flex-wrap: wrap; }
  .entry-row-note{ order: 3; width: 100%; }
  .vocab-row{ flex-wrap: wrap; }
  .vocab-status{ width: 100%; }
}

@media (prefers-reduced-motion: reduce){
  *{ transition: none !important; }
}
