/* ============================================================
   CellTech World — portal styles
   Pure black & white, iOS-inspired minimal design
   (white pill cards on light gray, black circular icon badges)
   ============================================================ */

:root {
  --bg: #f2f2f2;
  --card: #ffffff;
  --ink: #0a0a0a;
  --ink-dim: #6e6e73;
  --ink-faint: #a3a3a8;
  --line: rgba(0, 0, 0, 0.07);
  --line-strong: rgba(0, 0, 0, 0.12);
  --black: #111111;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04), 0 2px 8px rgba(0, 0, 0, 0.03);
  --shadow-md: 0 2px 6px rgba(0, 0, 0, 0.05), 0 10px 28px rgba(0, 0, 0, 0.07);
  --shadow-lg: 0 6px 16px rgba(0, 0, 0, 0.07), 0 24px 60px rgba(0, 0, 0, 0.1);
  --font-ui: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --font-brand: "Barlow Condensed", "Inter", sans-serif;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.3, 0.44, 1);
  --r-card: 26px;
  --r-pill: 999px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { color-scheme: light; }

body {
  font-family: var(--font-ui);
  background: var(--bg);
  color: var(--ink);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.hidden { display: none !important; }

::selection { background: rgba(0, 0, 0, 0.85); color: #fff; }

/* ------------------------------------------------------------
   Login
   ------------------------------------------------------------ */

.login {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-card {
  width: min(410px, 92vw);
  padding: 52px 44px 38px;
  text-align: center;
  border-radius: 34px;
  background: var(--card);
  box-shadow: var(--shadow-lg);
  animation: card-in 0.8s var(--ease-out) both;
}

@keyframes card-in {
  from { opacity: 0; transform: translateY(22px) scale(0.98); }
  to   { opacity: 1; transform: none; }
}

.login-logo {
  width: 84px;
  height: 84px;
  border-radius: 22px;
  object-fit: cover;
  margin-bottom: 22px;
  box-shadow: var(--shadow-md);
}

.login-title {
  font-family: var(--font-brand);
  font-size: 2.5rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  line-height: 1;
}

.login-title-world {
  font-weight: 500;
  color: var(--ink-dim);
}

.login-sub {
  margin: 14px 0 30px;
  color: var(--ink-dim);
  font-size: 0.92rem;
  line-height: 1.65;
}

.google-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 15px 20px;
  border-radius: var(--r-pill);
  background: var(--black);
  color: #fff;
  font-weight: 600;
  font-size: 0.94rem;
  text-decoration: none;
  transition: transform 0.25s var(--ease-spring), box-shadow 0.25s ease, background 0.2s ease;
  box-shadow: var(--shadow-md);
}

.google-btn:hover {
  transform: translateY(-2px);
  background: #000;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.18);
}

.google-btn:active { transform: translateY(0) scale(0.99); }

.login-error {
  margin-top: 18px;
  padding: 11px 14px;
  border-radius: 14px;
  background: #f5f5f5;
  border: 1px solid var(--line-strong);
  color: #3a3a3c;
  font-size: 0.84rem;
  line-height: 1.5;
}

.login-foot {
  margin-top: 26px;
  font-size: 0.76rem;
  color: var(--ink-faint);
  letter-spacing: 0.02em;
}

.login-foot strong { color: var(--ink-dim); font-weight: 600; }

/* ------------------------------------------------------------
   Portal chrome
   ------------------------------------------------------------ */

.portal {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px clamp(20px, 4.5vw, 56px);
  animation: fade-down 0.6s var(--ease-out) both;
}

@keyframes fade-down {
  from { opacity: 0; transform: translateY(-12px); }
  to   { opacity: 1; transform: none; }
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--ink);
}

.brand-logo {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  object-fit: cover;
  box-shadow: var(--shadow-sm);
}

.brand-name {
  font-family: var(--font-brand);
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.topbar-right { display: flex; align-items: center; gap: 10px; }

.palette-hint {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 10px 14px;
  border-radius: var(--r-pill);
  border: none;
  background: var(--card);
  color: var(--ink-dim);
  font-family: var(--font-ui);
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.palette-hint:hover { color: var(--ink); box-shadow: var(--shadow-md); transform: translateY(-1px); }

.palette-hint kbd,
.palette-input-row kbd {
  font-family: var(--font-ui);
  font-size: 0.66rem;
  font-weight: 600;
  padding: 3px 7px;
  border-radius: 7px;
  background: #f0f0f0;
  color: var(--ink-faint);
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px 6px 6px;
  border-radius: var(--r-pill);
  background: var(--card);
  box-shadow: var(--shadow-sm);
}

.avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  object-fit: cover;
}

.avatar-fallback {
  display: grid;
  place-items: center;
  background: var(--black);
  color: #fff;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.user-meta { display: flex; flex-direction: column; line-height: 1.25; }
.user-name { font-size: 0.82rem; font-weight: 600; }
.user-email { font-size: 0.68rem; color: var(--ink-faint); }

.logout-btn {
  display: grid;
  place-items: center;
  width: 30px; height: 30px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--ink-faint);
  cursor: pointer;
  transition: color 0.2s ease, background 0.2s ease;
}

.logout-btn:hover { color: var(--ink); background: #f0f0f0; }

.main {
  flex: 1;
  width: min(1080px, 100%);
  margin: 0 auto;
  padding: clamp(14px, 3vh, 36px) clamp(20px, 4.5vw, 56px) 60px;
}

.foot {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 22px;
  font-size: 0.74rem;
  color: var(--ink-faint);
  letter-spacing: 0.03em;
}

.foot-dot { opacity: 0.5; }

/* ------------------------------------------------------------
   Home view
   ------------------------------------------------------------ */

.view { animation: view-in 0.5s var(--ease-out) both; }

@keyframes view-in {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}

.hero { margin: clamp(16px, 4vh, 44px) 0 clamp(28px, 4.5vh, 46px); }

.hero-kicker {
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 14px;
}

.hero-title {
  font-size: clamp(2rem, 4.8vw, 3.1rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.06;
}

.hero-title em {
  font-style: normal;
  color: var(--ink-dim);
}

.hero-sub {
  margin-top: 14px;
  color: var(--ink-dim);
  font-size: 0.98rem;
  max-width: 52ch;
  line-height: 1.6;
}

.section-label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 16px;
  padding: 0 6px;
}

.section-label h2 {
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.section-label span { font-size: 0.78rem; color: var(--ink-faint); }

/* Icon badge — black circle, white glyph (the Easlo signature) */

.badge {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--black);
  color: #fff;
  flex: none;
  transition: transform 0.35s var(--ease-spring);
}

/* Department cards */

.dept-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
  gap: 14px;
}

.dept-card {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 26px 26px 22px;
  border-radius: var(--r-card);
  border: none;
  background: var(--card);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  text-align: left;
  color: var(--ink);
  font-family: var(--font-ui);
  transition: transform 0.35s var(--ease-spring), box-shadow 0.3s ease;
  animation: rise-in 0.6s var(--ease-out) both;
  animation-delay: calc(var(--i) * 80ms);
}

@keyframes rise-in {
  from { opacity: 0; transform: translateY(20px) scale(0.99); }
  to   { opacity: 1; transform: none; }
}

.dept-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.dept-card .badge { margin-bottom: 20px; }

.dept-card:hover .badge { transform: scale(1.06); }

.dept-name {
  font-size: 1.22rem;
  font-weight: 700;
  letter-spacing: -0.025em;
}

.dept-tagline {
  margin-top: 6px;
  font-size: 0.85rem;
  color: var(--ink-dim);
  line-height: 1.55;
}

.dept-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.dept-count {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--ink-dim);
  letter-spacing: 0.01em;
}

.dept-count b { color: var(--ink); font-weight: 800; }

.dept-arrow {
  display: grid;
  place-items: center;
  width: 32px; height: 32px;
  border-radius: 50%;
  background: #f0f0f0;
  color: var(--ink-dim);
  transition: transform 0.3s var(--ease-spring), background 0.25s ease, color 0.25s ease;
}

.dept-card:hover .dept-arrow {
  transform: translateX(3px);
  background: var(--black);
  color: #fff;
}

/* ------------------------------------------------------------
   Department (apps) view
   ------------------------------------------------------------ */

.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 26px;
  padding: 10px 16px 10px 12px;
  border-radius: var(--r-pill);
  border: none;
  background: var(--card);
  color: var(--ink-dim);
  font-family: var(--font-ui);
  font-size: 0.83rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: color 0.2s ease, box-shadow 0.2s ease, transform 0.25s var(--ease-spring);
}

