* { box-sizing: border-box; margin: 0; padding: 0; }
:root {
--font-body: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
--font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
--text-xs: clamp(0.75rem, 0.7rem + 0.25vw, 0.875rem);
--text-sm: clamp(0.875rem, 0.8rem + 0.35vw, 1rem);
--text-base: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
--text-xl: clamp(1.5rem, 1.2rem + 1.25vw, 2.25rem);
--space-1: 0.25rem; --space-2: 0.5rem; --space-3: 0.75rem; --space-4: 1rem; --space-5: 1.25rem; --space-6: 1.5rem; --space-8: 2rem; --space-12: 3rem;
--radius-md: 0.5rem; --radius-xl: 1rem;
--color-bg: #f7f6f2; --color-surface: #f9f8f5; --color-surface-2: #fbfbf9; --color-divider: #dcd9d5; --color-border: #d4d1ca; --color-text: #28251d; --color-text-muted: #7a7974; --color-text-faint: #bab9b4; --color-primary: #01696f; --shadow-sm: 0 1px 2px oklch(0.2 0.01 80 / 0.06); --shadow-lg: 0 12px 32px oklch(0.2 0.01 80 / 0.12);
}
html { -webkit-font-smoothing: antialiased; }
body { height: 100dvh; font-family: var(--font-body); font-size: var(--text-base); color: var(--color-text); background: var(--color-bg); display: flex; flex-direction: column; overflow: hidden; }
body.locked main, body.locked .services-grid { pointer-events: none; user-select: none; }
header { position: relative; flex-shrink: 0; display: flex; align-items: center; padding: var(--space-4) var(--space-8); border-bottom: 1px solid var(--color-divider); background: var(--color-bg); z-index: 100; }
.logo { display: flex; align-items: center; gap: var(--space-3); text-decoration: none; color: var(--color-text); }
.logo-text { font-family: var(--font-mono); font-size: var(--text-sm); font-weight: 500; letter-spacing: -0.02em; }
.logo-sub { font-size: var(--text-xs); color: var(--color-text-muted); margin-top: 1px; }
.header-center-logo { position: absolute; left: 50%; transform: translateX(-50%); height: 100px; width: auto; pointer-events: none; }
.header-identity { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.header-user-badge { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border: 1px solid var(--color-border); border-radius: 999px; background: rgba(255,255,255,0.65); }
.header-user-avatar { width: 34px; height: 34px; overflow: hidden; display: grid; place-items: center; border-radius: 50%; background: rgba(255,255,255,0.8); }
.header-user-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.header-user-meta { display: flex; flex-direction: column; line-height: 1.05; }
.header-user-name { font-size: var(--text-sm); font-weight: 700; }
.header-user-sub { font-size: var(--text-xs); color: var(--color-text-muted); }
.header-auth-pill, .services-add-btn, .header-auth-btn { padding: 8px 12px; border-radius: 999px; border: 1px solid var(--color-border); background: #fff; cursor: pointer; font: inherit; font-size: var(--text-xs); }
.services-add-btn { background: var(--color-primary); color: #fff; border-color: transparent; box-shadow: var(--shadow-sm); }
main { flex: 1; overflow-y: auto; display: flex; flex-direction: column; align-items: center; gap: var(--space-4); padding: var(--space-8); }
.services-toolbar { width: min(1200px, 100%); display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.services-count { color: var(--color-text-muted); font-size: var(--text-sm); }
.services-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: var(--space-4); width: min(1200px, 100%); }
.tile { position: relative; display: flex; flex-direction: column; gap: var(--space-3); padding: var(--space-6); background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-xl); text-decoration: none; color: inherit; box-shadow: var(--shadow-sm); transition: transform 200ms cubic-bezier(0.16, 1, 0.3, 1), box-shadow 200ms cubic-bezier(0.16, 1, 0.3, 1), background 200ms ease, opacity 200ms ease, filter 200ms ease; overflow: hidden; min-height: 180px; }
.tile::before { content: ''; position: absolute; inset: 0; background: radial-gradient(circle at 10% 10%, var(--tile-accent, transparent) 0%, transparent 60%); opacity: 0.06; pointer-events: none; transition: opacity 200ms ease; }
.tile:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); background: var(--color-surface-2); }
.tile:hover::before { opacity: 0.1; }
.tile:active { transform: translateY(0); }
.tile.locked { opacity: 0.42; filter: grayscale(1) saturate(0.3); pointer-events: none; transform: none !important; }
.site-icon { font-size: 1.75rem; line-height: 1; display: block; width: 1.75rem; height: 1.75rem; }
.site-icon img { width: 100%; height: 100%; object-fit: contain; display: block; }
.tile-label { font-size: var(--text-base); font-weight: 600; letter-spacing: -0.02em; color: var(--color-text); }
.tile-desc { font-size: var(--text-sm); color: var(--color-text-muted); line-height: 1.5; flex: 1; overflow-wrap: anywhere; }
.tile-footer { display: flex; align-items: center; justify-content: space-between; margin-top: var(--space-2); }
.tile-status { display: flex; align-items: center; gap: var(--space-2); font-size: var(--text-xs); color: var(--color-text-faint); font-family: var(--font-mono); }
.status-dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; background: var(--color-text-faint); }
.status-dot.online { background: #437a22; }
.status-dot.offline { background: #a13544; }
.status-dot.checking { background: var(--color-text-faint); animation: pulse-dot 0.8s infinite; }
@keyframes pulse-dot { 0%,100%{opacity:1} 50%{opacity:.35} }
.tile-arrow { color: var(--color-text-faint); transition: color 180ms ease, transform 180ms ease; display: flex; }
.tile:hover .tile-arrow { color: var(--color-primary); transform: translateX(3px); }
footer { flex-shrink: 0; text-align: center; padding: var(--space-4) var(--space-8); border-top: 1px solid var(--color-divider); font-size: var(--text-xs); color: var(--color-text-faint); font-family: var(--font-mono); background: var(--color-bg); }
.loult-overlay { position: fixed; inset: 0; background: rgba(247, 246, 242, 0.62); backdrop-filter: blur(10px); display: flex; align-items: center; justify-content: center; z-index: 2000; padding: var(--space-6); }
.loult-panel { width: min(560px, 100%); border: 1px solid var(--color-border); border-radius: 24px; background: rgba(249, 248, 245, 0.96); box-shadow: var(--shadow-lg); overflow: hidden; }
.loult-panel-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); padding: var(--space-5) var(--space-6); border-bottom: 1px solid var(--color-divider); background: #d51f2c; }
.loult-head-left { display: flex; align-items: center; gap: var(--space-3); min-width: 0; }
.loult-head-icon { width: 68px; height: 68px; flex: 0 0 auto; display: grid; place-items: center; overflow: visible; }
.loult-head-icon img { width: 100%; height: 100%; object-fit: contain; display: block; }
.loult-panel-title { font-family: var(--font-mono); font-size: var(--text-base); font-weight: 500; color: white; }
.loult-panel-sub { margin-top: 4px; font-size: var(--text-xs); color: white; }
.loult-close { width: 30px; height: 30px; border-radius: 50%; border: 1px solid white; background: #d51f2c; color: white; cursor: pointer; font-size: 18px; line-height: 1; display: grid; place-items: center; }
.loult-form { padding: var(--space-6); }
.loult-form label { display: block; font-size: var(--text-xs); color: var(--color-text-muted); margin-bottom: 8px; margin-top: 14px; font-family: var(--font-mono); }
.select-wrap { position: relative; flex: 1 1 auto; }
.select-wrap::before { content: ''; position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 22px; height: 22px; border-radius: 6px; background: #fff; border: 1px solid var(--color-border); background-size: cover; background-position: center; pointer-events: none; z-index: 1; }
.select-wrap[data-site="loult.fr"]::before { background-image: url('images/loultfr-favicon.ico'); }
.select-wrap[data-site="loult.family"]::before { background-image: url('images/loultfamily-favicon.ico'); }
.select-wrap[data-site="loult.com"]::before { background-image: url('images/loultcom-favicon.ico'); }
.loult-form select, .loult-form input, .loult-form button { width: 100%; border-radius: 14px; border: 1px solid var(--color-border); background: #fff; color: var(--color-text); padding: 12px 14px; font: inherit; }
.loult-form #loultConnect { cursor: pointer; font-weight: 600; background: #0b3d5f; color: #fff; border-color: transparent; margin-top: 18px; }
.loult-form select { padding-left: 46px; appearance: none; }
.cookie-row { display: flex; gap: 10px; align-items: stretch; }
.cookie-input { flex: 1 1 auto; }
.cookie-generate { width: 52px !important; flex: 0 0 52px; display: grid; place-items: center; padding: 0 !important; font-family: var(--font-mono); font-weight: 700; background: #fff !important; color: var(--color-text); }
.loult-info { position: relative; width: 28px; height: 28px; flex: 0 0 auto; border-radius: 50%; border: 1px solid white; color: white; display: grid; place-items: center; font-family: var(--font-mono); font-size: var(--text-xs); background: rgba(255, 141, 103, 0.08); cursor: help; margin-top: 12px; }
.loult-info[data-tip]:hover::after { content: attr(data-tip); position: absolute; top: calc(100% + 10px); right: 0; width: max-content; max-width: 240px; padding: 8px 10px; border-radius: 10px; background: #222; color: #fff; font-size: 12px; line-height: 1.35; font-family: var(--font-body); box-shadow: 0 10px 28px rgba(0,0,0,0.18); z-index: 20; }
.loult-info[data-tip]:hover::before { content: ''; position: absolute; top: calc(100% + 4px); right: 10px; border: 6px solid transparent; border-bottom-color: #222; }
.loult-error, .loult-success { display: none; margin-top: 12px; padding: 10px 12px; border-radius: 12px; font-size: var(--text-xs); }
.loult-error { background: rgba(161,53,68,0.08); color: #8f2e3d; border: 1px solid rgba(161,53,68,0.25); }
.loult-success { background: rgba(67,122,34,0.08); color: #365d1d; border: 1px solid rgba(67,122,34,0.2); }


.site-footer {
  flex-shrink: 0;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 1rem;
  padding: 0.8rem 1rem;
  border-top: 1px solid var(--color-divider);
  background: var(--color-bg);
  color: var(--color-text-faint);
  font-size: var(--text-xs);
  font-family: var(--font-mono);
}

.footer-left {
  justify-self: start;
}

.footer-center {
  justify-self: center;
}

.footer-right {
  justify-self: end;
}

.services-add-btn {
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: var(--color-primary);
  color: #fff;
  cursor: pointer;
  font: inherit;
  font-size: var(--text-xs);
  box-shadow: var(--shadow-sm);
}


.modal-overlay {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(247, 246, 242, 0.65);
  backdrop-filter: blur(10px);
  z-index: 3000;
  padding: 1.5rem;
}

.modal-overlay.open {
  display: flex;
}

.modal-box {
  width: min(560px, 100%);
  background: rgba(249, 248, 245, 0.98);
  border: 1px solid var(--color-border);
  border-radius: 24px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--color-divider);
}

.modal-head h2 {
  font-size: var(--text-base);
}

.modal-head button {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--color-border);
  background: #fff;
  cursor: pointer;
}

#serviceForm {
  padding: 1.5rem;
  display: grid;
  gap: 0.75rem;
}

#serviceForm label {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  font-family: var(--font-mono);
}

#serviceForm input,
#serviceForm textarea,
#serviceForm button {
  width: 100%;
  border-radius: 14px;
  border: 1px solid var(--color-border);
  background: #fff;
  padding: 12px 14px;
  font: inherit;
}

#serviceForm textarea {
  min-height: 120px;
  resize: vertical;
}

#serviceForm button {
  background: var(--color-primary);
  color: #fff;
  border-color: transparent;
  cursor: pointer;
  font-weight: 600;
}

@media (max-width: 900px) { .services-grid { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); } }
@media (max-width: 700px) { header { padding: var(--space-4); } main { padding: var(--space-4); align-items: flex-start; } .services-toolbar { flex-direction: column; align-items: stretch; } .services-add-btn { width: 100%; } .loult-head-icon { width: 60px; height: 60px; } .cookie-row { flex-direction: column; } }
@media (max-width: 440px) { .services-grid { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: reduce) { .tile, .tile-arrow { transition: none; } .status-dot { animation: none !important; } 



@media (max-width: 700px) {
  .site-footer {
    grid-template-columns: 1fr;
    text-align: center;
    justify-items: center;
  }

  .footer-left,
  .footer-center,
  .footer-right {
    justify-self: center;
  }

  .services-add-btn {
    width: 100%;
  }
}
