/* =========================================================
   FAMÍLIA KOLLE UI V1.1 — DESIGN SYSTEM
   ========================================================= */

:root {
  --bg: #f8f6f1;
  --bg-surface: #ffffff;
  --card: #ffffff;
  --card-subtle: #fcfbf8;
  --text: #2a231d;
  --text-secondary: #5f554a;
  --muted: #8c8173;
  --border: #e8e2d7;
  --border-subtle: #f1ecdf;
  
  --accent: #b6603a;
  --accent-hover: #9e4f2c;
  --accent-soft: #fcf1ea;
  --accent-border: rgba(182, 96, 58, 0.22);
  --accent-ink: #ffffff;

  --success: #2d8253;
  --success-bg: #eaf6ef;
  --success-border: rgba(45, 130, 83, 0.25);
  
  --warn: #b87b1c;
  --warn-bg: #fdf5e7;
  --warn-border: rgba(184, 123, 28, 0.25);

  --info: #2a6cb0;
  --info-bg: #edf4fb;
  --info-border: rgba(42, 108, 176, 0.25);

  --danger: #bf392b;
  --danger-bg: #fdf1ef;
  --danger-border: rgba(191, 57, 43, 0.25);

  --shadow-xs: 0 1px 2px rgba(42, 35, 29, 0.04);
  --shadow-sm: 0 2px 6px rgba(42, 35, 29, 0.05), 0 1px 2px rgba(42, 35, 29, 0.03);
  --shadow: 0 6px 20px -3px rgba(42, 35, 29, 0.07), 0 2px 6px -1px rgba(42, 35, 29, 0.03);
  --shadow-lg: 0 16px 36px -6px rgba(42, 35, 29, 0.10), 0 4px 12px -2px rgba(42, 35, 29, 0.04);

  --radius-xs: 6px;
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 24px;
  --radius-full: 9999px;
  
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.5;
  height: 100%;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.screen {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.screen[hidden] { display: none !important; }

/* ---------- Login ---------- */
.login-card {
  margin: auto;
  width: 100%;
  max-width: 380px;
  padding: 36px 26px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
  text-align: center;
}
.login-emoji {
  font-size: 44px;
  line-height: 1;
  margin-bottom: 12px;
}
.login-card h1 {
  margin: 0 0 6px;
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text);
}
.login-sub {
  color: var(--muted);
  margin: 0 0 24px;
  font-size: 14px;
}
#login-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  text-align: left;
}
label {
  display: flex;
  flex-direction: column;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-secondary);
  gap: 6px;
}
label[hidden] { display: none !important; }

input, textarea, select {
  font-size: 15px;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  font-family: inherit;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  width: 100%;
}
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

.btn-primary {
  background: var(--accent);
  color: var(--accent-ink);
  border-radius: var(--radius-md);
  padding: 12px 20px;
  font-size: 15px;
  font-weight: 700;
  box-shadow: 0 2px 6px rgba(182, 96, 58, 0.25);
  transition: background 0.15s ease, transform 0.1s ease, box-shadow 0.15s ease;
}
.btn-primary:hover {
  background: var(--accent-hover);
  box-shadow: 0 4px 10px rgba(182, 96, 58, 0.35);
}
.btn-primary:active {
  transform: scale(0.98);
}

.btn-ghost {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 11px 18px;
  font-size: 14px;
  font-weight: 700;
  color: var(--text-secondary);
  transition: all 0.15s ease;
}
.btn-ghost:hover {
  background: var(--border-subtle);
  color: var(--text);
}

.btn-small {
  background: var(--accent);
  color: var(--accent-ink);
  border-radius: var(--radius-full);
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 700;
  box-shadow: 0 2px 5px rgba(182, 96, 58, 0.22);
  transition: all 0.15s ease;
}
.btn-small:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
}

.icon-btn {
  font-size: 18px;
  color: var(--text-secondary);
  padding: 8px;
  min-width: 40px;
  min-height: 40px;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, color 0.15s ease;
}
.icon-btn:hover {
  background: var(--border-subtle);
  color: var(--text);
}
.icon-btn.notif-on {
  color: var(--accent);
}

.error {
  color: var(--danger);
  font-size: 13px;
  font-weight: 600;
  margin-top: 4px;
}

