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

/* ── Theme transition ── */
*, *::before, *::after { transition: background-color .2s, color .2s, border-color .2s, box-shadow .2s; }

:root {
  --sidebar-w: 240px;
  --bg: #0f1117;
  --surface: #1a1d27;
  --surface-2: #222536;
  --surface-3: #2a2e42;
  --sidebar-bg: #13151f;
  --sidebar-border: #1e2132;
  --accent: #7c6af7;
  --accent-2: #5f8bff;
  --accent-glow: rgba(124, 106, 247, 0.25);
  --green: #34d399;
  --red: #f87171;
  --yellow: #fbbf24;
  --border: #2a2e42;
  --text: #e2e8f0;
  --text-muted: #64748b;
  --text-dim: #94a3b8;
  --mono: "SFMono-Regular", Consolas, monospace;
  --radius: 10px;
  --radius-sm: 6px;
}

body {
  font-family: "Inter", "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  display: flex;
  min-height: 100vh;
  font-size: 14px;
}

/* ── Sidebar ── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--sidebar-bg);
  border-right: 1px solid var(--sidebar-border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0;
  height: 100vh;
  z-index: 100;
  overflow-y: auto;
}
.sidebar-logo {
  padding: 1.5rem 1.25rem 1.25rem;
  border-bottom: 1px solid var(--sidebar-border);
}
.sidebar-logo-title {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-size: .95rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: .02em;
}
.sidebar-logo-badge {
  font-size: .6rem;
  font-weight: 700;
  background: var(--accent);
  color: #fff;
  padding: .1rem .4rem;
  border-radius: 4px;
  letter-spacing: .05em;
}
.sidebar-logo-sub {
  font-size: .7rem;
  color: var(--text-muted);
  margin-top: .3rem;
  padding-left: 1.6rem;
}
.sidebar-section {
  padding: 1.25rem 1rem .4rem;
  font-size: .65rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.sidebar nav a {
  display: flex;
  align-items: center;
  gap: .65rem;
  padding: .55rem 1rem;
  font-size: .825rem;
  color: var(--text-dim);
  text-decoration: none;
  border-radius: var(--radius-sm);
  margin: .1rem .5rem;
  transition: background .12s, color .12s;
  position: relative;
}
.sidebar nav a:hover { background: var(--surface-2); color: var(--text); }
.sidebar nav a.active {
  background: linear-gradient(90deg, rgba(124,106,247,.18), rgba(124,106,247,.06));
  color: #a89ff9;
  font-weight: 600;
}
.sidebar nav a.active::before {
  content: '';
  position: absolute;
  left: -0.5rem;
  top: 50%; transform: translateY(-50%);
  width: 3px; height: 60%;
  background: var(--accent);
  border-radius: 0 3px 3px 0;
}
.sidebar nav a .icon {
  font-size: .95rem;
  width: 1.3rem;
  text-align: center;
  flex-shrink: 0;
}
.sidebar-footer {
  margin-top: auto;
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--sidebar-border);
  font-size: .7rem;
  color: var(--text-muted);
}

/* ── Main ── */
.main {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
.topbar {
  background: var(--sidebar-bg);
  border-bottom: 1px solid var(--sidebar-border);
  padding: .85rem 2rem;
  display: flex;
  align-items: center;
  gap: .75rem;
  position: sticky;
  top: 0;
  z-index: 50;
}
.topbar-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
}
.topbar-badge {
  font-size: .65rem;
  font-weight: 700;
  background: var(--surface-3);
  color: var(--text-dim);
  padding: .15rem .5rem;
  border-radius: 4px;
  border: 1px solid var(--border);
  letter-spacing: .04em;
}
.content {
  padding: 2rem;
  flex: 1;
}

/* ── Card ── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
}

/* ── Section label ── */
.section-label {
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: .6rem;
}

/* ── Format row ── */
.format-row {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
  background: var(--surface-2);
  padding: .75rem 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}
label { font-size: .8rem; font-weight: 600; white-space: nowrap; color: var(--text-dim); }
select {
  padding: .35rem .65rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: .825rem;
  background: var(--surface-3);
  color: var(--text);
  cursor: pointer;
  outline: none;
}
select:focus { border-color: var(--accent); }
.arrow { font-size: 1rem; color: var(--text-muted); }

