*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --y: #fff200;
  --blk: #0d0d0d;
  --blk2: #141414;
  --blk3: #1c1c1c;
  --grey: #252525;
  --txt: #f0f0f0;
  --txt2: #666;
  --radius: 12px;
}

body {
  background: var(--blk);
  color: var(--txt);
  font-family: 'DM Sans', sans-serif;
  min-height: 100vh;
}

.page { max-width: 860px; margin: 0 auto; padding: 0 28px 60px; }

/* ── header ── */
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 36px 0 48px;
  border-bottom: 1px solid #1e1e1e;
  margin-bottom: 48px;
}

.logo-area { display: flex; align-items: center; gap: 16px; }

.logo-img {
  width: 58px; height: 58px;
  border-radius: 50%;
  object-fit: cover;
  border: 1.5px solid #2a2a2a;
}

.logo-name {
  font-family: "Bebas Neue", sans-serif;
  font-size: 28px;
  letter-spacing: 0.08em;
  color: var(--y);
  line-height: 1;
}

.logo-sub {
  font-size: 11px;
  letter-spacing: 0.16em;
  color: var(--txt2);
  text-transform: uppercase;
  margin-top: 4px;
}

.header-domain {
  font-size: 11px;
  color: #333;
  letter-spacing: 0.06em;
  font-family: monospace;
}

