:root {
  --bg: #f8fafc;
  --surface: #ffffff;
  --text: #0f172a;
  --text-soft: #334155;
  --muted: #64748b;
  --border: #e2e8f0;
  --accent: #2563eb;
  --accent-dark: #1d4ed8;
  --accent-soft: #dbeafe;
  --danger: #dc2626;
  --success: #065f46;
  --shadow-sm: 0 6px 18px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 14px 30px rgba(15, 23, 42, 0.1);
  --radius-sm: 10px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --content-width: 1120px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family:
    "Inter",
    "Plus Jakarta Sans",
    "Poppins",
    system-ui,
    -apple-system,
    "Segoe UI",
    sans-serif;
  line-height: 1.65;
}

main {
  flex: 1;
}

a,
button,
input,
select,
textarea {
  font: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  border: 0;
  background: none;
  color: inherit;
  cursor: pointer;
}

img,
svg {
  display: block;
  max-width: 100%;
}

code,
pre {
  background: #e2e8f0;
  color: #0f172a;
  border-radius: 8px;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

code {
  padding: 0.1rem 0.4rem;
}

pre {
  overflow-x: auto;
  padding: 1rem;
}

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 100;
  transform: translateY(-140%);
  padding: 0.65rem 0.9rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  font-weight: 600;
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
}

.nav-shell,
.footer-inner,
.hero-section,
.section-shell,
.project-detail,
.login-section {
  width: min(var(--content-width), calc(100% - 2rem));
  margin-inline: auto;
}

.nav-shell {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 72px;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  font-family: "Plus Jakarta Sans", "Inter", sans-serif;
  font-weight: 700;
  letter-spacing: 0;
  height: 40px;
}

.brand-logo {
  max-height: 40px;
  width: auto;
  object-fit: contain;
}

.brand-pixel {
  display: none;
}

.menu-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text-soft);
}

.site-menu {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

/* Cache Reminder Banner */
.cache-reminder-banner {
  display: none;
  position: relative;
  z-index: 40;
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  border-bottom: 2px solid #f59e0b;
  padding: 1rem;
}

.cache-reminder-banner.is-visible {
  display: block;
  animation: slideDown 300ms ease;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.reminder-content {
  width: min(var(--content-width), calc(100% - 2rem));
  margin-inline: auto;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 1rem;
  align-items: center;
}

.reminder-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: #fbbf24;
  color: #78350f;
  flex-shrink: 0;
  font-size: 1.125rem;
}

.reminder-text {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.reminder-title {
  margin: 0;
  font-weight: 700;
  color: #78350f;
  font-size: 0.95rem;
}

.reminder-description {
  margin: 0;
  color: #92400e;
  font-size: 0.875rem;
  line-height: 1.4;
}

.reminder-actions {
  display: flex;
  gap: 0.5rem;
  flex-shrink: 0;
}

.btn-dismiss-reminder {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.5);
  color: #78350f;
  border: 1px solid rgba(120, 53, 15, 0.2);
  cursor: pointer;
  transition: all 200ms ease;
  font-size: 1rem;
}

.btn-dismiss-reminder:hover {
  background: rgba(255, 255, 255, 0.8);
  border-color: #78350f;
}

.btn-remind-later {
  padding: 0.5rem 1rem;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.7);
  color: #78350f;
  border: 1px solid rgba(120, 53, 15, 0.3);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 200ms ease;
  white-space: nowrap;
}

.btn-remind-later:hover {
  background: #ffffff;
  border-color: #78350f;
}

@media (max-width: 768px) {
  .reminder-content {
    grid-template-columns: auto 1fr;
    gap: 0.75rem;
  }

  .reminder-actions {
    grid-column: 1 / -1;
    justify-content: flex-end;
  }

  .reminder-description {
    font-size: 0.8rem;
  }
}

/* Coachmark / Feature Highlight for refresh button */
.coachmark {
  position: fixed;
  z-index: 9999;
  display: none;
  align-items: center;
  gap: 0.5rem;
  pointer-events: auto;
}

.coachmark-bubble {
  background: #111827;
  color: #ffffff;
  padding: 0.6rem 0.9rem;
  border-radius: 14px;
  font-weight: 700;
  font-size: 0.92rem;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.18);
  max-width: 230px;
  line-height: 1.15;
  position: relative;
  white-space: normal;
  text-align: left;
  word-break: break-word;
}

.coachmark-bubble .coachmark-sub {
  display: block;
  font-weight: 600;
  opacity: 0.9;
  font-size: 0.78rem;
  margin-top: 0.2rem;
  color: #cbd5e1;
}

.coachmark-dismiss {
  background: transparent;
  border: 0;
  color: #111827;
  font-weight: 800;
  font-size: 1.1rem;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.06);
  cursor: pointer;
}

/* small pointer using pseudo-element */
.coachmark-bubble::after {
  content: "";
  position: absolute;
  width: 12px;
  height: 12px;
  left: var(--coachmark-arrow-left, 50%);
  top: var(--coachmark-arrow-top, -6px);
  transform: translateX(-50%) rotate(var(--coachmark-arrow-rotation, 45deg));
  background: #111827;
  border-radius: 2px;
}