/* ---------- Topbar Header ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-xs);
}
.topbar-inner {
  max-width: 1060px;
  margin: 0 auto;
  padding: 9px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.topbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
}
.brand-icon-box {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--accent-soft);
  border: 1px solid var(--accent-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 19px;
  flex-shrink: 0;
}
.brand-text {
  display: flex;
  flex-direction: column;
}
.brand-name {
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text);
  line-height: 1.2;
}

/* Desktop navigation tabs inside header */
.desktop-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg);
  padding: 4px 6px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border);
}
.nav-tab {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 15px;
  border-radius: var(--radius-full);
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-secondary);
  transition: all 0.18s ease;
  position: relative;
}
.nav-tab:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.6);
}
.nav-tab.active {
  background: var(--card);
  color: var(--accent);
  box-shadow: 0 1px 4px rgba(42, 35, 29, 0.08);
}
.tab-icon { font-size: 15px; }
.tab-label { line-height: 1; }

.topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}
.user-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 3px 10px 3px 4px;
  border-radius: var(--radius-full);
  background: var(--bg);
  border: 1px solid var(--border);
}
.user-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.avatar-wrap {
  position: relative;
  width: 32px;
  height: 32px;
  flex-shrink: 0;
}
.avatar-fallback,
.avatar-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}
.avatar-fallback {
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
}
.avatar-img { display: none; }
.avatar-btn { padding: 0; border: none; background: none; cursor: pointer; }

.avatar-wrap.small { width: 32px; height: 32px; }
.avatar-wrap.small .avatar-fallback { font-size: 12px; }

.notif-banner {
  background: var(--info-bg);
  color: var(--info);
  border-bottom: 1px solid var(--info-border);
  font-size: 13px;
  padding: 9px 20px;
  line-height: 1.4;
  text-align: center;
}
.notif-banner[hidden] { display: none !important; }

/* ---------- Main Layout Container ---------- */
#views {
  flex: 1;
  width: 100%;
  max-width: 1060px;
  margin: 0 auto;
  padding: 20px 20px 60px;
  display: flex;
  flex-direction: column;
}
.view {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}
.view[hidden] { display: none !important; }

.view-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-subtle);
}
.view-header h2 {
  margin: 0;
  font-size: 21px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ---------- Home View ---------- */
.home-hero {
  margin-bottom: 16px;
}
.home-hero h2 {
  margin: 0 0 2px;
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text);
}
.home-sub {
  margin: 0;
  font-size: 14px;
  color: var(--muted);
  font-weight: 500;
}

/* Home Avisos Faixa Compacta */
.home-notif-box {
  background: var(--card);
  border: 1px solid var(--warn-border);
  border-left: 3px solid var(--warn);
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  margin-bottom: 14px;
  box-shadow: var(--shadow-xs);
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.home-notif-title {
  font-size: 12px;
  font-weight: 800;
  color: var(--warn);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  flex-shrink: 0;
}
.home-notif-items {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  flex: 1;
}
.home-notif-pill {
  font-size: 12px;
  font-weight: 600;
  background: var(--warn-bg);
  color: var(--text);
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

/* 2x2 Grid */
.home-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.home-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  text-align: left;
  width: 100%;
  min-height: 160px;
  position: relative;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s ease, border-color 0.2s ease;
  overflow: hidden;
  cursor: pointer;
}
.home-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  border-color: var(--accent-border);
}
.home-card:active {
  transform: scale(0.985);
}

.home-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  margin-bottom: 10px;
}
.home-card-badge {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 7px;
}

.home-card-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}

/* Hero Metric (Big Number) */
.card-hero-metric {
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.metric-number {
  font-size: 32px;
  font-weight: 800;
  color: var(--accent);
  line-height: 1;
  letter-spacing: -0.02em;
}
.metric-label {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-secondary);
}

.home-card-meta {
  font-size: 13px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-wrap: break-word;
}
.home-card-meta strong {
  color: var(--text);
}
.meta-icon { font-size: 13px; }

.home-card-empty-state {
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.4;
  margin: auto 0;
}
.home-card-empty-state p {
  margin: 0;
  font-weight: 700;
  color: var(--text-secondary);
}
.empty-sub {
  font-size: 12px;
  color: var(--muted);
}