.back-btn:hover { color: var(--ink); box-shadow: var(--shadow-md); transform: translateX(-3px); }

.dept-hero {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 34px;
}

.dept-hero .badge { width: 60px; height: 60px; }

.dept-hero-title {
  font-size: clamp(1.6rem, 3.4vw, 2.3rem);
  font-weight: 800;
  letter-spacing: -0.035em;
}

.dept-hero-sub { margin-top: 5px; color: var(--ink-dim); font-size: 0.92rem; }

/* Two-column layout: apps on the left, SOPs on the right */

.dept-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 26px;
  align-items: start;
}

@media (max-width: 900px) {
  .dept-layout { grid-template-columns: 1fr; }
}

.app-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 14px;
}

.app-card {
  display: flex;
  flex-direction: column;
  padding: 26px 26px 22px;
  border-radius: var(--r-card);
  background: var(--card);
  box-shadow: var(--shadow-sm);
  transition: transform 0.35s var(--ease-spring), box-shadow 0.3s ease;
  animation: rise-in 0.55s var(--ease-out) both;
  animation-delay: calc(var(--i) * 70ms);
}

.app-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.app-card:hover .badge { transform: scale(1.06); }

.app-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
}

.app-live {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 12px;
  border-radius: var(--r-pill);
  background: #f0f0f0;
  color: var(--ink-dim);
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.app-live::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--black);
  animation: pulse-dot 2.4s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.35; transform: scale(0.75); }
}