.user-area { display: flex; align-items: center; gap: 12px; }
.user-greeting { font-size: 12px; color: #555; letter-spacing: 0.04em; }
.logout-btn {
  font-size: 10px; font-weight: 600; padding: 5px 12px;
  border-radius: 99px; border: 1.5px solid #2a2a2a;
  background: transparent; color: #555; cursor: pointer;
  letter-spacing: 0.06em; text-transform: uppercase;
  transition: border-color 0.15s, color 0.15s;
  font-family: inherit;
}
.logout-btn:hover { border-color: #ef4444; color: #ef4444; }

/* ── tools list ── */
.tools-list {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.tool-row {
  display: flex;
  align-items: center;
  background: var(--blk2);
  border: 1px solid #1e1e1e;
  border-radius: var(--radius);
  padding: 0 28px;
  height: 78px;
  cursor: default;
  text-decoration: none;
  outline: none;
  user-select: none;
  color: inherit;
  position: relative;
  overflow: hidden;
  transition: background 0.15s, border-color 0.15s;
  gap: 20px;
}

.tool-row::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--y);
  transform: scaleY(0);
  transform-origin: center;
  transition: transform 0.2s ease;
  border-radius: 0 2px 2px 0;
}

.tool-row:hover {
  background: var(--blk3);
  border-color: #2a2a2a;
}

.tool-row:hover::before { transform: scaleY(1); }
.tool-row:hover .tool-arrow { transform: translate(3px, -3px); color: var(--y); }
.tool-row:hover .tool-name { color: var(--y); }
.tool-row:hover .tool-num { color: #333; }

.tool-num {
  font-family: "Bebas Neue", sans-serif;
  font-size: 13px;
  letter-spacing: 0.1em;
  color: #272727;
  width: 24px;
  flex-shrink: 0;
  transition: color 0.15s;
}

.tool-icon {
  font-size: 20px;
  width: 38px;
  height: 38px;
  background: var(--grey);
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.tool-name {
  font-family: "Bebas Neue", sans-serif;
  font-size: 22px;
  letter-spacing: 0.06em;
  color: var(--txt);
  flex: 1;
  transition: color 0.15s;
}

.tool-url {
  font-size: 11px;
  color: #333;
  font-family: monospace;
  letter-spacing: 0.02em;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex-shrink: 0;
}
.tool-url.set { color: #444; }

.edit-btn {
  font-size: 10px;
  color: #444;
  background: none;
  border: 1px solid #252525;
  border-radius: 6px;
  padding: 4px 10px;
  cursor: default;
  font-family: inherit;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: all 0.15s;
  white-space: nowrap;
  flex-shrink: 0;
}
.edit-btn:hover { border-color: var(--y); color: var(--y); }

.tool-arrow {
  font-size: 16px;
  color: #2a2a2a;
  transition: transform 0.18s ease, color 0.15s;
  flex-shrink: 0;
  margin-left: 4px;
}

/* ── grouped tool row (multiple tools sharing one accessIndex) ── */
/* no shared box around the cards — each mini-card is its own full-width
   tile, so there's no outer highlight fighting the per-card hover state.
   grid-auto-flow makes each card's column equal width regardless of how
   many tools end up sharing an accessIndex — flex's equal-share rounding
   could leave the last column a hair off, and a fixed column count would
   break as soon as a group's size changes.
   the row number lives inside the first card for continuity with the
   regular tool rows. */
.tool-row-group {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  gap: 3px;
  height: 78px;
}

.tool-mini-card {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--blk2);
  border: 1px solid #1e1e1e;
  border-radius: var(--radius);
  padding: 0 20px;
  cursor: default;
  outline: none;
  position: relative;
  overflow: hidden;
  transition: background 0.15s, border-color 0.15s;
}

.tool-mini-card::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--y);
  transform: scaleY(0);
  transform-origin: center;
  transition: transform 0.2s ease;
  border-radius: 0 2px 2px 0;
}

.tool-mini-card:hover {
  background: var(--blk3);
  border-color: #2a2a2a;
}
.tool-mini-card:hover::before { transform: scaleY(1); }
.tool-mini-card:hover .tool-name { color: var(--y); }

.tool-mini-card .tool-icon {
  width: 32px;
  height: 32px;
  font-size: 16px;
  flex-shrink: 0;
}

.tool-mini-card .tool-name {
  font-size: 15px;
  letter-spacing: 0.04em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color 0.15s;
}

/* ── modal ── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.88);
  display: flex; align-items: center; justify-content: center;
  z-index: 100;
  opacity: 0; pointer-events: none;
  transition: opacity 0.18s;
  padding: 20px;
}
.modal-overlay.open { opacity: 1; pointer-events: all; }

.modal {
  background: var(--blk2);
  border: 1px solid #252525;
  border-radius: var(--radius);
  padding: 32px;
  width: 100%; max-width: 420px;
  transform: translateY(10px);
  transition: transform 0.18s;
}
.modal-overlay.open .modal { transform: translateY(0); }

.modal-title {
  font-family: "Bebas Neue", sans-serif;
  font-size: 22px; letter-spacing: 0.06em;
  color: var(--y); margin-bottom: 4px;
}
.modal-sub { font-size: 12px; color: var(--txt2); margin-bottom: 22px; }

.modal label {
  display: block; font-size: 10px;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--txt2); margin-bottom: 7px;
}

.modal input {
  width: 100%; background: var(--blk3);
  border: 1px solid #252525; border-radius: 8px;
  padding: 10px 14px; font-size: 13px;
  color: var(--txt); font-family: monospace;
  margin-bottom: 20px; transition: border-color 0.15s;
}
.modal input:focus { outline: none; border-color: var(--y); }

.modal-btns { display: flex; gap: 10px; }

.btn-save {
  flex: 1; background: var(--y); color: #111;
  border: none; border-radius: 8px; padding: 10px;
  font-size: 13px; font-weight: 500; cursor: default;
  font-family: inherit; transition: background 0.15s;
}
.btn-save:hover { background: #e8db00; }

.btn-cancel {
  background: none; border: 1px solid #252525;
  border-radius: 8px; padding: 10px 18px;
  font-size: 13px; color: var(--txt2);
  cursor: default; font-family: inherit;
  transition: border-color 0.15s;
}
.btn-cancel:hover { border-color: #555; }

/* ── footer ── */
footer {
  margin-top: 52px;
  padding-top: 20px;
  border-top: 1px solid #1a1a1a;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.footer-left { font-size: 11px; color: #2a2a2a; letter-spacing: 0.06em; }
.rock-badge { display: flex; align-items: center; gap: 6px; font-size: 10px; color: #2a2a2a; letter-spacing: 0.1em; text-transform: uppercase; }
.rock-y { font-family: "Bebas Neue", sans-serif; font-size: 13px; color: var(--y); }

/* ── animations ── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
header { animation: fadeUp 0.4s ease both; }
.tools-list > *:nth-child(1) { animation: fadeUp 0.35s 0.08s ease both; }
.tools-list > *:nth-child(2) { animation: fadeUp 0.35s 0.14s ease both; }
.tools-list > *:nth-child(3) { animation: fadeUp 0.35s 0.20s ease both; }
.tools-list > *:nth-child(4) { animation: fadeUp 0.35s 0.26s ease both; }
.tools-list > *:nth-child(5) { animation: fadeUp 0.35s 0.32s ease both; }
.tools-list > *:nth-child(6) { animation: fadeUp 0.35s 0.38s ease both; }
.tools-list > *:nth-child(7) { animation: fadeUp 0.35s 0.44s ease both; }
.tools-list > *:nth-child(8) { animation: fadeUp 0.35s 0.50s ease both; }
.tools-list > *:nth-child(9) { animation: fadeUp 0.35s 0.56s ease both; }
.tools-list > *:nth-child(10) { animation: fadeUp 0.35s 0.62s ease both; }

@media (max-width: 600px) {
  .page { padding: 0 16px 48px; }
  .tool-row { padding: 0 18px; height: 68px; gap: 14px; }
  .tool-url { display: none; }
  header { padding: 24px 0 36px; }
  .tool-row-group { grid-auto-flow: row; grid-auto-columns: unset; height: auto; }
  .tool-mini-card { padding: 10px 16px; }
}

/* ── login overlay ── */
.login-overlay {
  position: fixed; inset: 0; background: #0d0d0d; z-index: 999;
  display: flex; align-items: center; justify-content: center;
}
.login-overlay.hidden { display: none; }
.login-overlay::before {
  content: ''; position: fixed; inset: 0;
  background-image: linear-gradient(rgba(255,242,0,0.03) 1px, transparent 1px), linear-gradient(90deg, rgba(255,242,0,0.03) 1px, transparent 1px);
  background-size: 48px 48px; pointer-events: none;
}
.login-card {
  position: relative; z-index: 1; background: #151515;
  border: 1px solid #222; border-radius: 20px; padding: 2.5rem 2rem;
  width: 100%; max-width: 420px; animation: fadeUp 0.4s ease both;
}
.login-wordmark {
  font-family: 'Bebas Neue', sans-serif; font-size: 20px; letter-spacing: 0.18em;
  color: var(--y); margin-bottom: 2rem;
}
.login-tab-row {
  display: flex; gap: 4px; background: #0d0d0d; border-radius: 10px;
  padding: 4px; margin-bottom: 2rem;
}
.login-tab {
  flex: 1; padding: 8px; border-radius: 7px; border: none;
  background: transparent; color: #555; font-family: 'DM Sans', sans-serif;
  font-size: 13px; font-weight: 500; cursor: pointer; transition: background 0.15s, color 0.15s;
}
.login-tab.active { background: #151515; color: var(--txt); border: 1px solid #222; }
.login-form { display: flex; flex-direction: column; gap: 14px; }
.login-form.hidden { display: none; }
.login-field { display: flex; flex-direction: column; gap: 6px; }
.login-field label { font-size: 11px; font-weight: 500; letter-spacing: 0.06em; text-transform: uppercase; color: #555; }
.login-field input {
  background: #0d0d0d; border: 1px solid #222; border-radius: 10px;
  padding: 12px 14px; font-family: 'DM Sans', sans-serif; font-size: 14px;
  color: var(--txt); outline: none; transition: border-color 0.15s; width: 100%;
}
.login-field input:focus { border-color: var(--y); }
.login-btn {
  margin-top: 6px; padding: 13px; border-radius: 10px; border: none;
  background: var(--y); color: #1a1a00; font-family: 'DM Sans', sans-serif;
  font-size: 14px; font-weight: 700; cursor: pointer; transition: opacity 0.15s;
}
.login-btn:hover { opacity: 0.9; }
.login-error {
  font-size: 12px; color: #ff4d4d; display: none; padding: 10px 12px;
  background: rgba(255,77,77,0.08); border-radius: 8px; border: 1px solid rgba(255,77,77,0.2);
}
.login-error.show { display: block; }
.login-footer { margin-top: 1.5rem; font-size: 11px; color: #333; text-align: center; line-height: 1.6; }
