:root {
  --ink: #172033;
  --muted: #71809a;
  --line: #e6eaf1;
  --surface: #ffffff;
  --canvas: #f4f6fa;
  --blue: #3157e5;
  --blue-dark: #2443bd;
  --blue-soft: #edf1ff;
  --green: #158f68;
  --green-soft: #e8f8f2;
  --red: #c64958;
  --red-soft: #fff0f2;
  --amber: #a56b0a;
  --amber-soft: #fff5df;
  --shadow: 0 18px 50px rgba(28, 39, 66, 0.09);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--canvas);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.hidden {
  display: none !important;
}

.login-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(360px, 540px) 1fr;
  background: #fff;
}

.login-card {
  padding: clamp(36px, 8vw, 96px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 32px;
}

.login-card h1 {
  margin: 8px 0 0;
  font-size: clamp(38px, 5vw, 64px);
  line-height: 0.98;
  letter-spacing: -0.055em;
}

.login-copy,
.login-note {
  color: var(--muted);
  line-height: 1.6;
}

.login-note {
  font-size: 13px;
}

.login-art {
  position: relative;
  overflow: hidden;
  margin: 18px;
  border-radius: 30px;
  background:
    radial-gradient(circle at 72% 25%, rgba(116, 146, 255, 0.8), transparent 28%),
    linear-gradient(145deg, #101b4c, #294cdb 56%, #8fa9ff);
}

.orb {
  position: absolute;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.13);
  border: 1px solid rgba(255, 255, 255, 0.22);
  backdrop-filter: blur(18px);
}

.orb-one {
  width: 420px;
  height: 420px;
  right: -80px;
  bottom: -90px;
}

.orb-two {
  width: 190px;
  height: 190px;
  left: 12%;
  top: 14%;
}

.login-preview {
  position: absolute;
  left: 12%;
  bottom: 13%;
  width: min(440px, 76%);
  padding: 30px;
  display: grid;
  gap: 8px;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 24px;
  background: rgba(18, 31, 86, 0.42);
  backdrop-filter: blur(22px);
}

.login-preview strong {
  font-size: 54px;
  letter-spacing: -0.05em;
}

.preview-label,
.preview-status {
  color: rgba(255, 255, 255, 0.72);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand > span:last-child {
  display: grid;
}

.brand strong {
  letter-spacing: -0.02em;
}

.brand small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}

.brand-mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 800;
  border-radius: 12px;
  background: var(--blue);
  box-shadow: 0 8px 20px rgba(49, 87, 229, 0.28);
}

.brand-login {
  position: absolute;
  top: 42px;
}

.form-stack,
.form-grid {
  display: grid;
  gap: 18px;
}

.form-stack label,
.form-grid label,
.field-label {
  display: grid;
  gap: 8px;
  color: #4b5870;
  font-size: 13px;
  font-weight: 650;
}