.app-name {
  font-size: 1.16rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.app-desc {
  margin-top: 8px;
  font-size: 0.85rem;
  color: var(--ink-dim);
  line-height: 1.6;
  flex: 1;
}

.app-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 16px;
}

.app-tag {
  padding: 5px 11px;
  border-radius: var(--r-pill);
  background: #f0f0f0;
  color: var(--ink-dim);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.01em;
}

.app-launch {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  margin-top: 20px;
  padding: 13px 18px;
  border-radius: var(--r-pill);
  border: none;
  background: var(--black);
  color: #fff;
  font-family: var(--font-ui);
  font-size: 0.86rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.25s var(--ease-spring), box-shadow 0.3s ease, background 0.2s ease;
}

.app-launch:hover {
  background: #000;
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.18);
}

.app-launch svg { transition: transform 0.3s var(--ease-spring); }
.app-launch:hover svg { transform: translate(2px, -2px); }

/* ------------------------------------------------------------
   SOP panel (Easlo-style list rows)
   ------------------------------------------------------------ */

.sop-panel { animation: rise-in 0.6s var(--ease-out) both; animation-delay: 120ms; }

.sop-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  padding: 0 6px;
}

.sop-head h2 {
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.sop-add-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: none;
  background: var(--black);
  color: #fff;
  cursor: pointer;
  transition: transform 0.25s var(--ease-spring), box-shadow 0.25s ease;
}

.sop-add-btn:hover { transform: scale(1.08); box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2); }
.sop-add-btn.is-open { transform: rotate(45deg); }
.sop-add-btn.is-open:hover { transform: rotate(45deg) scale(1.08); }

.sop-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sop-row {
  position: relative;
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 12px 16px 12px 12px;
  border-radius: var(--r-pill);
  background: var(--card);
  box-shadow: var(--shadow-sm);
  text-decoration: none;
  color: var(--ink);
  transition: transform 0.3s var(--ease-spring), box-shadow 0.25s ease;
  animation: rise-in 0.5s var(--ease-out) both;
  animation-delay: calc(var(--i) * 55ms);
}

.sop-row:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.sop-row-link { cursor: pointer; }

.sop-row .badge {
  width: 42px;
  height: 42px;
}

.sop-row .badge svg { width: 18px; height: 18px; }

.sop-row-body { flex: 1; min-width: 0; }