/* ── Editors ── */
.editors {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}
@media (max-width: 700px) { .editors { grid-template-columns: 1fr; } }
.editor-wrap { display: flex; flex-direction: column; gap: .4rem; }
.editor-wrap > label { font-size: .7rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--text-muted); }
textarea {
  width: 100%;
  height: 320px;
  padding: .75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--mono);
  font-size: .8rem;
  resize: vertical;
  background: var(--surface-2);
  color: var(--text);
  line-height: 1.7;
  outline: none;
  transition: border-color .15s;
}
textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
textarea[readonly] { background: var(--bg); color: var(--text-dim); }

input[type="text"] {
  padding: .55rem .75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--mono);
  font-size: .9rem;
  background: var(--surface-2);
  color: var(--text);
  width: 100%;
  outline: none;
  transition: border-color .15s;
}
input[type="text"]:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }

/* ── Actions ── */
.actions {
  display: flex;
  gap: .6rem;
  align-items: center;
  padding-top: .75rem;
  border-top: 1px solid var(--border);
  margin-top: .25rem;
}
button {
  padding: .45rem 1.1rem;
  border: none;
  border-radius: var(--radius-sm);
  font-size: .825rem;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s;
  display: inline-flex;
  align-items: center;
  gap: .35rem;
}
.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 0 12px var(--accent-glow);
}
.btn-primary:hover { background: #6b59e8; box-shadow: 0 0 18px var(--accent-glow); }
.btn-secondary {
  background: var(--surface-3);
  color: var(--text-dim);
  border: 1px solid var(--border);
}
.btn-secondary:hover { background: var(--surface-2); color: var(--text); }
.btn-right { margin-left: auto; }
.btn-sm {
  padding: .3rem .75rem;
  font-size: .75rem;
}

/* ── Error ── */
.error-msg {
  margin-top: .75rem;
  padding: .6rem 1rem;
  background: rgba(248, 113, 113, .08);
  border: 1px solid rgba(248, 113, 113, .3);
  border-radius: var(--radius-sm);
  color: var(--red);
  font-size: .8rem;
  display: none;
}

/* ── Divider ── */
.divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 1.25rem 0;
}

/* ── Cron page ── */
.cron-input-row {
  display: flex;
  gap: .75rem;
  align-items: flex-end;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}
.cron-input-wrap {
  display: flex;
  flex-direction: column;
  gap: .4rem;
  flex: 1;
  min-width: 200px;
}
.cron-input-wrap label {
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--text-muted);
  white-space: normal;
}
.cron-fields {
  display: flex;
  gap: .4rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}
.cron-field {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .3rem;
}
.cron-field span {
  font-size: .6rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
}
.cron-field button {
  padding: .3rem .65rem;
  font-size: .75rem;
  background: var(--surface-2);
  color: var(--text-dim);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  white-space: nowrap;
  font-family: var(--mono);
}
.cron-field button:hover { background: var(--surface-3); color: var(--text); border-color: var(--accent); }
.results-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: .5rem;
}
.results-list li {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: .65rem 1rem;
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  font-family: var(--mono);
  font-size: .825rem;
  color: var(--text-dim);
  transition: border-color .12s;
}
.results-list li:hover { border-color: var(--accent); color: var(--text); }
.results-list li .index {
  font-size: .65rem;
  font-weight: 700;
  color: var(--accent);
  background: var(--accent-glow);
  padding: .1rem .4rem;
  border-radius: 4px;
  min-width: 1.8rem;
  text-align: center;
}
.empty-state {
  text-align: center;
  color: var(--text-muted);
  padding: 2.5rem;
  font-size: .85rem;
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
}
.presets { margin-bottom: 1.25rem; }
.presets > .section-label { margin-bottom: .6rem; }