input,
select,
textarea {
  width: 100%;
  padding: 12px 14px;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 11px;
  outline: none;
  background: #fff;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

input:focus,
select:focus,
textarea:focus {
  border-color: #96a9fa;
  box-shadow: 0 0 0 4px rgba(49, 87, 229, 0.1);
}

.button {
  min-height: 44px;
  padding: 0 18px;
  border: 0;
  border-radius: 11px;
  font-weight: 700;
}

.button-primary {
  color: #fff;
  background: var(--blue);
  box-shadow: 0 9px 20px rgba(49, 87, 229, 0.2);
}

.button-primary:hover {
  background: var(--blue-dark);
}

.button-quiet {
  color: var(--ink);
  background: #eef1f6;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 244px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 30px 20px 24px;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border-right: 1px solid var(--line);
}

.sidebar .brand {
  padding: 0 10px 28px;
}

.nav {
  display: grid;
  gap: 7px;
}

.nav-section-label {
  margin: 14px 12px 3px;
  color: #9aa5b7;
  font-size: 9px;
  font-weight: 850;
  letter-spacing: .13em;
  text-transform: uppercase;
}

.nav-item {
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  color: #68748a;
  border: 0;
  border-radius: 11px;
  background: transparent;
  text-align: left;
  font-weight: 650;
}

.nav-item:hover,
.nav-item.active {
  color: var(--blue);
  background: var(--blue-soft);
}

.nav-icon {
  width: 20px;
  text-align: center;
  font-size: 18px;
}

.sidebar-footer {
  margin-top: auto;
  display: grid;
  gap: 12px;
}

.profile-nav-link { text-decoration: none; }

.system-chip {
  padding: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.system-chip > span:last-child {
  display: grid;
  gap: 2px;
}

.system-chip strong {
  font-size: 12px;
}

.system-chip small {
  color: var(--muted);
  font-size: 10px;
}

.status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #25af7b;
  box-shadow: 0 0 0 4px var(--green-soft);
}

.logout-button {
  padding: 10px;
  color: var(--muted);
  border: 0;
  background: transparent;
}

.workspace {
  min-width: 0;
}

.topbar {
  height: 102px;
  padding: 24px clamp(24px, 4vw, 52px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(244, 246, 250, 0.88);
  backdrop-filter: blur(16px);
}

.topbar h2 {
  margin: 3px 0 0;
  font-size: 26px;
  letter-spacing: -0.035em;
}

.eyebrow {
  margin: 0;
  color: var(--blue);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 11px;
}

.icon-button,
.admin-avatar {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 12px;
}

.icon-button {
  color: var(--ink);
  border: 1px solid var(--line);
  background: #fff;
  font-size: 20px;
}

.admin-avatar {
  color: #fff;
  background: var(--ink);
  font-size: 11px;
  font-weight: 800;
}

.page-content {
  padding: 10px clamp(24px, 4vw, 52px) 56px;
}

.page-content > .help-box {
  margin-bottom: 28px;
}

.page-content > .stats-grid {
  margin-bottom: 28px;
}

.loading-bar {
  height: 3px;
  overflow: hidden;
}

.loading-bar span {
  width: 35%;
  height: 100%;
  display: block;
  background: var(--blue);
  animation: loading 900ms infinite ease-in-out;
}

@keyframes loading {
  from { transform: translateX(-120%); }
  to { transform: translateX(400%); }
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.stat-card,
.panel,
.model-card,
.plan-card,
.secret-card,
.post-admin-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(32, 44, 77, 0.035);
}

.stat-card {
  min-height: 148px;
  padding: 22px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.stat-card small {
  color: var(--muted);
  font-weight: 650;
}

.stat-card strong {
  font-size: 34px;
  letter-spacing: -0.055em;
}

.stat-foot {
  color: var(--green);
  font-size: 11px;
  font-weight: 700;
}

.section-grid {
  margin-top: 18px;
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 18px;
}

.panel {
  padding: 22px;
}

.panel-head,
.page-toolbar,
.card-head,
.dialog-head,
.dialog-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.panel-head {
  margin-bottom: 22px;
}

.panel h3,
.model-card h3,
.plan-card h3,
.dialog h3 {
  margin: 0;
  font-size: 17px;
  letter-spacing: -0.025em;
}

.muted {
  color: var(--muted);
}

.activity-list,
.distribution {
  display: grid;
  gap: 14px;
}

.activity-item {
  display: grid;
  grid-template-columns: 38px 1fr auto;
  align-items: center;
  gap: 12px;
}

.activity-icon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  color: var(--blue);
  border-radius: 11px;
  background: var(--blue-soft);
  font-weight: 800;
}

.activity-item strong,
.activity-item small {
  display: block;
}

.activity-item strong {
  font-size: 13px;
}

.activity-item small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

.activity-value {
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
}

.bar-row {
  display: grid;
  gap: 8px;
}

.bar-meta {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 650;
}

.bar-track {
  height: 8px;
  overflow: hidden;
  border-radius: 99px;
  background: #edf0f5;
}

.bar-track span {
  height: 100%;
  display: block;
  border-radius: inherit;
  background: var(--blue);
}

.page-toolbar {
  margin-bottom: 18px;
}

.cms-tabs {
  margin-bottom: 24px;
  padding: 5px;
  display: inline-flex;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

.cms-tabs button {
  padding: 9px 13px;
  color: var(--muted);
  border: 0;
  border-radius: 8px;
  background: transparent;
  font-size: 12px;
  font-weight: 750;
}

.cms-tabs button.active {
  color: var(--blue);
  background: var(--blue-soft);
}

.search-input {
  max-width: 340px;
}

.table-wrap {
  overflow: auto;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
}

table {
  width: 100%;
  border-collapse: collapse;
  white-space: nowrap;
}

th,
td {
  padding: 15px 18px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
}

th {
  color: var(--muted);
  background: #fafbfc;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

tbody tr:last-child td {
  border-bottom: 0;
}

tbody tr:hover {
  background: #fbfcff;
}

.user-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-avatar {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  color: var(--blue);
  border-radius: 10px;
  background: var(--blue-soft);
  font-size: 11px;
  font-weight: 800;
}

.user-cell strong,
.user-cell small {
  display: block;
}

.user-cell small {
  margin-top: 2px;
  color: var(--muted);
}

.badge {
  padding: 5px 8px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  color: var(--green);
  background: var(--green-soft);
  font-size: 10px;
  font-weight: 800;
}

.badge-blue {
  color: var(--blue);
  background: var(--blue-soft);
}

.badge-red {
  color: var(--red);
  background: var(--red-soft);
}

.badge-warn {
  color: var(--amber);
  background: var(--amber-soft);
}

.text-button {
  padding: 7px 10px;
  color: var(--blue);
  border: 0;
  border-radius: 8px;
  background: var(--blue-soft);
  font-size: 11px;
  font-weight: 750;
}

.table-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.danger-link { color: #bd3c50; }

.cards-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.model-card,
.plan-card,
.secret-card {
  padding: 22px;
}

.model-card .form-grid,
.plan-card .form-grid {
  margin-top: 22px;
}

.form-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.span-two {
  grid-column: span 2;
}

.card-actions {
  margin-top: 20px;
  display: flex;
  justify-content: flex-end;
}

.help-box {
  margin-bottom: 24px;
  padding: 18px 20px;
  color: #42506a;
  border: 1px solid #cfd8ff;
  border-radius: 14px;
  background: var(--blue-soft);
  line-height: 1.55;
}

.secret-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.secret-card {
  display: grid;
  gap: 13px;
}

.secret-card code {
  padding: 10px;
  overflow: hidden;
  color: #3d4c69;
  border-radius: 9px;
  background: #f2f4f8;
  text-overflow: ellipsis;
}

.cms-status-grid {
  margin-bottom: 18px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.post-admin-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.team-admin-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.roadmap-admin-list {
  display: grid;
  gap: 24px;
}

.popup-admin-list {
  display: grid;
  gap: 16px;
}

.roadmap-create-panel {
  margin-bottom: 32px;
  border-color: rgba(0, 122, 255, .42);
  box-shadow:
    0 0 0 1px rgba(0, 122, 255, .08),
    0 18px 42px rgba(0, 122, 255, .075);
}

.roadmap-create-panel .panel-head {
  padding-bottom: 4px;
}

.roadmap-admin-card,
.popup-admin-card {
  display: grid;
  gap: 18px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 8px 32px rgba(32, 44, 77, 0.035);
}

.roadmap-admin-form .form-grid,
.roadmap-admin-card .form-grid,
.popup-admin-card .form-grid {
  padding: 2px;
}

.roadmap-admin-head {
  display: grid;
  gap: 5px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.roadmap-admin-head span {
  color: var(--blue);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: .11em;
  text-transform: uppercase;
}

.roadmap-admin-head strong {
  font-size: 18px;
  letter-spacing: -.02em;
}

.roadmap-admin-head small {
  color: var(--muted);
  font-size: 12px;
}

.roadmap-admin-form {
  display: grid;
  gap: 18px;
}

.team-admin-card {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  gap: 16px;
  min-width: 0;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 8px 32px rgba(32, 44, 77, 0.035);
}

.team-admin-card.featured {
  border-color: #bed6ff;
  background: linear-gradient(135deg, #f4f8ff, #fff 55%);
}

.team-admin-avatar,
.team-preview-avatar {
  display: grid;
  place-items: center;
  overflow: hidden;
  color: #fff;
  border-radius: 999px;
  background: var(--blue);
  background-position: center;
  background-size: cover;
  font-weight: 850;
}

.team-admin-avatar {
  width: 76px;
  height: 76px;
  font-size: 18px;
}

.team-admin-copy {
  min-width: 0;
}

.team-admin-copy h3 {
  margin: 7px 0;
  font-size: 18px;
}

.team-admin-copy p {
  min-height: 58px;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.team-member-preview {
  text-align: center;
}

.team-preview-avatar {
  width: 132px;
  height: 132px;
  margin: 20px auto;
  font-size: 28px;
}

.team-member-preview .post-category {
  margin-top: 0;
}

.post-admin-card {
  min-width: 0;
  overflow: hidden;
}

.post-admin-image {
  position: relative;
  aspect-ratio: 16 / 9;
  display: grid;
  place-items: center;
  color: #fff;
  background: center / cover no-repeat #dbe7ff;
}

.post-admin-image.empty-image {
  background: linear-gradient(135deg, #3157e5, #8ba5ff);
}

.post-admin-image > span {
  font-size: 24px;
  font-weight: 850;
}

.featured-pill {
  position: absolute;
  top: 12px;
  right: 12px;
  padding: 6px 9px;
  border-radius: 999px;
  color: #58400b;
  background: #fff3bd;
  font-size: 9px;
  font-style: normal;
  font-weight: 850;
  text-transform: uppercase;
}

.post-admin-body {
  padding: 18px;
}

.post-admin-body .card-head small {
  color: var(--muted);
}

.post-category {
  display: block;
  margin-top: 16px;
  color: var(--blue);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.post-admin-body h3 {
  margin: 7px 0;
  font-size: 18px;
}

.post-admin-body p {
  min-height: 58px;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.post-admin-actions {
  margin-top: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.post-admin-actions a {
  text-decoration: none;
}

.prompt-create-panel {
  margin-bottom: 24px;
}

.panel-intro {
  max-width: 780px;
  margin: -4px 0 22px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.prompt-selection-head {
  display: flex;
  justify-content: space-between;
  margin-top: 22px;
}

.prompt-selection-head > span {
  display: grid;
  gap: 4px;
}

.prompt-selection-head small {
  color: var(--muted);
}

.package-project-picker {
  display: grid;
  gap: 9px;
  margin-top: 12px;
}

.package-project-option {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  padding: 15px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fbfcfe;
  transition: border-color .18s ease, background .18s ease, box-shadow .18s ease;
}

.package-project-option.selected {
  border-color: #9bc8ff;
  background: #f5f9ff;
  box-shadow: 0 0 0 1px rgba(13, 124, 255, .08);
}

.prompt-main-check {
  position: relative;
  display: grid;
  grid-template-columns: 21px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  cursor: pointer;
}

.prompt-main-check > input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.custom-check {
  position: relative;
  width: 19px;
  height: 19px;
  border: 1px solid #b8c3d0;
  border-radius: 6px;
  background: #fff;
}

.prompt-main-check input:checked + .custom-check {
  border-color: var(--blue);
  background: var(--blue);
}

.prompt-main-check input:checked + .custom-check::after {
  content: "";
  position: absolute;
  left: 6px;
  top: 3px;
  width: 5px;
  height: 9px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.prompt-option-copy {
  display: grid;
  gap: 3px;
}

.prompt-option-copy small {
  color: var(--muted);
  line-height: 1.4;
}

.permission-checks {
  display: flex;
  gap: 7px;
}

.permission-checks label {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

.permission-checks input {
  margin: 0;
  accent-color: var(--blue);
}

.package-create-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: 18px;
}

.package-create-footer > span {
  color: var(--muted);
  font-size: 12px;
}

.package-form-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.prompt-template-management {
  margin: 4px 0 28px;
}

.prompt-template-management > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  cursor: pointer;
  list-style: none;
}

.prompt-template-management > summary::-webkit-details-marker {
  display: none;
}

.prompt-template-management > summary > span:first-child {
  display: grid;
  gap: 3px;
}

.prompt-template-management > summary small,
.prompt-template-management > summary > span:last-child {
  color: var(--muted);
  font-size: 11px;
}

.prompt-template-management[open] > summary {
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.prompt-template-management .prompt-project-list {
  margin-top: 18px;
}

.template-explanation {
  max-width: 820px;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.prompt-template-placeholder > div {
  min-height: 84px;
  padding: 18px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.prompt-template-placeholder > div > span:first-child {
  display: grid;
  gap: 5px;
}

.prompt-template-placeholder small {
  color: var(--muted);
}

.prompt-lab-layout.reviews-only {
  grid-template-columns: 1fr;
}

.prompt-package-list {
  display: grid;
  gap: 12px;
  margin-bottom: 28px;
}

.prompt-package-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}

.prompt-package-card h3,
.prompt-package-card p {
  margin: 0;
}

.prompt-package-card > div:first-child {
  display: grid;
  gap: 6px;
}

.prompt-package-card > div:first-child > p:last-child {
  color: var(--muted);
  font-size: 12px;
}

.package-prompt-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.package-prompt-summary > span {
  display: grid;
  gap: 2px;
  padding: 7px 9px;
  border-radius: 8px;
  color: #35404d;
  background: #f0f4f8;
  font-size: 11px;
}

.package-prompt-summary small {
  color: var(--muted);
  font-size: 9px;
}

.package-card-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.package-usage {
  padding: 7px 10px;
  color: var(--muted);
  border-radius: 8px;
  background: #f3f5f8;
  font-size: 11px;
  font-weight: 750;
  white-space: nowrap;
}

.cost-limit-card,
.feedback-admin-card,
.review-admin-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(33, 44, 63, .04);
}

.cost-limit-card {
  margin-bottom: 18px;
  padding: 18px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, .45fr);
  gap: 18px;
  align-items: end;
}

.cost-limit-card > div {
  display: grid;
  gap: 8px;
}

.cost-limit-card span,
.feedback-admin-card footer {
  color: var(--muted);
  font-size: 12px;
}

.cost-limit-card strong {
  font-size: 24px;
  letter-spacing: -.03em;
}

.cost-limit-card form {
  display: flex;
  align-items: end;
  gap: 10px;
}

.usage-filters select {
  max-width: 210px;
}

.user-mini {
  display: grid;
  gap: 3px;
}

.user-mini strong {
  font-size: 12px;
}

.user-mini small {
  color: var(--muted);
  font-size: 11px;
}

.cost-settings-panel {
  margin-top: 18px;
  padding: 0;
}

.cost-settings-panel summary {
  padding: 18px 20px;
  display: flex;
  justify-content: space-between;
  cursor: pointer;
}

.model-cost-grid {
  padding: 0 20px 20px;
  display: grid;
  gap: 14px;
}

.model-cost-grid fieldset {
  margin: 0;
  padding: 14px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.model-cost-grid legend {
  padding: 0 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.feedback-admin-list,
.review-admin-list {
  display: grid;
  gap: 14px;
}

.feedback-admin-card,
.review-admin-card {
  padding: 18px;
}

.feedback-admin-card h3 {
  margin: 5px 0 0;
  color: #f5a400;
  letter-spacing: .03em;
}

.feedback-admin-card p {
  color: #445066;
  line-height: 1.6;
}

.feedback-admin-card footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.feedback-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}

.feedback-actions select {
  min-width: 140px;
}

.review-admin-form {
  display: grid;
  gap: 16px;
}

.prompt-lab-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(340px, .85fr);
  gap: 24px;
  align-items: start;
}

.section-title {
  display: flex;
  align-items: end;
  justify-content: space-between;
  margin: 6px 0 14px;
}

.section-title h3 {
  margin: 0;
}

.prompt-project-list,
.submission-list {
  display: grid;
  gap: 14px;
}

.prompt-project-card,
.submission-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(33, 44, 63, .04);
}

.prompt-project-card > summary {
  display: flex;
  min-height: 84px;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 20px;
  cursor: pointer;
  list-style: none;
}

.prompt-project-card > summary::-webkit-details-marker {
  display: none;
}

.prompt-project-card > summary > span:first-child {
  display: grid;
  gap: 5px;
}

.prompt-project-card > summary small,
.submission-card p {
  color: var(--muted);
}

.prompt-project-card > summary strong {
  font-size: 16px;
}

.prompt-summary-meta {
  display: grid;
  justify-items: end;
  gap: 7px;
  text-align: right;
}

.prompt-project-form {
  padding: 20px;
  border-top: 1px solid var(--line);
  background: #fbfcfe;
}

.code-input,
.submission-detail pre {
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 12px;
}

.prompt-link-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 10px;
  align-items: center;
  margin-top: 18px;
  padding: 12px;
  border: 1px solid #dce7f4;
  border-radius: 10px;
  background: #f4f9ff;
}

.prompt-link-row code {
  overflow: hidden;
  color: #28527d;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.split-actions {
  justify-content: space-between;
}

.submission-card {
  padding: 19px;
}

.submission-card p {
  line-height: 1.55;
}

.score-pill {
  display: inline-grid;
  min-width: 50px;
  min-height: 36px;
  place-items: center;
  border-radius: 999px;
  color: #12613b;
  background: #e8f8ef;
  font-size: 13px;
  font-weight: 850;
}

.submission-card details {
  margin-top: 14px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 13px 0;
}

.submission-card summary {
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.submission-detail {
  display: grid;
  gap: 14px;
  margin-top: 14px;
}

.submission-detail pre {
  max-height: 280px;
  overflow: auto;
  margin: 0;
  padding: 14px;
  border-radius: 9px;
  color: #dce5ef;
  background: #111318;
  white-space: pre-wrap;
}

.submission-actions {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 15px;
}

.submission-actions select {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 0 10px;
  background: #fff;
}

.external-link {
  color: var(--blue);
  font-weight: 750;
  text-decoration: none;
}

.empty {
  padding: 50px 20px;
  color: var(--muted);
  text-align: center;
}

.dialog {
  width: min(640px, calc(100vw - 32px));
  padding: 0;
  border: 0;
  border-radius: 20px;
  box-shadow: var(--shadow);
}

.post-dialog {
  width: min(1120px, calc(100vw - 32px));
}

.post-dialog form {
  max-height: calc(100vh - 42px);
  overflow-y: auto;
}

.post-editor-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, .65fr);
  gap: 24px;
}

.post-editor-grid textarea {
  resize: vertical;
}

.post-editor-grid label small {
  color: var(--muted);
  font-weight: 500;
}

.checkbox-field {
  min-height: 48px;
  padding: 12px 14px;
  display: flex !important;
  align-items: center;
  align-self: end;
  border: 1px solid var(--line);
  border-radius: 11px;
}

.checkbox-field input {
  width: 18px;
  margin: 0 9px 0 0;
}

.post-preview {
  position: sticky;
  top: 0;
  align-self: start;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #f8faff;
}

.post-preview-image {
  aspect-ratio: 16 / 10;
  margin: 14px 0;
  display: grid;
  place-items: center;
  border-radius: 13px;
  color: var(--muted);
  background: center / cover no-repeat #e8edf6;
  font-size: 12px;
}

.post-preview h4 {
  margin: 14px 0 8px;
  font-size: 22px;
  letter-spacing: -.035em;
}

.post-preview p {
  color: var(--muted);
  line-height: 1.55;
}

.button-danger {
  color: #fff;
  background: var(--red);
}

.dialog-spacer {
  flex: 1;
}

.website-content-form {
  display: grid;
  gap: 18px;
}

.website-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.website-fields label {
  display: grid;
  gap: 8px;
  color: #4b5870;
  font-size: 13px;
  font-weight: 650;
}

.website-fields small {
  color: var(--muted);
  font-weight: 500;
}

.slideshow-cms-panel .panel-head {
  align-items: end;
}

.slideshow-cms-panel .panel-head > span {
  max-width: 420px;
  text-align: right;
}

.slideshow-cms-list {
  display: grid;
  gap: 16px;
}

.slideshow-cms-card {
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fbfcff;
}

.slideshow-cms-card figure {
  margin: 0;
  overflow: hidden;
  border: 1px solid #dfe7f3;
  border-radius: 12px;
  background: #fff;
}

.slideshow-cms-card img {
  width: 100%;
  aspect-ratio: 9 / 16;
  object-fit: contain;
  display: block;
  background: #f3f6fb;
}

.slideshow-cms-card figcaption {
  padding: 8px 10px;
  color: var(--blue);
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.slideshow-cms-fields {
  display: grid;
  gap: 12px;
}

.slideshow-cms-fields label {
  display: grid;
  gap: 7px;
  color: #4b5870;
  font-size: 13px;
  font-weight: 650;
}

.sticky-save-bar {
  position: sticky;
  bottom: 18px;
  z-index: 3;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border: 1px solid #cfd8ff;
  border-radius: 14px;
  background: rgba(255,255,255,.94);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.sticky-save-bar span {
  color: var(--muted);
  font-size: 12px;
}

.dialog::backdrop {
  background: rgba(19, 27, 48, 0.45);
  backdrop-filter: blur(4px);
}

.dialog form {
  padding: 26px;
}

.dialog-head {
  margin-bottom: 24px;
}

.dialog-actions {
  margin-top: 26px;
  justify-content: flex-end;
}

.toast {
  position: fixed;
  z-index: 20;
  right: 24px;
  bottom: 24px;
  max-width: 360px;
  padding: 13px 16px;
  opacity: 0;
  pointer-events: none;
  color: #fff;
  border-radius: 11px;
  background: var(--ink);
  box-shadow: var(--shadow);
  transform: translateY(10px);
  transition: 180ms ease;
  font-size: 12px;
  font-weight: 650;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.toast.error {
  background: var(--red);
}

@media (max-width: 1000px) {
  .stats-grid,
  .secret-grid,
  .cms-status-grid,
  .post-admin-grid,
  .team-admin-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .section-grid,
  .prompt-lab-layout {
    grid-template-columns: 1fr;
  }

  .post-editor-grid {
    grid-template-columns: 1fr;
  }

  .post-preview {
    position: static;
  }
}

@media (max-width: 780px) {
  .login-shell {
    grid-template-columns: 1fr;
  }

  .login-art {
    display: none;
  }

  .app-shell {
    display: block;
  }

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 20;
    height: auto;
    padding: 12px 12px 10px;
    gap: 10px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    box-shadow: 0 12px 28px rgba(28, 39, 66, 0.08);
  }

  .sidebar .brand {
    padding: 0 4px;
  }

  .sidebar .brand > span:last-child {
    display: grid;
  }

  .nav {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 2px 0 4px;
    scrollbar-width: none;
  }

  .nav::-webkit-scrollbar {
    display: none;
  }

  .nav-section-label,
  .system-chip {
    display: none;
  }

  .nav-item {
    flex: 0 0 auto;
    min-height: 40px;
    justify-content: center;
    gap: 7px;
    padding: 0 12px;
    border: 1px solid #edf1f6;
    border-radius: 999px;
    background: #fff;
    font-size: 12px;
    white-space: nowrap;
  }

  .nav-icon {
    width: auto;
    font-size: 15px;
  }

  .sidebar-footer {
    margin-top: 0;
    grid-template-columns: 1fr auto;
    align-items: center;
  }

  .logout-button {
    display: block;
    padding: 8px 10px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #fff;
    font-size: 12px;
  }

  .workspace {
    min-width: 0;
  }

  .topbar {
    height: auto;
    min-height: 76px;
    padding: 16px;
    align-items: flex-start;
    gap: 14px;
  }

  .topbar h2 {
    font-size: 22px;
  }

  .top-actions {
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .page-content {
    padding: 12px 14px 44px;
  }

  .stats-grid,
  .cards-grid,
  .secret-grid,
  .cms-status-grid,
  .post-admin-grid,
  .team-admin-grid,
  .prompt-lab-layout,
  .website-fields {
    grid-template-columns: 1fr;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .slideshow-cms-panel .panel-head {
    align-items: start;
  }

  .slideshow-cms-panel .panel-head > span {
    max-width: none;
    text-align: left;
  }

  .slideshow-cms-card {
    grid-template-columns: 86px minmax(0, 1fr);
  }

  .cms-tabs {
    display: flex;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: none;
  }

  .cms-tabs::-webkit-scrollbar {
    display: none;
  }

  .cms-tabs button {
    flex: 0 0 auto;
  }

  .span-two {
    grid-column: span 1;
  }

  .prompt-link-row {
    grid-template-columns: 1fr;
  }

  .package-project-option {
    grid-template-columns: 1fr;
  }

  .permission-checks {
    grid-column: auto;
    padding-left: 33px;
  }

  .package-create-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .package-form-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .prompt-package-card {
    align-items: stretch;
    flex-direction: column;
  }

  .prompt-link-row code {
    white-space: normal;
    overflow-wrap: anywhere;
  }
}
