:root {
  color-scheme: light;
  --bg: #f5f7fb;
  --bg-blue: #eef5ff;
  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --surface-blue: #f3f8ff;
  --text: #111827;
  --text-soft: #334155;
  --muted: #64748b;
  --line: #e5e7eb;
  --line-strong: #cbd5e1;
  --primary: #2563eb;
  --primary-strong: #1d4ed8;
  --primary-soft: #dbeafe;
  --ok: #059669;
  --ok-bg: #dcfce7;
  --warn: #d97706;
  --warn-bg: #fef3c7;
  --down: #dc2626;
  --down-bg: #fee2e2;
  --deploying: #2563eb;
  --deploying-bg: #dbeafe;
  --unknown: #64748b;
  --unknown-bg: #e2e8f0;
  --shadow: 0 18px 44px rgba(15, 23, 42, 0.08);
  --shadow-sm: 0 10px 24px rgba(15, 23, 42, 0.06);
  --radius-lg: 28px;
  --radius: 20px;
  --radius-sm: 14px;
}

* { box-sizing: border-box; }

html {
  min-height: 100%;
  background:
    radial-gradient(circle at 10% -10%, rgba(37, 99, 235, 0.12), transparent 34rem),
    radial-gradient(circle at 95% 3%, rgba(14, 165, 233, 0.10), transparent 30rem),
    linear-gradient(180deg, #ffffff 0%, var(--bg) 28rem);
}

body {
  min-height: 100%;
  margin: 0;
  color: var(--text);
  font-family: Pretendard, "Noto Sans KR", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

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

button,
a { transition: border-color .15s ease, background .15s ease, color .15s ease, box-shadow .15s ease, transform .15s ease; }

button:hover,
a:hover { transform: translateY(-1px); }

.shell {
  width: min(1440px, calc(100% - 40px));
  margin: 0 auto;
  padding: 24px 0 64px;
}

.utilitybar,
.top-chat,
.tabs,
.panel,
.table-wrap,
.section-head,
.manage-form,
.chat-shell {
  border: 1px solid rgba(203, 213, 225, .72);
  background: rgba(255, 255, 255, .94);
  box-shadow: var(--shadow-sm);
}

.utilitybar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
  border-radius: 22px;
  padding: 12px 14px 12px 18px;
}

.footbar {
  margin: 26px 0 0;
  padding: 8px 10px 8px 12px;
  border-radius: 16px;
  box-shadow: none;
  opacity: .78;
}

.footbar .eyebrow {
  font-size: .66rem;
}

.footbar .updated-card {
  min-width: auto;
  padding: 7px 9px;
  border-radius: 13px;
  background: #fff;
}

.footbar .updated-card span {
  font-size: .58rem;
}

.footbar #updatedAt {
  font-size: .72rem;
}

.footbar .session-actions button {
  padding: 7px 10px;
  font-size: .76rem;
}

.top-chat {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  border-radius: 24px;
  padding: 12px;
}

.top-chat-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.top-chat-form button {
  border: 0;
  border-radius: 16px;
  padding: 0 18px;
  color: #fff;
  background: linear-gradient(135deg, var(--primary), #3b82f6);
  cursor: pointer;
  font-weight: 950;
}

#topChatStatus {
  min-width: 44px;
  color: var(--muted);
  font-size: .78rem;
  font-weight: 900;
  text-align: right;
}

.prompt-chips {
  grid-column: 1 / -1;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 2px 0;
  scrollbar-width: none;
}

.prompt-chips::-webkit-scrollbar { display: none; }

.prompt-chips button {
  flex: 0 0 auto;
  min-height: 34px;
  border: 1px solid #dbeafe;
  border-radius: 999px;
  padding: 0 12px;
  color: var(--primary-strong);
  background: #eff6ff;
  cursor: pointer;
  font-size: .8rem;
  font-weight: 900;
  white-space: nowrap;
}

.prompt-chips button:hover {
  border-color: #93c5fd;
  background: #dbeafe;
}

.eyebrow,
.panel h2 { margin: 0; }

.eyebrow {
  margin: 0;
  color: var(--primary);
  font-size: .76rem;
  font-weight: 950;
  letter-spacing: .16em;
  text-transform: uppercase;
}