@media (max-width: 760px) {
  .coachmark-bubble {
    max-width: 180px;
    font-size: 0.78rem;
  }
}

.site-menu a,
.admin-nav a {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 0.8rem;
  border-radius: 10px;
  border: 1px solid transparent;
  color: var(--text-soft);
  font-weight: 600;
  transition: all 300ms ease;
}

.site-menu a:hover,
.site-menu a.is-active,
.admin-nav a:hover,
.admin-nav a.is-active {
  color: var(--accent-dark);
  background: var(--accent-soft);
  border-color: #bfdbfe;
}

.nav-console {
  border-color: var(--border) !important;
}

.hero-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 3rem;
  padding-block: 4.5rem;
}

.eyebrow {
  margin: 0 0 0.9rem;
  color: var(--accent-dark);
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0;
}

h1,
h2,
h3 {
  margin: 0;
  font-family: "Plus Jakarta Sans", "Inter", sans-serif;
  line-height: 1.3;
  letter-spacing: 0;
}

h1 {
  font-size: 2.45rem;
}

h2 {
  font-size: 1.75rem;
}

h3 {
  font-size: 1.1rem;
}

p {
  margin: 0;
}

.hero-role {
  display: inline-flex;
  align-items: center;
  margin-top: 1.15rem;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-dark);
  border: 1px solid #bfdbfe;
  padding: 0.45rem 0.9rem;
  font-size: 0.9rem;
  font-weight: 600;
}

.hero-text {
  max-width: 700px;
  margin-top: 1.25rem;
  color: var(--text-soft);
  font-size: 1.05rem;
  margin-left: auto;
  margin-right: auto;
}

.hero-actions,
.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.6rem;
  justify-content: center;
}

.detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.6rem;
  justify-content: flex-start;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin-top: 1.2rem;
  justify-content: center;
}

.hero-meta span {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.4rem 0.7rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--muted);
  background: var(--surface);
  font-size: 0.85rem;
  box-shadow: var(--shadow-sm);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  min-height: 44px;
  padding: 0.65rem 1rem;
  border-radius: 12px;
  border: 1px solid transparent;
  font-size: 0.94rem;
  font-weight: 600;
  transition: all 300ms ease;
}

.btn:hover {
  transform: translateY(-4px);
}

.btn-primary {
  background: var(--accent);
  color: #ffffff;
  box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
  background: var(--accent-dark);
  box-shadow: var(--shadow-md);
}

.btn-outline {
  background: var(--surface);
  color: var(--text-soft);
  border-color: var(--border);
}

.btn-outline:hover {
  color: var(--accent-dark);
  border-color: #93c5fd;
  background: #eff6ff;
}

.btn.compact {
  min-height: 38px;
  padding: 0.45rem 0.8rem;
  font-size: 0.85rem;
}

.hero-media {
  display: grid;
  justify-items: center;
  gap: 1.2rem;
  padding: 1.25rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow-md);
}

.profile-image,
.profile-avatar {
  width: min(100%, 300px);
  aspect-ratio: 1 / 1;
  border-radius: 18px;
  border: 1px solid var(--border);
}

.profile-image {
  object-fit: cover;
}

.profile-avatar {
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, #2563eb 0%, #4f46e5 100%);
  color: #ffffff;
}

.profile-avatar span {
  font-size: 3rem;
  font-weight: 700;
}

.profile-summary {
  display: grid;
  gap: 0.25rem;
  width: 100%;
  text-align: center;
}

.profile-summary strong {
  color: var(--text);
  font-size: 0.98rem;
}

.profile-summary span {
  color: var(--muted);
  font-size: 0.88rem;
}

.section-shell {
  padding-block: 4rem;
}

.section-shell + .section-shell {
  border-top: 1px solid var(--border);
}

.section-heading {
  margin-bottom: 1.8rem;
}

.section-subtext {
  max-width: 720px;
  margin-top: 0.7rem;
  color: var(--text-soft);
}

.section-heading-row,
.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.tech-grid,
.project-grid,
.about-grid,
.stats-grid {
  display: grid;
  gap: 1rem;
}

