/* ==========================================================================
   Editorial Theme (和风暖纸刊物风) + Glass Mode Layout Compatibility
   ========================================================================== */

/* Glass mode preserves exact flat flex-column order via display: contents */
html:not(.theme-editorial) body:not(.theme-editorial) .ed-hero,
html:not(.theme-editorial) body:not(.theme-editorial) .ed-layout,
html:not(.theme-editorial) body:not(.theme-editorial) .ed-main,
html:not(.theme-editorial) body:not(.theme-editorial) .ed-aside {
  display: contents;
}

html:not(.theme-editorial) body:not(.theme-editorial) .ed-hero-left {
  display: contents;
}

html:not(.theme-editorial) body:not(.theme-editorial) .ed-hero-art,
html:not(.theme-editorial) body:not(.theme-editorial) .ed-quick-links,
html:not(.theme-editorial) body:not(.theme-editorial) .ed-aside-title,
html:not(.theme-editorial) body:not(.theme-editorial) .cal-month-badge,
html:not(.theme-editorial) body:not(.theme-editorial) .cal-weekday-label {
  display: none !important;
}

html:not(.theme-editorial) body:not(.theme-editorial) .hero-clock { order: 1; }
html:not(.theme-editorial) body:not(.theme-editorial) .search-section { order: 2; }
html:not(.theme-editorial) body:not(.theme-editorial) #widgets-primary { order: 3; }
html:not(.theme-editorial) body:not(.theme-editorial) #widgets-secondary { order: 4; }
html:not(.theme-editorial) body:not(.theme-editorial) #category-bar { order: 5; }
html:not(.theme-editorial) body:not(.theme-editorial) #sites-container { order: 6; }
html:not(.theme-editorial) body:not(.theme-editorial) .page-footer { order: 10; }

/* ---------- Theme Editorial Variables & Base ---------- */
html.theme-editorial,
html.theme-editorial body,
body.theme-editorial {
  --ed-paper: #f6f2e9;
  --ed-paper-card: #fcfaf5;
  --ed-paper-soft: #efeae0;
  --ed-ink: #1e2321;
  --ed-ink-sub: #5c5850;
  --ed-ink-muted: #8a8479;
  --ed-line: #ddd6c7;
  --ed-line-strong: #c9bfae;
  --ed-accent: #c84b28;
  --ed-accent-hover: #b23f1e;
  --ed-accent-soft: rgba(200, 75, 40, 0.1);
  --ed-serif: "Songti SC", "Noto Serif SC", "Source Han Serif SC", "STSong", "SimSun", Georgia, serif;
  --ed-sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;

  background: var(--ed-paper);
  color: var(--ed-ink);
  font-family: var(--ed-sans);
}

html.theme-editorial .wallpaper-bg,
html.theme-editorial .wallpaper-overlay,
body.theme-editorial .wallpaper-bg,
body.theme-editorial .wallpaper-overlay {
  display: none !important;
}

html.theme-editorial:not(.app-ready) .page-shell {
  opacity: 0;
}

html.theme-editorial .page-shell {
  transition: opacity 0.12s ease;
}

body.theme-editorial .page-shell {
  max-width: min(var(--page-max-width, 1320px), 1240px);
  padding: 18px 28px 24px;
}

/* ---------- Top Header Bar ---------- */
body.theme-editorial .top-bar {
  padding-bottom: 14px;
  margin-bottom: 0;
  border-bottom: 1px solid var(--ed-line);
}

body.theme-editorial .brand {
  gap: 12px;
}

body.theme-editorial .brand-logo {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: transparent;
  box-shadow: none;
  padding: 0;
}

body.theme-editorial .brand-text {
  display: flex;
  flex-direction: row;
  align-items: baseline;
  gap: 12px;
}

body.theme-editorial .brand-text h1 {
  font-family: var(--ed-serif);
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--ed-ink);
  text-shadow: none;
}

body.theme-editorial .brand-text span {
  font-family: var(--ed-serif);
  font-size: 12px;
  letter-spacing: 2px;
  color: var(--ed-ink-sub);
  border-left: 1px solid var(--ed-line-strong);
  padding-left: 12px;
  opacity: 1;
}

body.theme-editorial .top-actions {
  gap: 6px;
}

body.theme-editorial .glass-pill {
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border: none;
  box-shadow: none;
  color: var(--ed-ink-sub);
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 13px;
}

body.theme-editorial .glass-pill:hover {
  background: var(--ed-paper-soft);
  color: var(--ed-ink);
  transform: none;
}

body.theme-editorial .switch-track {
  width: 38px;
  height: 20px;
  background: var(--ed-line-strong);
}

body.theme-editorial .switch-track.is-backup {
  background: var(--ed-accent);
}

body.theme-editorial .switch-thumb {
  width: 14px;
  height: 14px;
  top: 3px;
  left: 3px;
  background: #fffdf9;
}

body.theme-editorial .switch-track.is-backup .switch-thumb {
  transform: translateX(18px);
}

body.theme-editorial .switch-labels small {
  display: none;
}

body.theme-editorial .switch-labels strong {
  font-weight: 500;
  color: var(--ed-ink);
}

body.theme-editorial #appearance-btn,
body.theme-editorial #admin-btn {
  position: relative;
}

body.theme-editorial #appearance-btn::before,
body.theme-editorial #admin-btn::before {
  content: "";
  display: inline-block;
  width: 1px;
  height: 14px;
  background: var(--ed-line-strong);
  margin-right: 10px;
}

body.theme-editorial #admin-btn {
  color: var(--ed-accent);
  font-weight: 600;
}

body.theme-editorial #admin-btn::after {
  content: " ↗";
  font-size: 12px;
}

body.theme-editorial .auth-pill:not(.guest) {
  display: none;
}

.ed-cal-mini-grid,
.ed-cal-legend,
.ed-mobile-more-btn {
  display: none;
}

/* ---------- Editorial Hero Band ---------- */
body.theme-editorial .ed-hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 440px) 1fr;
  align-items: center;
  gap: 20px;
  padding: 14px 0 18px;
  border-bottom: 1px solid var(--ed-line);
  margin-bottom: 18px;
  min-height: 128px;
}

