:root {
  color-scheme: dark;
  --navy: #0e1525;
  --cyan: #0c738d;
  --ink: #0e1525;
  --muted: #5b6879;
  --line: #d6dce6;
  --canvas: #f2f4f7;
  --green: #16a34a;
  --amber: #f59e0b;
  --red: #c22525;
  --blue: #1d4ed8;
  --white: #fafafa;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--white);
  font-family: "Segoe UI", Inter, ui-sans-serif, system-ui, sans-serif;
  background:
    radial-gradient(ellipse at 18% 12%, rgba(12, 115, 141, 0.5), transparent 42%),
    radial-gradient(ellipse at 82% 88%, rgba(12, 115, 141, 0.28), transparent 40%),
    var(--navy);
}

body.in-app {
  color-scheme: light;
  color: var(--ink);
  background: var(--canvas);
}

button, input, select { font: inherit; }
button { cursor: pointer; }
h1, h2, p { margin: 0; }

.landing {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.glass {
  width: min(420px, 100%);
  padding: 40px 32px 30px;
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 1px 2px rgba(8, 12, 24, 0.2), 0 24px 60px rgba(8, 12, 24, 0.4);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.logo {
  display: block;
  width: min(320px, 100%);
  height: auto;
  margin: 0 auto 18px;
}

.kicker, .eyebrow {
  color: rgba(255, 255, 255, 0.72);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.glass h1 {
  margin: 8px 0 6px;
  font-size: 28px;
}

.lead, .form-message, .hint, .muted {
  color: rgba(255, 255, 255, 0.78);
  line-height: 1.45;
}

.glass label, .app label {
  display: grid;
  gap: 6px;
  margin-top: 14px;
  font-size: 13px;
  font-weight: 650;
}

.glass input {
  height: 46px;
  padding: 0 16px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.4);
  background: rgba(8, 12, 24, 0.45);
  color: white;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.glass input:focus {
  outline: none;
  border-color: #38bdf8;
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.28);
}

.password-field { position: relative; display: block; }
.password-field input { width: 100%; padding-right: 92px; }
.password-toggle {
  position: absolute;
  top: 50%;
  right: 6px;
  transform: translateY(-50%);
  height: 32px;
  padding: 0 14px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: rgba(255, 255, 255, 0.82);
  font-size: 12px;
  font-weight: 700;
}
.password-toggle:hover { background: rgba(255, 255, 255, 0.12); }
.password-toggle:focus-visible { outline: 2px solid #38bdf8; }

.enter, .solid {
  border: 0;
  border-radius: 8px;
  background: #18181b;
  color: var(--white);
  font-weight: 700;
}

.enter {
  width: 100%;
  height: 46px;
  margin-top: 18px;
  border-radius: 999px;
  background: var(--cyan);
  font-weight: 600;
  transition: background 0.15s, opacity 0.15s, transform 0.1s;
}
.enter:hover:not(:disabled) { background: #0a8aa8; }
.enter:active:not(:disabled) { transform: scale(0.98); }
.enter:focus-visible { outline: 3px solid rgba(56, 189, 248, 0.5); outline-offset: 2px; }
.enter:disabled { opacity: 0.65; cursor: progress; }

.form-message {
  min-height: 20px;
  margin-top: 12px;
  font-size: 13px;
  font-weight: 650;
}
.form-message[data-tone="error"] {
  padding: 10px 14px;
  border-radius: 14px;
  background: rgba(194, 37, 37, 0.22);
  border: 1px solid rgba(248, 113, 113, 0.55);
  color: #fecaca;
}
.form-message[data-tone="info"] { color: rgba(255, 255, 255, 0.85); }

.text-button, .ghost {
  border: 1px solid var(--line);
  background: transparent;
  color: inherit;
  border-radius: 8px;
}

.text-button {
  width: 100%;
  margin-top: 8px;
  height: 44px;
  border-radius: 999px;
  font-weight: 600;
  border-color: rgba(255, 255, 255, 0.35);
  color: white;
}

.app { padding: 24px; }
body.in-app .eyebrow { color: var(--muted); }

.topbar, .toolbar, .panel-head, .button-row, .offset-row {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
}

.topbar { margin-bottom: 18px; }
.topbar h1 { font-size: 28px; }
.topbar-actions, .toolbar, .button-row, .offset-row { flex-wrap: wrap; }

.user-chip, .pill {
  border-radius: 999px;
  padding: 6px 10px;
  background: white;
  border: 1px solid var(--line);
  font-size: 13px;
}

.pill.warn { color: #92400e; }
.pill.ok { color: var(--green); }

.toolbar, .metrics, .tabs, .panel { margin-top: 14px; }
.toolbar { align-items: flex-end; }
.toolbar label { margin: 0; color: var(--muted); font-weight: 650; }
.toolbar label.check {
  display: flex;
  flex-direction: row;
  align-items: center;
  align-self: center;
  gap: 8px;
  margin: 0;
  white-space: nowrap;
}
.grow { flex: 1; min-width: 220px; }

.app input, .app select {
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 10px;
  background: white;
  color: var(--ink);
}

.ghost, .solid, .segment, .tab, .offset-row button {
  height: 40px;
  padding: 0 14px;
}

.solid { border: 0; }

.segmented, .tabs { display: flex; flex-wrap: wrap; gap: 6px; }
.segment, .tab, .offset-row button {
  border: 1px solid var(--line);
  background: white;
  color: var(--ink);
  border-radius: 8px;
}
.segment.active, .tab.active, .offset-row button.active {
  background: var(--navy);
  color: white;
  border-color: var(--navy);
}

.metrics {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
}

.metrics article,
.metrics .metric {
  background: white;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  border-top: 3px solid var(--cyan);
  text-align: left;
}

.metrics .metric { height: auto; color: inherit; }
.metrics .metric.active { box-shadow: inset 0 0 0 2px var(--navy); }

.metrics article:nth-child(1) { border-top-color: var(--blue); }
.metrics article:nth-child(2) { border-top-color: var(--cyan); }
.metrics article:nth-child(3) { border-top-color: var(--green); }
.metrics article:nth-child(4) { border-top-color: var(--red); }
.metrics article:nth-child(5) { border-top-color: var(--amber); }
.metrics article:nth-child(6) { border-top-color: #64748b; }
.day-label { align-self: center; color: var(--muted); font-weight: 700; text-transform: capitalize; }
.slot.good { color: #166534; }
.print-table .muted, .slot.muted { color: var(--muted); font-weight: 650; }

.day-nav { display: flex; gap: 8px; align-items: flex-end; }
body.tab-resumo .period-only { display: none !important; }
body:not(.tab-resumo) .day-nav,
body:not(.tab-resumo) #dayMetrics,
body:not(.tab-resumo) #dayAttention,
body.tab-definicoes .period-only { display: none !important; }
.more-menu { position: relative; }
.more-menu summary {
  list-style: none;
  height: 40px;
  padding: 0 12px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  font-weight: 700;
}
.more-menu summary::-webkit-details-marker { display: none; }
.more-menu > div {
  position: absolute;
  right: 0;
  z-index: 5;
  display: grid;
  gap: 8px;
  min-width: 190px;
  margin-top: 6px;
  padding: 12px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 12px 30px rgba(14, 21, 37, 0.12);
}
.more-menu .check { margin: 0; }
#settingsButton.active { background: var(--navy); color: white; }
.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 20;
  margin: 0;
  padding: 12px 14px;
  border-radius: 10px;
  background: var(--navy);
  color: white;
  font-weight: 700;
}
.skeleton td span {
  display: block;
  height: 12px;
  border-radius: 6px;
  background: linear-gradient(90deg, #e8edf3, #f8fafc, #e8edf3);
  background-size: 200% 100%;
  animation: shimmer 1.1s linear infinite;
}
@keyframes shimmer {
  from { background-position: 100% 0; }
  to { background-position: -100% 0; }
}

.sort {
  border: 0;
  background: transparent;
  color: inherit;
  padding: 0;
  height: auto;
  font-weight: 700;
}
.sort.active::after { content: attr(data-dir); margin-left: 4px; text-transform: lowercase; }
.sort[data-dir="asc"]::after { content: " â†‘"; }
.sort[data-dir="desc"]::after { content: " â†“"; }

.name-link { color: var(--cyan); font-weight: 700; text-decoration: none; }
.name-link:hover { text-decoration: underline; }
.slot.assumed, .slot.na { color: var(--muted); font-weight: 600; }
.exceptions { list-style: none; padding: 0; margin: 12px 0 0; display: grid; gap: 8px; }
.exceptions li { display: flex; justify-content: space-between; gap: 8px; align-items: center; font-size: 13px; }
body.schedule-continuous #morningOutField,
body.schedule-continuous #afternoonInField { display: none; }
.ongoing { color: var(--cyan); font-size: 11px; font-weight: 700; }

.charts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 14px;
}
.charts .panel { min-height: 280px; }
.charts canvas { width: 100%; height: 220px; }
.chart-wide { grid-column: 1 / -1; }
.history-who { flex: 1; }

.metrics span { display: block; color: var(--muted); font-size: 12px; font-weight: 700; }
.metrics strong { display: block; margin-top: 4px; font-size: 28px; font-variant-numeric: tabular-nums; letter-spacing: -0.03em; }

.panel {
  background: white;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px;
}

.panel-head { margin-bottom: 10px; }
.panel-head span, .hint, .app .muted { color: var(--muted); font-size: 13px; }

.table-wrap { overflow: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 9px 8px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
th { color: var(--muted); font-size: 12px; font-weight: 700; }
.empty { color: var(--muted); text-align: center; }
.slot { font-variant-numeric: tabular-nums; font-weight: 700; }
.slot.late, .slot.mid { color: #b45309; }
#resumoColumns [data-absence] { color: #b45309; }
.slot.missing { color: var(--red); }
.slot.wait { color: #c5ced8; }
.status {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 12px;
  font-weight: 700;
}
.status.inside { background: #e7f4f7; color: var(--cyan); }
.status.out { background: #ecfdf3; color: #166534; }
.status.lunch { background: var(--canvas); color: var(--muted); }
.status.absent { background: #fef2f2; color: var(--red); }
.status.late { background: #fff7ed; color: #b45309; }
.status.wait { background: #eef2ff; color: #3730a3; }
.status.justified { background: #eff6ff; color: var(--blue); }
.manual-mark { margin-left: 4px; color: var(--blue); font-size: 11px; font-weight: 800; cursor: help; }
.drawer {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  justify-content: end;
  background: rgba(14, 21, 37, 0.35);
}
.drawer-card {
  width: min(440px, 100%);
  height: 100%;
  overflow: auto;
  padding: 20px;
  background: white;
}
.drawer-card h3 { margin: 18px 0 8px; font-size: 15px; }
.plain-list { margin: 8px 0 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.plain-list li { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.treat { margin-left: 6px; height: 28px; padding: 0 8px; }
.status + .status { margin-left: 4px; }

.banner {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  background: #fff7ed;
  color: #9a3412;
}

.clock { margin: 8px 0; font-size: 40px; letter-spacing: 0.04em; color: var(--cyan); }
.settings-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.time-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.weekdays { border: 1px solid var(--line); border-radius: 8px; display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.weekdays label, .check { display: flex; gap: 8px; align-items: center; margin: 0; font-weight: 600; }
.check { margin-top: 12px; }
.toolbar .check { margin-top: 0; white-space: nowrap; }
.button-row { margin-top: 14px; justify-content: flex-start; }

.history-metrics { grid-template-columns: repeat(4, minmax(0, 1fr)); }
button.kpi {
  display: block;
  width: 100%;
  height: auto;
  padding: 12px 14px;
  font: inherit;
  color: inherit;
  text-align: left;
  cursor: pointer;
}
.history-metrics .kpi[data-tone="good"] { border-top-color: var(--green); }
.history-metrics .kpi[data-tone="bad"] { border-top-color: var(--red); }
.history-metrics .kpi[data-tone="warn"] { border-top-color: var(--amber); }
.history-metrics .kpi[data-tone="neutral"] { border-top-color: #94a3b8; }
.history-metrics .kpi.active { box-shadow: inset 0 0 0 2px var(--navy); }
.history-metrics .kpi strong.good { color: #166534; }
.history-metrics .kpi strong.bad { color: var(--red); }
.kpi-sub { display: block; margin-top: 6px; color: var(--muted); font-size: 12px; font-weight: 650; line-height: 1.35; }
.kpi-bar { display: block; height: 4px; margin-top: 8px; overflow: hidden; border-radius: 999px; background: var(--canvas); }
.kpi-bar i { display: block; height: 100%; width: 0; background: var(--cyan); }
.cal.dim { opacity: 0.28; }
.filter-chip { display: flex; align-items: center; gap: 8px; margin: 0; color: var(--ink); font-size: 13px; font-weight: 650; }
.filter-chip .ghost { height: 32px; }

@media (max-width: 900px) {
  .metrics:not(.history-metrics) { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .settings-grid { grid-template-columns: 1fr; }
  .app { padding: 16px; }
}

@media (max-width: 640px) {
  .metrics, .history-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .topbar, .toolbar, .panel-head { align-items: stretch; flex-wrap: wrap; }
  .topbar-actions, .day-nav, .segmented { width: 100%; }
  .tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 4px;
  }
  .tab { flex: 0 0 auto; }
  .charts { grid-template-columns: 1fr; }
  .card-table thead { display: none; }
  .card-table, .card-table tbody { display: block; }
  .card-table tr {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px 10px;
    margin-bottom: 10px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: white;
  }
  .card-table td {
    display: block;
    min-width: 0;
    padding: 0;
    border: 0;
    white-space: normal;
  }
  .card-table td::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 2px;
    color: var(--muted);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
  }
  .card-table td[data-label="NÂº"] { order: 1; }
  .card-table td[data-label="FuncionÃ¡rio"],
  .card-table td[data-label="Data"] {
    order: 1;
    grid-column: 2 / 4;
    font-size: 16px;
  }
  .card-table td[data-label="Estado"] {
    order: 1;
    text-align: right;
  }
  .card-table td[data-label="HorÃ¡rio"] { order: 2; grid-column: 1 / -1; }
  .card-table td[data-label="Entrada"],
  .card-table td[data-label="SaÃ­da almoÃ§o"],
  .card-table td[data-label="Entrada tarde"],
  .card-table td[data-label="SaÃ­da"] { order: 3; }
  .card-table td[data-label="Horas"],
  .card-table td[data-label="Previsto"] { order: 4; }
  .card-table td[data-label="Saldo"] { order: 4; grid-column: 3 / -1; }
  .card-table td[data-label="FuncionÃ¡rio"]::before,
  .card-table td[data-label="Data"]::before,
  .card-table td[data-label="Estado"]::before { display: none; }
}

.map-controls { gap: 10px; }
.map-controls label { margin: 0; color: var(--muted); font-weight: 650; }
.map-controls .grow { min-width: 200px; }

.month-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
}
.month h3 { margin: 0 0 8px; font-size: 14px; text-transform: capitalize; }
.month-week, .month-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 3px;
}
.month-week span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  text-align: center;
}
.cal {
  aspect-ratio: 1;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: white;
  color: var(--ink);
  font-size: 11px;
  font-weight: 700;
  padding: 0;
  height: auto;
}
.cal.blank { visibility: hidden; }
.cal.ok { background: #dcfce7; border-color: #86efac; color: #166534; }
.cal.late { background: #fef3c7; border-color: #fcd34d; color: #92400e; }
.cal.bad { background: #fee2e2; border-color: #fca5a5; color: #991b1b; }
.cal.just { background: #dbeafe; border-color: #93c5fd; color: #1e40af; }
.cal.off { background: var(--canvas); color: var(--muted); }
.calendar-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 12px;
}
.calendar-legend span { display: inline-flex; align-items: center; gap: 6px; }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.dot.ok { background: #22c55e; }
.dot.late { background: #f59e0b; }
.dot.bad { background: #ef4444; }
.dot.just { background: #3b82f6; }
.dot.off { background: #cbd5e1; }

#printView { padding: 8px 0; }
.print-bar { margin-bottom: 14px; }
.print-page {
  background: white;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 18px;
}
.print-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  border-bottom: 2px solid var(--navy);
  padding-bottom: 10px;
  margin-bottom: 10px;
}
.print-head h2 { margin: 4px 0 0; font-size: 20px; }
.print-head img { width: 120px; }
.print-who { margin: 6px 0 12px; font-size: 15px; }
.print-table th, .print-table td { padding: 6px; font-size: 12px; }
.print-table tfoot td { font-weight: 700; border-top: 2px solid var(--navy); }
.print-sign {
  display: flex;
  justify-content: space-between;
  gap: 40px;
  margin-top: 48px;
}
.print-sign span {
  flex: 1;
  border-top: 1px solid var(--ink);
  padding-top: 6px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

@media print {
  body { background: white !important; }
  body.in-app { background: white !important; }
  .topbar, .banner, .toast, #boardView, #historyView, .print-bar, .drawer { display: none !important; }
  .app { padding: 0; }
  #printView { padding: 0; }
  #printView[hidden] { display: none !important; }
  .print-page {
    border: 0;
    border-radius: 0;
    margin: 0;
    padding: 0 0 24px;
    page-break-after: always;
    break-after: page;
  }
  .print-page:last-child { page-break-after: auto; break-after: auto; }
}

/* ---------- Painel: cartÃµes compactos e formas arredondadas ---------- */
body.in-app { background: #f5f5f7; }

.day-metrics { gap: 10px; }
.day-metrics .metric {
  --tone: var(--blue);
  display: grid;
  align-content: start;
  gap: 1px;
  padding: 11px 16px 10px;
  border: 1px solid rgba(14, 21, 37, 0.06);
  border-radius: 20px;
  box-shadow: 0 1px 2px rgba(14, 21, 37, 0.04), 0 6px 18px rgba(14, 21, 37, 0.04);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.day-metrics .metric:hover { transform: translateY(-1px); box-shadow: 0 8px 24px rgba(14, 21, 37, 0.1); }
.day-metrics .metric.active { box-shadow: 0 0 0 2px var(--navy), 0 8px 24px rgba(14, 21, 37, 0.1); }
.day-metrics .metric[data-tone="blue"] { --tone: var(--blue); }
.day-metrics .metric[data-tone="red"] { --tone: var(--red); }
.day-metrics .metric[data-tone="amber"] { --tone: var(--amber); }
.day-metrics .metric[data-tone="orange"] { --tone: #ea580c; }
.day-metrics .metric[data-tone="slate"] { --tone: #64748b; }
.day-metrics .metric[data-tone="cyan"] { --tone: var(--cyan); }
.day-metrics .metric span { display: flex; align-items: center; gap: 6px; font-size: 12px; }
.day-metrics .metric span::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--tone); }
.day-metrics .metric strong { margin: 0; font-size: 26px; line-height: 1.1; }
.day-metrics .metric strong em { margin-left: 2px; color: var(--muted); font-size: 15px; font-style: normal; font-weight: 650; letter-spacing: 0; }
.day-metrics .metric small { min-height: 15px; color: var(--muted); font-size: 11.5px; font-weight: 600; }
.day-metrics .metric.zero strong { color: #a7b0bd; }
.day-metrics .metric.zero span::before { background: #cbd5e1; }

.attention { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.attention:empty { display: none; }
.att-group {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 12px;
  padding: 5px 14px 5px 5px;
  border: 1px solid rgba(14, 21, 37, 0.06);
  border-radius: 999px;
  background: white;
  font-size: 13px;
  box-shadow: 0 1px 2px rgba(14, 21, 37, 0.04);
}
.att-label {
  height: 26px;
  padding: 0 12px;
  border: 0;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 750;
}
.att-group[data-tone="red"] .att-label { background: #fef2f2; color: var(--red); }
.att-group[data-tone="amber"] .att-label { background: #fff7ed; color: #b45309; }
.att-group[data-tone="orange"] .att-label { background: #ffedd5; color: #c2410c; }
.att-item { display: inline-flex; align-items: baseline; gap: 6px; }
.att-time { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.att-more { color: var(--muted); font-size: 12px; font-weight: 700; }
.att-ok { padding: 6px 14px; border-radius: 999px; background: #ecfdf3; color: #166534; font-size: 13px; font-weight: 650; }

/* BotÃµes e controlos em cÃ¡psula */
body.in-app .ghost,
body.in-app .solid,
body.in-app .more-menu summary {
  height: 38px;
  padding: 0 18px;
  border-radius: 999px;
  font-weight: 600;
  transition: background 0.15s ease, box-shadow 0.15s ease, transform 0.1s ease;
}
body.in-app .ghost, body.in-app .more-menu summary { border-color: rgba(14, 21, 37, 0.12); background: white; box-shadow: 0 1px 2px rgba(14, 21, 37, 0.04); }
body.in-app .ghost:hover:not(:disabled), body.in-app .more-menu summary:hover { background: #f0f2f5; }
body.in-app .solid { background: var(--navy); color: white; }
body.in-app .solid:hover:not(:disabled) { background: #1f2a44; }
body.in-app .ghost:active, body.in-app .solid:active { transform: scale(0.97); }
body.in-app button:disabled { opacity: 0.55; cursor: progress; }
body.in-app button:focus-visible, body.in-app summary:focus-visible { outline: 3px solid rgba(12, 115, 141, 0.35); outline-offset: 2px; }
body.in-app .treat { height: 26px; padding: 0 12px; font-size: 12px; }
body.in-app #settingsButton { width: 38px; padding: 0; }

body.in-app .segmented, body.in-app .tabs {
  gap: 2px;
  width: fit-content;
  max-width: 100%;
  padding: 4px;
  border-radius: 999px;
  background: #e6e8ec;
}
body.in-app .segment, body.in-app .tab, body.in-app .offset-row button {
  height: 32px;
  padding: 0 16px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #3f4a5c;
  font-weight: 600;
  transition: background 0.15s ease, color 0.15s ease;
}
body.in-app .segment.active, body.in-app .tab.active, body.in-app .offset-row button.active {
  background: white;
  color: var(--ink);
  box-shadow: 0 1px 3px rgba(14, 21, 37, 0.16);
}
body.in-app .offset-row { gap: 6px; }

body.in-app .app input:not([type="checkbox"]):not([type="radio"]),
body.in-app .app select {
  height: 38px;
  border-radius: 12px;
  border-color: rgba(14, 21, 37, 0.12);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
body.in-app .app input[type="search"] { padding: 0 16px; border-radius: 999px; }
body.in-app .app input:focus, body.in-app .app select:focus {
  outline: none;
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px rgba(12, 115, 141, 0.18);
}

.panel {
  padding: 18px 20px;
  border-color: rgba(14, 21, 37, 0.06);
  border-radius: 24px;
  box-shadow: 0 1px 2px rgba(14, 21, 37, 0.04), 0 10px 30px rgba(14, 21, 37, 0.04);
}
.more-menu > div { border-radius: 18px; }
.banner { border-radius: 14px; }
.toast { border-radius: 999px; padding: 12px 20px; }
.status { padding: 3px 10px; }

@media (min-width: 721px) {
  .metrics.day-metrics { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .day-metrics .metric { padding: 10px 12px 9px 14px; }
  .day-metrics .metric strong { font-size: 24px; }
  .day-metrics .metric small { font-size: 11px; line-height: 1.3; }
}
