*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --col-blocked:    #ef4444;
  --col-todo:       #6366f1;
  --col-inprogress: #f59e0b;
  --col-done:       #10b981;
  --accent:         #6366f1;
  --bg:       #0f172a;
  --surface:  #1e293b;
  --surface2: #334155;
  --text:     #f1f5f9;
  --muted:    #94a3b8;
  --border:   #334155;
}

:root[data-theme="light"] {
  --bg:       #f1f5f9;
  --surface:  #ffffff;
  --surface2: #f8fafc;
  --text:     #0f172a;
  --muted:    #64748b;
  --border:   #e2e8f0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/*  HEADER ─ */
header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 11px 24px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--text);
  font-weight: 700;
  font-size: 1rem;
  white-space: nowrap;
}

.logo-bars {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  width: 22px;
  height: 18px;
}

.logo-bars span {
  flex: 1;
  border-radius: 2px;
}

.logo-bars span:nth-child(1) { height: 10px; background: var(--col-blocked); }
.logo-bars span:nth-child(2) { height: 18px; background: var(--col-todo); }
.logo-bars span:nth-child(3) { height: 14px; background: var(--col-inprogress); }

#board-title {
  flex: 1;
  text-align: center;
  font-size: 1rem;
  font-weight: 600;
  background: none;
  border: 2px solid transparent;
  color: var(--text);
  padding: 4px 10px;
  border-radius: 8px;
  cursor: pointer;
  min-width: 0;
  transition: background 0.15s, border-color 0.15s;
}

#board-title:hover  { background: var(--surface2); }
#board-title:focus  { outline: none; background: var(--surface2); border-color: var(--accent); cursor: text; }

.share-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: opacity 0.15s;
}

.share-btn:hover { opacity: 0.82; }

.new-board-btn {
  padding: 7px 14px;
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.15s, border-color 0.15s;
}

.new-board-btn:hover { color: var(--text); border-color: var(--muted); }
.new-board-btn:focus-visible { outline: 2px solid var(--muted); outline-offset: 2px; }


/*  FOOTER ─ */
footer {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 24px;
  background: var(--surface);
  border-top: 1px solid var(--border);
  font-size: 0.74rem;
  color: var(--muted);
  flex-shrink: 0;
}

.budget-track {
  flex: 1;
  max-width: 180px;
  height: 4px;
  background: var(--surface2);
  border-radius: 99px;
  overflow: hidden;
}

.budget-fill {
  height: 100%;
  border-radius: 99px;
  transition: width 0.35s, background 0.35s;
}

.budget-fill.budget-ok     { background: var(--col-done); }
.budget-fill.budget-warn   { background: var(--col-inprogress); }
.budget-fill.budget-danger { background: var(--col-blocked); }

.footer-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.settings-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  flex-shrink: 0;
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--muted);
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}

.settings-btn:hover { color: var(--text); border-color: var(--muted); }
.settings-btn:focus-visible { outline: 2px solid var(--muted); outline-offset: 2px; }

/* ── Restore banner ── */
.restore-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 24px;
  background: #78350f;
  color: #fef3c7;
  font-size: 0.8rem;
  border-bottom: 1px solid #92400e;
  flex-shrink: 0;
  animation: slideBannerIn 0.2s ease;
}
.restore-banner[hidden] { display: none; }
.restore-banner > svg { flex-shrink: 0; opacity: 0.85; }
#restore-banner-msg { flex: 1; }
.restore-banner-actions { display: flex; gap: 8px; flex-shrink: 0; }

.btn-restore {
  padding: 4px 12px;
  background: #fef3c7;
  color: #78350f;
  border: none;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.12s;
}
.btn-restore:hover { background: #fff; }

.btn-restore-dismiss {
  padding: 4px 10px;
  background: transparent;
  color: #fde68a;
  border: 1px solid #92400e;
  border-radius: 6px;
  font-size: 0.78rem;
  cursor: pointer;
  transition: background 0.12s;
}
.btn-restore-dismiss:hover { background: rgba(255,255,255,0.1); }

@keyframes slideBannerIn {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── URL info button & tooltip ── */
.url-info-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.url-info-btn {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  background: none;
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: color 0.15s, border-color 0.15s;
}
.url-info-btn:hover,
.url-info-btn.open { color: var(--text); border-color: var(--muted); }
.url-info-btn:focus-visible { outline: 2px solid var(--muted); outline-offset: 2px; }

.url-info-tooltip {
  position: absolute;
  bottom: calc(100% + 10px);
  right: 0;
  width: 250px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 13px;
  font-size: 0.78rem;
  line-height: 1.55;
  color: var(--text);
  box-shadow: 0 4px 20px rgba(0,0,0,0.35);
  z-index: 200;
  animation: fadeTooltipIn 0.12s ease;
}
.url-info-tooltip[hidden] { display: none; }
.url-info-tooltip strong { color: var(--accent); }

@keyframes fadeTooltipIn {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}
