/*
 * EmlogStudio daylight layout stability
 *
 * The daylight palette may change material, contrast and shadows, but it must
 * never change the application's spatial contract. This final layer restores
 * the dark-mode geometry wherever older daylight refinements supplied their
 * own measurements. Keeping this separate makes future palette work safe.
 */

html[data-theme="light"] body {
  font-size: var(--font-md);
  line-height: 1.45;
  letter-spacing: normal;
}

/* Shared application frame --------------------------------------------------------- */
html[data-theme="light"] .app-shell {
  gap: 18px;
  width: min(1536px, calc(100% - 28px));
  min-height: calc(100vh - 28px);
  margin: 14px auto;
}

html[data-theme="light"] .sidebar {
  padding: 20px 14px 16px;
  border-radius: var(--radius-xl);
}

html[data-theme="light"] .brand {
  gap: 9px;
  min-height: 46px;
  padding: 0 7px 12px;
}

html[data-theme="light"] .nav-list {
  gap: 6px;
  margin-top: 26px;
}

html[data-theme="light"] .nav-item {
  min-height: 44px;
  gap: 12px;
  padding: 0 13px;
  border-radius: 13px;
  font-size: inherit;
}

html[data-theme="light"] .workspace-switcher {
  padding: 13px 8px 16px;
}

html[data-theme="light"] .switcher-label {
  margin-bottom: 10px;
}

html[data-theme="light"] .switcher {
  min-height: 40px;
  border-radius: 12px;
}

html[data-theme="light"] .profile {
  gap: 10px;
  padding: 16px 5px 4px;
}

html[data-theme="light"] .workspace {
  padding: 7px 0 0;
}

html[data-theme="light"] .topbar {
  min-height: 74px;
  gap: 18px;
  padding: 0;
  border-bottom: 0;
}

html[data-theme="light"] .top-actions { gap: 8px; }
html[data-theme="light"] .search-box input { height: 39px; }

html[data-theme="light"] .route-view.active {
  min-height: auto;
  padding-top: 0;
}

html[data-theme="light"] .content-page {
  padding: 14px 0 24px;
}

@media (min-width: 1281px) {
  html[data-theme="light"] .app-shell {
    grid-template-columns: 190px minmax(0, 1fr) 276px;
  }

  html[data-theme="light"] .app-shell.wide-view {
    grid-template-columns: 190px minmax(0, 1fr);
  }
}

@media (min-width: 821px) {
  html[data-theme="light"] .app-shell > .sidebar {
    top: 14px;
    left: max(14px, calc((100vw - 1536px) / 2));
    width: 190px;
    height: calc(100vh - 28px);
    min-height: 700px;
  }
}

@media (min-width: 821px) and (max-width: 1280px) {
  html[data-theme="light"] .app-shell {
    grid-template-columns: 74px minmax(0, 1fr) 260px;
  }

  html[data-theme="light"] .app-shell.wide-view {
    grid-template-columns: 74px minmax(0, 1fr);
  }

  html[data-theme="light"] .app-shell > .sidebar { width: 74px; }
}

@media (min-width: 821px) and (max-width: 1080px) {
  html[data-theme="light"] .app-shell,
  html[data-theme="light"] .app-shell.wide-view {
    grid-template-columns: 74px minmax(0, 1fr);
  }
}

@media (max-width: 820px) {
  html[data-theme="light"] .app-shell {
    width: min(100% - 20px, 720px);
    min-height: calc(100vh - 28px);
    margin: 10px auto;
  }

  html[data-theme="light"] .workspace { padding: 0; }

  html[data-theme="light"] .topbar {
    min-height: 74px;
    gap: 9px;
    padding: 0;
  }

  html[data-theme="light"] .sidebar {
    inset: 10px auto 10px 10px;
    width: 210px;
    min-height: 0;
    border-radius: var(--radius-xl);
  }
}

@media (max-width: 540px) {
  html[data-theme="light"] .topbar { padding: 8px 0 12px; }
}