.tech-grid {
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

.tech-tile,
.project-card,
.about-grid article,
.system-panel,
.auth-card,
.admin-panel,
.stat-card,
.empty-state {
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.tech-tile {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  min-height: 72px;
  padding: 0.9rem 1rem;
  color: var(--text-soft);
  font-weight: 600;
}

.tech-tile i,
.stat-card i,
.empty-state i {
  color: var(--accent-dark);
  font-size: 1.2rem;
}

.project-grid {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.project-card {
  display: flex;
  flex-direction: column;
  min-height: 320px;
  padding: 1rem;
  transition: all 300ms ease;
}

.project-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.project-thumb {
  display: grid;
  place-items: center;
  height: 148px;
  border-radius: var(--radius-sm);
  border: 1px solid #dbeafe;
  background: linear-gradient(150deg, #eff6ff 0%, #e0e7ff 100%);
  color: #4f46e5;
  font-size: 1.5rem;
  margin-bottom: 0.9rem;
}

.project-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.7rem;
}

.project-year {
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #f1f5f9;
  color: var(--text-soft);
  padding: 0.2rem 0.65rem;
  font-size: 0.82rem;
  font-weight: 600;
}

.project-card h3 {
  margin-top: 0.95rem;
}

.project-card p {
  margin-top: 0.7rem;
  color: var(--text-soft);
}

.stack-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 1rem;
}

.stack-list span {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.58rem;
  border-radius: 999px;
  background: #f8fafc;
  border: 1px solid var(--border);
  color: var(--text-soft);
  font-size: 0.8rem;
  font-weight: 600;
}

.card-actions {
  margin-top: auto;
  padding-top: 1.25rem;
}

.icon-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1px solid var(--border);
  color: var(--text-soft);
  background: var(--surface);
  transition: all 300ms ease;
}

.icon-link:hover {
  transform: translateY(-3px);
  color: var(--accent-dark);
  border-color: #93c5fd;
  background: #eff6ff;
}

.project-links-panel {
  margin-top: 1.2rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  padding: 1rem;
}

.project-link-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  grid-template-columns: repeat(3, minmax(200px, 1fr));
  gap: 1rem;
}

.project-link-list li {
  position: relative;
}

.project-link-list a {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem;
  color: var(--text);
  font-weight: 600;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface);
  transition: all 300ms ease;
  min-height: 100px;
  position: relative;
}

.project-link-list a:hover {
  text-decoration: none;
  background: var(--accent-soft);
  border-color: #93c5fd;
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

/* Pagination */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 2rem;
  flex-wrap: wrap;
}

.pagination a,
.pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 1px solid var(--border);
  color: var(--text-soft);
  font-weight: 600;
  transition: all 300ms ease;
  text-decoration: none;
}

.pagination a:hover {
  color: var(--accent-dark);
  background: var(--accent-soft);
  border-color: #93c5fd;
  transform: translateY(-2px);
}

.pagination span.active {
  background: var(--accent);
  color: #ffffff;
  border-color: var(--accent);
}

.pagination span.disabled {
  color: var(--muted);
  cursor: not-allowed;
  opacity: 0.5;
}

.about-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.about-grid article,
.system-panel,
.auth-card,
.admin-panel,
.stat-card,
.empty-state {
  padding: 1.1rem;
}

.about-grid p {
  margin-top: 0.7rem;
  color: var(--text-soft);
}

.journey-section {
  position: relative;
}

.journey-timeline {
  position: relative;
  display: grid;
  gap: 1.25rem;
  padding-block: 0.35rem;
}

.journey-timeline::before {
  content: "";
  position: absolute;
  top: 0.9rem;
  bottom: 0.9rem;
  left: 50%;
  width: 4px;
  border-radius: 999px;
  background: linear-gradient(180deg, #2563eb 0%, #14b8a6 52%, #f59e0b 100%);
  box-shadow: 0 0 0 6px rgba(37, 99, 235, 0.06);
  transform: translateX(-50%);
}

.journey-item {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 66px minmax(0, 1fr);
  gap: 0.75rem;
  align-items: start;
}

.journey-node {
  position: relative;
  z-index: 2;
  grid-column: 2;
  grid-row: 1;
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  margin-inline: auto;
  border-radius: 50%;
  border: 1px solid #bfdbfe;
  background: #ffffff;
  color: var(--accent-dark);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.12);
}

.journey-node img {
  width: 62%;
  height: 62%;
  object-fit: contain;
}

.journey-node i {
  font-size: 1.05rem;
}

.journey-item.is-latest .journey-node {
  border-color: #fde68a;
  background: #fffbeb;
  color: #b45309;
}

.journey-card {
  position: relative;
  z-index: 1;
  grid-row: 1;
  display: grid;
  gap: 0.75rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  padding: 1rem;
}

.journey-card::after {
  content: "";
  position: absolute;
  top: 29px;
  width: calc(33px + 0.75rem);
  height: 2px;
  background: #bfdbfe;
}

.journey-item:nth-child(odd) .journey-card {
  grid-column: 1;
}

.journey-item:nth-child(odd) .journey-card::after {
  right: calc(-33px - 0.75rem);
}

.journey-item:nth-child(even) .journey-card {
  grid-column: 3;
}

.journey-item:nth-child(even) .journey-card::after {
  left: calc(-33px - 0.75rem);
}

.journey-card-top,
.journey-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem;
}

.journey-card-top {
  justify-content: space-between;
}

.journey-period,
.journey-badge {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  border-radius: 999px;
  padding: 0.25rem 0.65rem;
  font-size: 0.8rem;
  font-weight: 700;
}

.journey-period {
  border: 1px solid #ccfbf1;
  background: #f0fdfa;
  color: #0f766e;
}

.journey-badge {
  border: 1px solid #fde68a;
  background: #fffbeb;
  color: #b45309;
}

.journey-card p {
  color: var(--text-soft);
}

.journey-stack {
  margin-top: 0;
}

.journey-actions {
  margin-top: 0.15rem;
}

.site-footer {
  border-top: 1px solid var(--border);
  background: #ffffff;
  padding-block: 1.4rem;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  color: var(--text-soft);
}

.footer-links {
  display: flex;
  gap: 0.55rem;
}