/* ── JWT page ── */
.jwt-input-wrap { display: flex; flex-direction: column; gap: .4rem; margin-bottom: 1rem; }
.jwt-input-wrap > label {
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.jwt-input-wrap textarea { height: 90px; }
.jwt-results { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-bottom: 1rem; }
@media (max-width: 700px) { .jwt-results { grid-template-columns: 1fr; } }
.jwt-results .editor-wrap textarea { height: 260px; }
.badge {
  display: inline-flex;
  align-items: center;
  padding: .1rem .45rem;
  border-radius: 4px;
  font-size: .65rem;
  font-weight: 700;
  letter-spacing: .05em;
  margin-left: .4rem;
}
.badge-header  { background: rgba(95,139,255,.15); color: var(--accent-2); border: 1px solid rgba(95,139,255,.25); }
.badge-payload { background: rgba(52,211,153,.12); color: var(--green);    border: 1px solid rgba(52,211,153,.25); }

/* ════════════════════════════════════
   Light theme overrides
   ════════════════════════════════════ */
[data-theme="light"] {
  --bg: #f5f6fa;
  --surface: #ffffff;
  --surface-2: #f0f2f8;
  --surface-3: #e4e8f2;
  --sidebar-bg: #ffffff;
  --sidebar-border: #e2e8f0;
  --accent: #6355d8;
  --accent-2: #3b6fe8;
  --accent-glow: rgba(99, 85, 216, 0.15);
  --border: #dde1ef;
  --text: #1a1d2e;
  --text-muted: #8492a6;
  --text-dim: #5a6480;
  --red: #e53e3e;
  --green: #0e9f6e;
}
[data-theme="light"] .sidebar nav a:hover { background: var(--surface-2); }
[data-theme="light"] .sidebar nav a.active {
  background: linear-gradient(90deg, rgba(99,85,216,.1), rgba(99,85,216,.03));
  color: #6355d8;
}
[data-theme="light"] .sidebar nav a.active::before { background: var(--accent); }
[data-theme="light"] textarea[readonly] { background: #f8f9fd; color: var(--text-dim); }
[data-theme="light"] .results-list li:hover { border-color: var(--accent); }
[data-theme="light"] .btn-primary { box-shadow: 0 0 10px rgba(99,85,216,.2); }
[data-theme="light"] .btn-primary:hover { background: #5347c4; box-shadow: 0 0 16px rgba(99,85,216,.3); }

/* ── Theme toggle button ── */
.theme-toggle {
  display: flex;
  align-items: center;
  gap: .5rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: .3rem .75rem;
  cursor: pointer;
  font-size: .75rem;
  font-weight: 600;
  color: var(--text-dim);
  width: 100%;
  justify-content: center;
  margin-bottom: .5rem;
}
.theme-toggle:hover { background: var(--surface-3); color: var(--text); }
.theme-toggle .toggle-track {
  width: 30px; height: 16px;
  background: var(--surface-3);
  border: 1px solid var(--border);
  border-radius: 999px;
  position: relative;
  flex-shrink: 0;
  transition: background .2s;
}
.theme-toggle .toggle-thumb {
  position: absolute;
  top: 2px; left: 2px;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--text-muted);
  transition: transform .2s, background .2s;
}
[data-theme="light"] .theme-toggle .toggle-track { background: var(--accent-glow); border-color: var(--accent); }
[data-theme="light"] .theme-toggle .toggle-thumb { background: var(--accent); transform: translateX(14px); }

/* ════════════════════════════════════
   Responsive Design
   ════════════════════════════════════ */

/* ── Hamburger button (mobile only) ── */
.menu-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 36px; height: 36px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: var(--text-dim);
  font-size: 1.1rem;
  flex-shrink: 0;
  padding: 0;
}
.menu-btn:hover { background: var(--surface-3); color: var(--text); }

/* ── Overlay (mobile) ── */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 99;
  backdrop-filter: blur(2px);
}
.sidebar-overlay.active { display: block; }

/* ── Tablet: icon-only sidebar ── */
@media (max-width: 1024px) and (min-width: 769px) {
  :root { --sidebar-w: 60px; }
  .sidebar-logo,
  .sidebar-section,
  .sidebar nav a span:not(.icon),
  .sidebar-footer .theme-label-text,
  .sidebar-logo-sub,
  .sidebar-logo-badge { display: none; }
  .sidebar { align-items: center; }
  .sidebar nav { width: 100%; }
  .sidebar nav a {
    justify-content: center;
    padding: .65rem;
    margin: .1rem .4rem;
    font-size: 1.1rem;
  }
  .sidebar nav a.active::before { display: none; }
  .sidebar nav a .icon { width: auto; font-size: 1.2rem; }
  .sidebar-footer {
    padding: .75rem .5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .5rem;
    font-size: 0;
  }
  .sidebar-footer .theme-toggle {
    width: 36px; height: 36px;
    padding: 0;
    border-radius: 50%;
    justify-content: center;
    margin-bottom: 0;
  }
  .sidebar-footer .theme-toggle span { display: none; }
  .sidebar-footer .theme-toggle .toggle-track { display: none; }
  .sidebar-footer .theme-toggle #themeIcon { display: block; font-size: 1rem; }
  .topbar { padding: .85rem 1.25rem; }
  .content { padding: 1.5rem 1.25rem; }
}

