:root {
  --volt: #E8FF2A;
  --heat: #FF2E00;
  --ink: #070707;
  --snow: #FFFFFF;
  --studio: #0C0D10;
  --panel: #16181E;
  --line: #2A2D36;
  --muted: #9AA0AE;
}

.site-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 28px;
  padding-left: max(16px, env(safe-area-inset-left));
  padding-right: max(16px, env(safe-area-inset-right));
  background: #07080a;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 40;
}

.site-nav .nav-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #fff;
  text-decoration: none;
}

.site-nav .nav-brand img {
  width: 32px;
  height: 32px;
  object-fit: contain;
  background: #fff;
  border-radius: 50%;
}

.site-nav .nav-brand strong {
  font-size: 16px;
  letter-spacing: 0.04em;
}

.site-nav nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.site-nav nav a,
.site-nav nav button {
  color: var(--muted);
  text-decoration: none;
  font-weight: 800;
  font-size: 14px;
  padding: 8px 16px;
  border-radius: 999px;
  border: 0;
  background: transparent;
  cursor: pointer;
  font-family: inherit;
}

.site-nav nav a:hover,
.site-nav nav a.on,
.site-nav nav button:hover,
.site-nav nav button.on {
  background: var(--volt);
  color: var(--ink);
}

.sync-badge {
  font-size: 12px;
  font-weight: 800;
  padding: 6px 10px;
  border-radius: 999px;
  color: var(--muted);
  border: 1px solid var(--line);
  white-space: nowrap;
}

.sync-badge.server { color: #14F195; border-color: #14F195; }
.sync-badge.pending { color: var(--volt); border-color: var(--volt); }
.sync-badge.offline,
.sync-badge.file { color: #FF8A00; border-color: #FF8A00; }

.server-warn {
  background: #3a2208;
  color: #ffd8a8;
  padding: 10px 28px;
  padding-left: max(16px, env(safe-area-inset-left));
  padding-right: max(16px, env(safe-area-inset-right));
  font-size: 13px;
  font-weight: 700;
}

.history-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.history-table th,
.history-table td {
  text-align: left;
  padding: 10px 8px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

.history-table th { color: var(--muted); font-weight: 800; }
.history-table button { margin-right: 8px; }

.home {
  min-height: calc(100vh - 58px);
  padding: 48px 28px 64px;
}

.home-hero {
  max-width: 880px;
  margin: 0 auto 40px;
}

.home-hero h1 {
  font-size: 42px;
  letter-spacing: -0.04em;
  line-height: 1.15;
  margin-bottom: 14px;
}

.home-hero p {
  color: var(--muted);
  font-size: 16px;
  line-height: 1.7;
  max-width: 640px;
}

.tool-grid {
  max-width: 880px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.tool-card {
  display: block;
  text-decoration: none;
  color: #fff;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 24px;
  min-height: 220px;
}

.tool-card:hover {
  border-color: var(--volt);
}

.tool-card .tag {
  display: inline-block;
  background: var(--volt);
  color: var(--ink);
  font-size: 12px;
  font-weight: 900;
  padding: 4px 10px;
  border-radius: 999px;
  margin-bottom: 16px;
}

.tool-card h2 {
  font-size: 26px;
  margin-bottom: 10px;
}

.tool-card p {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
}

.tool-card .go {
  margin-top: 22px;
  color: var(--volt);
  font-weight: 900;
}

@media (max-width: 800px) {
  .tool-grid { grid-template-columns: 1fr; }
  .home-hero h1 { font-size: 32px; }
  .home { padding: 28px 16px 48px; }
}

@media (max-width: 720px) {
  .site-nav {
    flex-wrap: wrap;
    gap: 10px;
    padding: 10px 14px;
    padding-left: max(14px, env(safe-area-inset-left));
    padding-right: max(14px, env(safe-area-inset-right));
  }
  .site-nav .nav-brand { min-width: 0; }
  .site-nav .nav-brand strong {
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 46vw;
  }
  .site-nav nav {
    order: 3;
    width: 100%;
    justify-content: flex-start;
  }
  .site-nav nav a,
  .site-nav nav button {
    flex: 1 1 auto;
    text-align: center;
    min-height: 40px;
    padding: 8px 10px;
    font-size: 13px;
  }
  .sync-badge { margin-left: auto; font-size: 11px; padding: 5px 8px; }
  .server-warn { padding: 10px 14px; font-size: 12px; line-height: 1.55; }

  .history-table thead { display: none; }
  .history-table,
  .history-table tbody,
  .history-table tr,
  .history-table td { display: block; width: 100%; }
  .history-table tr {
    background: #111318;
    border: 1px solid var(--line);
    border-radius: 12px;
    margin-bottom: 10px;
    padding: 10px 12px;
  }
  .history-table td {
    padding: 4px 0;
    border-bottom: 0;
  }
  .history-table td:last-child {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding-top: 8px;
  }
  .history-table button {
    min-height: 40px;
    margin-right: 0;
    padding: 8px 12px;
  }
}