.footer-links a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 1px solid var(--border);
  color: var(--text-soft);
  background: var(--surface);
  transition: all 300ms ease;
}

.footer-links a:hover {
  transform: translateY(-3px);
  color: var(--accent-dark);
  border-color: #93c5fd;
  background: #eff6ff;
}

.login-section {
  display: grid;
  place-items: center;
  min-height: calc(100vh - 72px);
  padding-block: 2.5rem;
}

.auth-card {
  width: min(480px, 100%);
}

.field {
  display: grid;
  gap: 0.45rem;
  margin-top: 0.95rem;
  font-weight: 600;
  color: var(--text-soft);
}

.field input,
.field select,
.field textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #ffffff;
  color: var(--text);
  padding: 0.7rem 0.8rem;
  resize: vertical;
  transition: all 300ms ease;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: #93c5fd;
  box-shadow: 0 0 0 3px #dbeafe;
  outline: none;
}

.field-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem;
  margin-top: 0.95rem;
}

.field-row .field {
  margin-top: 0;
}

.flash {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  margin-bottom: 0.8rem;
  padding: 0.75rem 0.9rem;
  background: #f8fafc;
  color: var(--text-soft);
  font-weight: 600;
}

.flash-success {
  border-color: #a7f3d0;
  background: #ecfdf5;
  color: var(--success);
}

.flash-error {
  border-color: #fecaca;
  background: #fef2f2;
  color: #991b1b;
}

.flash button {
  color: inherit;
}

.project-detail {
  padding-block: 3rem 4rem;
}

.breadcrumbs {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.breadcrumbs a {
  color: var(--accent-dark);
  font-weight: 600;
}

.breadcrumbs a:hover {
  text-decoration: underline;
}

.detail-hero {
  position: relative;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  padding: 1.4rem;
  box-shadow: var(--shadow-sm);
}

.detail-hero.has-logo {
  padding-right: clamp(5.5rem, 9vw, 8rem);
}

.detail-hero-content {
  max-width: 860px;
  text-align: left;
}

.detail-hero h1 {
  margin: 0.4rem 0 0;
  line-height: 1.08;
}

.detail-hero > .detail-hero-content > p:not(.eyebrow) {
  max-width: 860px;
  margin-top: 0.9rem;
  color: var(--text-soft);
}

.detail-stack {
  margin: 1rem 0 1.1rem;
  justify-content: flex-start;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin-bottom: 1rem;
  font-weight: 600;
  color: var(--accent-dark);
}

.back-link:hover {
  text-decoration: underline;
}

.detail-hero-logo {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: clamp(78px, 10vw, 112px);
  height: clamp(78px, 10vw, 112px);
  pointer-events: none;
}

.detail-hero-logo-orb {
  position: relative;
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
}

.detail-hero-logo-orb::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: linear-gradient(150deg, #eff6ff 0%, #e0e7ff 100%);
  border: 1px solid #dbeafe;
}

.detail-hero-logo-orb img {
  position: relative;
  z-index: 1;
  width: 58%;
  height: 58%;
  object-fit: contain;
  filter: drop-shadow(0 6px 10px rgba(15, 23, 42, 0.12));
}

.case-study {
  max-width: 860px;
  margin-top: 2rem;
  color: var(--text-soft);
  line-height: 1.85;
}

.case-study > * + * {
  margin-top: 1rem;
}

.case-study a {
  color: var(--accent-dark);
  text-decoration: underline;
  font-weight: 600;
}

.case-study ul,
.case-study ol {
  padding-left: 1.4rem;
}

.empty-state {
  display: grid;
  place-items: center;
  gap: 0.55rem;
  min-height: 160px;
  text-align: center;
  color: var(--text-soft);
}

.system-panel h1,
.system-panel h2,
.auth-card h1 {
  margin-bottom: 0.8rem;
}

.system-panel .btn {
  margin-top: 1rem;
}

.admin-body {
  background: var(--bg);
}

.admin-layout {
  display: grid;
  grid-template-columns: 270px minmax(0, 1fr);
  min-height: 100vh;
}

.admin-sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 1rem;
  border-right: 1px solid var(--border);
  background: #ffffff;
}

.admin-brand {
  display: flex;
  padding: 0.65rem 0.4rem 1rem;
  border-bottom: 1px solid var(--border);
}

.admin-nav {
  display: grid;
  gap: 0.35rem;
  margin-top: 1rem;
}

.admin-main {
  min-width: 0;
  padding: 1.35rem;
}

.admin-topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.admin-user {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #ffffff;
  padding: 0.45rem 0.65rem;
  color: var(--text-soft);
  font-weight: 600;
}

.stats-grid {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  margin-bottom: 1.5rem;
}

.stat-card {
  display: grid;
  gap: 0.45rem;
}

.stat-card span {
  color: var(--text);
  font-size: 1.8rem;
  font-weight: 700;
  line-height: 1.2;
}

.admin-grid {
  display: grid;
  grid-template-columns: minmax(280px, 420px) minmax(0, 1fr);
  gap: 1.3rem;
  align-items: start;
}

.admin-grid.wide-form {
  grid-template-columns: minmax(320px, 540px) minmax(0, 1fr);
}