/* School highlights on home card */
.school-highlights-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.school-highlight-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  background: var(--bg);
  border-radius: var(--radius-xs);
  border: 1px solid var(--border-subtle);
}
.highlight-tag {
  font-size: 10.5px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  flex-shrink: 0;
}
.tag-exam { background: #fee2e2; color: var(--danger); }
.tag-paper { background: #e0f2fe; color: var(--info); }
.highlight-details {
  display: flex;
  flex-direction: column;
  font-size: 12.5px;
  min-width: 0;
}
.highlight-details strong {
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.highlight-sub {
  font-size: 11px;
  color: var(--muted);
}

/* Jarbas intro on home card */
.jarbas-card-intro {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.jarbas-desc {
  margin: 0;
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.4;
}
.jarbas-chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.prompt-chip {
  font-size: 11px;
  font-weight: 600;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--muted);
  padding: 3px 8px;
  border-radius: var(--radius-full);
}

/* Chat preview on home card */
.chat-card-preview {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.preview-sender {
  font-size: 11px;
  font-weight: 800;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.preview-text {
  margin: 0;
  font-size: 13.5px;
  color: var(--text);
  font-style: italic;
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Card footer link */
.home-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 10px;
  border-top: 1px solid var(--border-subtle);
  font-size: 12.5px;
  font-weight: 700;
  color: var(--accent);
}
.footer-arrow {
  font-size: 14px;
  transition: transform 0.15s ease;
}
.home-card:hover .footer-arrow {
  transform: translateX(4px);
}

/* Status Chips */
.status-chip {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: var(--radius-full);
  font-size: 11.5px;
  font-weight: 700;
  line-height: 1;
}
.chip-success { background: var(--success-bg); color: var(--success); }
.chip-warn { background: var(--warn-bg); color: var(--warn); }
.chip-info { background: var(--info-bg); color: var(--info); }
.chip-urgent { background: var(--danger-bg); color: var(--danger); }
.chip-neutral { background: var(--border-subtle); color: var(--muted); }

/* ---------- Chat & Jarbas Views ---------- */
.chat-view {
  padding: 0 !important;
  max-width: 860px !important;
  margin: 0 auto;
  width: 100%;
  flex: 1;
  display: flex;
  flex-direction: column;
}
.chat-card-wrap {
  display: flex;
  flex-direction: column;
  flex: 1;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  height: calc(100vh - 160px);
  max-height: 760px;
  min-height: 460px;
}

.chat-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  background: var(--card);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.chat-header-info {
  display: flex;
  align-items: center;
  gap: 12px;
}
.chat-icon-badge {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  background: var(--info-bg);
  border: 1px solid var(--info-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 19px;
  flex-shrink: 0;
}
.chat-icon-badge.jarbas {
  background: var(--accent-soft);
  border-color: var(--accent-border);
}
.chat-header-title {
  display: block;
  font-size: 15px;
  font-weight: 800;
  color: var(--text);
  line-height: 1.2;
}
.chat-header-status {
  font-size: 12px;
  color: var(--muted);
  font-weight: 500;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: var(--card-subtle);
}

.bubble-row {
  display: flex;
  max-width: 84%;
}
.bubble-row.mine {
  align-self: flex-end;
  flex-direction: row-reverse;
  align-items: flex-end;
  gap: 8px;
}
.bubble-row.theirs {
  align-self: flex-start;
  flex-direction: row;
  align-items: flex-end;
  gap: 8px;
}
.bubble-content {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.bubble-row.mine .bubble-content { align-items: flex-end; }
.bubble-row.theirs .bubble-content { align-items: flex-start; }

.bubble-sender {
  font-size: 11.5px;
  color: var(--muted);
  font-weight: 700;
  margin-bottom: 4px;
  padding: 0 4px;
}

.bubble {
  padding: 12px 18px;
  border-radius: 18px;
  font-size: 14.5px;
  line-height: 1.55;
  word-break: break-word;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
  box-shadow: var(--shadow-xs);
}
.bubble strong { font-weight: 700; color: inherit; }
.bubble em { font-style: italic; }
.bubble-code {
  background: rgba(0, 0, 0, 0.06);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.9em;
}
.bubble-link {
  color: var(--info);
  text-decoration: underline;
  text-underline-offset: 2px;
  font-weight: 500;
  word-break: break-all;
  overflow-wrap: anywhere;
  cursor: pointer;
}
.bubble-link:hover {
  color: var(--accent);
}
.bubble-list-item {
  display: inline-block;
  width: 100%;
  margin: 2.5px 0;
}
.bubble-pre {
  background: rgba(0, 0, 0, 0.05);
  border-radius: 8px;
  padding: 10px 14px;
  margin: 6px 0;
  overflow-x: auto;
}
.bubble-pre code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.9em;
  background: transparent;
  padding: 0;
}

.bubble-row.mine .bubble {
  background: var(--accent);
  color: #fff;
  border-bottom-right-radius: 4px;
  box-shadow: 0 2px 6px rgba(182, 96, 58, 0.22);
}
.bubble-row.theirs .bubble {
  background: var(--card);
  color: var(--text);
  border: 1px solid var(--border);
  border-bottom-left-radius: 4px;
}

/* Jarbas response bubbles */
.bubble-row.theirs.jarbas-bubble .bubble,
#jarbas-messages .bubble-row.theirs .bubble {
  background: #ffffff;
  color: var(--text);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-bottom-left-radius: 4px;
  box-shadow: var(--shadow-sm);
  padding: 13px 18px;
}

.bubble-time {
  font-size: 10.5px;
  color: var(--muted);
  margin-top: 4px;
  padding: 0 4px;
}

.composer {
  display: flex;
  gap: 10px;
  padding: 12px 18px;
  background: var(--card);
  border-top: 1px solid var(--border);
  position: relative;
  align-items: center;
  flex-shrink: 0;
}
.composer input {
  flex: 1;
  border-radius: var(--radius-full);
  padding: 11px 18px;
  font-size: 14.5px;
  background: var(--bg);
  width: auto;
}
.send-btn {
  background: var(--accent);
  color: #fff;
  border: none;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  font-size: 17px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 5px rgba(182, 96, 58, 0.25);
  transition: transform 0.15s ease, background 0.15s ease;
}
.send-btn:hover { background: var(--accent-hover); }
.send-btn:active { transform: scale(0.92); }

/* ---------- Shopping View ---------- */
.card-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.card-list[hidden] { display: none !important; }

.shopping-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 22px;
  box-shadow: var(--shadow-sm);
}
.shopping-card-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 10px;
}
.shopping-card-title {
  font-weight: 800;
  font-size: 17px;
  letter-spacing: -0.01em;
  color: var(--text);
  overflow-wrap: break-word;
}
.shopping-card-date {
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.shopping-progress-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-secondary);
  margin: 8px 0 6px;
}
.progress-track {
  height: 8px;
  border-radius: var(--radius-full);
  background: var(--border-subtle);
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent) 0%, #d47b54 100%);
  border-radius: var(--radius-full);
  transition: width 0.3s ease;
}

.item-group { margin-top: 12px; }
.item-group-title {
  font-size: 11.5px;
  font-weight: 800;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 5px;
}
.item-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid var(--border-subtle);
}
.item-row:last-of-type { border-bottom: none; }