body.theme-editorial .ed-hero-left {
  position: relative;
  z-index: 3;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

body.theme-editorial .hero-clock {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin: 0;
  text-align: left;
}

body.theme-editorial .clock-time {
  display: none;
}

body.theme-editorial .clock-date {
  margin: 0;
  font-size: 14px;
  color: var(--ed-ink-sub);
  letter-spacing: 0.4px;
  text-shadow: none;
  font-weight: 500;
}

body.theme-editorial .search-section {
  margin: 0;
  max-width: 100%;
}

body.theme-editorial .search-wrapper {
  background: var(--ed-paper-card);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border: 1px solid var(--ed-line-strong);
  border-radius: 8px;
  padding: 4px 10px;
  box-shadow: 0 2px 6px rgba(30, 35, 33, 0.04);
}

body.theme-editorial .search-wrapper:focus-within {
  border-color: var(--ed-accent);
  background: #ffffff;
  box-shadow: 0 0 0 3px var(--ed-accent-soft);
}

body.theme-editorial .engine-trigger {
  background: transparent;
  color: var(--ed-ink-sub);
  padding: 5px 8px 5px 4px;
  border-right: 1px solid var(--ed-line);
  border-radius: 0;
  margin-right: 4px;
  font-size: 13px;
}

body.theme-editorial .engine-trigger:hover {
  background: transparent;
  color: var(--ed-accent);
}

body.theme-editorial .search-input {
  color: var(--ed-ink);
  font-size: 14px;
  padding: 6px 4px;
}

body.theme-editorial .search-input::placeholder {
  color: var(--ed-ink-muted);
}

body.theme-editorial .search-clear {
  background: var(--ed-paper-soft);
  color: var(--ed-ink-sub);
}

body.theme-editorial .search-kbd kbd {
  background: var(--ed-paper-soft);
  border: 1px solid var(--ed-line-strong);
  color: var(--ed-ink-sub);
  border-radius: 5px;
  font-family: var(--ed-sans);
}

body.theme-editorial .engine-menu,
body.theme-editorial .search-dropdown {
  background: #fdfbf7;
  backdrop-filter: none;
  border: 1px solid var(--ed-line-strong);
  border-radius: 10px;
  box-shadow: 0 14px 36px rgba(30, 35, 33, 0.14);
}

body.theme-editorial .engine-option,
body.theme-editorial .search-item {
  color: var(--ed-ink);
  border-radius: 8px;
}

body.theme-editorial .engine-option:hover,
body.theme-editorial .search-item:hover,
body.theme-editorial .search-item.selected {
  background: var(--ed-paper-soft);
}

body.theme-editorial .engine-option.active {
  background: var(--ed-accent-soft);
  color: var(--ed-accent);
}

body.theme-editorial .search-item-group {
  background: var(--ed-paper-soft);
  color: var(--ed-ink-sub);
}

body.theme-editorial .search-item-url {
  color: var(--ed-ink-muted);
}

body.theme-editorial .ed-hero-art {
  position: relative;
  height: 162px;
  margin: -14px 0 -18px;
  overflow: hidden;
  pointer-events: none;
  display: flex;
  justify-content: flex-end;
  align-items: flex-end;
}

body.theme-editorial .ed-hero-art img {
  height: 100%;
  width: 100%;
  max-width: 100%;
  object-fit: contain;
  object-position: right bottom;
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 6%, #000 100%);
  mask-image: linear-gradient(90deg, transparent 0%, #000 6%, #000 100%);
}

/* ---------- 2-Column Editorial Workspace ---------- */
body.theme-editorial .ed-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 310px;
  gap: 28px;
  align-items: start;
}

body.theme-editorial .ed-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

body.theme-editorial .ed-aside {
  border-left: 1px solid var(--ed-line);
  padding-left: 26px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

body.theme-editorial .ed-aside-title,
body.theme-editorial .ed-section-heading {
  font-family: var(--ed-serif);
  font-size: 19px;
  font-weight: 700;
  color: var(--ed-ink);
  letter-spacing: 0.5px;
  margin: 0 0 12px;
}

/* ---------- Quick Links Row (常用入口) ---------- */
body.theme-editorial .ed-quick-links {
  margin-bottom: 2px;
}

body.theme-editorial .ed-quick-links .ed-quick-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(112px, 1fr));
  gap: 8px;
}

body.theme-editorial .ed-quick-links .ed-quick-grid .site-card.layout-card-item,
body.theme-editorial .ed-quick-links .ed-quick-grid .site-card {
  width: 100%;
  min-width: 0;
  max-width: none;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  gap: 7px;
  padding: 8px 10px;
  background: var(--ed-paper-card);
  backdrop-filter: none;
  border: 1px solid var(--ed-line);
  border-radius: 9px;
  box-shadow: 0 1px 3px rgba(30, 35, 33, 0.04);
  color: var(--ed-ink);
}

body.theme-editorial .ed-quick-links .ed-quick-grid .site-card::after {
  display: none;
}

body.theme-editorial .ed-quick-links .ed-quick-grid .site-card:hover {
  border-color: var(--ed-accent);
  background: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(30, 35, 33, 0.07);
}

body.theme-editorial .ed-quick-links .ed-quick-grid .site-icon-box {
  width: 24px;
  height: 24px;
  margin-bottom: 0;
  flex-shrink: 0;
  filter: none !important;
}

body.theme-editorial .ed-quick-links .ed-quick-grid .site-icon-inner {
  clip-path: none !important;
  border-radius: 6px !important;
  box-shadow: none !important;
  background: var(--ed-paper-soft);
}

body.theme-editorial .ed-quick-links .ed-quick-grid .site-card-meta {
  flex: 1;
  min-width: 0;
}

body.theme-editorial .ed-quick-links .ed-quick-grid .site-name {
  font-size: 13px;
  font-weight: 600;
  text-shadow: none;
  color: var(--ed-ink);
  text-align: left;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

body.theme-editorial .ed-quick-links .ed-quick-grid .site-sub {
  display: none;
}

/* ---------- Text Category Tabs ---------- */
body.theme-editorial .glass-bar.category-bar {
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border: none;
  border-top: 1px solid var(--ed-line);
  border-bottom: 1px solid var(--ed-line);
  border-radius: 0;
  box-shadow: none;
  padding: 0;
  margin: 0;
  gap: 0;
}

body.theme-editorial .cat-tab {
  position: relative;
  border-radius: 0;
  padding: 11px 14px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--ed-ink-sub);
  background: transparent !important;
  box-shadow: none !important;
}

body.theme-editorial .cat-tab + .cat-tab::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 1px;
  height: 12px;
  background: var(--ed-line);
}

body.theme-editorial .cat-tab:hover {
  color: var(--ed-ink);
}