.session-actions {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 12px;
}

.session-actions form { margin: 0; }

.updated-card {
  min-width: 178px;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 10px 12px;
  background: rgba(248, 250, 252, .88);
}

.updated-card span {
  display: block;
  color: var(--muted);
  font-size: .68rem;
  font-weight: 950;
  letter-spacing: .14em;
}

#updatedAt {
  display: block;
  margin-top: 3px;
  color: var(--text-soft);
  font-size: .86rem;
  font-weight: 800;
  white-space: nowrap;
}

.session-actions button,
.tab,
.section-head button,
.manage-form button,
.json-actions button,
.manage-list button {
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 10px 15px;
  color: var(--text);
  background: #fff;
  cursor: pointer;
  font-weight: 850;
}

.session-actions button:hover,
.tab:hover,
.section-head button:hover,
.json-actions button:hover,
.manage-list button:hover {
  border-color: #93c5fd;
  color: var(--primary-strong);
  background: #eff6ff;
  box-shadow: 0 8px 20px rgba(37, 99, 235, .10);
}

.tabs {
  margin-top: 14px;
  border-radius: 22px;
  padding: 10px;
}

.nav-search input,
.top-chat-form input,
.manage-form input,
.manage-form select,
.manage-form textarea,
.chat-form textarea {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  padding: 12px 14px;
  color: var(--text);
  background: #fff;
  outline: none;
}