.admin-panel + .admin-panel {
  margin-top: 1rem;
}

.form-panel {
  position: sticky;
  top: 1rem;
}

.panel-heading {
  margin-bottom: 1rem;
}

.table-wrap {
  overflow-x: auto;
  border-radius: 12px;
  border: 1px solid var(--border);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 620px;
}

.data-table th,
.data-table td {
  border-bottom: 1px solid var(--border);
  padding: 0.75rem;
  text-align: left;
  vertical-align: middle;
}

.data-table th {
  background: #f1f5f9;
  color: var(--text-soft);
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
}

.action-cell {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.danger {
  color: var(--danger);
}

.danger:hover {
  border-color: #fecaca;
  background: #fef2f2;
  color: #b91c1c;
}

.checkbox-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 0.6rem;
}

.checkbox-tile {
  position: relative;
  display: block;
}

.checkbox-tile input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.checkbox-tile span {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 44px;
  padding: 0.55rem 0.7rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  color: var(--text-soft);
  font-weight: 600;
  transition: all 300ms ease;
}

.checkbox-tile input:checked + span,
.checkbox-tile span:hover {
  color: var(--accent-dark);
  background: var(--accent-soft);
  border-color: #93c5fd;
}

legend {
  padding: 0;
  color: var(--text-soft);
  font-weight: 600;
}

fieldset {
  min-width: 0;
  border: 0;
  padding: 0;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.mode-switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  max-width: min(46vw, 360px);
  overflow-x: auto;
  scrollbar-width: none;
  padding: 0.25rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #ffffff;
  box-shadow: var(--shadow-sm);
}

.mode-switch::before {
  content: "";
  position: absolute;
  top: 0.25rem;
  left: 0;
  width: var(--switch-width, 0px);
  height: calc(100% - 0.5rem);
  border-radius: 9px;
  background: #0f172a;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.3);
  opacity: 0;
  transform: translateX(var(--switch-x, 0px));
  transition: none;
  pointer-events: none;
}

.mode-switch.is-ready::before {
  opacity: 1;
}

.mode-switch.is-animating::before {
  transition:
    transform 360ms cubic-bezier(0.22, 1, 0.36, 1),
    width 360ms cubic-bezier(0.22, 1, 0.36, 1),
    opacity 180ms ease;
}

.mode-switch::-webkit-scrollbar {
  display: none;
}

.mode-switch a {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-height: 34px;
  flex: 0 0 auto;
  padding: 0.35rem 0.6rem;
  border-radius: 9px;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 700;
  transition: all 250ms ease;
}

.mode-switch a:hover {
  color: var(--text);
}

.mode-switch a.is-active {
  color: #ffffff;
  background: #0f172a;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.3);
}

.mode-switch.is-ready a.is-active {
  background: transparent;
  box-shadow: none;
}

.models-hero {
  width: min(var(--content-width), calc(100% - 2rem));
  margin-inline: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 2rem;
  padding-block: 4.5rem 3.5rem;
}

.models-hero-copy {
  max-width: 820px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
  margin-top: 1.8rem;
}

.models-hero-copy h1 {
  font-size: clamp(2rem, 4vw, 3.15rem);
  line-height: 1.08;
}

.models-hero-copy p:not(.eyebrow) {
  margin-top: 1rem;
  color: var(--text-soft);
  font-size: 1.04rem;
}

.models-hero-panel {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 320px;
  overflow: hidden;
  border-radius: var(--radius-lg);
  border: 1px solid #ccfbf1;
  background:
    linear-gradient(135deg, rgba(20, 184, 166, 0.14), rgba(245, 158, 11, 0.12)),
    repeating-linear-gradient(
      90deg,
      rgba(15, 23, 42, 0.06) 0 1px,
      transparent 1px 34px
    ),
    repeating-linear-gradient(
      0deg,
      rgba(15, 23, 42, 0.05) 0 1px,
      transparent 1px 34px
    ),
    #ffffff;
  box-shadow: var(--shadow-md);
}

.models-hero-panel i {
  position: relative;
  z-index: 2;
  color: #0f766e;
  font-size: 6rem;
  filter: drop-shadow(0 18px 24px rgba(15, 23, 42, 0.18));
  transform: rotate(-12deg);
}

.model-axis {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 52%;
  height: 3px;
  border-radius: 999px;
  transform-origin: left center;
}

.axis-x {
  background: #dc2626;
  transform: rotate(0deg);
}

.axis-y {
  background: #16a34a;
  transform: rotate(-58deg);
}

.axis-z {
  background: #2563eb;
  transform: rotate(58deg);
}

.section-count,
.model-card-meta span {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #ffffff;
  color: var(--text-soft);
  font-size: 0.84rem;
  font-weight: 700;
}

.section-count {
  min-height: 38px;
  padding: 0.45rem 0.75rem;
}

.model-grid {
  align-items: stretch;
}

.model-card {
  border-color: #ccfbf1;
}

.model-thumb {
  height: clamp(220px, 28vw, 260px);
  flex-shrink: 0;
  overflow: hidden;
  background:
    linear-gradient(
      180deg,
      rgba(20, 184, 166, 0.04) 0%,
      rgba(20, 184, 166, 0.08) 100%
    ),
    #f8fafc;
  border-color: #ccfbf1;
  color: #0f766e;
  display: flex;
  align-items: center;
  justify-content: center;
}