body.theme-editorial .cat-tab.active {
  color: var(--ed-accent);
  font-weight: 700;
}

body.theme-editorial .cat-tab.active::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 0;
  height: 2px;
  background: var(--ed-accent);
}

/* ---------- Two-Column Editorial Group Grids ---------- */
body.theme-editorial .sites-container {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px 28px;
  align-items: start;
}

body.theme-editorial .sites-container.single-group {
  grid-template-columns: 1fr;
}

body.theme-editorial .site-group-head {
  margin-bottom: 10px;
  gap: 8px;
}

body.theme-editorial .group-badge-icon {
  display: none;
}

body.theme-editorial .group-title {
  font-family: var(--ed-serif);
  font-size: 18px;
  font-weight: 700;
  color: var(--ed-ink);
  text-shadow: none;
}

body.theme-editorial .group-private-tag {
  background: var(--ed-paper-soft);
  color: var(--ed-ink-sub);
  border-color: var(--ed-line-strong);
}

body.theme-editorial .sites-grid,
body.theme-editorial .sites-grid.layout-card {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

body.theme-editorial .sites-container:not(.single-group) .sites-grid {
  max-height: 340px;
  overflow-y: auto;
  padding: 2px 4px 2px 0;
  scrollbar-width: thin;
  scrollbar-color: rgba(138, 132, 121, 0.38) transparent;
}

body.theme-editorial .sites-container:not(.single-group) .sites-grid::-webkit-scrollbar {
  width: 4px;
}

body.theme-editorial .sites-container:not(.single-group) .sites-grid::-webkit-scrollbar-track {
  background: transparent;
}

body.theme-editorial .sites-container:not(.single-group) .sites-grid::-webkit-scrollbar-thumb {
  background: rgba(138, 132, 121, 0.38);
  border-radius: 4px;
}

body.theme-editorial .sites-container:not(.single-group) .sites-grid::-webkit-scrollbar-thumb:hover {
  background: rgba(200, 75, 40, 0.55);
}

body.theme-editorial .sites-container:not(.single-group) .site-card,
body.theme-editorial .sites-container:not(.single-group) .site-card.layout-card-item {
  flex-shrink: 0;
  height: 60px;
  box-sizing: border-box;
}

body.theme-editorial .sites-container.single-group .sites-grid,
body.theme-editorial .sites-container.single-group .sites-grid.layout-card {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(236px, 1fr));
  gap: 10px;
  max-height: none;
  overflow: visible;
}

body.theme-editorial .site-card,
body.theme-editorial .site-card.layout-card-item {
  flex-direction: row;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 9px;
  background: var(--ed-paper-card);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border: 1px solid var(--ed-line);
  box-shadow: 0 1px 2px rgba(30, 35, 33, 0.03);
  color: var(--ed-ink);
}

body.theme-editorial .site-card::after,
body.theme-editorial .site-card.layout-card-item::after {
  content: "→";
  font-size: 14px;
  color: var(--ed-ink-muted);
  margin-left: auto;
  padding-left: 8px;
  transition: transform 0.16s ease, color 0.16s ease;
}

body.theme-editorial .site-card:hover,
body.theme-editorial .site-card.layout-card-item:hover {
  transform: translateY(-1px);
  border-color: var(--ed-accent);
  background: #ffffff;
  box-shadow: 0 4px 12px rgba(30, 35, 33, 0.07);
}

body.theme-editorial .site-card:hover::after {
  transform: translateX(3px);
  color: var(--ed-accent);
}

body.theme-editorial .site-card .site-icon-box,
body.theme-editorial .site-card.layout-card-item .site-icon-box {
  width: 38px;
  height: 38px;
  margin-bottom: 0;
  flex-shrink: 0;
  filter: none !important;
}

body.theme-editorial .site-icon-inner {
  clip-path: none !important;
  border-radius: 8px !important;
  box-shadow: none !important;
  background: transparent;
}

body.theme-editorial .site-icon-inner.has-img {
  background: var(--ed-paper-soft);
  padding: 4px;
}

body.theme-editorial .site-card-meta {
  gap: 2px;
}

body.theme-editorial .site-card .site-name,
body.theme-editorial .site-card.layout-card-item .site-name {
  text-align: left;
  max-width: 100%;
  font-size: 14px;
  font-weight: 600;
  color: var(--ed-ink);
  text-shadow: none;
}

body.theme-editorial .site-sub {
  font-size: 11.5px;
  color: var(--ed-ink-muted);
}

body.theme-editorial .site-status-dot {
  width: 9px;
  height: 9px;
  top: -2px;
  right: -2px;
  border-color: var(--ed-paper-card);
}

body.theme-editorial .site-status-dot.online {
  background: #16a34a;
  box-shadow: none;
}

body.theme-editorial .site-status-dot.offline {
  background: #dc2626;
  box-shadow: none;
}

body.theme-editorial .site-backup-badge {
  background: var(--ed-accent);
  color: #ffffff;
}

/* ---------- Right Sidebar: 随手工具 ---------- */
body.theme-editorial .widgets-grid {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-bottom: 0;
}

body.theme-editorial .widgets-secondary {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 12px;
}

body.theme-editorial .ed-aside .glass-card {
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border: none;
  border-radius: 0;
  box-shadow: none;
  padding: 14px 0;
  border-bottom: 1px solid var(--ed-line);
}

body.theme-editorial .ed-aside .glass-card:first-child {
  padding-top: 4px;
}

body.theme-editorial .ed-aside .glass-card:last-child {
  border-bottom: none;
}

body.theme-editorial .widget-head {
  margin-bottom: 8px;
}

body.theme-editorial .widget-title,
body.theme-editorial .widget-title-btn {
  color: var(--ed-ink-sub);
  font-size: 13px;
  font-weight: 600;
}

body.theme-editorial .widget-title-btn:hover {
  color: var(--ed-accent);
}

body.theme-editorial .widget-link-btn {
  color: var(--ed-accent);
  font-size: 12px;
  font-weight: 500;
}

body.theme-editorial .widget-link-btn:hover {
  color: var(--ed-accent-hover);
  text-decoration: underline;
}

body.theme-editorial .widget-loading {
  color: var(--ed-ink-muted);
}

/* Weather inside sidebar */
body.theme-editorial .weather-body {
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
}

body.theme-editorial .weather-now {
  gap: 12px;
}

body.theme-editorial .weather-temp {
  font-size: 30px;
  font-weight: 700;
  color: var(--ed-ink);
}