.checkbox {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  border: 2px solid var(--border);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  color: #fff;
  background: var(--card);
  cursor: pointer;
  transition: all 0.15s ease;
}
.checkbox.checked {
  background: var(--success);
  border-color: var(--success);
}
.checkbox.large {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  font-size: 22px;
}

.item-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow-wrap: break-word;
}
.item-line {
  font-size: 14.5px;
  font-weight: 600;
  overflow-wrap: break-word;
}
.item-row.done .item-line {
  text-decoration: line-through;
  color: var(--muted);
}
.item-qty {
  color: var(--accent);
  font-weight: 700;
  font-size: 12.5px;
  background: var(--accent-soft);
  padding: 2px 7px;
  border-radius: var(--radius-full);
  margin-left: 6px;
  display: inline-block;
}
.item-note {
  font-size: 12px;
  color: var(--muted);
  overflow-wrap: break-word;
}
.item-added-by {
  font-size: 11px;
  color: var(--muted);
  font-style: italic;
}

.item-actions { display: flex; gap: 4px; }
.item-actions button {
  color: var(--muted);
  font-size: 15px;
  padding: 6px;
  min-width: 36px;
  min-height: 36px;
  border-radius: var(--radius-xs);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}
.item-actions button:hover {
  background: var(--border-subtle);
  color: var(--text);
}

.add-item-row {
  display: flex;
  gap: 10px;
  margin-top: 14px;
}
.add-item-row input {
  flex: 1;
  border-radius: var(--radius-md);
  padding: 11px 16px;
}
.add-item-row button {
  background: var(--accent);
  color: #fff;
  border-radius: var(--radius-md);
  padding: 0 18px;
  font-weight: 700;
  font-size: 19px;
  min-height: 44px;
  box-shadow: 0 2px 5px rgba(182, 96, 58, 0.25);
}

.all-done-banner {
  background: var(--success-bg);
  color: var(--success);
  text-align: center;
  font-weight: 700;
  font-size: 13.5px;
  padding: 11px;
  border-radius: var(--radius-md);
  margin-top: 12px;
  border: 1px solid var(--success-border);
}