.model-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  padding: 0.5rem;
  display: block;
  border-radius: calc(var(--radius-sm) - 1px);
}

.model-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.9rem;
}

.model-card-meta span {
  padding: 0.28rem 0.58rem;
  background: #f8fafc;
}

.model-detail-meta {
  margin-top: 0;
}

.model-detail-hero {
  overflow: hidden;
}

.iot-hero {
  padding-block: 4rem 3rem;
}

.iot-grid {
  align-items: stretch;
}

.iot-card {
  border-color: #bae6fd;
}

.iot-thumb {
  height: clamp(190px, 24vw, 240px);
  flex-shrink: 0;
  overflow: hidden;
  border-color: #bae6fd;
  color: #0369a1;
  background:
    linear-gradient(180deg, rgba(14, 165, 233, 0.05) 0%, rgba(34, 197, 94, 0.08) 100%),
    #f8fafc;
  display: flex;
  align-items: center;
  justify-content: center;
}

.iot-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  padding: 0.65rem;
}

.iot-card-meta span {
  border-color: #bae6fd;
  background: #f0f9ff;
  color: #075985;
}

.iot-detail-hero {
  overflow: hidden;
}

.iot-device-section {
  max-width: none;
}

.iot-device-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 1rem;
}

.iot-device-card {
  display: grid;
  gap: 0.75rem;
  grid-template-rows: auto auto;
  align-content: start;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface);
  padding: 0.9rem;
  box-shadow: var(--shadow-sm);
}

.iot-device-image {
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 1 / 1;
  min-height: 0;
  border-radius: var(--radius-sm);
  border: 1px solid #bae6fd;
  background: #f0f9ff;
  color: #0369a1;
  overflow: hidden;
}

.iot-device-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  padding: 0.55rem;
}

.iot-device-card h3 {
  font-size: 1rem;
  text-align: center;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
}

.iot-device-card p {
  margin-top: 0.3rem;
  color: var(--text-soft);
  font-size: 0.9rem;
  line-height: 1.45;
  text-align: center;
}

.model-viewer-stage {
  position: relative;
  width: min(var(--content-width), calc(100% - 2rem));
  margin-inline: auto;
  min-height: clamp(500px, 72vh, 780px);
  margin-top: 2rem;
  overflow: hidden;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: #f8fafc;
}

.model-env-studio {
  background: linear-gradient(180deg, #f8fafc 0%, #e2e8f0 100%);
}

.model-env-sunset {
  background: linear-gradient(180deg, #fff7ed 0%, #fde68a 48%, #f8fafc 100%);
}

.model-env-gallery {
  background: linear-gradient(180deg, #ffffff 0%, #f1f5f9 100%);
}

.model-env-midnight {
  background: linear-gradient(180deg, #0f172a 0%, #1e293b 54%, #334155 100%);
}

.model-viewer,
.model-canvas-host {
  position: absolute;
  inset: 0;
}

.model-canvas-host canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.model-loading {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 2;
  transform: translate(-50%, -50%);
  display: grid;
  gap: 0.7rem;
  width: min(84vw, 320px);
  padding: 1rem 1.05rem;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.58);
  background: rgba(255, 255, 255, 0.9);
  color: var(--text-soft);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(8px);
}

.model-loading__row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.93rem;
  font-weight: 700;
}

.model-loading__label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.model-loading__percent {
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
  color: var(--accent-dark);
}

.model-loading__bar {
  overflow: hidden;
  height: 10px;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.14);
}

.model-loading__bar-fill {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), #60a5fa);
  transition: width 120ms linear;
}

.model-loading.is-hidden {
  opacity: 0;
  pointer-events: none;
}

.model-control-bar {
  position: absolute;
  left: 50%;
  bottom: 1rem;
  z-index: 3;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.55rem;
  width: min(100% - 2rem, 980px);
  transform: translateX(-50%);
  padding: 0.55rem;
  border-radius: 14px;
  border: 1px solid rgba(226, 232, 240, 0.8);
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.18);
  backdrop-filter: blur(10px);
}

.viewer-control-group {
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.35rem;
}

.viewer-control-group button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.38rem;
  min-height: 38px;
  padding: 0.45rem 0.65rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #ffffff;
  color: var(--text-soft);
  font-size: 0.82rem;
  font-weight: 700;
  transition: all 220ms ease;
}

.viewer-control-group button:hover,
.viewer-control-group button.is-active {
  border-color: #5eead4;
  background: #ccfbf1;
  color: #0f766e;
}

.icon-only-controls button {
  width: 38px;
  padding-inline: 0;
}

.model-noscript {
  position: absolute;
  inset: auto 1rem 1rem;
  z-index: 4;
  border-radius: 10px;
  background: #ffffff;
  padding: 0.75rem;
  color: var(--text-soft);
  font-weight: 700;
}

.model-story {
  margin-inline: auto;
}

.checkbox-line {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-top: 0.95rem;
  color: var(--text-soft);
  font-weight: 700;
}