/* ── Mobile: drawer sidebar ── */
@media (max-width: 768px) {
  :root { --sidebar-w: 0px; }

  .sidebar {
    width: 260px;
    transform: translateX(-100%);
    transition: transform .25s ease;
    z-index: 101;
    box-shadow: 4px 0 24px rgba(0,0,0,.4);
  }
  .sidebar.open { transform: translateX(0); }

  .main { margin-left: 0; }

  .menu-btn { display: flex; }

  .topbar {
    padding: .7rem 1rem;
    gap: .6rem;
  }
  .topbar-title { font-size: .9rem; }

  .content { padding: 1rem; }

  .card { padding: 1rem; }

  .editors {
    grid-template-columns: 1fr;
  }
  textarea { height: 200px; }

  .jwt-results { grid-template-columns: 1fr; }
  .jwt-results .editor-wrap textarea { height: 180px; }

  .format-row {
    padding: .6rem .75rem;
    gap: .5rem;
  }

  .actions {
    flex-wrap: wrap;
    gap: .5rem;
  }
  .btn-right { margin-left: 0; width: 100%; justify-content: center; }

  .cron-input-row { flex-direction: column; }
  .cron-input-row .btn-primary { width: 100%; justify-content: center; }
  .cron-fields { gap: .35rem; }
  .cron-field button { font-size: .7rem; padding: .25rem .5rem; }
}

/* ════════════════════════════════════
   HTTP Request Tool
   ════════════════════════════════════ */
.http-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}
@media (max-width: 900px) { .http-grid { grid-template-columns: 1fr; } }

.http-url-row {
  display: flex;
  gap: .6rem;
  margin-bottom: 1rem;
  align-items: center;
}
.method-select {
  padding: .5rem .65rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: .85rem;
  font-weight: 700;
  background: var(--surface-3);
  color: var(--accent);
  cursor: pointer;
  outline: none;
  min-width: 100px;
}
.method-select:focus { border-color: var(--accent); }
.url-input {
  flex: 1;
  padding: .5rem .75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--mono);
  font-size: .85rem;
  background: var(--surface-2);
  color: var(--text);
  outline: none;
}
.url-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }

.kv-list { display: flex; flex-direction: column; gap: .4rem; margin-bottom: .6rem; }
.kv-row { display: flex; gap: .4rem; align-items: center; }
.kv-row input {
  flex: 1;
  padding: .4rem .6rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--mono);
  font-size: .78rem;
  background: var(--surface-2);
  color: var(--text);
  outline: none;
  width: 0;
}
.kv-row input:focus { border-color: var(--accent); }
.kv-remove {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1rem;
  cursor: pointer;
  padding: .2rem .35rem;
  border-radius: 4px;
  line-height: 1;
}
.kv-remove:hover { background: rgba(248,113,113,.12); color: var(--red); }
.btn-add-row {
  font-size: .75rem;
  padding: .3rem .7rem;
  background: var(--surface-2);
  border: 1px dashed var(--border);
  color: var(--text-muted);
  border-radius: var(--radius-sm);
}
.btn-add-row:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-glow); }

.panel-title {
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: .75rem;
}

/* ── Status badge ── */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .3rem .75rem;
  border-radius: 999px;
  font-size: .8rem;
  font-weight: 700;
  font-family: var(--mono);
  margin-bottom: .75rem;
}
.status-2xx { background: rgba(52,211,153,.12); color: var(--green); border: 1px solid rgba(52,211,153,.3); }
.status-3xx { background: rgba(251,191,36,.1);  color: var(--yellow); border: 1px solid rgba(251,191,36,.3); }
.status-4xx { background: rgba(248,113,113,.1); color: var(--red);   border: 1px solid rgba(248,113,113,.3); }
.status-5xx { background: rgba(248,113,113,.1); color: var(--red);   border: 1px solid rgba(248,113,113,.3); }

/* ── Code tabs ── */
.code-tabs { display: flex; gap: 0; margin-bottom: 0; border-bottom: 1px solid var(--border); }
.code-tab {
  padding: .45rem 1rem;
  font-size: .78rem;
  font-weight: 600;
  color: var(--text-muted);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  border-radius: 0;
  transition: color .12s, border-color .12s;
  margin-bottom: -1px;
}
.code-tab:hover { color: var(--text); }
.code-tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.code-panel { display: none; }
.code-panel.active { display: block; }
.code-block {
  background: var(--bg);
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  padding: 1rem;
  font-family: var(--mono);
  font-size: .78rem;
  line-height: 1.7;
  color: var(--text-dim);
  white-space: pre-wrap;
  word-break: break-all;
  max-height: 220px;
  overflow-y: auto;
  position: relative;
}
.copy-code-btn {
  position: absolute;
  top: .5rem; right: .5rem;
  padding: .2rem .55rem;
  font-size: .7rem;
}