/* Personal centre: preserve the same right-side menu and card geometry. ----------- */
html[data-theme="light"] body.emstudio-view-profile .profile-dashboard {
  display: block;
  gap: normal;
  padding: 14px 0 24px;
}

html[data-theme="light"] body.emstudio-view-profile .profile-dashboard-hero {
  grid-template-columns: minmax(0, 1fr) auto auto;
  min-height: 210px;
  gap: 28px;
  padding: 28px 30px;
  border-radius: 22px;
}

html[data-theme="light"] body.emstudio-view-profile .profile-hero-intro { gap: 18px; }

html[data-theme="light"] body.emstudio-view-profile .profile-dashboard-avatar {
  width: 88px;
  height: 88px;
  flex-basis: 88px;
  border-radius: 27px;
}

html[data-theme="light"] body.emstudio-view-profile .profile-identity-title { gap: 9px; }

html[data-theme="light"] body.emstudio-view-profile .profile-role-badge {
  min-height: 25px;
  padding-inline: 8px;
}

html[data-theme="light"] body.emstudio-view-profile .profile-hero-stats {
  padding-left: 22px;
}

html[data-theme="light"] body.emstudio-view-profile .profile-hero-stats > div {
  min-width: 64px;
  gap: 5px;
  padding: 0 12px;
}

html[data-theme="light"] body.emstudio-view-profile .profile-edit-button {
  min-height: 38px;
  padding: 0 14px;
}

html[data-theme="light"] body.emstudio-view-profile .profile-dashboard-layout {
  grid-template-columns: minmax(0, 1fr) clamp(230px, 18vw, 360px);
  gap: 16px;
  margin-top: 16px;
  padding: 0;
}

html[data-theme="light"] body.emstudio-view-profile .profile-dashboard-layout > .profile-dashboard-content {
  padding: 0;
}

html[data-theme="light"] body.emstudio-view-profile .profile-dashboard-layout > .profile-dashboard-nav {
  top: 14px;
  padding: 13px;
  border-radius: 19px;
}

html[data-theme="light"] body.emstudio-view-profile .profile-nav-caption {
  margin: 2px 8px 8px;
}

html[data-theme="light"] body.emstudio-view-profile .profile-dashboard-nav button,
html[data-theme="light"] body.emstudio-view-profile .profile-dashboard-nav .logout-item {
  min-height: 44px;
  gap: 10px;
  padding: 0 10px;
  font-size: 13px;
}

html[data-theme="light"] body.emstudio-view-profile .profile-dashboard-nav button > .icon:first-child {
  width: 16px;
  height: 16px;
}

html[data-theme="light"] body.emstudio-view-profile .profile-dashboard-nav .logout-item {
  margin-top: 9px;
}

html[data-theme="light"] body.emstudio-view-profile .profile-dashboard-stat-grid { gap: 14px; }

html[data-theme="light"] body.emstudio-view-profile .profile-dashboard-stat-grid > article {
  min-height: 125px;
  padding: 18px;
  border-radius: 18px;
}

html[data-theme="light"] body.emstudio-view-profile .profile-stat-icon {
  top: 18px;
  right: 18px;
}

html[data-theme="light"] body.emstudio-view-profile .profile-recent-card {
  margin-top: 16px;
  padding: 21px 23px 10px;
  border-radius: 19px;
}

html[data-theme="light"] body.emstudio-view-profile .profile-recent-card ul { margin-top: 16px; }

html[data-theme="light"] body.emstudio-view-profile .profile-recent-card li {
  min-height: 72px;
  padding: 13px 0;
}

html[data-theme="light"] body.emstudio-view-profile .profile-dashboard-content .panel-heading {
  min-height: 76px;
  padding: 0 3px 14px;
}

html[data-theme="light"] body.emstudio-view-profile .profile-dashboard-content .user-list {
  padding: 7px 18px;
}

html[data-theme="light"] body.emstudio-view-profile .profile-dashboard-content .user-list > div {
  min-height: 76px;
  grid-template-columns: 63px minmax(0, 1fr) auto;
  gap: 15px;
}

html[data-theme="light"] body.emstudio-view-profile .profile-dashboard-content .comment-list { gap: 12px; }