.shopping-card-footer {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}
.shopping-card-footer button {
  flex: 1;
  padding: 11px;
  border-radius: var(--radius-md);
  font-size: 13.5px;
  font-weight: 700;
  min-height: 42px;
  transition: all 0.15s ease;
}
.btn-finish {
  background: var(--success-bg);
  color: var(--success);
  border: 1px solid var(--success-border) !important;
}
.btn-finish:hover { background: #d9f0e2; }
.btn-finish:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-delete {
  background: none;
  color: var(--danger);
  border: 1px solid var(--danger-border) !important;
}
.btn-delete:hover { background: var(--danger-bg); }

.history-wrap { margin-top: 20px; }
.history-wrap summary {
  font-size: 14px;
  font-weight: 700;
  color: var(--muted);
  cursor: pointer;
  padding: 8px 0;
  list-style: none;
}
.history-wrap summary::-webkit-details-marker { display: none; }
.history-wrap summary::before { content: "▸ "; }
.history-wrap[open] summary::before { content: "▾ "; }
.history-wrap .card-list { margin-top: 10px; }
.history-card:not([open]) { opacity: 0.85; }
.history-card summary { cursor: pointer; list-style: none; }
.history-card summary::-webkit-details-marker { display: none; }
.history-card .items { margin-top: 10px; }

/* ---------- School View ---------- */
.school-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  background: var(--card);
  padding: 4px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-xs);
}
.tab-btn {
  flex: 1;
  border-radius: var(--radius-sm);
  padding: 9px;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--muted);
  transition: all 0.15s ease;
}
.tab-btn.active {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 2px 5px rgba(182, 96, 58, 0.25);
}

.agenda-groups {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.agenda-groups[hidden] { display: none !important; }
.agenda-group-title {
  font-size: 12.5px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
}
.agenda-group .card-list { gap: 10px; }

.task-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 15px 18px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 5px;
  text-align: left;
  width: 100%;
  border-left: 4px solid var(--accent);
  transition: all 0.18s ease;
}
.task-card:hover {
  box-shadow: var(--shadow);
  border-color: var(--accent-border);
}

/* Distinção clara Prova vs Trabalho */
.task-card.card-exam { border-left-color: var(--danger); }
.task-card.card-paper { border-left-color: var(--info); }
.task-card.overdue { border-left-color: var(--danger); }
.task-card.today { border-left-color: var(--danger); }
.task-card.tomorrow { border-left-color: var(--warn); }

.task-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2px;
}
.task-card-pills {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.type-pill {
  font-size: 11px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.type-pill.type-exam { background: #fee2e2; color: var(--danger); }
.type-pill.type-paper { background: #e0f2fe; color: var(--info); }
.type-pill.type-other { background: var(--bg); color: var(--muted); }

.task-title {
  font-weight: 800;
  font-size: 15.5px;
  color: var(--text);
  overflow-wrap: break-word;
  word-break: break-word;
}
.task-meta {
  font-size: 13px;
  color: var(--muted);
  overflow-wrap: break-word;
}
.task-summary {
  font-size: 13.5px;
  color: var(--text);
  line-height: 1.4;
  overflow-wrap: break-word;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 700;
}
.status-pendente { background: var(--warn-bg); color: var(--warn); }
.status-em-andamento { background: var(--info-bg); color: var(--info); }
.status-concluído { background: var(--success-bg); color: var(--success); }
.priority-urgente { background: var(--danger-bg); color: var(--danger); }
.priority-importante { background: var(--warn-bg); color: var(--warn); }

.task-notes {
  font-size: 13px;
  color: var(--text);
  background: var(--bg);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  overflow-wrap: break-word;
}
.task-attachments {
  font-size: 13px;
  color: var(--muted);
}
.attachment-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 6px;
}
.attachment-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg);
}
.attachment-thumb-btn {
  flex-shrink: 0;
  display: block;
  padding: 0;
  border: none;
  background: none;
  cursor: pointer;
}
.attachment-thumb {
  width: 52px;
  height: 52px;
  object-fit: cover;
  border-radius: var(--radius-xs);
  border: 1px solid var(--border);
  display: block;
}
.attachment-icon {
  width: 52px;
  height: 52px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
}
.attachment-name {
  flex: 1;
  min-width: 0;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.attachment-open {
  flex-shrink: 0;
  font-size: 13px;
  font-weight: 700;
  color: var(--info);
  padding: 6px 12px;
  border-radius: var(--radius-xs);
  cursor: pointer;
}
.attachment-open:hover { background: var(--info-bg); }

.task-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 6px;
}
.task-actions select {
  flex: 1;
  min-width: 130px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
}
.upload-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--info-bg);
  color: var(--info);
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
.upload-label input { display: none; }

/* Type picker grid */
.type-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.type-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 6px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text);
  transition: all 0.15s ease;
}
.type-tile span { font-size: 26px; }
.type-tile:hover {
  background: var(--accent-soft);
  border-color: var(--accent-border);
  color: var(--accent);
}