/* Response tabs */
.resp-tabs { display: flex; gap: 0; border-bottom: 1px solid var(--border); margin-bottom: 0; }
.resp-tab {
  padding: .45rem 1rem;
  font-size: .78rem;
  font-weight: 600;
  color: var(--text-muted);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  border-radius: 0;
  margin-bottom: -1px;
  transition: color .12s, border-color .12s;
}
.resp-tab:hover { color: var(--text); }
.resp-tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.resp-panel { display: none; }
.resp-panel.active { display: block; }
.resp-body-area {
  background: var(--bg);
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  padding: 1rem;
  font-family: var(--mono);
  font-size: .78rem;
  line-height: 1.7;
  color: var(--text-dim);
  white-space: pre-wrap;
  word-break: break-all;
  max-height: 320px;
  overflow-y: auto;
  min-height: 80px;
}
.resp-headers-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .75rem;
  font-family: var(--mono);
}
.resp-headers-table td {
  padding: .35rem .6rem;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.resp-headers-table td:first-child { color: var(--accent-2); width: 40%; word-break: break-all; }
.resp-headers-table td:last-child  { color: var(--text-dim); word-break: break-all; }
.elapsed { font-size: .72rem; color: var(--text-muted); margin-left: .5rem; }

@media (max-width: 768px) {
  .http-url-row { flex-wrap: wrap; }
  .method-select { min-width: 80px; }
}

/* ─── Top / Hero ─────────────────────────────── */
.hero {
  background: linear-gradient(135deg, var(--accent) 0%, #6c63ff 100%);
  border-radius: var(--radius);
  padding: 2.5rem 2rem;
  margin-bottom: 2rem;
  color: #fff;
}
.hero-title {
  font-size: 2rem;
  font-weight: 700;
  margin: 0 0 0.75rem;
}
.hero-subtitle {
  font-size: 1rem;
  opacity: 0.9;
  margin: 0;
}

/* ─── Tool Card Grid ─────────────────────────── */
.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
}
.tool-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1rem;
  text-decoration: none;
  color: var(--text);
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}
.tool-card:hover {
  border-color: var(--accent);
  box-shadow: 0 4px 16px rgba(99,102,241,0.15);
  transform: translateY(-2px);
}
.tool-card-icon {
  font-size: 2rem;
  flex-shrink: 0;
  width: 2.5rem;
  text-align: center;
}
.tool-card-body {
  flex: 1;
}
.tool-card-title {
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 0.25rem;
  color: var(--text);
}
.tool-card-desc {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin: 0;
}
.tool-card-arrow {
  font-size: 1.1rem;
  color: var(--accent);
  flex-shrink: 0;
  opacity: 0;
  transition: opacity 0.15s;
}
.tool-card:hover .tool-card-arrow {
  opacity: 1;
}

/* ─── Hero datetime ──────────────────────────── */
.hero-datetime {
  display: inline-flex;
  align-items: baseline;
  gap: 0.75rem;
  margin-top: 1.25rem;
  background: rgba(0,0,0,0.18);
  border-radius: 999px;
  padding: 0.4rem 1.2rem;
  flex-wrap: wrap;
  justify-content: center;
}
.hero-datetime-time {
  font-size: 1.6rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.03em;
}
.hero-datetime-date {
  font-size: 0.95rem;
  opacity: 0.85;
}
.hero-datetime-tz {
  font-size: 0.78rem;
  opacity: 0.65;
  font-family: monospace;
}

