:root {
  --brand: #DC2626;
  --brand-dark: #991B1B;
  --brand-soft: #FEE7E7;
  --black: #0A0A0A;
  --bg: #FFFFFF;
  --surface: #FFFFFF;
  --text: #0A0A0A;
  --text-2: #3A3A38;
  --text-3: #6A6A66;
  --border: rgba(0,0,0,0.12);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  width: 380px;
  max-height: 560px;
  background: var(--bg);
  color: var(--text);
  font-family: "DM Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }

/* header */
.hd {
  display: flex; align-items: baseline; gap: 10px;
  padding: 14px 16px 10px;
}
.logo {
  font-weight: 800; font-size: 19px; letter-spacing: -0.5px; color: var(--black);
}
.logo .accent { color: var(--brand); }
.tag { font-size: 11px; color: var(--text-3); }

/* search */
.searchbar {
  position: relative;
  margin: 0 16px 10px;
}
.searchbar .sicon {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  width: 16px; height: 16px; color: var(--text-3); pointer-events: none;
}
#q {
  width: 100%;
  padding: 10px 34px 10px 36px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-family: inherit; font-size: 14px; color: var(--text);
  outline: none; background: var(--surface);
  transition: border-color .15s, box-shadow .15s;
}
#q:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.clear {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  width: 22px; height: 22px; border: 0; background: transparent;
  color: var(--text-3); font-size: 18px; line-height: 1; cursor: pointer; border-radius: 6px;
}
.clear:hover { background: #f1f1f1; color: var(--text); }

/* quick action */
.quick { padding: 0 16px 10px; }
.q-act {
  width: 100%;
  display: flex; align-items: center; gap: 8px;
  padding: 9px 12px;
  border: 1px dashed var(--brand);
  background: var(--brand-soft);
  color: var(--brand-dark);
  border-radius: 10px;
  font-family: inherit; font-size: 13px; font-weight: 600; cursor: pointer;
  transition: background .15s;
}
.q-act:hover { background: #fff; }
.q-act svg { width: 16px; height: 16px; flex-shrink: 0; }

/* grid */
.grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  padding: 4px 16px 14px;
  overflow-y: auto;
  max-height: 360px;
}
.tile {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 6px; text-align: center;
  padding: 10px 6px;
  height: 78px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  cursor: pointer;
  transition: transform .15s, border-color .15s, background .15s, box-shadow .15s;
}
.tile:hover {
  transform: translateY(-2px);
  border-color: var(--brand);
  background: var(--brand-soft);
  box-shadow: 0 6px 16px rgba(220,38,38,0.14);
}
.tile:active { transform: translateY(0) scale(.97); }
.tile .ic {
  width: 30px; height: 30px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.tile .ic img { width: 100%; height: 100%; object-fit: contain; }
.tile .badge {
  width: 30px; height: 30px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  background: var(--brand-soft); color: var(--brand);
  font-weight: 800; font-size: 12px;
}
.tile .nm {
  font-size: 10.5px; line-height: 1.2; color: var(--text-2); font-weight: 500;
}
.tile:hover .nm { color: var(--brand-dark); }

/* empty state */
.empty {
  padding: 18px 16px 22px; text-align: center; color: var(--text-3); font-size: 13px;
}
.empty a { color: var(--brand); font-weight: 600; }

/* footer */
.ft {
  display: flex; gap: 18px; align-items: center;
  padding: 10px 16px 14px;
  border-top: 1px solid var(--border);
}
.ft-link { font-size: 13px; font-weight: 600; color: var(--text-2); }
.ft-link:hover { color: var(--brand); }

/* scrollbar */
.grid::-webkit-scrollbar { width: 8px; }
.grid::-webkit-scrollbar-thumb { background: #e2e2e2; border-radius: 8px; }
.grid::-webkit-scrollbar-thumb:hover { background: #cfcfcf; }