/* Modals & Sheets */
.sheet-form {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  background: var(--card);
  border-top: 1px solid var(--border);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  padding: 20px 18px calc(20px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.14);
  z-index: 50;
}
.sheet-form[hidden] { display: none !important; }
.sheet-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}
.sheet-header strong {
  font-size: 16.5px;
  font-weight: 800;
  color: var(--text);
}
.sheet-close {
  font-size: 24px;
  line-height: 1;
  color: var(--muted);
  padding: 4px 8px;
  border-radius: var(--radius-xs);
}
.sheet-close:hover {
  background: var(--border-subtle);
  color: var(--text);
}
.sheet-actions {
  display: flex;
  gap: 10px;
  margin-top: 6px;
}
.sheet-actions button { flex: 1; }

.scroll-sheet {
  max-height: 85vh;
  max-height: 85dvh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.field-row {
  display: flex;
  gap: 10px;
}
.field-row label { flex: 1; min-width: 0; }

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(20, 16, 12, 0.45);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 45;
}
.modal-backdrop[hidden] { display: none !important; }

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(10, 8, 6, 0.92);
  backdrop-filter: blur(8px);
  z-index: 60;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.lightbox[hidden] { display: none !important; }
.lightbox img {
  max-width: 100%;
  max-height: 80vh;
  border-radius: var(--radius-md);
  object-fit: contain;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}
.lightbox-caption {
  color: #fff;
  font-size: 14px;
  margin-top: 14px;
  text-align: center;
}
.lightbox-close {
  position: absolute;
  top: max(16px, env(safe-area-inset-top));
  right: 16px;
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  border: none;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  font-size: 24px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

/* Empty states */
.empty-state {
  text-align: center;
  color: var(--muted);
  padding: 40px 18px;
  font-size: 14.5px;
  background: var(--card);
  border: 1px dashed var(--border);
  border-radius: var(--radius-lg);
  margin: 10px 0;
}
.empty-state .emoji {
  font-size: 38px;
  display: block;
  margin-bottom: 10px;
}

/* Toast */
.toast {
  position: fixed;
  left: 50%;
  bottom: 80px;
  transform: translateX(-50%);
  background: var(--text);
  color: #fff;
  padding: 11px 22px;
  border-radius: var(--radius-full);
  font-size: 13.5px;
  font-weight: 600;
  z-index: 60;
  box-shadow: var(--shadow-lg);
  max-width: 90vw;
}
.toast.error { background: var(--danger); }

/* ---------- Bottom Nav (Mobile Only) ---------- */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--border);
  padding-bottom: env(safe-area-inset-bottom);
  z-index: 40;
}
.nav-btn {
  flex: 1;
  background: none;
  border: none;
  color: var(--muted);
  padding: 8px 4px 10px;
  font-weight: 700;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  position: relative;
  min-height: 52px;
  transition: color 0.15s ease;
}
.nav-icon { font-size: 20px; }
.nav-label { font-size: 11px; }
.nav-btn.active { color: var(--accent); }

.nav-badge {
  position: absolute;
  top: 6px;
  right: 25%;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--danger);
}

/* ---------- Responsive Breakpoints ---------- */
@media (max-width: 768px) {
  .desktop-nav { display: none !important; }
  .home-grid { grid-template-columns: 1fr; }
  #views { padding: 16px 16px calc(76px + env(safe-area-inset-bottom)); }
  .user-name { display: none; }
  
  .chat-view {
    position: fixed;
    top: 56px;
    bottom: 52px;
    left: 0;
    right: 0;
    z-index: 20;
    padding: 0 !important;
  }
  .chat-card-wrap {
    border-radius: 0;
    border: none;
    box-shadow: none;
    height: 100% !important;
    max-height: none !important;
    min-height: 0 !important;
  }
}

@media (min-width: 769px) {
  .bottom-nav { display: none !important; }
  #views { padding-bottom: 48px; }
  .bubble-row { max-width: 72%; }
  
  .sheet-form {
    max-width: 560px;
    left: 50%;
    transform: translateX(-50%);
    bottom: auto;
    top: 50%;
    transform: translate(-50%, -50%);
    border-radius: var(--radius-xl);
    border: 1px solid var(--border);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
  }
}

/* Topbar Live Clock */
.topbar-clock {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: var(--radius-full);
  background: var(--bg);
  border: 1px solid var(--border);
  font-size: 13px;
  user-select: none;
  white-space: nowrap;
}
.topbar-clock-icon {
  font-size: 13px;
  line-height: 1;
}
.topbar-clock-date {
  font-weight: 600;
  color: var(--text-secondary);
}
.topbar-clock-sep {
  color: var(--muted);
  font-weight: 400;
}
.topbar-clock-time {
  font-weight: 800;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}