/* ─── Time Progress Section ──────────────────── */
.progress-section {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}
.progress-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
}
.progress-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 0.6rem;
  color: var(--text);
}
.progress-label span:last-child {
  font-variant-numeric: tabular-nums;
  color: var(--accent);
}
.progress-bar-track {
  height: 10px;
  background: var(--border);
  border-radius: 999px;
  overflow: hidden;
}
.progress-bar-fill {
  height: 100%;
  width: 0%;
  background: var(--accent);
  border-radius: 999px;
  transition: width 0.6s ease;
}
.progress-bar-fill.warn   { background: #f59e0b; }
.progress-bar-fill.danger { background: #ef4444; }

/* ─── Hero 2-column layout ───────────────────── */
.hero-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}
.hero-left {
  flex: 1 1 0;
  min-width: 0;
}
.hero-right {
  flex: 0 0 300px;
  min-width: 0;
}
.hero-progress-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}
.hero-progress-item {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}
.hero-progress-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.82rem;
  font-weight: 600;
  color: rgba(255,255,255,0.9);
}
.hero-progress-label span:last-child {
  font-variant-numeric: tabular-nums;
  color: #fff;
}
.hero-right .progress-bar-track {
  background: rgba(255,255,255,0.2);
}
.hero-right .progress-bar-fill {
  background: #fff;
}
.hero-right .progress-bar-fill.warn   { background: #fbbf24; }
.hero-right .progress-bar-fill.danger { background: #fca5a5; }

/* タブレット以下: 縦1カラム */
@media (max-width: 768px) {
  .hero-inner {
    flex-direction: column;
    align-items: stretch;
    gap: 1.5rem;
  }
  .hero-left {
    text-align: center;
  }
  .hero-datetime {
    justify-content: center;
  }
  .hero-right {
    flex: none;
    width: 100%;
  }
}

/* モバイル: パディング縮小・時計フォント縮小 */
@media (max-width: 480px) {
  .hero { padding: 1.5rem 1rem; }
  .hero-title { font-size: 1.4rem; }
  .hero-datetime-time { font-size: 1.2rem; }
  .hero-datetime-date { font-size: 0.82rem; }
}

/* ─── Category Section ───────────────────────── */
.category-section {
  margin-bottom: 2rem;
}
.category-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 0 0 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}
.tool-card-placeholder {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  color: var(--text-muted);
  font-size: 0.9rem;
}
.placeholder-icon { font-size: 1.3rem; }

/* ─── Sidebar empty state ────────────────────── */
.sidebar-empty {
  display: block;
  padding: 0.4rem 1rem 0.4rem 1.2rem;
  font-size: 0.78rem;
  color: var(--text-muted);
  font-style: italic;
}

/* ─── Markdown Tool ──────────────────────────── */
.md-toolbar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
}
.md-title-input {
  flex: 1 1 200px;
  padding: 0.45rem 0.75rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 0.9rem;
}
.md-title-input:focus { outline: none; border-color: var(--accent); }
.md-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }

.md-editor-wrap {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  height: calc(100vh - 260px);
  min-height: 400px;
}
.md-pane {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.md-pane-label {
  padding: 0.4rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.md-textarea {
  flex: 1;
  resize: none;
  border: none;
  outline: none;
  padding: 1rem;
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 0.88rem;
  line-height: 1.7;
  background: var(--surface);
  color: var(--text);
  tab-size: 2;
}
.md-preview {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 1.25rem;
  font-size: 0.9rem;
  line-height: 1.8;
  color: var(--text);
}

/* markdown-body styles */
.markdown-body h1,.markdown-body h2,.markdown-body h3 {
  border-bottom: 1px solid var(--border);
  padding-bottom: .3em;
  margin-top: 1.4em;
}
.markdown-body code {
  background: var(--bg);
  border: 1px solid var(--border);
  padding: .15em .35em;
  border-radius: 4px;
  font-size: .85em;
}
.markdown-body pre {
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 1em;
  border-radius: var(--radius);
  overflow-x: auto;
}
.markdown-body pre code { background: none; border: none; padding: 0; }
.markdown-body blockquote {
  border-left: 4px solid var(--accent);
  margin: 0;
  padding: .5em 1em;
  color: var(--text-muted);
}
.markdown-body table { border-collapse: collapse; width: 100%; margin: 1em 0; }
.markdown-body th,.markdown-body td {
  border: 1px solid var(--border);
  padding: .4em .75em;
}
.markdown-body th { background: var(--bg); font-weight: 600; }
.markdown-body hr { border: none; border-top: 1px solid var(--border); margin: 1.5em 0; }

/* レスポンシブ */
@media (max-width: 768px) {
  .md-editor-wrap { grid-template-columns: 1fr; height: auto; }
  .md-textarea { min-height: 250px; }
  .md-preview  { min-height: 250px; }
}

/* ─── External badge ─────────────────────────── */
.ext-badge {
  font-size: 0.7rem;
  opacity: 0.6;
  vertical-align: super;
}
.tool-card-external {
  border-style: dashed;
}
.tool-card-external:hover {
  border-style: solid;
}