.checkbox-line input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

.checkbox-line span {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.current-upload-preview {
  display: grid;
  gap: 0.45rem;
  margin-top: 0.4rem;
}

.current-upload-preview img {
  width: 150px;
  max-height: 110px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--border);
}

.iot-device-admin-list {
  display: grid;
  gap: 0.75rem;
}

.iot-device-admin-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(170px, 0.8fr);
  gap: 0.65rem;
  align-items: end;
  padding: 0.75rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: #f8fafc;
}

.iot-device-admin-row label {
  display: grid;
  gap: 0.35rem;
}

.iot-device-admin-row label span {
  font-size: 0.82rem;
  color: var(--muted);
}

.current-device-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.current-device-preview span {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 38px;
  padding: 0.35rem 0.6rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #ffffff;
  color: var(--text-soft);
  font-size: 0.84rem;
  font-weight: 700;
}

.current-device-preview img {
  width: 28px;
  height: 28px;
  object-fit: contain;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #f8fafc;
}

/* Gallery Slider */
.detail-logo-section {
  margin-block: 1.5rem;
  text-align: center;
}

.project-gallery {
  margin-block: 1.75rem;
}

.gallery-slider {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.gallery-viewport {
  overflow: hidden;
}

.gallery-track {
  display: flex;
  width: 100%;
  transition: transform 420ms cubic-bezier(0.33, 0.66, 0.66, 1);
  will-change: transform;
}

.gallery-item {
  flex: 0 0 100%;
  min-width: 100%;
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: clamp(280px, 50vw, 560px);
  background: white;
}

.gallery-item-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: zoom-in;
  color: inherit;
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

body.is-modal-open {
  overflow: hidden;
}

.gallery-modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: rgba(15, 23, 42, 0.7);
  opacity: 0;
  pointer-events: none;
  transition: opacity 200ms ease;
  z-index: 200;
}

.gallery-modal.is-open {
  opacity: 1;
  pointer-events: auto;
}

.gallery-modal-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: transparent;
  cursor: zoom-out;
}

.gallery-modal-panel {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: min(100%, 1100px);
  max-height: 90vh;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: #0f172a;
  padding: 0.75rem;
  box-shadow: 0 20px 45px rgba(15, 23, 42, 0.35);
}

.gallery-modal-image {
  width: 100%;
  max-height: 80vh;
  object-fit: contain;
  border-radius: calc(var(--radius-lg) - 6px);
  background: #0b1220;
}

.gallery-modal-close {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  width: 38px;
  height: 38px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(15, 23, 42, 0.8);
  color: #ffffff;
  display: grid;
  place-items: center;
  cursor: pointer;
}

.gallery-modal-close:hover {
  background: rgba(15, 23, 42, 0.95);
}

.gallery-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.9);
  color: var(--text);
  font-size: 1.1rem;
  cursor: pointer;
  transition: all 300ms ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.gallery-nav:hover {
  background: var(--surface);
  box-shadow: var(--shadow-md);
}

.gallery-prev {
  left: 0.5rem;
}

.gallery-next {
  right: 0.5rem;
}

.gallery-dots {
  display: flex;
  justify-content: center;
  gap: 0.6rem;
  margin: 1rem 0 0;
  padding-bottom: 1rem;
}

.dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: transparent;
  cursor: pointer;
  transition: all 300ms ease;
}

.dot.active {
  background: var(--accent);
  border-color: var(--accent);
}

.dot:hover {
  border-color: var(--accent);
}