/* Home Hero with Date Badge */
.home-hero {
  margin-bottom: 16px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.home-hero-text {
  flex: 1;
  min-width: 200px;
}
.home-hero-date-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--card);
  border: 1px solid var(--border);
  padding: 6px 14px;
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-xs);
  font-size: 13px;
  color: var(--text-secondary);
  user-select: none;
}
.home-hero-date-badge strong {
  color: var(--accent);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

@media (max-width: 640px) {
  .topbar-clock {
    padding: 4px 8px;
    gap: 4px;
    font-size: 11.5px;
  }
  .topbar-clock-date {
    display: inline;
    font-size: 11px;
  }
  .topbar-clock-sep {
    display: inline;
  }
  .topbar-clock-icon {
    font-size: 11px;
  }
  .home-hero {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
}

/* ---------- Jarbas Quick Actions ---------- */
.jarbas-quick-actions {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  padding: 8px 18px 14px 18px;
  background: var(--card);
  border-top: 1px solid var(--border-subtle);
  flex-shrink: 0;
}

.quick-action-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: var(--card-subtle);
  color: var(--text-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
  user-select: none;
  box-shadow: var(--shadow-xs);
}

.quick-action-btn:hover:not(:disabled) {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: var(--accent-border);
  transform: translateY(-1px);
}

.quick-action-btn:active:not(:disabled) {
  transform: translateY(0);
}

.quick-action-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.quick-action-icon {
  font-size: 14px;
  line-height: 1;
}

.quick-action-label {
  line-height: 1.2;
}

@media (max-width: 768px) {
  .jarbas-quick-actions {
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
    padding: 6px 12px 10px 12px;
  }
  .quick-action-btn {
    padding: 9px 8px;
    font-size: 12.5px;
  }
}


/* =========================================================
   MURAL DA FAMÍLIA (TIMELINE, CARDS, FOTOS E REAÇÕES)
   ========================================================= */

.mural-view-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  gap: 12px;
}
.mural-view-header h2 {
  font-size: 22px;
  font-weight: 800;
  margin: 0;
  color: var(--text);
  letter-spacing: -0.02em;
}
.mural-add-btn {
  font-size: 14px;
  font-weight: 700;
  padding: 10px 18px;
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

/* Timeline */
.mural-timeline {
  display: flex;
  flex-direction: column;
  gap: 20px;
  max-width: 600px;
  margin: 0 auto 30px;
}

/* Empty State */
.mural-empty-state {
  text-align: center;
  padding: 48px 24px;
  background: var(--card);
  border: 1px dashed var(--border);
  border-radius: var(--radius-xl);
  margin-top: 10px;
}
.mural-empty-icon {
  font-size: 44px;
  margin-bottom: 12px;
}
.mural-empty-state h3 {
  font-size: 18px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 8px;
}
.mural-empty-state p {
  font-size: 14px;
  color: var(--muted);
  max-width: 340px;
  margin: 0 auto 20px;
  line-height: 1.5;
}

/* Card */
.mural-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.mural-card:hover {
  box-shadow: var(--shadow);
}
.mural-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px 10px;
}
.mural-author-info {
  display: flex;
  align-items: center;
  gap: 10px;
}
.mural-avatar-wrap {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--accent-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 1px solid var(--accent-border);
}
.mural-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.mural-avatar-fallback {
  font-weight: 800;
  font-size: 15px;
  color: var(--accent);
}
.mural-author-name {
  display: block;
  font-size: 14.5px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
}
.mural-post-time {
  font-size: 11.5px;
  color: var(--muted);
}
.mural-author-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}
.mural-btn-icon-subtle {
  background: transparent;
  border: none;
  font-size: 15px;
  padding: 6px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  opacity: 0.65;
  transition: opacity 0.15s, background 0.15s;
}
.mural-btn-icon-subtle:hover {
  opacity: 1;
  background: var(--border-subtle);
}
.mural-btn-icon-subtle.btn-danger-subtle:hover {
  background: var(--danger-bg);
}

/* Post Photo */
.mural-photo-wrap {
  width: 100%;
  background: #181512;
  max-height: 480px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: zoom-in;
  overflow: hidden;
}
.mural-photo {
  width: 100%;
  max-height: 480px;
  object-fit: contain;
  display: block;
  image-orientation: from-image;
}

/* Post Text */
.mural-post-text {
  padding: 12px 16px;
  font-size: 15px;
  line-height: 1.55;
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-word;
}