.sop-row-title {
  font-size: 0.88rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sop-row-sub {
  margin-top: 2px;
  font-size: 0.7rem;
  color: var(--ink-faint);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sop-open-hint {
  color: var(--ink-faint);
  flex: none;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.sop-row:hover .sop-open-hint { opacity: 1; }

.sop-del {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  flex: none;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--ink-faint);
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.sop-row:hover .sop-del { opacity: 1; }
.sop-del:hover { background: #f0f0f0; color: #d00; }

.sop-empty {
  padding: 26px 18px;
  border-radius: var(--r-card);
  background: var(--card);
  box-shadow: var(--shadow-sm);
  text-align: center;
  color: var(--ink-faint);
  font-size: 0.82rem;
  line-height: 1.6;
}

/* Add-SOP inline form */

.sop-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px;
  margin-bottom: 12px;
  border-radius: var(--r-card);
  background: var(--card);
  box-shadow: var(--shadow-md);
  animation: rise-in 0.35s var(--ease-out) both;
}

.sop-form input {
  width: 100%;
  padding: 11px 14px;
  border-radius: 12px;
  border: 1px solid var(--line-strong);
  background: #fafafa;
  font-family: var(--font-ui);
  font-size: 0.85rem;
  color: var(--ink);
  outline: none;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.sop-form input:focus { border-color: var(--black); background: #fff; }
.sop-form input::placeholder { color: var(--ink-faint); }
.sop-form input:disabled { opacity: 0.5; cursor: not-allowed; }

.sop-file-drop {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px dashed var(--line-strong);
  background: #fafafa;
  color: var(--ink-dim);
  font-family: var(--font-ui);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  text-align: center;
  transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.sop-file-drop:hover { border-color: var(--black); color: var(--ink); }
.sop-file-drop svg { flex-shrink: 0; }
.sop-file-drop #sop-file-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sop-file-drop.has-file {
  border-style: solid;
  border-color: var(--black);
  background: #fff;
  color: var(--ink);
  font-weight: 600;
}

.sop-or {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink-faint);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.sop-or::before,
.sop-or::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--line);
}

.sop-form-actions {
  display: flex;
  gap: 8px;
  margin-top: 4px;
}

.sop-save-btn {
  flex: 1;
  padding: 11px;
  border-radius: var(--r-pill);
  border: none;
  background: var(--black);
  color: #fff;
  font-family: var(--font-ui);
  font-size: 0.83rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s var(--ease-spring), box-shadow 0.2s ease;
}

.sop-save-btn:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(0, 0, 0, 0.18); }
.sop-save-btn:disabled { opacity: 0.5; cursor: default; transform: none; box-shadow: none; }

.sop-cancel-btn {
  padding: 11px 16px;
  border-radius: var(--r-pill);
  border: none;
  background: #f0f0f0;
  color: var(--ink-dim);
  font-family: var(--font-ui);
  font-size: 0.83rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.sop-cancel-btn:hover { background: #e6e6e6; color: var(--ink); }

.sop-form-error {
  font-size: 0.76rem;
  color: #c00;
  padding: 0 2px;
}

/* ------------------------------------------------------------
   Settings: user management
   ------------------------------------------------------------ */

.icon-pill {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: var(--card);
  color: var(--ink-dim);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: color 0.2s ease, box-shadow 0.2s ease, transform 0.25s var(--ease-spring);
}

.icon-pill:hover { color: var(--ink); box-shadow: var(--shadow-md); transform: rotate(30deg); }

.admin-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 560px;
}

.user-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.user-card {
  padding: 18px 20px;
  border-radius: var(--r-card);
  background: var(--card);
  box-shadow: var(--shadow-sm);
  animation: rise-in 0.5s var(--ease-out) both;
  animation-delay: calc(var(--i) * 60ms);
}

.user-card-top {
  display: flex;
  align-items: center;
  gap: 13px;
  margin-bottom: 14px;
}

.user-card-top .badge {
  width: 42px;
  height: 42px;
  font-size: 1rem;
  font-weight: 700;
}

.access-group { margin-top: 10px; }

.access-group-name {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 7px;
}

.access-group-apps {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.access-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 13px;
  border-radius: var(--r-pill);
  background: #f0f0f0;
  color: var(--ink-dim);
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
  user-select: none;
  transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.access-chip input { display: none; }

.access-chip:hover { background: #e8e8e8; }

.access-chip.is-on {
  background: var(--black);
  color: #fff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
}

.access-chip.is-on::before {
  content: "✓";
  font-size: 0.7rem;
  font-weight: 700;
}

/* ------------------------------------------------------------
   Command palette
   ------------------------------------------------------------ */

.palette {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  justify-content: center;
  padding-top: clamp(60px, 16vh, 170px);
}

.palette-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(4px);
  animation: fade 0.2s ease both;
}

@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

.palette-panel {
  position: relative;
  width: min(580px, calc(100vw - 40px));
  max-height: min(430px, 70vh);
  display: flex;
  flex-direction: column;
  border-radius: 24px;
  background: var(--card);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: palette-in 0.26s var(--ease-spring) both;
}

@keyframes palette-in {
  from { opacity: 0; transform: translateY(-12px) scale(0.98); }
  to   { opacity: 1; transform: none; }
}

.palette-input-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 17px 20px;
  border-bottom: 1px solid var(--line);
  color: var(--ink-faint);
}

#palette-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 0.96rem;
  font-weight: 500;
}

#palette-input::placeholder { color: var(--ink-faint); font-weight: 400; }

.palette-results {
  list-style: none;
  overflow-y: auto;
  padding: 8px;
}

.palette-item {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 10px 12px;
  border-radius: 16px;
  cursor: pointer;
}

.palette-item .badge { width: 38px; height: 38px; }
.palette-item .badge svg { width: 18px; height: 18px; }

.palette-item-name { font-size: 0.9rem; font-weight: 600; }
.palette-item-dept { font-size: 0.72rem; color: var(--ink-faint); margin-top: 2px; }

.palette-item[aria-selected="true"] { background: #f2f2f2; }

.palette-item-go {
  margin-left: auto;
  color: var(--ink-faint);
  font-size: 0.7rem;
  font-weight: 500;
  display: none;
}

.palette-item[aria-selected="true"] .palette-item-go { display: block; }

.palette-empty {
  padding: 30px;
  text-align: center;
  color: var(--ink-faint);
  font-size: 0.86rem;
}

/* ------------------------------------------------------------
   Responsive / motion
   ------------------------------------------------------------ */

@media (max-width: 640px) {
  .user-meta { display: none; }
  .palette-hint span, .palette-hint kbd { display: none; }
  .brand-name { display: none; }
  .dept-hero { gap: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001s !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001s !important;
  }
}
