/* ---------- Theme (monochrome) ---------- */
:root {
    --bg: #000000;
    --card: #111111;
    --hover: #1a1a1a;
    --border: #262626;
    --border-strong: #4a4a4a;
    --text: #d2d2d7;
    --heading: #f5f5f7;
    --muted: #86868b;
    --invert-bg: #f5f5f7;
    --invert-text: #1d1d1f;
  }
  
  [data-theme="light"] {
    --bg: #ffffff;
    --card: #fbfbfd;
    --hover: #f5f5f7;
    --border: #e5e5ea;
    --border-strong: #b5b5ba;
    --text: #424245;
    --heading: #1d1d1f;
    --muted: #6e6e73;
    --invert-bg: #1d1d1f;
    --invert-text: #f5f5f7;
  }
  
  * { margin: 0; padding: 0; box-sizing: border-box; }
  
  body {
    /* Apple's font stack: SF Pro on Apple devices, closest system font elsewhere */
    font-family: "SF Pro Text", "SF Pro Display", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Helvetica, Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    background: var(--bg);
    color: var(--text);
    line-height: 1.47;
    letter-spacing: -0.01em;
    min-height: 100vh;
    transition: background-color 0.25s, color 0.25s;
  }
  
  .container { max-width: 680px; margin: 0 auto; padding: 40px 20px; }
  
  /* ---------- Header ---------- */
  header { text-align: center; margin-bottom: 32px; position: relative; }
  h1 { font-family: "SF Pro Display", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Helvetica, Arial, sans-serif; font-size: 2.6rem; font-weight: 600; letter-spacing: -0.03em; color: var(--heading); }
  .tagline { font-size: 1.05rem; color: var(--muted); margin-top: 6px; }
  
  .theme-toggle {
    position: absolute; top: 0; right: 0;
    width: 36px; height: 36px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--heading);
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
  }
  .theme-toggle:hover { background: var(--hover); border-color: var(--border-strong); }
  
  /* ---------- Tabs ---------- */
  .tabs {
    display: flex;
    gap: 4px;
    padding: 4px;
    margin-bottom: 20px;
    background: var(--hover);
    border-radius: 10px;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .tabs::-webkit-scrollbar { display: none; }
  
  .tab {
    flex: 1;
    min-width: max-content;
    display: flex; align-items: center; justify-content: center; gap: 6px;
    padding: 8px 14px;
    border: none;
    border-radius: 7px;
    background: transparent;
    color: var(--muted);
    font: inherit;
    font-size: 0.92rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
  }
  .tab span { display: none; } /* hide emoji icons for a clean look */
  .tab:hover { color: var(--heading); }
  .tab.active { background: var(--bg); color: var(--heading); box-shadow: 0 0 0 1px var(--border); }
  .tab small { font-size: 0.75rem; color: var(--muted); }
  
  /* ---------- Notice ---------- */
  .notice-board { border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; margin-bottom: 20px; }
  .notice-header { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin-bottom: 4px; }
  .notice-icon { display: none; }
  .notice-content { font-size: 0.92rem; color: var(--text); }
  
  /* ---------- Search ---------- */
  .search-box { margin-bottom: 20px; }
  #search {
    width: 100%;
    padding: 12px 16px;
    font: inherit;
    font-size: 1rem;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: transparent;
    color: var(--heading);
    outline: none;
    transition: border-color 0.2s;
  }
  #search:focus { border-color: var(--border-strong); }
  #search::placeholder { color: var(--muted); }
  
  /* ---------- Cards ---------- */
  .sites-list { display: flex; flex-direction: column; gap: 8px; }
  
  .site-card { border: 1px solid var(--border); border-radius: 12px; overflow: hidden; background: var(--card); transition: border-color 0.2s; animation: fadeIn 0.25s ease; }
  .site-card:hover, .site-card.open { border-color: var(--border-strong); }
  @keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
  
  .site-header { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; cursor: pointer; user-select: none; }
  .site-header:hover { background: var(--hover); }
  .site-main { flex: 1; min-width: 0; }
  .site-name { font-weight: 600; font-size: 1.05rem; color: var(--heading); }
  .site-url { display: inline-block; font-size: 0.85rem; color: var(--muted); margin-top: 1px; text-decoration: none; word-break: break-all; }
  .site-url:hover { color: var(--heading); text-decoration: underline; }
  
  .dropdown-arrow { color: var(--muted); font-size: 0.65rem; margin-left: 12px; flex-shrink: 0; transition: transform 0.2s; }
  .site-card.open .dropdown-arrow { transform: rotate(180deg); }
  
  .site-details { display: none; padding: 0 18px 16px; border-top: 1px solid var(--border); }
  .site-card.open .site-details { display: block; }
  
  .detail-row { display: flex; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--border); font-size: 0.9rem; }
  .detail-row:last-of-type { border-bottom: none; }
  .detail-label { color: var(--muted); min-width: 140px; flex-shrink: 0; }
  .detail-value { color: var(--text); }
  
  .visit-btn {
    display: inline-block;
    margin-top: 12px;
    padding: 8px 18px;
    background: var(--invert-bg);
    color: var(--invert-text);
    text-decoration: none;
    border-radius: 980px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: opacity 0.2s;
  }
  .visit-btn:hover { opacity: 0.8; }
  
  .no-results { text-align: center; color: var(--muted); padding: 48px 0; font-size: 0.95rem; }
  
  footer { margin-top: 48px; text-align: center; font-size: 0.8rem; color: var(--muted); }
  footer code { border: 1px solid var(--border); padding: 1px 6px; border-radius: 6px; color: var(--text); }
  
  /* ---------- Responsive ---------- */
  @media (max-width: 480px) {
    .container { padding: 32px 16px; }
    h1 { font-size: 2.1rem; }
    .site-header { padding: 12px 14px; }
    .site-details { padding: 0 14px 14px; }
    .detail-label { min-width: 110px; font-size: 0.85rem; }
    .detail-value { font-size: 0.85rem; }
  }
  
  @media (prefers-reduced-motion: reduce) {
    * { animation: none !important; transition: none !important; }
  }