/* Card Footer */
.mural-card-footer {
  padding: 8px 16px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--border-subtle);
  margin-top: 4px;
}
.mural-reactions-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.mural-heart-btn {
  background: var(--card-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  padding: 5px 12px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 14px;
  cursor: pointer;
  transition: transform 0.15s cubic-bezier(0.175, 0.885, 0.32, 1.275), background 0.15s, border-color 0.15s;
}
.mural-heart-btn:hover {
  border-color: #fca5a5;
  background: #fff1f2;
}
.mural-heart-btn:active {
  transform: scale(0.9);
}
.mural-heart-btn.reacted {
  background: #ffe4e6;
  border-color: #fda4af;
}
.mural-heart-btn .heart-count {
  font-weight: 700;
  font-size: 13px;
  color: #e11d48;
}
.mural-reactors-list {
  font-size: 12px;
  color: var(--muted);
}

/* Sheet & Photo Picker */
.mural-sheet-form {
  max-width: 520px;
}
.mural-form-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin: 14px 0;
}
.mural-preview-container {
  position: relative;
  width: 100%;
  max-height: 260px;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: #181512;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
}
.mural-preview-container img {
  max-height: 260px;
  width: 100%;
  object-fit: contain;
  display: block;
}
.mural-remove-photo-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.75);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.3);
  font-size: 16px;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s, transform 0.15s;
}
.mural-remove-photo-btn:hover {
  background: rgba(220, 38, 38, 0.9);
  transform: scale(1.1);
}
.mural-photo-actions {
  display: flex;
  gap: 10px;
}
.mural-btn-camera, .mural-btn-gallery {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 14px;
  font-size: 14px;
  font-weight: 700;
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  color: var(--text);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.mural-btn-camera:hover, .mural-btn-gallery:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.mural-btn-icon {
  font-size: 18px;
}
.mural-compress-status {
  font-size: 12px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Home Card Mural */
.chip-mural {
  background: #fdf2f4;
  color: #be123c;
  border: 1px solid rgba(190, 18, 60, 0.2);
}
.home-mural-preview-box {
  display: flex;
  gap: 12px;
  align-items: center;
}
.home-mural-thumb-wrap {
  width: 60px;
  height: 60px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  flex-shrink: 0;
  background: #222;
  border: 1px solid var(--border);
}
.home-mural-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.home-mural-text-box {
  flex: 1;
  min-width: 0;
}
.home-mural-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  margin-bottom: 2px;
}
.home-mural-author {
  font-weight: 700;
  color: var(--text);
}
.home-mural-time {
  color: var(--muted);
}
.home-mural-snippet {
  font-size: 13.5px;
  color: var(--text-secondary);
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin: 0 0 4px;
}
.home-mural-reactions-badge {
  display: inline-flex;
  font-size: 11.5px;
  font-weight: 700;
  color: #e11d48;
}

/* Mobile Nav Compact Optimization (6 buttons) */
@media (max-width: 768px) {
  .nav-btn {
    padding: 6px 1px 8px !important;
  }
  .nav-icon {
    font-size: 18px !important;
  }
  .nav-label {
    font-size: 10.5px !important;
    letter-spacing: -0.02em;
  }
}

.mural-preview-container[hidden],
.mural-compress-status[hidden] {
  display: none !important;
}


/* Mural Comments */
.mural-comments-section {
  padding: 10px 16px 14px;
  background: var(--card-subtle);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.mural-comments-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.mural-comment-item {
  display: flex;
  gap: 8px;
  align-items: flex-start;
}
.mural-comment-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--accent-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 2px;
  border: 1px solid var(--accent-border);
}
.comment-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.comment-avatar-fallback {
  font-size: 11px;
  font-weight: 800;
  color: var(--accent);
}
.mural-comment-bubble {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 6px 10px;
  flex: 1;
  min-width: 0;
  position: relative;
}
.mural-comment-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 2px;
}
.mural-comment-author {
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
}
.mural-comment-time {
  font-size: 10.5px;
  color: var(--muted);
  flex: 1;
}
.mural-btn-del-comment {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 12px;
  padding: 0 4px;
  cursor: pointer;
  opacity: 0.5;
  transition: opacity 0.15s, color 0.15s;
}
.mural-btn-del-comment:hover {
  opacity: 1;
  color: var(--danger);
}
.mural-comment-text {
  font-size: 13px;
  line-height: 1.4;
  color: var(--text);
  word-break: break-word;
}

/* Comment input form */
.mural-comment-form {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
}
.mural-comment-input {
  flex: 1;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  padding: 7px 14px;
  font-size: 12.5px;
  color: var(--text);
  outline: none;
  transition: border-color 0.15s;
}
.mural-comment-input:focus {
  border-color: var(--accent);
}
.mural-comment-send-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  cursor: pointer;
  flex-shrink: 0;
  transition: transform 0.15s, background 0.15s;
}
.mural-comment-send-btn:hover {
  background: var(--accent-hover);
  transform: scale(1.05);
}
.mural-comment-send-btn:active {
  transform: scale(0.95);
}
