@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;600;700;800&family=Noto+Sans+SC:wght@400;500;600;700&display=swap');

:root {
  --orange: #36a1f0;
  --blue: #89c7f8;
  --mint: #36ba8f;
  --text-main: #1f2a44;
  --text-soft: #6e7a91;
  --text-muted: #8b9eb8;
  --card-bg: rgba(246, 249, 252, .78);
  --card-line: rgba(140, 156, 181, .2);
  --card-line-strong: rgba(156, 173, 199, .34);
  --shadow: 0 14px 42px rgba(87, 108, 134, .12);
  --shadow-sm: 0 10px 26px rgba(112, 130, 155, .14);
  --shadow-lg: 0 22px 60px rgba(100, 125, 162, .2);
  --shadow-btn: 0 10px 20px rgba(54, 161, 240, .28);
  --radius-panel: 30px;
  --radius-card: 22px;
  --radius-metric: 16px;
  --radius-btn: 12px;
  --radius-pill: 999px;
  --radius-sm: 10px;
  --green: #36ba8f;
  --red-strong: #dd6d7d;
  --yellow-strong: #d98a38;
  --yellow-wash: #fff7e3;
  --green-wash: #e9f9f0;
  --red-wash: #ffeff3;
  --blue-wash: #f0f8ff;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { height: 100%; }
body {
  min-height: 100vh;
  color: var(--text-main);
  background:
    radial-gradient(circle at 10% 12%, #f5c69661 0, #f5c69600 26%),
    radial-gradient(circle at 88% 16%, #b0eae657 0, #b0eae600 27%),
    linear-gradient(160deg, #eceff4, #eaf0f5 60%, #e9edf3);
  font-family: "Noto Sans SC", "Segoe UI", -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

button, input, textarea, select { font: inherit; }
button { cursor: pointer; border: none; }
a { text-decoration: none; color: inherit; }
img { max-width: 100%; display: block; }

/* ====== Navbar ====== */
.navbar {
  position: sticky; top: 0; z-index: 1000;
  height: 60px; padding: 0 28px;
  display: flex; align-items: center;
  background: rgba(255, 255, 255, .68);
  -webkit-backdrop-filter: blur(14px) saturate(180%);
  backdrop-filter: blur(14px) saturate(180%);
  border-bottom: 1px solid var(--card-line);
}
.navbar-content {
  width: 100%; max-width: 1540px; margin: 0 auto;
  display: flex; justify-content: space-between; align-items: center;
}
.logo {
  display: flex; align-items: center; gap: 10px;
  font-family: "Space Grotesk", "Noto Sans SC", sans-serif;
  font-size: 20px; font-weight: 800; color: var(--text-main); letter-spacing: -.5px;
}
.logo-icon {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, #6fb7ff, #4fd1b1);
  border-radius: 10px; display: grid; place-items: center;
  font-size: 18px;
}
.nav-actions { display: flex; gap: 10px; align-items: center; }
.ws-badge {
  display: inline-flex; align-items: center; gap: 6px;
  border-radius: var(--radius-pill);
  padding: 5px 14px;
  font-size: .78rem; font-weight: 700;
}
.ws-badge.online  { color: #0f9e73; background: rgba(54, 186, 143, .14); border: 1px solid rgba(54, 186, 143, .3); }
.ws-badge.offline { color: #71839d; background: rgba(146, 162, 187, .16); border: 1px solid rgba(146, 162, 187, .25); }
.ws-dot {
  display: inline-block; width: 7px; height: 7px; border-radius: 50%;
  background: #d47d8d;
}
.ws-dot.connected { background: #36ba8f; box-shadow: 0 0 0 4px rgba(54, 186, 143, .15); }

/* ====== Total Gen Counter ====== */
.total-gen-counter {
  display: flex; align-items: center; gap: 8px;
  margin-right: 10px; padding: 6px 14px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--card-line);
  background: rgba(246, 249, 252, .65);
}
.total-gen-value {
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.1rem; font-weight: 800; color: var(--orange);
  line-height: 1;
}
.total-gen-label {
  font-size: .78rem; font-weight: 700; color: var(--text-soft);
  white-space: nowrap;
}

/* ====== Shell ====== */
.app-shell { width: min(1540px, 96vw); margin: 0 auto; padding: 32px 0 60px; }

/* ====== Panel Base ====== */
.panel {
  background: var(--card-bg);
  border: 1px solid var(--card-line);
  border-radius: var(--radius-panel);
  box-shadow: var(--shadow);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  padding: 28px;
}
@media (max-width: 768px) { .panel { padding: 18px; border-radius: 20px; } }

/* ====== Hero Card ====== */
.hero-card {
  display: flex; flex-direction: column;
  min-height: 244px;
  background: var(--card-bg);
  border: 1px solid var(--card-line);
  border-radius: var(--radius-panel);
  box-shadow: var(--shadow);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  padding: 36px 40px;
}
.hero-card h1 {
  margin: 10px 0 16px;
  line-height: 1.06;
  font-family: "Space Grotesk", "Noto Sans SC", sans-serif;
  font-size: clamp(2.6rem, 4vw, 4rem);
  font-weight: 800;
  letter-spacing: .02em;
  color: var(--text-main);
}
.hero-card h1 span {
  display: block;
  color: var(--orange);
}
.hero-desc {
  margin: 0;
  max-width: 640px;
  color: var(--text-soft);
  font-size: 1.12rem;
  line-height: 1.68;
}
.hero-actions { display: flex; gap: 12px; margin-top: 20px; }
.hero-announcement-slot { margin-top: auto; padding-top: 20px; }

/* ====== Announcement Strip ====== */
.announcement-strip { display: grid; gap: 8px; margin-top: 10px; }
.announcement-strip-item {
  display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 10px;
  border-radius: 12px; padding: 8px 10px;
  border: 1px solid rgba(180, 193, 214, .44);
  background: rgba(247, 251, 255, .92);
}
.announcement-strip-tag {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 72px; height: 22px; padding: 0 8px;
  border-radius: var(--radius-pill);
  font-size: .74rem; font-weight: 800; letter-spacing: .03em;
}
.announcement-strip-text {
  margin: 0; min-width: 0;
  font-size: .92rem; line-height: 1.45; color: #3f5a83;
  overflow-wrap: anywhere; word-break: break-word;
}
.announcement-strip-item.level-info    { border-color: #78a7de66; background: #f0f8fff0; }
.announcement-strip-item.level-info    .announcement-strip-tag { color: #1f72bd; border: 1px solid #67a0df80; background: #dbeeffeb; }
.announcement-strip-item.level-warning { border-color: #eab6517a; background: #fff7e3f0; }
.announcement-strip-item.level-warning .announcement-strip-tag { color: #a86d0f; border: 1px solid #eab65194; background: #ffeab7f5; }
.announcement-strip-item.level-success { border-color: #65c69285; background: #e9f9f0f2; }
.announcement-strip-item.level-success .announcement-strip-tag { color: #177f52; border: 1px solid #5cb78794; background: #ccf4def5; }
.announcement-strip-item.level-error   { border-color: #e97e9280; background: #ffeff3f2; }
.announcement-strip-item.level-error   .announcement-strip-tag { color: #be3456; border: 1px solid #e2667f8f; background: #ffdbe5f5; }

/* ====== Runtime Panel ====== */
.runtime-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.runtime-item {
  border: 1px solid var(--card-line-strong);
  border-radius: var(--radius-metric);
  background: rgba(243, 247, 252, .82);
  padding: 17px 16px;
}
.runtime-value {
  display: block;
  font-family: "Space Grotesk", sans-serif;
  font-size: 2.2rem;
  font-weight: 800;
  line-height: 1.04;
  color: var(--text-main);
}
.runtime-label { display: block; margin-top: 8px; color: #8c99af; font-size: .86rem; font-weight: 500; }

/* Tone colors for runtime items */
.runtime-item.tone-blue  .runtime-value { color: #3d89dc; }
.runtime-item.tone-mint  .runtime-value { color: #22a98b; }
.runtime-item.tone-orange .runtime-value { color: #d98a38; }
.runtime-item.tone-rose  .runtime-value { color: #dd6d7d; }

/* ====== Two-Column Layout ====== */
.top-row { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 22px; }
.mid-row { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 22px; }

/* ====== Create Panel ====== */
.create-panel .panel-title {
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.25rem; font-weight: 800; color: var(--text-main); margin-bottom: 6px;
}
.create-panel .panel-subtitle {
  font-size: .85rem; color: var(--text-soft); margin-bottom: 20px;
}

/* ====== Tabs ====== */
.tabs {
  display: flex; gap: 6px; margin-bottom: 16px;
  background: rgba(220, 233, 250, .7);
  border: 1px solid rgba(155, 178, 208, .3);
  border-radius: 12px; padding: 4px;
}
.tab {
  flex: 1; padding: 10px 16px; text-align: center;
  border-radius: 8px; font-size: .88rem; font-weight: 700;
  color: var(--text-soft); transition: all .18s ease; cursor: pointer;
}
.tab:hover { color: #2c4f7e; }
.tab.active {
  background: #fff; color: #2c4f7e;
  box-shadow: 0 8px 16px rgba(114, 139, 174, .16);
}

/* ====== Input ====== */
.textarea {
  width: 100%; min-height: 120px; padding: 16px;
  border: 1px solid var(--card-line-strong);
  border-radius: var(--radius-card);
  background: rgba(255, 255, 255, .6);
  color: var(--text-main);
  font-size: .95rem; line-height: 1.7;
  resize: vertical; transition: all .2s ease;
}
.textarea::placeholder { color: var(--text-muted); }
.textarea:focus {
  outline: none; border-color: var(--orange);
  box-shadow: 0 0 0 4px rgba(54, 161, 240, .08);
}
.form-group { margin-bottom: 16px; }
.form-label {
  display: block; font-size: .82rem; font-weight: 700;
  color: #35527d; margin-bottom: 6px;
}

/* ====== Buttons ====== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 18px; border-radius: var(--radius-btn);
  font-weight: 700;
  transition: transform .16s ease, box-shadow .16s ease;
}
.btn-primary {
  color: #fff;
  background: linear-gradient(120deg, #72c1f8, #36a1f0);
  box-shadow: 0 8px 18px rgba(54, 161, 240, .28);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: var(--shadow-btn); }
.btn-primary:active { transform: translateY(0); }
.btn-ghost {
  background: rgba(242, 246, 252, .95);
  color: #3c4e6d;
  border: 1px solid rgba(155, 173, 200, .4);
}
.btn-ghost:hover { background: rgba(232, 243, 255, .9); color: #2d6faa; }
.btn-sm { padding: 8px 16px; font-size: .84rem; border-radius: var(--radius-sm); }
.btn-lg { padding: 14px 28px; font-size: .98rem; }
.btn-danger {
  color: #fff;
  background: linear-gradient(135deg, #f06b64, #d94b55);
  box-shadow: 0 8px 18px rgba(217, 75, 85, .22);
}
.btn-danger:hover { transform: translateY(-1px); box-shadow: 0 14px 30px rgba(217, 75, 85, .22); }

/* ====== User Panel ====== */
.user-header { display: flex; align-items: center; gap: 16px; margin-bottom: 20px; }
.user-avatar-lg {
  width: 56px; height: 56px; border-radius: 50%;
  background: linear-gradient(135deg, #6fb7ff, #4fd1b1);
  display: grid; place-items: center;
  font-size: 22px; font-weight: 800; color: #fff; flex-shrink: 0;
}
.user-info h3 { font-size: 1.15rem; font-weight: 800; color: var(--text-main); }
.user-level {
  display: inline-flex; align-items: center; gap: 6px; margin-top: 6px;
  padding: 4px 12px; border-radius: var(--radius-pill);
  background: rgba(54, 161, 240, .12);
  font-size: .78rem; color: #277ac2; font-weight: 700;
}
.user-stats {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
  padding-top: 18px; border-top: 1px solid var(--card-line);
}
.stat-item { text-align: center; }
.stat-num { font-family: "Space Grotesk", sans-serif; font-size: 1.35rem; font-weight: 800; color: var(--text-main); }
.stat-label { font-size: .76rem; color: var(--text-soft); margin-top: 2px; }

/* ====== Works Section ====== */
.works-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 22px; flex-wrap: wrap; gap: 12px;
}
.works-header h3 { font-family: "Space Grotesk", sans-serif; font-size: 1.25rem; font-weight: 800; color: var(--text-main); }

/* ====== Filter Pills ====== */
.filter-pills { display: flex; gap: 6px; flex-wrap: wrap; }
.filter-btn {
  padding: 8px 18px; border-radius: var(--radius-pill);
  font-size: .84rem; font-weight: 700;
  background: rgba(220, 233, 250, .5);
  color: var(--text-soft);
  transition: all .18s ease;
}
.filter-btn:hover { background: rgba(54, 161, 240, .1); color: var(--orange); }
.filter-btn.active { background: var(--orange); color: #fff; box-shadow: 0 4px 12px rgba(54, 161, 240, .3); }

/* ====== Search Box ====== */
.search-box { position: relative; }
.search-input {
  padding: 10px 16px 10px 42px;
  border: 1px solid var(--card-line-strong);
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, .6);
  color: var(--text-main); font-size: .88rem;
  transition: all .2s ease; width: 100%;
}
.search-input:focus { outline: none; border-color: var(--orange); box-shadow: 0 0 0 3px rgba(54, 161, 240, .06); }
.search-input::placeholder { color: var(--text-muted); }
.search-icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--text-muted); font-size: 15px; pointer-events: none; }

/* ====== Batch Bar ====== */
.batch-bar {
  display: flex; align-items: center; gap: 16px;
  padding: 14px 18px; margin-bottom: 18px;
  border-radius: 14px;
  background: rgba(54, 161, 240, .08);
  border: 1px solid rgba(54, 161, 240, .25);
}
.batch-checkbox { width: 18px; height: 18px; accent-color: var(--orange); }
.select-all-checkbox {
  width: 20px; height: 20px; accent-color: var(--orange);
  cursor: pointer; flex-shrink: 0;
}

/* ====== Reference Image ====== */
.ref-image-preview-wrap {
  position: relative; display: inline-block;
  max-width: 200px;
}
.ref-image-preview {
  max-width: 100%; max-height: 160px;
  border-radius: 14px; border: 1px solid var(--card-line-strong);
  box-shadow: var(--shadow-sm);
}
.ref-image-remove {
  position: absolute; top: -8px; right: -8px;
  width: 24px; height: 24px; border-radius: 50%;
  background: #fff; border: 1px solid rgba(180,193,212,.6);
  color: var(--red-strong); font-size: 16px; font-weight: 700;
  display: grid; place-items: center; cursor: pointer;
  box-shadow: 0 4px 10px rgba(100,115,148,.2);
}
.ref-paste-hint { opacity: .7; }
.batch-info { flex: 1; font-size: .88rem; color: var(--text-soft); font-weight: 600; }
.batch-info b { color: var(--orange); }

/* ====== Works Grid ====== */
.works-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr));
  gap: 16px;
}
.work-card {
  background: rgba(247, 250, 253, .93);
  border: 1px solid rgba(156, 174, 199, .24);
  border-radius: var(--radius-card);
  overflow: visible;
  box-shadow: 0 10px 26px rgba(112, 130, 155, .14);
  transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
}
.work-card:hover {
  transform: translateY(-5px);
  border-color: rgba(125, 147, 180, .38);
  box-shadow: 0 18px 34px rgba(93, 117, 150, .24);
}
.work-image-wrap {
  position: relative; overflow: hidden; cursor: pointer;
  margin: 10px 10px 0;
  border-radius: 18px;
  border: 1px solid rgba(164, 183, 209, .32);
  box-shadow: 0 10px 24px rgba(84, 106, 138, .22);
}
.work-image-wrap img {
  width: 100%; aspect-ratio: 1 / 1; object-fit: cover; display: block;
  transition: transform .22s ease, filter .22s ease;
  transform: translateZ(0);
}
.work-image-wrap:hover img {
  transform: scale(1.1);
  filter: saturate(1.12) contrast(1.05);
}
.work-image-wrap .placeholder {
  width: 100%; aspect-ratio: 1 / 1;
  display: grid; place-items: center;
  color: var(--text-muted); font-size: .82rem; font-weight: 600;
  background: #eef3f8;
}
.zoom-indicator {
  position: absolute; left: 50%; top: 50%;
  transform: translate(-50%, -50%) scale(.8);
  width: 34px; height: 34px; border-radius: 50%;
  background: rgba(232, 239, 249, .78);
  border: 1px solid rgba(131, 150, 180, .32);
  display: grid; place-items: center; font-size: 14px; color: #5d7ba0;
  opacity: 0; transition: opacity .2s ease, transform .2s ease;
  pointer-events: none;
}
.work-image-wrap:hover .zoom-indicator { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.quote-btn {
  position: absolute; top: 10px; right: 10px; z-index: 3;
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 56px; height: 30px; padding: 0 12px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(177, 198, 226, .72);
  background: rgba(235, 244, 255, .9);
  color: #3f5d86;
  font-size: 12px; font-weight: 800; letter-spacing: .02em;
  box-shadow: 0 8px 16px rgba(60, 91, 132, .24);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}
.work-info { padding: 16px 18px; }
.badge {
  display: inline-block;
  padding: 5px 12px; border-radius: var(--radius-pill);
  font-size: .76rem; font-weight: 700;
}
.badge.queued     { color: #b47d14; background: var(--yellow-wash); }
.badge.processing { color: #277ac2; background: var(--blue-wash); }
.badge.succeeded  { color: #0b8e6f; background: var(--green-wash); }
.badge.failed     { color: #c94444; background: var(--red-wash); }
.badge.processing::after {
  content: ''; display: inline-block; width: 6px; height: 6px;
  border-radius: 50%; background: var(--orange); margin-left: 6px;
  animation: pulse 1.2s ease-in-out infinite;
}
.work-prompt {
  margin: 10px 0; padding: 12px;
  border: 1px solid rgba(180, 193, 212, .38);
  border-radius: 14px;
  background: rgba(248, 251, 255, .96);
  font-size: .88rem; color: var(--text-soft);
  line-height: 1.6; cursor: pointer;
  box-shadow: 0 8px 18px rgba(107, 128, 161, .08);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.work-prompt:hover { border-color: rgba(126, 148, 177, .5); transform: translateY(-2px); box-shadow: 0 10px 20px rgba(107, 128, 161, .14); }
.work-meta { display: flex; gap: 12px; font-size: .78rem; color: var(--text-muted); }
.work-actions { display: flex; gap: 6px; padding-top: 12px; border-top: 1px solid var(--card-line); }
.work-actions button, .work-actions a {
  flex: 1; padding: 8px 12px; border-radius: 8px;
  font-size: .8rem; font-weight: 700; text-align: center;
  transition: all .18s ease;
}
.btn-download { background: var(--blue-wash); color: #277ac2; }
.btn-copy     { background: rgba(220, 233, 250, .5); color: #4f6d98; }
.btn-download:hover { background: rgba(210, 234, 254, .95); }
.btn-copy:hover     { background: rgba(200, 220, 248, .8); }

/* ====== Empty State ====== */
.empty-state { text-align: center; padding: 60px 20px; }
.empty-icon { font-size: 60px; margin-bottom: 12px; opacity: .5; }
.empty-title { font-size: 1.1rem; font-weight: 700; color: var(--text-main); margin-bottom: 6px; }
.empty-desc { font-size: .88rem; color: var(--text-soft); max-width: 360px; margin: 0 auto; }

/* ====== Login Prompt ====== */
.login-prompt-card {
  text-align: center; min-height: 244px; display: grid; place-items: center;
  padding: 40px 20px;
}
.login-prompt-card .hero-desc { margin-bottom: 20px; }

/* ====== Modal ====== */
.modal-overlay {
  position: fixed; inset: 0; z-index: 2000;
  background: radial-gradient(circle at 50% 32%, rgba(32, 52, 86, .42), rgba(9, 17, 34, .9) 62%, rgba(6, 12, 24, .96));
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  display: grid; place-items: center; padding: 24px;
  animation: fadeIn .22s ease;
}
.modal-card {
  background: rgba(247, 250, 255, .98);
  border: 1px solid rgba(196, 210, 231, .45);
  border-radius: 32px; max-width: 480px; width: 100%;
  max-height: 85vh; overflow: auto;
  box-shadow: 0 26px 46px rgba(18, 34, 58, .24);
  padding: 28px;
  animation: scaleIn .25s cubic-bezier(.175, .885, .32, 1.275);
}
.modal-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 24px; padding-bottom: 16px;
  border-bottom: 1px solid var(--card-line);
}
.modal-title { font-family: "Space Grotesk", sans-serif; font-size: 1.25rem; font-weight: 800; color: var(--text-main); }
@media (max-width: 640px) { .modal-card { border-radius: 22px; padding: 22px; } }

/* ====== Scrollbar ====== */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(120, 152, 196, .85); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(91, 132, 186, .94); }

/* ====== Toast ====== */
.toast {
  position: fixed; bottom: 24px; right: 24px; z-index: 3000;
  padding: 16px 22px; border-radius: 12px;
  font-weight: 700; color: #fff;
  box-shadow: 0 10px 26px rgba(24, 38, 64, .32);
  display: flex; align-items: center; gap: 10px; min-width: 280px;
  animation: slideIn .3s ease;
}
.toast-success { background: linear-gradient(120deg, #2ba874, #1f925f); }
.toast-error   { background: linear-gradient(120deg, #da5d5d, #c94444); }
.toast-info    { background: linear-gradient(120deg, #72c1f8, #36a1f0); }

/* ====== Animations ====== */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes scaleIn { from { transform: scale(.95); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .4; } }

/* ====== Responsive ====== */
@media (max-width: 1200px) { .top-row, .mid-row { grid-template-columns: 1fr; } }
@media (max-width: 900px) {
  .works-grid { grid-template-columns: repeat(auto-fill, minmax(min(240px, 100%), 1fr)); }
  .app-shell { padding: 20px 0 40px; }
  .hero-card, .panel { padding: 24px 20px; }
}
@media (max-width: 640px) {
  .navbar { padding: 0 16px; }
  .works-grid { grid-template-columns: 1fr; }
  .runtime-grid { grid-template-columns: 1fr; }
  .works-header { flex-direction: column; align-items: flex-start; }
  .user-stats { grid-template-columns: 1fr 1fr; }
}