@media (max-width: 980px) {
  .about-grid,
  .models-hero,
  .admin-layout,
  .admin-grid,
  .admin-grid.wide-form,
  .stats-grid {
    grid-template-columns: 1fr;
  }

  .hero-section {
    padding-block: 3rem;
  }

  .models-hero {
    padding-block: 3rem;
  }

  .admin-sidebar {
    position: relative;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  .form-panel {
    position: static;
  }
}

@media (max-width: 760px) {
  h1 {
    font-size: 1.9rem;
  }

  h2 {
    font-size: 1.4rem;
  }

  .project-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .journey-timeline::before {
    left: 50%;
    transform: translateX(-50%);
  }

  .journey-item {
    grid-template-columns: minmax(0, 1fr) 44px minmax(0, 1fr);
    gap: 0.5rem;
  }

  .journey-node {
    grid-column: 2;
    width: 44px;
    height: 44px;
  }

  .journey-card {
    padding: 0.85rem;
  }

  .journey-card::after {
    top: 22px;
  }

  .journey-item:nth-child(odd) .journey-card::after {
    right: calc(-22px - 0.5rem);
    left: auto;
    width: calc(22px + 0.5rem);
  }

  .journey-item:nth-child(even) .journey-card::after {
    left: calc(-22px - 0.5rem);
    right: auto;
    width: calc(22px + 0.5rem);
  }

  .journey-card-top {
    flex-direction: column;
    align-items: flex-start;
  }

  .journey-card h3 {
    font-size: 1rem;
  }

  .journey-card p {
    font-size: 0.9rem;
    line-height: 1.45;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    overflow: hidden;
  }

  .journey-stack {
    display: none;
  }

  .journey-actions {
    gap: 0.4rem;
  }

  .field-row {
    grid-template-columns: 1fr;
  }

  .project-link-list {
    grid-template-columns: repeat(1, 1fr);
  }

  .detail-hero {
    padding: 1.1rem;
  }

  .detail-hero.has-logo {
    padding-right: 4.75rem;
  }

  .detail-hero-logo {
    top: 0.8rem;
    right: 0.8rem;
    width: 86px;
    height: 86px;
  }

  .gallery-slider {
    border-radius: 14px;
  }

  .gallery-item {
    min-height: 280px;
  }

  .gallery-nav {
    width: 40px;
    height: 40px;
    font-size: 1rem;
  }

  .gallery-nav.gallery-prev {
    left: 0.25rem;
  }

  .gallery-nav.gallery-next {
    right: 0.25rem;
  }

  .nav-shell {
    min-height: 66px;
    flex-wrap: wrap;
  }

  .nav-actions {
    margin-left: auto;
  }

  .mode-switch {
    max-width: calc(100vw - 178px);
  }

  .menu-toggle {
    display: inline-flex;
  }

  .site-menu {
    display: none;
    width: 100%;
    padding-bottom: 0.9rem;
  }

  .site-menu.is-open {
    display: grid;
    grid-template-columns: 1fr;
    position: absolute;
    top: 66px;
    left: 0;
    right: 0;
    z-index: 40;
    background: #ffffff;
    border-bottom: 1px solid var(--border);
    padding: 0.9rem 1rem;
    margin: 0;
    width: 100%;
  }

  .site-menu a {
    border-color: var(--border);
  }

  .models-hero-panel {
    min-height: 240px;
  }

  .models-hero-panel i {
    font-size: 4.4rem;
  }

  .model-viewer-stage {
    min-height: 620px;
  }

  .model-control-bar {
    align-content: flex-start;
    bottom: 0.75rem;
    max-height: 42%;
    overflow-y: auto;
  }

  .footer-inner,
  .section-heading-row,
  .panel-heading,
  .admin-topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .hero-actions,
  .card-actions,
  .detail-actions {
    flex-direction: column;
  }

  .btn {
    width: 100%;
  }

  .project-thumb {
    height: 128px;
  }

  .iot-device-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.5rem;
  }

  .iot-device-card {
    gap: 0.4rem;
    padding: 0.45rem;
    border-radius: 10px;
  }

  .iot-device-image {
    border-radius: 8px;
  }

  .iot-device-card > div:last-child {
    min-width: 0;
  }

  .iot-device-image img {
    padding: 0.35rem;
  }

  .iot-device-card h3 {
    font-size: 0.72rem;
    line-height: 1.2;
  }

  .iot-device-card p {
    display: none;
  }
}

@media (max-width: 560px) {
  .mode-switch {
    max-width: calc(100vw - 154px);
  }

  .mode-switch a span,
  .viewer-control-group button span {
    display: none;
  }

  .model-viewer-stage {
    min-height: 560px;
  }

  .journey-item {
    grid-template-columns: minmax(0, 1fr) 38px minmax(0, 1fr);
    gap: 0.4rem;
  }

  .journey-node {
    width: 38px;
    height: 38px;
  }

  .journey-card {
    padding: 0.75rem;
  }

  .journey-card::after {
    top: 19px;
  }

  .journey-item:nth-child(odd) .journey-card::after {
    right: calc(-19px - 0.4rem);
    width: calc(19px + 0.4rem);
  }

  .journey-item:nth-child(even) .journey-card::after {
    left: calc(-19px - 0.4rem);
    width: calc(19px + 0.4rem);
  }

  .project-grid {
    grid-template-columns: 1fr;
  }

  .iot-device-admin-row {
    grid-template-columns: 1fr;
  }

  .journey-card-top {
    align-items: flex-start;
    flex-direction: column;
  }
}

.tech-icon-svg {
  width: 1.2em !important;
  height: 1.2em !important;
  max-width: 32px !important;
  max-height: 32px !important;
  object-fit: contain;
  flex-shrink: 0;
  display: inline-block;
  vertical-align: middle;
  line-height: 1;
}

/* Specific constraint for table cells in admin */
.data-table td .tech-icon-svg {
  width: 24px !important;
  height: 24px !important;
}


.contact-layout {
  display: grid;
  grid-template-columns: minmax(240px, 360px) minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
}

.contact-aside,
.contact-card {
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.contact-aside {
  padding: 1.1rem;
  display: grid;
  gap: 0.75rem;
}

.contact-aside h3 {
  font-size: 1.2rem;
}

.contact-aside p {
  color: var(--text-soft);
}

.contact-detail-list {
  display: grid;
  gap: 0.85rem;
  margin-top: 0.35rem;
}

.contact-detail-list div {
  display: grid;
  gap: 0.2rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--border);
}

.contact-detail-list span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
}

.contact-detail-list a,
.contact-detail-list strong {
  color: var(--text-soft);
  font-weight: 600;
}

.contact-card {
  width: 100%;
  padding: 1.1rem;
}

.contact-card form {
  width: 100%;
}

.contact-actions {
  align-items: center;
}