body.theme-editorial .weather-desc {
  font-size: 14px;
  color: var(--ed-ink);
}

body.theme-editorial .weather-wind {
  color: var(--ed-ink-sub);
  font-size: 11.5px;
}

body.theme-editorial .weather-badge {
  background: var(--ed-paper-soft);
  color: var(--ed-ink-sub);
  border: 1px solid var(--ed-line);
}

body.theme-editorial .weather-badge.aqi-good { background: rgba(22, 163, 74, 0.12); color: #15803d; border-color: rgba(22, 163, 74, 0.28); }
body.theme-editorial .weather-badge.aqi-mid { background: rgba(202, 138, 4, 0.14); color: #a16207; border-color: rgba(202, 138, 4, 0.3); }
body.theme-editorial .weather-badge.aqi-bad { background: rgba(220, 38, 38, 0.12); color: #b91c1c; border-color: rgba(220, 38, 38, 0.28); }

body.theme-editorial .weather-forecast {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

body.theme-editorial .forecast-day:nth-child(n+4) {
  display: none;
}

body.theme-editorial .forecast-day {
  background: var(--ed-paper-card);
  border: 1px solid var(--ed-line);
  border-radius: 8px;
  padding: 5px 4px;
  gap: 2px;
}

body.theme-editorial .forecast-day:hover {
  background: #ffffff;
  border-color: var(--ed-line-strong);
}

body.theme-editorial .forecast-name {
  color: var(--ed-ink-sub);
  font-size: 11px;
}

body.theme-editorial .forecast-temps {
  color: var(--ed-ink);
  font-size: 11px;
}

/* Tear-off Calendar Card inside sidebar */
body.theme-editorial .cal-body {
  min-height: auto;
}

body.theme-editorial .cal-main {
  margin: 2px 0 10px;
  gap: 16px;
}

body.theme-editorial .cal-day-col {
  width: 72px;
  border-radius: 10px;
  border: 1px solid var(--ed-line-strong);
  background: var(--ed-paper-card);
  overflow: hidden;
  text-align: center;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(30, 35, 33, 0.05);
}

body.theme-editorial .cal-month-badge {
  display: block;
  background: var(--ed-accent);
  color: #fffdf9;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 0;
  letter-spacing: 0.5px;
}

body.theme-editorial .cal-weekday {
  display: none;
}

body.theme-editorial .cal-big-day {
  font-family: var(--ed-sans);
  font-size: 28px;
  font-weight: 700;
  color: var(--ed-ink);
  padding: 6px 0 8px;
}

body.theme-editorial .cal-big-day::after {
  content: "日";
  font-size: 12px;
  font-weight: 500;
  margin-left: 2px;
  color: var(--ed-ink-sub);
}

body.theme-editorial .cal-lunar-col {
  gap: 5px;
}

body.theme-editorial .cal-weekday-label {
  display: block;
  font-size: 15px;
  font-weight: 700;
  color: var(--ed-ink);
}

body.theme-editorial .cal-lunar-date {
  font-size: 12.5px;
  color: var(--ed-ink-sub);
}

body.theme-editorial .cal-day-tag {
  display: inline-block;
  width: fit-content;
  font-size: 11.5px;
  padding: 2px 8px;
  border-radius: 5px;
  background: var(--ed-paper-card);
  border: 1px solid var(--ed-line-strong);
  color: var(--ed-ink-sub);
}

body.theme-editorial .cal-week-strip {
  display: none;
}

body.theme-editorial .ed-cal-mini-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 2px 3px;
  padding-top: 8px;
  border-top: 1px solid var(--ed-line);
}

body.theme-editorial .ed-mini-head {
  text-align: center;
  font-size: 10.5px;
  font-weight: 500;
  color: var(--ed-ink-muted);
  padding-bottom: 3px;
}

body.theme-editorial .ed-mini-day {
  height: 22px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--ed-ink);
  font-family: var(--ed-sans);
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  display: grid;
  place-items: center;
  position: relative;
  padding: 0;
  transition: background 0.14s ease, color 0.14s ease;
}

body.theme-editorial .ed-mini-day:hover {
  background: var(--ed-paper-soft);
}

body.theme-editorial .ed-mini-day.other-month {
  color: var(--ed-ink-muted);
  opacity: 0.42;
}

body.theme-editorial .ed-mini-day.is-weekend:not(.other-month):not(.is-today) {
  color: var(--ed-ink-sub);
}

body.theme-editorial .ed-mini-day.is-holiday:not(.is-today)::after {
  content: "";
  position: absolute;
  bottom: 2px;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--ed-accent);
}

body.theme-editorial .ed-mini-day.is-today {
  background: var(--ed-accent);
  color: #fffdf9;
  font-weight: 700;
}

body.theme-editorial .ed-mini-day.is-cn-off:not(.is-today) {
  background: rgba(22, 163, 74, 0.1);
  color: #166534;
  font-weight: 600;
}

body.theme-editorial .ed-mini-day.is-cn-work:not(.is-today) {
  background: rgba(180, 83, 9, 0.11);
  color: #92400e;
  font-weight: 600;
}

body.theme-editorial .ed-mini-corner {
  position: absolute;
  top: 1px;
  right: 2px;
  font-style: normal;
  font-size: 8px;
  line-height: 1;
  font-weight: 700;
}

body.theme-editorial .ed-mini-corner.off {
  color: #15803d;
}

body.theme-editorial .ed-mini-corner.work {
  color: #b45309;
}

body.theme-editorial .ed-mini-day.is-today .ed-mini-corner {
  color: #fffdf9;
  opacity: 0.9;
}

body.theme-editorial .ed-mini-day.is-jp-hol::before {
  content: "";
  position: absolute;
  bottom: 2px;
  left: 3px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #0284c7;
}

body.theme-editorial .ed-mini-day.is-today.is-jp-hol::before {
  background: #fde047;
}

body.theme-editorial .ed-cal-legend {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-top: 6px;
  margin-top: 4px;
  border-top: 1px dashed var(--ed-line);
  font-size: 10px;
  color: var(--ed-ink-muted);
}

body.theme-editorial .ed-cal-legend span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

body.theme-editorial .ed-cal-legend .lg-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

body.theme-editorial .ed-cal-legend .lg-dot.off { background: #16a34a; }
body.theme-editorial .ed-cal-legend .lg-dot.work { background: #d97706; }
body.theme-editorial .ed-cal-legend .lg-dot.jp { background: #0284c7; }

body.theme-editorial .cal-day-tag.is-off {
  background: rgba(22, 163, 74, 0.12);
  border-color: rgba(22, 163, 74, 0.35);
  color: #15803d;
}

body.theme-editorial .cal-day-tag.is-work {
  background: rgba(217, 119, 6, 0.12);
  border-color: rgba(217, 119, 6, 0.35);
  color: #b45309;
}

body.theme-editorial .cal-day-tag.is-jp {
  background: rgba(2, 132, 199, 0.1);
  border-color: rgba(2, 132, 199, 0.3);
  color: #0369a1;
}

body.theme-editorial .cal-cell.is-cn-off:not(.is-today) {
  background: rgba(22, 163, 74, 0.08);
  border-color: rgba(22, 163, 74, 0.28);
}

body.theme-editorial .cal-cell.is-cn-work:not(.is-today) {
  background: rgba(217, 119, 6, 0.08);
  border-color: rgba(217, 119, 6, 0.28);
}

body.theme-editorial .cal-hol-corner.off {
  background: rgba(22, 163, 74, 0.15);
  color: #15803d;
}

body.theme-editorial .cal-hol-corner.work {
  background: rgba(217, 119, 6, 0.16);
  color: #b45309;
}

body.theme-editorial .cal-jp-tag {
  color: #0369a1;
  font-weight: 500;
}

body.theme-editorial .cal-modal-summary {
  background: var(--ed-paper-soft);
  border-color: var(--ed-line);
  color: var(--ed-ink-sub);
}

body.theme-editorial .cal-modal-summary strong {
  color: var(--ed-ink);
}

/* AI Translate inside sidebar */
body.theme-editorial .glass-select {
  background: var(--ed-paper-card);
  border: 1px solid var(--ed-line-strong);
  color: var(--ed-ink);
  border-radius: 7px;
}

body.theme-editorial .glass-select option {
  background: var(--ed-paper-card);
  color: var(--ed-ink);
}

body.theme-editorial .translate-textarea {
  background: var(--ed-paper-card);
  border: 1px solid var(--ed-line-strong);
  color: var(--ed-ink);
  border-radius: 8px;
}

body.theme-editorial .translate-textarea::placeholder {
  color: var(--ed-ink-muted);
}

body.theme-editorial .translate-textarea:focus {
  border-color: var(--ed-accent);
  background: #ffffff;
}

body.theme-editorial .translate-result-box {
  background: #ffffff;
  border-color: var(--ed-accent);
  color: var(--ed-ink);
  border-radius: 8px;
}

body.theme-editorial .translate-footer {
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
}

body.theme-editorial .translate-hint {
  color: var(--ed-ink-muted);
  display: none;
}

body.theme-editorial .translate-go-btn {
  width: 100%;
  background: var(--ed-accent);
  color: #fffdf9;
  border-radius: 7px;
  padding: 9px 14px;
  font-size: 13px;
}

body.theme-editorial .translate-go-btn:hover {
  background: var(--ed-accent-hover);
}

/* Notes & Countdowns in Editorial */
body.theme-editorial .note-row,
body.theme-editorial .cd-row {
  background: var(--ed-paper-card);
  border: 1px solid var(--ed-line);
  color: var(--ed-ink);
}

body.theme-editorial .note-del,
body.theme-editorial .cd-del {
  color: var(--ed-ink-muted);
}

body.theme-editorial .inline-add-form input {
  background: var(--ed-paper-card);
  border-color: var(--ed-line-strong);
  color: var(--ed-ink);
}

body.theme-editorial .inline-add-form button {
  background: var(--ed-accent);
  color: #fff;
}

/* ---------- Footer ---------- */
body.theme-editorial .page-footer {
  color: var(--ed-ink-muted);
  border-top: 1px solid var(--ed-line);
  padding-top: 14px;
  margin-top: 28px;
}

body.theme-editorial .page-footer::before {
  display: none;
}

/* ---------- Editorial Dialogs, Admin & Menus ---------- */
body.theme-editorial .glass-dialog {
  background: var(--ed-paper);
  backdrop-filter: none;
  border: 1px solid var(--ed-line-strong);
  color: var(--ed-ink);
  box-shadow: 0 24px 60px rgba(30, 35, 33, 0.22);
}

body.theme-editorial .glass-dialog::backdrop {
  background: rgba(30, 35, 33, 0.38);
  backdrop-filter: blur(4px);
}

body.theme-editorial .modal-desc,
body.theme-editorial .form-field label,
body.theme-editorial .cal-cell small,
body.theme-editorial .admin-row-info small,
body.theme-editorial .toggle-row small {
  color: var(--ed-ink-sub);
}

body.theme-editorial .icon-close {
  background: var(--ed-paper-soft);
  color: var(--ed-ink);
}

body.theme-editorial .icon-close:hover {
  background: var(--ed-line);
}

body.theme-editorial .mini-btn,
body.theme-editorial .btn-secondary,
body.theme-editorial .city-chip {
  background: var(--ed-paper-card);
  border: 1px solid var(--ed-line-strong);
  color: var(--ed-ink);
}

body.theme-editorial .mini-btn:hover,
body.theme-editorial .btn-secondary:hover {
  background: var(--ed-paper-soft);
}

body.theme-editorial .city-chip:hover {
  background: var(--ed-accent-soft);
  border-color: var(--ed-accent);
}

body.theme-editorial .btn-primary {
  background: var(--ed-accent);
  color: #fffdf9;
}

body.theme-editorial .btn-danger {
  background: rgba(220, 38, 38, 0.1);
  border-color: rgba(220, 38, 38, 0.35);
  color: #b91c1c;
}

body.theme-editorial .hourly-item,
body.theme-editorial .cal-cell,
body.theme-editorial .admin-card,
body.theme-editorial .admin-row,
body.theme-editorial .admin-group-wrap,
body.theme-editorial .group-site-chip {
  background: var(--ed-paper-card);
  border-color: var(--ed-line);
  color: var(--ed-ink);
}

body.theme-editorial .cal-cell.is-today {
  background: var(--ed-accent-soft);
  border-color: var(--ed-accent);
}

body.theme-editorial .cal-cell.is-holiday small {
  color: var(--ed-accent);
}

body.theme-editorial .admin-sidebar {
  background: var(--ed-paper-soft);
  border-right-color: var(--ed-line);
}

body.theme-editorial .admin-brand small {
  color: var(--ed-ink-sub);
}

body.theme-editorial .admin-tab {
  color: var(--ed-ink-sub);
}

body.theme-editorial .admin-tab:hover {
  background: rgba(30, 35, 33, 0.06);
  color: var(--ed-ink);
}

body.theme-editorial .admin-tab.active {
  background: var(--ed-accent-soft);
  color: var(--ed-accent);
}

body.theme-editorial .form-field input[type="text"],
body.theme-editorial .form-field input[type="password"],
body.theme-editorial .form-field select,
body.theme-editorial .form-field textarea,
body.theme-editorial .city-search-row input,
body.theme-editorial .inline-input-btn input,
body.theme-editorial .g-move-search,
body.theme-editorial .admin-filter-input,
body.theme-editorial .admin-filter-select,
body.theme-editorial .admin-inline-select {
  background: #ffffff;
  border: 1px solid var(--ed-line-strong);
  color: var(--ed-ink);
}

body.theme-editorial .form-field input::placeholder,
body.theme-editorial .form-field textarea::placeholder,
body.theme-editorial .g-move-search::placeholder,
body.theme-editorial .admin-filter-input::placeholder {
  color: var(--ed-ink-muted);
}

body.theme-editorial .admin-filter-select option,
body.theme-editorial .admin-inline-select option,
body.theme-editorial .form-field select option {
  background: #fdfbf7;
  color: var(--ed-ink);
}

body.theme-editorial .form-field input:focus,
body.theme-editorial .form-field select:focus,
body.theme-editorial .form-field textarea:focus,
body.theme-editorial .g-move-search:focus,
body.theme-editorial .admin-filter-input:focus,
body.theme-editorial .admin-filter-select:focus,
body.theme-editorial .admin-inline-select:focus {
  border-color: var(--ed-accent);
  background: #ffffff;
}

body.theme-editorial .form-field .form-checkbox-label,
body.theme-editorial .form-checkbox-label {
  color: var(--ed-ink);
}

body.theme-editorial .form-checkbox-label input[type="checkbox"],
body.theme-editorial .row-check {
  accent-color: var(--ed-accent);
}

body.theme-editorial .icon-pick-btn {
  background: #ffffff;
  border-color: var(--ed-line-strong);
  color: var(--ed-ink-sub);
}

body.theme-editorial .icon-pick-btn:hover {
  background: var(--ed-paper-soft);
  color: var(--ed-ink);
}

body.theme-editorial .icon-pick-btn.active {
  border-color: var(--ed-accent);
  background: var(--ed-accent-soft);
  color: var(--ed-accent);
}

body.theme-editorial .admin-row-icon.is-group-icon {
  background: var(--ed-paper-soft);
  border: 1px solid var(--ed-line);
  color: var(--ed-ink);
}

body.theme-editorial .admin-row-icon.has-img {
  background: #ffffff;
  border: 1px solid var(--ed-line);
}

body.theme-editorial .admin-row-icon.is-letter {
  color: #ffffff;
}

body.theme-editorial .drag-handle {
  color: var(--ed-ink-muted);
}

body.theme-editorial .admin-row.drag-over,
body.theme-editorial .admin-group-wrap.drag-over {
  border-color: var(--ed-accent);
  box-shadow: inset 0 2px 0 var(--ed-accent);
}

body.theme-editorial .group-site-chip.drag-over {
  border-color: var(--ed-accent);
  box-shadow: inset 2px 0 0 var(--ed-accent);
}

body.theme-editorial .admin-bulk-bar {
  background: var(--ed-accent-soft);
  border-color: rgba(200, 75, 40, 0.35);
  color: var(--ed-ink);
}

body.theme-editorial .admin-badge {
  background: var(--ed-paper-soft);
  border-color: var(--ed-line-strong);
  color: var(--ed-ink-sub);
}

body.theme-editorial .admin-badge.is-pinned {
  background: rgba(200, 75, 40, 0.1);
  border-color: rgba(200, 75, 40, 0.35);
  color: var(--ed-accent);
}

body.theme-editorial .admin-badge.is-sync-ok {
  background: rgba(22, 163, 74, 0.12);
  border-color: rgba(22, 163, 74, 0.35);
  color: #15803d;
}

body.theme-editorial .admin-badge.is-sync-warn {
  background: rgba(217, 119, 6, 0.12);
  border-color: rgba(217, 119, 6, 0.35);
  color: #b45309;
}

body.theme-editorial .admin-badge.is-sync-err {
  background: rgba(220, 38, 38, 0.1);
  border-color: rgba(220, 38, 38, 0.32);
  color: #b91c1c;
}

body.theme-editorial .admin-empty-hint {
  color: var(--ed-ink-muted);
}

body.theme-editorial .sync-inline-msg {
  color: #15803d;
}

body.theme-editorial .sync-inline-msg.is-err {
  color: #b91c1c;
}

body.theme-editorial .group-delete-confirm {
  background: rgba(220, 38, 38, 0.05);
  border-top-color: rgba(220, 38, 38, 0.28);
  color: var(--ed-ink);
}

body.theme-editorial .g-move-menu,
body.theme-editorial .context-menu {
  background: #fdfbf7;
  border-color: var(--ed-line-strong);
  color: var(--ed-ink);
  box-shadow: 0 14px 36px rgba(30, 35, 33, 0.16);
}

body.theme-editorial .g-move-option,
body.theme-editorial .context-menu button {
  color: var(--ed-ink);
}

body.theme-editorial .g-move-option:hover,
body.theme-editorial .context-menu button:hover {
  background: var(--ed-paper-soft);
}

body.theme-editorial .g-move-opt-grp,
body.theme-editorial .chip-act {
  background: var(--ed-paper-soft);
  color: var(--ed-ink-sub);
}

body.theme-editorial .g-move-opt-act {
  color: var(--ed-accent);
}

body.theme-editorial .admin-group-wrap.expanded {
  border-color: var(--ed-accent);
}

body.theme-editorial .group-sites-drawer {
  background: var(--ed-paper-soft);
  border-top-color: var(--ed-line);
}

body.theme-editorial .g-sites-toggle.active {
  background: var(--ed-accent-soft);
  border-color: var(--ed-accent);
  color: var(--ed-accent);
}

body.theme-editorial .toggle-row {
  border-bottom-color: var(--ed-line);
}

body.theme-editorial .toggle-row strong {
  color: var(--ed-ink);
}

body.theme-editorial .admin-card h5 {
  color: var(--ed-ink-sub);
}

body.theme-editorial .preset-swatch.active,
body.theme-editorial .logo-preset-btn.active {
  border-color: var(--ed-accent);
  background: var(--ed-accent-soft);
}

body.theme-editorial .logo-preset-btn {
  border-color: var(--ed-line-strong);
  background: var(--ed-paper-card);
  color: var(--ed-ink);
}

body.theme-editorial .toast {
  background: #1e2321;
  color: #faf7f0;
  border-color: rgba(255, 255, 255, 0.12);
}

/* ---------- Theme Switcher Cards in Admin ---------- */
.theme-choice-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.theme-choice-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 2px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
  color: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.16s ease, background 0.16s ease;
}

body.theme-editorial .theme-choice-card {
  border-color: var(--ed-line-strong);
  background: var(--ed-paper-card);
}

.theme-choice-card.active {
  border-color: #4ade80;
  background: rgba(74, 222, 128, 0.14);
}

body.theme-editorial .theme-choice-card.active {
  border-color: var(--ed-accent);
  background: var(--ed-accent-soft);
}

.theme-swatch-mini {
  width: 48px;
  height: 36px;
  border-radius: 8px;
  flex-shrink: 0;
  border: 1px solid rgba(128, 128, 128, 0.25);
}

.theme-swatch-mini.sw-editorial {
  background: linear-gradient(135deg, #f6f2e9 65%, #c84b28 65%);
}

.theme-swatch-mini.sw-glass {
  background: linear-gradient(135deg, #0d5c63 0%, #178a88 60%, #4ade80 100%);
}

.theme-choice-card strong {
  display: block;
  font-size: 13.5px;
}

.theme-choice-card small {
  display: block;
  font-size: 11px;
  opacity: 0.75;
  margin-top: 2px;
}

/* ---------- Responsive Editorial & Desktop Single-Screen Lock ---------- */
@media (min-width: 1025px) {
  html.theme-editorial,
  html.theme-editorial body,
  body.theme-editorial {
    height: 100vh;
    overflow: hidden;
  }

  body.theme-editorial .page-shell {
    height: calc(100vh / var(--page-scale, 1));
    min-height: 0;
    overflow: hidden;
    padding: 12px 28px 10px;
  }

  body.theme-editorial .top-bar {
    padding-bottom: 10px;
  }

  body.theme-editorial .ed-hero {
    padding: 8px 0 12px;
    margin-bottom: 12px;
    min-height: 98px;
  }

  body.theme-editorial .ed-hero-left {
    gap: 9px;
  }

  body.theme-editorial .ed-hero-art {
    height: 128px;
    margin: -8px 0 -12px;
  }

  body.theme-editorial .ed-layout {
    flex: 1;
    min-height: 0;
    align-items: stretch;
  }

  body.theme-editorial .ed-main {
    height: 100%;
    min-height: 0;
    gap: 10px;
  }

  body.theme-editorial .ed-section-heading,
  body.theme-editorial .ed-aside-title {
    font-size: 17px;
    margin: 0 0 8px;
  }

  body.theme-editorial .ed-quick-links .ed-quick-grid .site-card.layout-card-item,
  body.theme-editorial .ed-quick-links .ed-quick-grid .site-card {
    padding: 6px 10px;
  }

  body.theme-editorial .cat-tab {
    padding: 8px 14px;
  }

  body.theme-editorial .sites-container {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    align-content: start;
    gap: 14px 24px;
    padding-right: 4px;
    scrollbar-width: thin;
    scrollbar-color: rgba(138, 132, 121, 0.35) transparent;
  }

  body.theme-editorial .sites-container::-webkit-scrollbar {
    width: 4px;
  }

  body.theme-editorial .sites-container::-webkit-scrollbar-thumb {
    background: rgba(138, 132, 121, 0.35);
    border-radius: 4px;
  }

  body.theme-editorial .site-group-head {
    margin-bottom: 7px;
  }

  body.theme-editorial .group-title {
    font-size: 16.5px;
  }

  body.theme-editorial .sites-container:not(.single-group) .sites-grid,
  body.theme-editorial .sites-container:not(.single-group) .sites-grid.layout-card {
    gap: 6px;
    max-height: 208px;
  }

  body.theme-editorial .sites-container:not(.single-group) .site-card,
  body.theme-editorial .sites-container:not(.single-group) .site-card.layout-card-item {
    height: 46px;
    padding: 6px 12px;
    gap: 10px;
  }

  body.theme-editorial .sites-container:not(.single-group) .site-card .site-icon-box,
  body.theme-editorial .sites-container:not(.single-group) .site-card.layout-card-item .site-icon-box {
    width: 30px;
    height: 30px;
  }

  body.theme-editorial .sites-container:not(.single-group) .site-card .site-icon-inner .badge-text.single {
    font-size: 14px;
  }

  body.theme-editorial .sites-container:not(.single-group) .site-card .site-icon-inner .badge-text.double {
    font-size: 11.5px;
  }

  body.theme-editorial .sites-container:not(.single-group) .site-card .site-name,
  body.theme-editorial .sites-container:not(.single-group) .site-card.layout-card-item .site-name {
    font-size: 13.5px;
    line-height: 1.2;
  }

  body.theme-editorial .sites-container:not(.single-group) .site-sub {
    font-size: 11px;
    line-height: 1.2;
  }

  body.theme-editorial .ed-aside {
    height: 100%;
    min-height: 0;
    overflow-y: auto;
    gap: 0;
    scrollbar-width: none;
  }

  body.theme-editorial .ed-aside:not(:has(#widgets-secondary:not(.hidden))) {
    overflow: hidden;
  }

  body.theme-editorial .ed-aside::-webkit-scrollbar {
    display: none;
  }

  body.theme-editorial .ed-aside:not(:has(#widgets-secondary:not(.hidden))) .widgets-grid {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
  }

  body.theme-editorial .ed-aside:not(:has(#widgets-secondary:not(.hidden))) .widget-weather,
  body.theme-editorial .ed-aside:not(:has(#widgets-secondary:not(.hidden))) .widget-calendar {
    flex: 0 0 auto;
  }

  body.theme-editorial .ed-aside:not(:has(#widgets-secondary:not(.hidden))) .widget-translate {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
  }

  body.theme-editorial .ed-aside:not(:has(#widgets-secondary:not(.hidden))) .translate-body {
    flex: 1;
    min-height: 0;
  }

  body.theme-editorial .ed-aside:not(:has(#widgets-secondary:not(.hidden))) .translate-textarea {
    flex: 1;
    min-height: 44px;
    max-height: 160px;
    height: auto;
  }

  body.theme-editorial .ed-aside:not(:has(#widgets-secondary:not(.hidden))) .translate-result-box {
    flex: 1;
    min-height: 48px;
    max-height: 160px;
  }

  body.theme-editorial .ed-aside:not(:has(#widgets-secondary:not(.hidden))) .translate-footer {
    flex-shrink: 0;
    margin-top: auto;
  }

  body.theme-editorial .ed-aside .ed-aside-title {
    margin: 0 0 4px;
    font-size: 16.5px;
  }

  body.theme-editorial .ed-aside .glass-card {
    padding: 8px 0;
  }

  body.theme-editorial .ed-aside .glass-card:last-child {
    padding-bottom: 0;
  }

  body.theme-editorial .ed-aside .widget-head {
    margin-bottom: 5px;
  }

  body.theme-editorial .weather-body {
    gap: 7px;
  }

  body.theme-editorial .weather-temp {
    font-size: 26px;
  }

  body.theme-editorial .forecast-day {
    padding: 4px 3px;
    gap: 1px;
  }

  body.theme-editorial .cal-main {
    margin: 0 0 6px;
    gap: 10px;
  }

  body.theme-editorial .cal-day-col {
    width: 52px;
  }

  body.theme-editorial .cal-month-badge {
    font-size: 10px;
    padding: 2px 0;
  }

  body.theme-editorial .cal-big-day {
    font-size: 20px;
    padding: 3px 0 4px;
  }

  body.theme-editorial .cal-lunar-col {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 3px 8px;
  }

  body.theme-editorial .cal-weekday-label {
    font-size: 14px;
  }

  body.theme-editorial .cal-lunar-date {
    font-size: 12px;
  }

  body.theme-editorial .cal-day-tag {
    font-size: 11px;
    padding: 1px 6px;
  }

  body.theme-editorial .ed-cal-mini-grid {
    padding-top: 5px;
    gap: 1px 3px;
  }

  body.theme-editorial .ed-mini-head {
    padding-bottom: 2px;
    font-size: 10px;
  }

  body.theme-editorial .ed-mini-day {
    height: 19px;
    font-size: 11px;
  }

  body.theme-editorial .ed-cal-legend {
    padding-top: 4px;
    margin-top: 3px;
  }

  body.theme-editorial .translate-body {
    gap: 6px;
  }

  body.theme-editorial .translate-textarea {
    min-height: 46px;
    height: 46px;
    padding: 6px 10px;
    font-size: 12.5px;
  }

  body.theme-editorial .translate-go-btn {
    padding: 6px 14px;
    font-size: 12.5px;
  }

  body.theme-editorial .page-footer {
    margin-top: 6px;
    padding-top: 6px;
    font-size: 11px;
    flex-shrink: 0;
  }
}

@media (max-width: 1024px) {
  body.theme-editorial .ed-layout {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  body.theme-editorial .ed-aside {
    border-left: none;
    border-top: 1px solid var(--ed-line);
    padding-left: 0;
    padding-top: 18px;
  }
  body.theme-editorial .sites-container:not(.single-group) .sites-grid,
  body.theme-editorial .sites-container:not(.single-group) .sites-grid.layout-card {
    max-height: none;
    overflow: visible;
    padding-right: 0;
  }
}

@media (max-width: 760px) {
  body.theme-editorial .page-shell {
    padding: 14px 16px 28px;
  }
  body.theme-editorial .top-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding-bottom: 12px;
  }
  body.theme-editorial .brand {
    gap: 10px;
  }
  body.theme-editorial .brand-logo {
    width: 26px;
    height: 26px;
  }
  body.theme-editorial .brand-text {
    gap: 10px;
    min-width: 0;
  }
  body.theme-editorial .brand-text h1 {
    font-size: 20px;
    white-space: nowrap;
  }
  body.theme-editorial .brand-text span {
    font-size: 10.5px;
    letter-spacing: 1.5px;
    padding-left: 10px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  body.theme-editorial .top-actions {
    gap: 6px;
    flex-wrap: wrap;
  }
  body.theme-editorial #appearance-btn::before,
  body.theme-editorial #admin-btn::before {
    display: none;
  }
  body.theme-editorial .glass-pill {
    height: 32px;
    padding: 0 10px;
    font-size: 12px;
    border: 1px solid var(--ed-line);
    background: var(--ed-paper-card);
    border-radius: 999px;
  }
  body.theme-editorial .url-switch-pill {
    padding: 0 10px 0 6px;
    gap: 6px;
  }
  body.theme-editorial #appearance-btn .hide-sm {
    display: inline;
  }
  body.theme-editorial .ed-hero {
    grid-template-columns: 1fr;
    padding: 10px 0 14px;
    min-height: auto;
    margin-bottom: 14px;
  }
  body.theme-editorial .ed-hero-left {
    gap: 10px;
  }
  body.theme-editorial .ed-hero-art,
  body.theme-editorial .search-kbd {
    display: none;
  }
  body.theme-editorial .search-wrapper {
    height: 44px;
    padding: 2px 8px;
  }
  body.theme-editorial .ed-main {
    gap: 14px;
  }
  body.theme-editorial .ed-quick-links .ed-quick-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }
  body.theme-editorial .cat-tab {
    padding: 10px 12px;
    font-size: 13px;
  }
  body.theme-editorial .sites-container {
    grid-template-columns: 1fr;
    gap: 18px;
  }
  body.theme-editorial .sites-container.single-group .sites-grid,
  body.theme-editorial .sites-container.single-group .sites-grid.layout-card {
    grid-template-columns: 1fr;
  }
  body.theme-editorial .site-card,
  body.theme-editorial .site-card.layout-card-item {
    min-height: 54px;
    padding: 9px 12px;
  }
  body.theme-editorial .sites-container:not(.single-group) .site-group:not(.mobile-expanded) .sites-grid .site-card:nth-child(n+7) {
    display: none;
  }
  body.theme-editorial .ed-mobile-more-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    margin-top: 8px;
    padding: 8px 12px;
    border-radius: 9px;
    border: 1px dashed var(--ed-line-strong);
    background: var(--ed-paper-soft);
    color: var(--ed-ink-sub);
    font-size: 12.5px;
    font-weight: 500;
    cursor: pointer;
  }
  body.theme-editorial .ed-mobile-more-btn:active {
    background: var(--ed-accent-soft);
    color: var(--ed-accent);
  }
  body.theme-editorial .translate-go-btn {
    min-height: 40px;
  }
}