.nav-search input,
.top-chat-form input {
  min-height: 48px;
  border-color: #dbe3ef;
  background: linear-gradient(180deg, #fff, #fbfdff);
  font-weight: 650;
}

.nav-search input {
  min-height: 38px;
  border-radius: 999px;
  padding: 8px 14px;
  font-size: .86rem;
}

.nav-search input::placeholder,
.top-chat-form input::placeholder { color: #94a3b8; }

.nav-search input:focus,
.top-chat-form input:focus,
.manage-form input:focus,
.manage-form select:focus,
.manage-form textarea:focus,
.chat-form textarea:focus {
  border-color: #60a5fa;
  box-shadow: 0 0 0 4px rgba(96, 165, 250, .16);
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  background: rgba(255, 255, 255, .92);
}

.nav-search {
  flex: 1 1 260px;
  max-width: 360px;
  margin-left: auto;
}

.tab {
  min-height: 38px;
  padding: 8px 14px;
  font-size: .86rem;
}

.tab.active {
  border-color: var(--primary);
  color: #fff;
  background: linear-gradient(135deg, var(--primary), #3b82f6);
  box-shadow: 0 10px 22px rgba(37, 99, 235, .18);
}

.tab-panel { margin-top: 18px; }
.hidden { display: none !important; }

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
  border-radius: 22px;
  padding: 14px 18px;
}

.section-head h2 {
  margin: 0;
  font-size: 1.02rem;
  letter-spacing: -.025em;
}

.section-head span {
  color: var(--muted);
  font-weight: 850;
}

.section-actions,
.manage-actions {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.lane-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 18px 0 10px;
  padding: 0 4px;
}

.lane-head h3 {
  margin: 0;
  font-size: 1rem;
  letter-spacing: -.02em;
}

.lane-head span {
  color: var(--muted);
  font-weight: 900;
}

.bookmark-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}

.bookmark-card {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 13px;
  min-height: 138px;
  border: 1px solid rgba(203, 213, 225, .78);
  border-radius: 22px;
  padding: 16px;
  background: #fff;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
}

.bookmark-card:hover {
  border-color: #93c5fd;
  box-shadow: 0 18px 38px rgba(37, 99, 235, .12);
  transform: translateY(-1px);
}

.bookmark-card:focus-visible {
  outline: 3px solid rgba(37, 99, 235, .22);
  outline-offset: 3px;
}

.bookmark-icon {
  display: grid;
  place-items: center;
  overflow: hidden;
  width: 48px;
  height: 48px;
  border: 1px solid var(--line);
  border-radius: 16px;
  color: var(--primary-strong);
  background: #fff;
  box-shadow: 0 10px 22px rgba(15, 23, 42, .08);
  font-size: 1.35rem;
  font-weight: 950;
  line-height: 1;
}

.bookmark-icon img {
  display: block;
  width: 34px;
  height: 34px;
  object-fit: contain;
}

.bookmark-icon.logo-icon {
  background: linear-gradient(180deg, #fff, #f8fafc);
}

.bookmark-icon.fallback-icon {
  border-color: transparent;
  color: #fff;
  background: linear-gradient(135deg, var(--primary), #38bdf8);
  box-shadow: 0 12px 24px rgba(37, 99, 235, .18);
}

.bookmark-icon.fallback-icon.tool-icon {
  background: linear-gradient(135deg, #7c3aed, #06b6d4);
}

.bookmark-icon.fallback-icon.dev-icon {
  background: linear-gradient(135deg, #0f766e, #22c55e);
}

.bookmark-icon.fallback-icon.service-icon {
  background: linear-gradient(135deg, var(--primary), #38bdf8);
}

.bookmark-main {
  min-width: 0;
}

.bookmark-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.bookmark-actions,
.modal-header-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 8px;
}

.favorite-toggle {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: #94a3b8;
  background: #fff;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 950;
  line-height: 1;
}

.favorite-toggle:hover {
  border-color: #fbbf24;
  color: #d97706;
  background: #fffbeb;
}

.favorite-toggle.active {
  border-color: #facc15;
  color: #d97706;
  background: #fef3c7;
}

.bookmark-card h3 {
  min-width: 0;
  margin: 0;
  overflow: hidden;
  font-size: 1.03rem;
  letter-spacing: -.035em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.modal-title-wrap {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
  min-width: 0;
}

.modal-service-icon {
  width: 64px;
  height: 64px;
  border-radius: 20px;
  font-size: 1.7rem;
}

.modal-service-icon img {
  width: 44px;
  height: 44px;
}

.bookmark-card p {
  margin: 8px 0 12px;
  overflow: hidden;
  color: var(--muted);
  font-size: .82rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bookmark-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.bookmark-meta span {
  max-width: 100%;
  overflow: hidden;
  border-radius: 999px;
  padding: 5px 8px;
  color: var(--text-soft);
  background: var(--surface-soft);
  font-size: .72rem;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.domain-card {
  display: grid;
  grid-template-columns: minmax(260px, .8fr) minmax(0, 1.2fr);
  gap: 16px;
  border: 1px solid rgba(203, 213, 225, .78);
  border-radius: 28px;
  padding: 22px;
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.domain-hero {
  display: grid;
  align-content: start;
  gap: 12px;
  border-radius: 22px;
  padding: 22px;
  background: linear-gradient(135deg, #eff6ff, #ffffff);
}

.domain-hero h3 {
  margin: 0;
  font-size: clamp(2.4rem, 6vw, 4.5rem);
  line-height: .9;
  letter-spacing: -.08em;
}

.domain-hero strong {
  color: var(--ok);
  font-size: 1.15rem;
}

.domain-meta {
  display: grid;
  gap: 1px;
  overflow: hidden;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--line);
}

.domain-meta div {
  display: grid;
  grid-template-columns: 90px minmax(0, 1fr);
  gap: 12px;
  padding: 13px 14px;
  background: #fff;
}

.domain-meta dt {
  color: var(--muted);
  font-size: .78rem;
  font-weight: 950;
}

.domain-meta dd {
  min-width: 0;
  margin: 0;
  color: var(--text-soft);
  font-size: .9rem;
  word-break: break-word;
}

.admin-tab {
  margin-left: auto;
  color: var(--muted);
}

.provider-badge {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  border: 1px solid #dbeafe;
  border-radius: 999px;
  padding: 3px 8px;
  color: var(--primary-strong);
  background: #eff6ff;
  font-size: .7rem;
  font-weight: 950;
  letter-spacing: .04em;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  height: fit-content;
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: .72rem;
  font-weight: 950;
  white-space: nowrap;
}

.status-ok { color: var(--ok); background: var(--ok-bg); }
.status-warn { color: var(--warn); background: var(--warn-bg); }
.status-down { color: var(--down); background: var(--down-bg); }
.status-deploying { color: var(--deploying); background: var(--deploying-bg); }
.status-unknown { color: var(--unknown); background: var(--unknown-bg); }

.service-links {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
  margin-top: 12px;
}

.service-links a {
  border: 1px solid #d6e2f0;
  border-radius: 14px;
  padding: 10px 12px;
  color: var(--primary-strong);
  text-align: center;
  text-decoration: none;
  background: #fff;
  font-size: .84rem;
  font-weight: 900;
}

.service-links a:hover {
  border-color: #93c5fd;
  background: #eff6ff;
  box-shadow: 0 8px 20px rgba(37, 99, 235, .10);
}

.service-links a.disabled { pointer-events: none; opacity: .42; }

body.modal-open {
  overflow: hidden;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(15, 23, 42, .42);
  backdrop-filter: blur(6px);
}

.service-modal-card {
  width: min(620px, 100%);
  max-height: min(760px, calc(100vh - 48px));
  overflow: auto;
  border: 1px solid rgba(203, 213, 225, .86);
  border-radius: 28px;
  padding: 22px;
  background: #fff;
  box-shadow: 0 28px 80px rgba(15, 23, 42, .24);
}

.service-modal-card header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.service-modal-card h2 {
  margin: 12px 0 0;
  font-size: 2rem;
  line-height: 1;
  letter-spacing: -.065em;
}

#serviceModalProject {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: .9rem;
  word-break: break-all;
}

#serviceModalClose,
#manageModalClose,
.modal-utility {
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 9px 14px;
  background: #fff;
  cursor: pointer;
  font-weight: 900;
}

.modal-utility {
  color: var(--primary-strong);
  background: #eff6ff;
}

.modal-utility:disabled {
  cursor: not-allowed;
  opacity: .45;
}

.manage-modal-card {
  width: min(760px, 100%);
}

.modal-managed-form {
  margin-top: 18px;
  box-shadow: none;
}

.modal-status-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin: 18px 0;
  border: 1px solid #e2e8f0;
  border-radius: 18px;
  padding: 12px;
  background: var(--surface-soft);
}

.modal-status-row strong {
  min-width: 0;
  color: var(--text);
  font-size: .9rem;
}

.modal-meta {
  display: grid;
  gap: 1px;
  overflow: hidden;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--line);
}

.modal-meta div {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 12px;
  padding: 12px 14px;
  background: #fff;
}

.modal-meta dt {
  color: var(--muted);
  font-size: .78rem;
  font-weight: 950;
}

.modal-meta dd {
  min-width: 0;
  margin: 0;
  color: var(--text-soft);
  font-size: .9rem;
  word-break: break-word;
}

.modal-links {
  margin-top: 16px;
}

.table-wrap {
  overflow: auto;
  border-radius: 22px;
}

.status-table {
  width: 100%;
  min-width: 780px;
  border-collapse: collapse;
  background: #fff;
}

.status-table th,
.status-table td {
  border-bottom: 1px solid var(--line);
  padding: 14px 15px;
  text-align: left;
  vertical-align: middle;
}

.status-table th {
  color: var(--muted);
  font-size: .72rem;
  font-weight: 950;
  letter-spacing: .08em;
  text-transform: uppercase;
  background: #f8fafc;
}

.status-table td {
  color: var(--text-soft);
  font-size: .9rem;
}

.status-table tr:hover td { background: #fbfdff; }
.status-table tr:last-child td { border-bottom: 0; }

.status-table a {
  color: var(--primary-strong);
  font-weight: 800;
  text-decoration: none;
}

.status-table a:hover { text-decoration: underline; }

.panel,
.manage-form,
.manage-block,
.chat-shell {
  border-radius: 24px;
  padding: 20px;
}

.panel { margin-top: 0; }

.panel h2,
.manage-form h2,
.manage-block h2 {
  margin: 0 0 14px;
  font-size: 1.02rem;
  letter-spacing: -.02em;
}

.timeline,
.deploy-list,
.manage-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.timeline li,
.deploy-list li,
.manage-list li {
  border-top: 1px solid var(--line);
  padding-top: 11px;
}

.timeline strong,
.deploy-list strong {
  display: block;
  color: var(--text);
  font-size: .94rem;
}

.timeline span,
.deploy-list span,
.manage-list em {
  color: var(--muted);
  font-size: .82rem;
  font-style: normal;
}

.empty {
  grid-column: 1 / -1;
  border: 1px dashed #cbd5e1;
  border-radius: 22px;
  padding: 34px;
  color: var(--muted);
  text-align: center;
  background: #fff;
}

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

.form-grid label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: .8rem;
  font-weight: 950;
}

.form-grid .wide { grid-column: 1 / -1; }

.manage-form > button,
.chat-form button {
  border: 0;
  color: #fff;
  background: linear-gradient(135deg, var(--primary), #3b82f6);
}

.manage-form > button {
  width: 100%;
  margin-top: 14px;
}

.manage-list {
  max-height: 420px;
  overflow: auto;
}

.manage-list + .manage-form {
  margin-top: 18px;
}

.manage-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px;
  background: #fff;
}

.manage-list span {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.manage-list strong,
.manage-list em {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.manage-list .danger {
  color: var(--down);
  background: var(--down-bg);
}

.security-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}

.security-item {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 13px;
  background: #fff;
}

.security-item header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.security-item strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.security-item p {
  margin: 0;
  color: var(--muted);
  font-size: .82rem;
  font-weight: 750;
}

.manage-block {
  margin-bottom: 18px;
  border: 1px solid rgba(203, 213, 225, .72);
  background: rgba(255, 255, 255, .94);
  box-shadow: var(--shadow-sm);
}

.json-panel { margin-bottom: 18px; }

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

.calendar-board {
  overflow: hidden;
  margin-bottom: 18px;
  border: 1px solid rgba(203, 213, 225, .72);
  border-radius: 24px;
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.calendar-weekdays,
.calendar-days {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.calendar-weekdays span {
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 12px 8px;
  color: var(--muted);
  background: #f8fafc;
  text-align: center;
  font-size: .78rem;
  font-weight: 950;
}

.calendar-weekdays span:last-child,
.calendar-day:nth-child(7n) {
  border-right: 0;
}

.calendar-day {
  min-height: 132px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 10px;
  background: #fff;
  cursor: pointer;
  transition: background .15s ease, box-shadow .15s ease, transform .15s ease;
}

.calendar-day:hover {
  background: #f8fbff;
  box-shadow: inset 0 0 0 2px rgba(147, 197, 253, .35);
}

.calendar-day:focus-visible {
  outline: 3px solid rgba(37, 99, 235, .22);
  outline-offset: -3px;
}

.calendar-day.outside {
  background: #f8fafc;
  color: var(--muted);
}

.calendar-day.today {
  background: #eff6ff;
  box-shadow: inset 0 0 0 2px rgba(37, 99, 235, .18);
}

.calendar-day-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
  color: var(--text);
  font-weight: 950;
}

.calendar-day-head span {
  display: grid;
  min-width: 22px;
  height: 22px;
  place-items: center;
  border-radius: 999px;
  color: var(--primary-strong);
  background: var(--primary-soft);
  font-size: .75rem;
}

.calendar-day-items {
  display: grid;
  gap: 6px;
}

.calendar-item {
  overflow: hidden;
  border: 1px solid #dbeafe;
  border-radius: 12px;
  padding: 7px 8px;
  background: #f8fbff;
}

.calendar-item strong,
.calendar-item span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.calendar-item strong {
  color: var(--text);
  font-size: .78rem;
}

.calendar-item span,
.more-items {
  color: var(--muted);
  font-size: .72rem;
  font-style: normal;
}

.event-item.done {
  border-color: #bbf7d0;
  background: #f0fdf4;
}

.event-item.cancelled {
  border-color: #fecaca;
  background: #fff1f2;
}

.more-items {
  display: block;
  margin-top: 6px;
  font-weight: 900;
}

.wiki-card {
  display: flex;
  min-height: 230px;
  flex-direction: column;
  border: 1px solid rgba(203, 213, 225, .72);
  border-radius: 24px;
  padding: 18px;
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.wiki-card header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.wiki-card h3 {
  margin: 0;
  font-size: 1.04rem;
  letter-spacing: -.03em;
}

.wiki-card .wiki-meta {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: .78rem;
  font-weight: 800;
}

.wiki-content {
  display: -webkit-box;
  overflow: hidden;
  margin: 14px 0;
  color: var(--text-soft);
  font-size: .9rem;
  line-height: 1.55;
  white-space: pre-wrap;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 6;
}

.md-content h3,
.md-content h4,
.md-content h5 {
  margin: 0 0 8px;
  color: var(--text);
  font-size: .98rem;
  letter-spacing: -.02em;
}

.md-content p,
.md-content ul,
.md-content pre {
  margin: 0 0 8px;
}

.md-content ul {
  padding-left: 18px;
}

.md-content pre {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 8px;
  background: #f8fafc;
  font-size: .8rem;
}

.wiki-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: auto;
}

.wiki-tags span {
  border-radius: 999px;
  padding: 5px 9px;
  color: var(--primary-strong);
  background: var(--primary-soft);
  font-size: .72rem;
  font-weight: 900;
}

.wiki-actions {
  display: flex;
  gap: 8px;
  margin-top: 14px;
}

.wiki-actions button {
  flex: 1;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  padding: 9px 10px;
  background: #fff;
  cursor: pointer;
  font-weight: 900;
}

.wiki-actions .danger {
  color: var(--down);
  background: var(--down-bg);
}

.password-form {
  margin-bottom: 16px;
}

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

.form-message {
  color: var(--muted);
  font-size: .84rem;
  font-weight: 850;
}

.form-message.ok {
  color: var(--ok);
}

.form-message.error {
  color: var(--down);
}

.json-actions,
.head-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.json-actions { margin-bottom: 12px; }

.json-actions div,
.head-actions {
  display: flex;
  gap: 10px;
}

#jsonEditor {
  min-height: 420px;
  resize: vertical;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .82rem;
  line-height: 1.5;
}

.inline-form { margin-bottom: 18px; }
.inline-form textarea { min-height: 110px; resize: vertical; }

.chat-shell {
  display: grid;
  gap: 14px;
  margin-bottom: 18px;
}

.chat-log {
  display: grid;
  gap: 12px;
  max-height: 520px;
  overflow: auto;
  padding-right: 4px;
}

.chat-message {
  max-width: min(760px, 92%);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 13px 14px;
  background: #f8fafc;
}

.chat-message.assistant {
  justify-self: end;
  border-color: #bfdbfe;
  background: #eff6ff;
}

.chat-message header {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: baseline;
  margin-bottom: 7px;
}

.chat-message header span {
  color: var(--muted);
  font-size: .78rem;
}

.chat-message p {
  margin: 0;
  white-space: pre-wrap;
}

.chat-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.chat-form textarea { min-height: 72px; resize: vertical; }

.chat-form button {
  border-radius: 16px;
  padding: 0 20px;
  font-weight: 950;
  cursor: pointer;
}


.home-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 18px;
  align-items: start;
}

.home-main {
  min-width: 0;
}

.home-side {
  position: sticky;
  top: 16px;
  display: grid;
  gap: 14px;
}

.quick-block {
  border: 1px solid rgba(203, 213, 225, .78);
  border-radius: 24px;
  padding: 16px;
  background: rgba(255, 255, 255, .96);
  box-shadow: var(--shadow-sm);
}

.quick-block + .quick-block {
  margin-top: 18px;
}

.home-side .quick-block + .quick-block {
  margin-top: 0;
}

.compact-head {
  margin: 0 0 12px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.quick-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.quick-title-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.quick-title h2 {
  margin: 0;
  font-size: 1rem;
  letter-spacing: -.03em;
}

.quick-title span {
  color: var(--muted);
  font-size: .76rem;
  font-weight: 900;
  white-space: nowrap;
}

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

.quick-actions button,
.today-actions button,
.nav-search button,
.quick-title-actions button,
.command-card header button {
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  padding: 10px 12px;
  color: var(--text);
  background: #fff;
  cursor: pointer;
  font-size: .82rem;
  font-weight: 900;
}

.quick-actions button:hover,
.today-actions button:hover,
.nav-search button:hover,
.quick-title-actions button:hover,
.command-card header button:hover {
  border-color: #93c5fd;
  color: var(--primary-strong);
  background: #eff6ff;
}

.nav-search {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px;
  align-items: center;
}

#commandOpen {
  min-height: 38px;
  border-radius: 999px;
  padding: 8px 12px;
  color: var(--primary-strong);
  background: #eff6ff;
  white-space: nowrap;
}

.status-digest {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.status-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: -2px 0 12px;
}

.status-filter button {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 10px;
  color: var(--muted);
  background: #fff;
  cursor: pointer;
  font-size: .72rem;
  font-weight: 950;
  white-space: nowrap;
}

.status-filter button.active {
  border-color: #93c5fd;
  color: var(--primary-strong);
  background: #eff6ff;
}

.digest-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 10px;
  background: var(--surface-soft);
  cursor: pointer;
  text-align: left;
}

.digest-card:hover,
.digest-card.active {
  border-color: #93c5fd;
  background: #eff6ff;
}

.digest-card span {
  display: block;
  color: var(--muted);
  font-size: .68rem;
  font-weight: 950;
}

.digest-card strong {
  display: block;
  margin-top: 5px;
  font-size: 1.45rem;
  line-height: 1;
  letter-spacing: -.05em;
}

.digest-card.ok strong { color: var(--ok); }
.digest-card.warn strong { color: var(--warn); }
.digest-card.down strong { color: var(--down); }
.digest-card.deploying strong { color: var(--deploying); }

.attention-list,
.today-list,
.recent-list {
  display: grid;
  gap: 8px;
}

.attention-item,
.today-item,
.recent-item,
.command-item {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 10px;
  color: var(--text);
  background: #fff;
  cursor: pointer;
  text-align: left;
}

.attention-item,
.recent-item,
.command-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.today-item {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  gap: 4px 10px;
}

.today-item span {
  grid-row: span 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  border-radius: 12px;
  color: var(--primary-strong);
  background: #eff6ff;
  font-size: .78rem;
  font-weight: 950;
}

.attention-item:hover,
.today-item:hover,
.recent-item:hover,
.command-item:hover,
.command-item.active {
  border-color: #93c5fd;
  background: #f8fbff;
  box-shadow: 0 10px 24px rgba(37, 99, 235, .10);
}

.attention-item strong,
.today-item strong,
.recent-item strong,
.command-item strong {
  display: block;
  min-width: 0;
  overflow: hidden;
  font-size: .9rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.attention-item em,
.today-item em,
.recent-item em,
.command-item em {
  display: block;
  min-width: 0;
  overflow: hidden;
  margin-top: 2px;
  color: var(--muted);
  font-size: .74rem;
  font-style: normal;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recent-list {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.mini-icon {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  font-size: .9rem;
}

.mini-icon img {
  width: 24px;
  height: 24px;
}

.today-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 2px;
}

.compact-empty {
  margin: 0;
  color: var(--muted);
  font-size: .82rem;
  font-weight: 750;
}

.palette-backdrop {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: grid;
  place-items: start center;
  padding: 8vh 18px 24px;
  background: rgba(15, 23, 42, .22);
  backdrop-filter: blur(10px);
}

.command-card {
  width: min(720px, 100%);
  border: 1px solid rgba(203, 213, 225, .9);
  border-radius: 26px;
  padding: 16px;
  background: #fff;
  box-shadow: 0 30px 80px rgba(15, 23, 42, .22);
}

.command-card header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.command-card h2 {
  margin: 7px 0 0;
  font-size: 1.35rem;
  letter-spacing: -.045em;
}

#commandInput {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 18px;
  padding: 14px 16px;
  outline: none;
  font-size: 1rem;
  font-weight: 750;
}

#commandInput:focus {
  border-color: #60a5fa;
  box-shadow: 0 0 0 4px rgba(96, 165, 250, .16);
}

.command-results {
  display: grid;
  gap: 8px;
  max-height: min(58vh, 560px);
  overflow: auto;
  margin-top: 12px;
  padding-right: 2px;
}

.command-type {
  display: inline-grid;
  place-items: center;
  min-width: 52px;
  height: 34px;
  border-radius: 12px;
  color: var(--primary-strong);
  background: #eff6ff;
  font-size: .74rem;
  font-weight: 950;
}

.command-help {
  margin: 12px 2px 0;
  color: var(--muted);
  font-size: .78rem;
  font-weight: 800;
}

.mobile-dock {
  display: none;
}

body.modal-open .mobile-dock {
  display: none;
}

@media (max-width: 1240px) {
  .home-layout { grid-template-columns: minmax(0, 1fr) 330px; }
  .bookmark-grid { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
  .wiki-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 980px) {
  .home-layout { grid-template-columns: 1fr; }
  .home-side { position: static; }
  .recent-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bookmark-grid { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
  .domain-card { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  html {
    scroll-padding-bottom: calc(98px + env(safe-area-inset-bottom));
  }

  .shell {
    width: min(100% - 20px, 1440px);
    padding-top: 12px;
    padding-bottom: calc(112px + env(safe-area-inset-bottom));
  }


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

  .updated-card { min-width: 0; }

  .top-chat {
    position: sticky;
    top: 8px;
    z-index: 45;
    grid-template-columns: 1fr;
    border-radius: 22px;
    padding: 10px;
  }

  .top-chat-form {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
  }

  .top-chat-form input {
    min-height: 44px;
    padding: 10px 12px;
    font-size: .9rem;
  }

  .top-chat-form button {
    min-height: 44px;
    padding: 0 14px;
  }

  #topChatStatus {
    display: none;
  }

  .prompt-chips {
    padding-bottom: 1px;
  }

  .nav-search {
    display: none;
  }

  .quick-actions,
  .status-digest { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  .palette-backdrop { padding-top: 14px; }

  .bookmark-grid,
  .recent-list,
  .wiki-grid { grid-template-columns: 1fr; }

  .calendar-board {
    border-radius: 20px;
  }

  .calendar-weekdays,
  .calendar-days {
    grid-template-columns: repeat(7, minmax(42px, 1fr));
  }

  .calendar-weekdays span {
    padding: 8px 2px;
    font-size: .66rem;
  }

  .calendar-day {
    min-height: 72px;
    padding: 6px;
  }

  .calendar-day-head {
    gap: 3px;
    margin-bottom: 4px;
    font-size: .72rem;
  }

  .calendar-day-head span {
    min-width: 18px;
    height: 18px;
    font-size: .62rem;
  }

  .calendar-day-items {
    gap: 3px;
  }

  .calendar-item {
    border-radius: 8px;
    padding: 3px 4px;
    font-size: .62rem;
  }

  .calendar-item span {
    display: none;
  }

  .utilitybar {
    align-items: stretch;
    flex-direction: column;
  }

  .tabs {
    flex-wrap: nowrap;
    gap: 6px;
    overflow-x: auto;
    border-radius: 20px;
    padding: 8px;
    scrollbar-width: none;
  }

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

  .tab {
    flex: 0 0 auto;
    min-width: max-content;
    padding: 10px 12px;
  }

  .admin-tab { margin-left: 0; }

  .service-modal-card header,
  .section-head,
  .json-actions,
  .head-actions {
    align-items: flex-start;
    flex-direction: column;
  }

  .chat-form { grid-template-columns: 1fr; }
  .chat-form button { min-height: 48px; }

  .mobile-dock {
    position: fixed;
    right: 10px;
    bottom: 10px;
    left: 10px;
    z-index: 80;
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 4px;
    border: 1px solid rgba(203, 213, 225, .92);
    border-radius: 24px;
    padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
    background: rgba(255, 255, 255, .96);
    box-shadow: 0 18px 50px rgba(15, 23, 42, .18);
    backdrop-filter: blur(16px);
  }

  .mobile-dock button {
    display: grid;
    gap: 2px;
    place-items: center;
    min-width: 0;
    min-height: 50px;
    border: 0;
    border-radius: 17px;
    color: var(--muted);
    background: transparent;
    cursor: pointer;
    font-size: .66rem;
    font-weight: 950;
  }

  .mobile-dock button::before {
    content: attr(data-mobile-icon);
    display: grid;
    width: 24px;
    height: 24px;
    place-items: center;
    border-radius: 10px;
    color: var(--text-soft);
    background: #f1f5f9;
    font-size: .86rem;
    line-height: 1;
  }

  .mobile-dock button.active {
    color: var(--primary-strong);
    background: #eff6ff;
  }

  .mobile-dock button.active::before {
    color: #fff;
    background: var(--primary);
  }
}