html[data-theme="light"] body.emstudio-view-profile .profile-dashboard-content .comment-list article {
  padding: 18px;
  border-radius: 17px;
}

html[data-theme="light"] body.emstudio-view-profile .profile-favorite-grid { gap: 12px; }

html[data-theme="light"] body.emstudio-view-profile .profile-favorite-card {
  min-height: 156px;
  padding: 18px 18px 15px;
  border-radius: 18px;
}

html[data-theme="light"] body.emstudio-view-profile .profile-favorite-main { min-height: 0; }

html[data-theme="light"] body.emstudio-view-profile .profile-dashboard-content .profile-like-list { gap: 12px; }

html[data-theme="light"] body.emstudio-view-profile .profile-dashboard-content .profile-like-item {
  min-height: 102px;
  padding: 18px;
  border-radius: 17px;
}

html[data-theme="light"] body.emstudio-view-profile .profile-dashboard-content .account-form {
  gap: 16px;
  padding: 20px;
  border-radius: 18px;
}

@media (max-width: 1120px) {
  html[data-theme="light"] body.emstudio-view-profile .profile-dashboard-hero {
    grid-template-columns: minmax(0, 1fr) auto;
    min-height: 210px;
    gap: 22px;
  }

  html[data-theme="light"] body.emstudio-view-profile .profile-hero-stats {
    grid-column: 1 / -1;
    padding: 14px 0 0;
  }
}

@media (max-width: 760px) {
  html[data-theme="light"] body.emstudio-view-profile .profile-dashboard {
    padding: 14px 0 24px;
  }

  html[data-theme="light"] body.emstudio-view-profile .profile-dashboard-hero {
    grid-template-columns: 1fr;
    min-height: 0;
    gap: 18px;
    padding: 22px;
  }

  html[data-theme="light"] body.emstudio-view-profile .profile-hero-intro { gap: 14px; }

  html[data-theme="light"] body.emstudio-view-profile .profile-dashboard-avatar {
    width: 72px;
    height: 72px;
    flex-basis: 72px;
    border-radius: 22px;
  }

  html[data-theme="light"] body.emstudio-view-profile .profile-dashboard-layout {
    grid-template-columns: 1fr;
    gap: 13px;
    margin-top: 13px;
  }

  html[data-theme="light"] body.emstudio-view-profile .profile-dashboard-layout > .profile-dashboard-nav {
    position: static;
    display: flex;
    gap: 7px;
    padding: 9px;
  }

  html[data-theme="light"] body.emstudio-view-profile .profile-dashboard-nav button,
  html[data-theme="light"] body.emstudio-view-profile .profile-dashboard-nav .logout-item {
    min-height: 42px;
    gap: 7px;
    margin: 0;
    padding: 0 11px;
    border-radius: 10px;
    font-size: 12px;
  }

  html[data-theme="light"] body.emstudio-view-profile .profile-dashboard-stat-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  html[data-theme="light"] body.emstudio-view-profile .profile-dashboard-stat-grid > article {
    min-height: 102px;
    padding: 18px;
  }

  html[data-theme="light"] body.emstudio-view-profile .profile-favorite-grid { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  html[data-theme="light"] body.emstudio-view-profile .profile-dashboard-hero {
    padding: 18px;
    border-radius: 18px;
  }

  html[data-theme="light"] body.emstudio-view-profile .profile-recent-card { padding: 18px 16px 8px; }
  html[data-theme="light"] body.emstudio-view-profile .profile-recent-card li { min-height: 86px; }
  html[data-theme="light"] body.emstudio-view-profile .profile-dashboard-content .panel-heading { min-height: 70px; }
  html[data-theme="light"] body.emstudio-view-profile .profile-dashboard-content .user-list { padding-inline: 13px; }
  html[data-theme="light"] body.emstudio-view-profile .profile-dashboard-content .user-list > div {
    grid-template-columns: 54px minmax(0, 1fr);
    gap: 10px;
    padding-block: 10px;
  }

  html[data-theme="light"] body.emstudio-view-profile .profile-favorite-card { min-height: 145px; }
}
