:root {
  --ink: #172033;
  --muted: #607086;
  --faint: #8a98aa;
  --line: #dbe3ee;
  --line-strong: #bfccdc;
  --paper: #ffffff;
  --cream: #f8fafc;
  --sand: #f3f6fa;
  --chip: #eef3f8;
  --teal: #278d84;
  --teal-dark: #176d66;
  --teal-soft: #e6f3ef;
  --red: #d84f4f;
  --red-soft: #fff0f0;
  --yellow: #ffb22d;
  --blue: #17b4ce;
  --purple: #815cf4;
  --pink: #ec4595;
  --shadow: 0 18px 48px rgba(23, 32, 51, .08);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  color: var(--ink);
  background: var(--sand);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic", "Noto Sans JP", sans-serif;
  letter-spacing: 0;
}

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

button {
  cursor: pointer;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto auto 1fr;
}

.topbar {
  min-height: 88px;
  background: var(--paper);
  color: var(--ink);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 22px;
  padding: 18px 28px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 250px;
  font-weight: 900;
  font-size: 25px;
}

.brand-mark,
.help-mark {
  width: 38px;
  height: 38px;
  border: 3px solid var(--teal);
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 900;
}

.brand-mark {
  border-radius: 12px;
  transform: rotate(45deg);
  position: relative;
}

.brand-mark::before,
.brand-mark::after {
  content: "";
  position: absolute;
  inset: 7px;
  border-top: 4px solid var(--teal);
  border-bottom: 4px solid var(--teal);
  border-radius: 12px;
}

.brand-mark::after {
  transform: rotate(90deg);
}

.top-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.group-pill {
  min-width: min(380px, 38vw);
  background: var(--cream);
  color: var(--ink);
  border: 1px solid var(--line);
  box-shadow: none;
  border-radius: 10px;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  font-weight: 800;
}

.nav-row {
  min-height: 74px;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px 24px;
}

.nav-row strong {
  font-size: 17px;
}

.tabs,
.nav-tools {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.btn,
.icon-btn,
.tab-btn {
  border: 1px solid var(--line);
  color: var(--teal-dark);
  background: var(--paper);
  border-radius: 10px;
  min-height: 42px;
  padding: 9px 16px;
  font-weight: 850;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 1px 2px rgba(23, 32, 51, .04);
}

.btn.primary {
  background: var(--teal);
  border-color: var(--teal);
  color: #fff;
}

.btn.ghost {
  background: var(--cream);
  border-color: var(--line-strong);
  color: var(--muted);
}

.btn.danger {
  color: var(--red);
  background: var(--red-soft);
  border-color: #f4b6b1;
}

.btn.dashed {
  border-style: dashed;
  background: var(--cream);
  color: var(--muted);
}

.tab-btn {
  border-color: var(--line);
  color: var(--muted);
  background: var(--cream);
}

.tab-btn.active {
  color: #fff;
  border-color: var(--teal-dark);
  background: var(--teal-dark);
}

.icon-btn {
  width: 42px;
  padding: 0;
}

.main {
  padding: 18px;
}

/* ── Auth: Enterprise login redesign ── */
.auth-wrap {
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  grid-template-columns: 1fr minmax(400px, 520px);
  background: #0a0f1a;
}

.auth-panel {
  background: var(--paper);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 40px;
  border-left: 1px solid var(--line);
}

.auth-panel-inner {
  width: 100%;
  max-width: 380px;
}

.auth-panel-top {
  margin-bottom: 32px;
}

.auth-panel-eyebrow {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--teal-dark);
  background: var(--teal-soft);
  border-radius: 4px;
  padding: 4px 10px;
  margin-bottom: 16px;
}

.auth-panel-title {
  font-size: 28px;
  font-weight: 750;
  letter-spacing: -.03em;
  line-height: 1.15;
  margin: 0 0 10px;
  color: var(--ink);
}

.auth-panel-desc {
  font-size: 14px;
  line-height: 1.6;
  color: var(--muted);
  margin: 0;
}

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

.auth-form .field {
  margin-bottom: 0;
}

.auth-form .input,
.auth-form .select {
  min-height: 48px;
  border-radius: 10px;
  border: 1.5px solid var(--line);
  background: var(--cream);
  font-size: 14px;
  transition: border-color .15s, box-shadow .15s, background .15s;
}

.auth-form .input:focus,
.auth-form .select:focus {
  background: var(--paper);
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(84, 184, 173, .12);
}

.auth-submit {
  min-height: 48px;
  font-size: 15px;
  font-weight: 650;
  border-radius: 10px;
  gap: 8px;
  margin-top: 4px;
}

.auth-switch {
  margin-top: 24px;
  display: flex;
  align-items: center;
  gap: 6px;
  justify-content: center;
}

.auth-switch span {
  font-size: 13px;
  color: var(--muted);
}

.auth-switch .link-btn {
  font-size: 13px;
  font-weight: 650;
  color: var(--teal-dark);
}

/* ── Auth visual (left panel) ── */
.auth-visual {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 60px 48px;
  overflow: hidden;
}

.auth-visual-bg {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(160deg, #0a0f1a 0%, #0e1a2e 30%, #122338 60%, #0f1b2d 100%);
}

.auth-visual-bg::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 20% 80%, rgba(84, 184, 173, .12) 0%, transparent 70%),
    radial-gradient(ellipse 60% 50% at 80% 20%, rgba(91, 95, 199, .1) 0%, transparent 60%);
}

.auth-visual-grid {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.auth-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: .35;
}

.auth-orb-1 {
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(84, 184, 173, .6), transparent 70%);
  top: -10%;
  right: -5%;
  animation: auth-float-1 14s ease-in-out infinite;
}

.auth-orb-2 {
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(91, 95, 199, .5), transparent 70%);
  bottom: 10%;
  left: -5%;
  animation: auth-float-2 18s ease-in-out infinite;
}

.auth-orb-3 {
  width: 200px;
  height: 200px;
  background: radial-gradient(circle, rgba(236, 69, 149, .3), transparent 70%);
  top: 40%;
  left: 40%;
  animation: auth-float-3 12s ease-in-out infinite;
}

@keyframes auth-float-1 {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(-30px, 40px); }
}
@keyframes auth-float-2 {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(25px, -35px); }
}
@keyframes auth-float-3 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-20px, 20px) scale(1.15); }
}

.auth-visual-content {
  position: relative;
  z-index: 2;
  text-align: center;
  max-width: 480px;
}

.auth-visual-logo {
  margin-bottom: 36px;
}

.auth-logo-mark {
  display: inline-grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border-radius: 16px;
  background: linear-gradient(135deg, #54b8ad, #3d9d93);
  color: #fff;
  font-size: 28px;
  font-weight: 750;
  letter-spacing: -.02em;
  box-shadow: 0 8px 32px rgba(84, 184, 173, .3);
}

.auth-visual-heading {
  font-size: clamp(28px, 4vw, 42px);
  font-weight: 750;
  line-height: 1.25;
  letter-spacing: -.03em;
  color: #fff;
  margin: 0 0 20px;
}

.auth-visual-sub {
  font-size: 15px;
  line-height: 1.75;
  color: rgba(229, 237, 247, .55);
  margin: 0 0 40px;
}

.auth-visual-stats {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  padding: 20px 28px;
  border-radius: 14px;
  background: rgba(255, 255, 255, .06);
  border: 1px solid rgba(255, 255, 255, .08);
  backdrop-filter: blur(12px);
}

.auth-stat {
  flex: 1;
  text-align: center;
}

.auth-stat strong {
  display: block;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -.02em;
  color: #fff;
  margin-bottom: 4px;
}

.auth-stat span {
  font-size: 11px;
  font-weight: 500;
  color: rgba(229, 237, 247, .45);
  letter-spacing: .02em;
}

.auth-stat-divider {
  width: 1px;
  height: 36px;
  background: rgba(255, 255, 255, .1);
  margin: 0 4px;
  flex: 0 0 auto;
}

.auth-visual-footer {
  position: absolute;
  bottom: 32px;
  left: 0;
  right: 0;
  text-align: center;
  z-index: 2;
}

.auth-visual-footer span {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .04em;
  color: rgba(229, 237, 247, .25);
}

/* Hide old auth-art elements */
.auth-art { display: none; }
.auth-graph { display: none; }
.auth-graph::before { display: none; }
.auth-graph-copy { display: none; }

.api-key-test-form .api-test-result {
  min-height: 120px;
  white-space: pre-wrap;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  font-size: clamp(30px, 5vw, 56px);
  line-height: 1.08;
  margin-bottom: 18px;
}

h2 {
  font-size: 24px;
  margin-bottom: 10px;
}

h3 {
  font-size: 17px;
  margin-bottom: 10px;
}

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

.field {
  display: grid;
  gap: 7px;
  margin-bottom: 16px;
}

.field label {
  font-size: 13px;
  font-weight: 850;
  color: var(--muted);
}

.input,
.textarea,
.select {
  width: 100%;
  border: 2px solid var(--line);
  background: var(--paper);
  color: var(--ink);
  border-radius: 14px;
  min-height: 46px;
  padding: 12px 14px;
  outline: none;
}

.input:focus,
.textarea:focus,
.select:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 4px rgba(92, 169, 155, .14);
}

.textarea {
  min-height: 240px;
  resize: vertical;
  line-height: 1.8;
}

.auth-switch {
  margin-top: 18px;
  color: var(--muted);
}

.link-btn {
  border: 0;
  background: transparent;
  color: var(--teal-dark);
  font-weight: 900;
  padding: 0;
}

.section-grid {
  display: grid;
  gap: 16px;
  min-width: 0;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.metric {
  background: var(--paper);
  border-radius: 12px;
  padding: 18px;
  border: 1px solid var(--line);
}

.metric b {
  display: block;
  font-size: 26px;
  margin-top: 4px;
}

.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 8px 22px rgba(23, 32, 51, .05);
}

.toolbar-card {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  padding: 14px;
  margin-bottom: 14px;
  flex-wrap: nowrap;
}

.toolbar-card .left,
.toolbar-card .right {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: nowrap;
  min-width: 0;
}

.toolbar-card .left {
  flex: 1;
}

.toolbar-card .left .input {
  flex: 1 1 180px;
  min-width: 0 !important;
  max-width: 360px;
}

.toolbar-card .input,
.toolbar-card .select,
.toolbar-card .btn {
  flex: 0 0 auto;
}

.users-toolbar {
  overflow: visible;
}

.users-toolbar .left {
  flex: 1 1 auto;
}

.users-toolbar .right {
  flex: 0 0 auto;
  justify-content: flex-end;
}

.users-toolbar #userSearch {
  flex: 1 1 260px;
  min-width: 220px !important;
  max-width: 420px;
}

.users-toolbar #roleFilter {
  flex: 0 0 190px;
  width: 190px;
  min-width: 190px;
}

.users-toolbar .btn {
  white-space: nowrap;
}

.audit-toolbar {
  align-items: flex-start;
  flex-wrap: wrap;
}

.audit-toolbar .left {
  flex-wrap: wrap;
}

.audit-toolbar .right {
  justify-content: flex-end;
}

.audit-toolbar .select,
.audit-toolbar .input {
  min-width: 150px;
  max-width: 260px;
}

.audit-toolbar #auditSearch {
  flex: 1 1 240px;
  max-width: 360px;
}

.audit-filter-summary {
  flex: 1 0 100%;
  color: var(--muted);
  font-size: 12px;
  padding: 2px 4px 0;
}

.table-wrap {
  overflow-x: auto;
}

[data-audit-log-id] {
  cursor: pointer;
}

[data-audit-log-id]:hover {
  background: var(--cream);
}

.pagination-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
  margin-bottom: 16px;
  color: var(--muted);
  font-size: 13px;
}

.pagination-bar > div {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pagination-count {
  min-width: 54px;
  color: var(--ink);
  text-align: center;
  font-weight: 600;
}

.pagination-bar .btn:disabled {
  opacity: .45;
  cursor: not-allowed;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 820px;
}

th,
td {
  text-align: left;
  padding: 16px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

th {
  color: var(--muted);
  font-size: 13px;
  background: var(--cream);
}

.clickable-row {
  cursor: pointer;
}

.clickable-row:hover td {
  background: #f8fafc;
}

.avatar-cell {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 850;
}

.avatar {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: var(--teal-soft);
  color: var(--teal-dark);
  font-weight: 900;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  background: var(--chip);
  padding: 7px 11px;
  font-size: 12px;
  font-weight: 850;
  color: var(--ink);
  white-space: nowrap;
}

.status-toggle {
  border: 0;
  cursor: pointer;
  font-family: inherit;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.status-toggle:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
}

.badge.admin {
  background: #e8ddff;
  color: #5c41b1;
}

.badge.role-general {
  background: var(--teal-soft);
  color: var(--teal-dark);
}

.badge.role-content {
  background: #eef0ff;
  color: #4f46a8;
}

.badge.role-admin {
  background: #e8ddff;
  color: #5c41b1;
}

.inline-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
}

.btn.small {
  min-height: 34px;
  padding: 0 12px;
  font-size: 12px;
  white-space: nowrap;
}

.btn.mini,
.btn.compact {
  min-height: 34px;
  padding: 0 12px;
  font-size: 12px;
  white-space: nowrap;
  word-break: keep-all;
  flex: 0 0 auto;
}

.member-profile-layout {
  display: grid;
  grid-template-columns: minmax(320px, 0.9fr) minmax(0, 1.4fr);
  gap: 16px;
  margin-bottom: 16px;
}

.member-profile-card,
.member-progress-summary {
  padding: 22px;
}

.member-profile-top {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 22px;
  flex-wrap: wrap;
}

.member-profile-main {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 22px;
}

.member-profile-main h2 {
  margin: 0 0 6px;
  font-size: 28px;
  font-weight: 700;
}

.member-profile-main p {
  margin: 0;
  color: var(--muted);
}

.member-profile-avatar {
  width: 72px;
  height: 72px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  background: var(--teal-soft);
  color: var(--teal-dark);
  font-size: 28px;
  font-weight: 700;
}

.profile-definition {
  display: grid;
  gap: 0;
  margin: 0;
}

.profile-definition div {
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr);
  gap: 16px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
}

.profile-definition dt {
  color: var(--muted);
  font-size: 13px;
}

.profile-definition dd {
  margin: 0;
}

.member-progress-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.member-progress-metrics div {
  border-top: 1px solid var(--line);
  padding-top: 14px;
  min-width: 0;
}

.member-progress-metrics span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 8px;
}

.member-progress-metrics b {
  display: block;
  color: var(--ink);
  font-size: 28px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.member-learning-card h2 {
  font-size: 20px;
  font-weight: 700;
}

.user-edit-page {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 1px;
  min-height: calc(100vh - 160px);
}

.user-edit-page-single {
  grid-template-columns: minmax(0, 1fr);
  max-width: 1080px;
}

.user-edit-main,
.user-edit-side {
  border-radius: 0;
  padding: 22px;
}

.user-edit-profile-head {
  margin: 20px 0 24px;
}

.user-edit-permissions {
  margin: 16px 0;
}

.user-edit-section-title {
  margin-top: 26px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.user-integration-panel {
  display: grid;
  gap: 10px;
  margin: 18px 0;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.user-integration-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}

.user-integration-row:first-of-type {
  border-top: 0;
}

.user-integration-row strong,
.user-integration-row span {
  display: block;
}

.user-integration-row span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.user-integration-row .btn {
  white-space: nowrap;
}

.account-slack-import-panel .muted {
  margin-top: 4px;
}

.account-chat-import-panel .muted {
  margin-top: 4px;
}

.account-slack-import-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 16px;
  align-items: start;
}

.account-chat-import-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 16px;
  align-items: start;
}

.account-slack-import-grid .field,
.account-chat-import-grid .field {
  min-width: 0;
}

.account-notification-panel .muted {
  margin-top: 4px;
}

.account-notification-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  gap: 18px;
  align-items: start;
}

.account-notification-block {
  display: grid;
  gap: 12px;
  min-width: 0;
  align-content: start;
}

.account-notification-options {
  display: grid;
  gap: 8px;
  align-content: start;
  align-items: start;
}

.account-notification-channels,
.account-notification-timings {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.account-notification-switch {
  width: 100%;
  margin: 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  white-space: normal;
}

.account-notification-switch span:last-child {
  min-width: 0;
  line-height: 1.45;
}

.account-notification-time {
  max-width: 260px;
}

.account-integration-modal {
  max-width: 760px;
}

.field-note {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

@media (max-width: 860px) {
  .account-notification-grid,
  .account-slack-import-grid,
  .account-chat-import-grid,
  .account-notification-channels,
  .account-notification-timings {
    grid-template-columns: 1fr;
  }
}

.member-blog-detail {
  max-width: 980px;
  margin: 0 auto;
}

.unified-timeline {
  padding: 0;
  overflow: hidden;
}

.timeline-stream {
  display: grid;
}

.timeline-item {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 14px;
  padding: 20px 22px;
  border-bottom: 1px solid var(--line);
}

.timeline-item:last-child {
  border-bottom: 0;
}

.timeline-load-more {
  border-top: 1px solid var(--line);
  padding: 14px 18px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  text-align: center;
  background: var(--paper-soft);
}

.timeline-avatar {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--ink);
  font-weight: 700;
}

.calendar-page {
  display: grid;
  gap: 16px;
}

.calendar-toolbar,
.calendar-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.calendar-toolbar h1 {
  margin: 4px 0 6px;
  font-size: 32px;
  letter-spacing: 0;
}

.calendar-toolbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.calendar-nav > div {
  display: grid;
  gap: 2px;
  margin-right: auto;
}

.calendar-nav > div span {
  color: var(--muted);
  font-size: 13px;
}

.calendar-layout {
  display: grid;
  gap: 12px;
  overflow: hidden;
}

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

.calendar-weekdays span {
  padding: 0 10px 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.calendar-month-grid {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.calendar-month-grid-lines {
  display: grid;
  grid-template-columns: 1fr;
}

.calendar-month-week-row {
  position: relative;
  min-height: calc(128px + (var(--span-lanes, 0) * 32px));
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.calendar-month-week-row:last-child {
  border-bottom: 0;
}

.calendar-month-week-cells {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  min-height: inherit;
}

.calendar-day-cell {
  min-height: 128px;
  padding: 10px;
  border: 0;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.calendar-day-cell:nth-child(7n) {
  border-right: 0;
}

.calendar-day-cell:nth-last-child(-n+7) {
  border-bottom: 0;
}

.calendar-month-grid-lines .calendar-day-cell {
  min-height: inherit;
  border-bottom: 0;
}

.calendar-month-grid-lines .calendar-month-week-cells .calendar-day-cell:nth-child(7n) {
  border-right: 0;
}

.calendar-day-cell:hover {
  background: #f8fbfc;
}

.calendar-day-cell > span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  font-weight: 700;
}

.calendar-day-cell.today > span {
  background: var(--teal);
  color: #fff;
}

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

.calendar-day-cell small,
.calendar-day-cell em {
  display: block;
  margin-top: 6px;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.calendar-day-cell small {
  padding: 4px 6px;
  border-radius: 6px;
  background: #eaf7f5;
  color: #277a71;
}

.calendar-day-cell em {
  font-style: normal;
}

.calendar-day-span-spacer {
  display: block !important;
  width: 100% !important;
  height: calc(var(--span-lanes, 0) * 32px) !important;
  margin: 0 !important;
}

.calendar-month-spanning-events {
  position: absolute;
  top: 44px;
  right: 0;
  left: 0;
  z-index: 2;
  pointer-events: none;
}

.calendar-month-span-event {
  position: absolute;
  top: calc(var(--lane, 0) * 32px);
  left: calc(((var(--col-start, 1) - 1) * 100% / 7) + 8px);
  width: calc((var(--col-span, 1) * 100% / 7) - 12px);
  height: 26px;
  display: flex;
  align-items: center;
  min-width: 0;
  padding: 0 10px;
  border-radius: 7px;
  background: var(--event-color, #e97872);
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.12);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
}

.calendar-month-span-event::before,
.calendar-month-span-event::after {
  position: absolute;
  top: 0;
  bottom: 0;
  display: none;
  align-items: center;
  color: rgba(255, 255, 255, 0.95);
  font-size: 14px;
  font-weight: 900;
}

.calendar-month-span-event.continues-left::before {
  left: 5px;
  display: flex;
  content: "‹";
}

.calendar-month-span-event.continues-right::after {
  right: 5px;
  display: flex;
  content: "›";
}

.calendar-month-span-event.continues-left {
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
  padding-left: 64px;
}

.calendar-month-span-event.spans-days,
.calendar-month-span-event.continues-right {
  padding-right: 56px;
}

.calendar-month-span-event.continues-right {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}

.calendar-month-span-event span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.calendar-span-continues {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  opacity: 0.92;
  color: #fff;
  font-size: 10px;
  font-style: normal;
  font-weight: 900;
  line-height: 1;
  white-space: nowrap;
}

.calendar-span-continues-left {
  left: 17px;
}

.calendar-span-continues-right {
  right: 17px;
}

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

.calendar-year-card {
  min-height: 120px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.calendar-year-card:hover {
  border-color: var(--teal);
}

.calendar-year-card span,
.calendar-year-card small {
  color: var(--muted);
  font-size: 13px;
}

.calendar-year-card strong {
  display: block;
  margin: 14px 0 4px;
  font-size: 34px;
}

.calendar-week-board {
  position: relative;
}

.calendar-week-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.calendar-week-column {
  min-height: 360px;
  border-right: 1px solid var(--line);
  background: #fff;
}

.calendar-week-column:last-child {
  border-right: 0;
}

.calendar-week-head {
  width: 100%;
  padding: 12px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: #f8fafc;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.calendar-week-head span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.calendar-week-head strong {
  display: block;
  margin-top: 4px;
  font-size: 22px;
}

.calendar-week-events {
  display: grid;
  gap: 8px;
  padding: 10px;
}

.calendar-week-span-spacer {
  height: calc(var(--span-lanes, 0) * 32px);
}

.calendar-week-spanning-events {
  position: absolute;
  top: 72px;
  right: 0;
  left: 0;
  z-index: 2;
  pointer-events: none;
}

.calendar-compact-event {
  display: grid;
  gap: 3px;
  padding: 8px;
  border-radius: 8px;
  background: #eaf7f5;
  color: #277a71;
  font-size: 12px;
}

.calendar-compact-event.multi-day {
  border: 1px solid rgba(47, 159, 143, 0.25);
  background: linear-gradient(90deg, rgba(234, 247, 245, 0.95), rgba(234, 247, 245, 0.45));
}

.calendar-compact-event em {
  color: #2f7f76;
  font-size: 11px;
  font-style: normal;
  font-weight: 800;
}

.calendar-day-detail {
  display: grid;
  gap: 10px;
}

.calendar-day-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.calendar-agenda {
  display: grid;
  gap: 12px;
}

.calendar-agenda-list {
  display: grid;
  gap: 10px;
}

.calendar-event-card {
  display: grid;
  grid-template-columns: minmax(168px, 220px) minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.calendar-event-time {
  min-width: 0;
  color: var(--teal);
  font-weight: 700;
  line-height: 1.35;
  overflow-wrap: anywhere;
  white-space: normal;
}

.calendar-event-card h3 {
  margin: 0 0 4px;
  font-size: 16px;
}

.calendar-event-card p,
.calendar-event-card small {
  margin: 0;
  color: var(--muted);
}

@media (max-width: 980px) {
  .calendar-toolbar,
  .calendar-nav {
    align-items: stretch;
    flex-direction: column;
  }

  .calendar-event-card {
    grid-template-columns: 1fr;
  }

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

  .calendar-week-board,
  .calendar-week-grid,
  .calendar-month-grid,
  .calendar-weekdays {
    min-width: 760px;
  }

  .calendar-layout {
    overflow-x: auto;
  }
}

.timeline-item.slack .timeline-avatar {
  background: #4a154b;
}

.timeline-item.discord .timeline-avatar {
  background: #5865f2;
}

.timeline-item.teams .timeline-avatar {
  background: #6264a7;
}

.timeline-item.gmail .timeline-avatar {
  background: #d93025;
}

.timeline-item.calendar .timeline-avatar {
  background: #1a73e8;
}

.timeline-content {
  min-width: 0;
}

.timeline-event-details {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.timeline-event-details span {
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1;
  padding: 8px 10px;
}

.timeline-meta {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.timeline-meta strong {
  font-weight: 600;
}

.timeline-meta span,
.timeline-links {
  color: var(--muted);
  font-size: 12px;
}

.timeline-bubble {
  border: 1px solid var(--line);
  border-radius: 14px 14px 14px 4px;
  background: var(--paper);
  padding: 14px 16px;
  box-shadow: 0 8px 24px rgba(23, 32, 51, .05);
}

.timeline-bubble p {
  margin: 0;
  line-height: 1.7;
  font-weight: 400;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.timeline-translated-body {
  display: grid;
  gap: 8px;
}

.timeline-translated-body .badge {
  width: fit-content;
}

.timeline-original-link {
  justify-self: start;
  padding: 0;
  min-height: auto;
}

.timeline-email-body.is-collapsed {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
  overflow: hidden;
  cursor: pointer;
}

.timeline-email-body.is-collapsed.expanded {
  display: block;
  -webkit-line-clamp: unset;
  overflow: visible;
  cursor: text;
}

.timeline-email-toggle {
  margin-top: 8px;
  padding: 0;
  min-height: auto;
}

.timeline-original-body {
  min-height: 180px;
  max-height: min(60vh, 560px);
  overflow: auto;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  line-height: 1.7;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.timeline-selection-translate-popover {
  position: absolute;
  z-index: 80;
  display: flex;
  gap: 4px;
  padding: 5px;
  border: 1px solid rgba(226, 232, 240, 0.95);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.16);
}

.timeline-selection-translate-popover button {
  min-height: 30px;
  padding: 0 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
}

.timeline-selection-translate-popover button:hover,
.timeline-selection-translate-popover button.active {
  background: #eaf7f5;
  color: #277a71;
}

.timeline-selection-translation-modal {
  width: min(880px, calc(100vw - 28px));
}

.timeline-selection-translation-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.timeline-selection-translation-grid section {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.timeline-selection-translation-grid section > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.timeline-selection-translation-text {
  min-height: 180px;
  max-height: min(52vh, 460px);
  overflow: auto;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  color: var(--ink);
  line-height: 1.7;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

@media (max-width: 720px) {
  .timeline-selection-translation-grid {
    grid-template-columns: 1fr;
  }
}

.timeline-thread {
  display: grid;
  gap: 10px;
  margin-top: 10px;
  padding-left: 18px;
  border-left: 3px solid rgba(45, 123, 114, .18);
}

.timeline-thread-heading {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.timeline-thread-reply {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper-soft);
  padding: 10px 12px;
}

.timeline-thread-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
}

.timeline-thread-meta strong {
  color: var(--ink);
  font-size: 13px;
}

.timeline-thread-meta a {
  color: var(--teal-dark);
  font-weight: 600;
  text-decoration: none;
}

.timeline-thread-reply p {
  margin: 0;
  line-height: 1.65;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.timeline-thread-attachments {
  margin-top: 8px;
}

.timeline-latest-reply {
  display: grid;
  gap: 8px;
  margin-top: 10px;
  margin-left: 18px;
  padding: 10px 12px;
  border: 1px solid rgba(45, 123, 114, .22);
  border-radius: 12px;
  background: #f7fbfa;
}

.timeline-latest-reply-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}

.timeline-latest-reply-meta strong {
  color: var(--teal-dark);
  font-size: 13px;
}

.timeline-latest-reply p {
  margin: 0;
  line-height: 1.65;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.timeline-latest-reply-attachments {
  margin-top: 0;
}

.timeline-email-subject {
  margin-bottom: 12px !important;
  font-weight: 700 !important;
}

.timeline-email-html {
  max-width: 100%;
  overflow-x: auto;
  line-height: 1.6;
}

.timeline-email-html :where(p, div, blockquote, ul, ol, table, pre) {
  max-width: 100%;
}

.timeline-email-html :where(img) {
  max-width: 100%;
  height: auto;
}

.timeline-email-html :where(table) {
  border-collapse: collapse;
}

.timeline-email-html :where(td, th) {
  border: 1px solid var(--line);
  padding: 6px 8px;
  vertical-align: top;
}

.timeline-email-html :where(a) {
  color: var(--teal-dark);
  font-weight: 600;
}

.timeline-email-images {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 240px));
  gap: 10px;
  margin-top: 14px;
}

.timeline-email-images.is-collapsed {
  display: none;
}

.timeline-email-images.is-collapsed.expanded {
  display: grid;
}

.timeline-email-image {
  display: block;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.timeline-email-image img {
  display: block;
  width: 100%;
  max-height: 220px;
  object-fit: contain;
}

.timeline-links {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 8px;
}

.timeline-links a {
  color: var(--teal-dark);
  text-decoration: none;
  font-weight: 600;
}

.timeline-source-attachments,
.timeline-status-actions {
  max-width: 780px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.timeline-source-attachment {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper-soft);
  color: var(--ink);
  padding: 7px 10px;
  font-size: 12px;
  text-decoration: none;
}

.timeline-source-attachment span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 320px;
}

.timeline-source-attachment .attachment-icon {
  width: 14px;
  height: 14px;
}

.timeline-status-actions .btn.active {
  border-color: rgba(45, 123, 114, .32);
  background: rgba(45, 123, 114, .12);
  color: var(--teal-dark);
}

.timeline-reply {
  max-width: 780px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 42px 42px auto;
  gap: 10px;
  align-items: start;
  margin-top: 12px;
}

.timeline-reply-main {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.timeline-reply-input {
  min-height: 44px;
  max-height: 180px;
  resize: none;
  overflow-y: auto;
  line-height: 1.6;
  padding-top: 10px;
  padding-bottom: 10px;
}

.timeline-attach-btn,
.timeline-ai-btn {
  width: 42px;
  min-width: 42px;
  padding: 0;
}

.attachment-icon,
.ai-spark-icon {
  width: 19px;
  height: 19px;
  display: block;
}

.timeline-attachments {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.timeline-attachment {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--cream);
  color: var(--muted);
  padding: 6px 9px;
  font-size: 12px;
}

.timeline-attachment span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 220px;
}

.timeline-attachment small {
  color: var(--faint);
  font-size: 11px;
  white-space: nowrap;
}

.timeline-attachment .attachment-icon {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
}

.timeline-source-preview {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--cream);
  padding: 14px;
  margin: 14px 0;
}

.timeline-source-preview strong {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 8px;
}

.timeline-source-preview p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.timeline-toolbar .left {
  flex: 1 1 auto;
}

.timeline-toolbar #timelineSearch {
  flex: 1 1 420px;
  max-width: none;
  min-width: 220px !important;
}

.timeline-toolbar .right {
  flex: 0 0 auto;
}

.timeline-summary {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
  padding: 16px 20px;
  overflow: hidden;
}

.timeline-platform-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}

.timeline-platform-tabs button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: border-color .15s ease, color .15s ease, background .15s ease, box-shadow .15s ease;
}

.timeline-platform-tabs button:hover,
.timeline-platform-tabs button.active,
.timeline-platform-tabs button[aria-selected="true"] {
  border-color: rgba(44, 139, 128, .38);
  background: rgba(44, 139, 128, .08);
  color: var(--ink);
  box-shadow: 0 8px 18px rgba(15, 23, 42, .06);
}

.timeline-platform-tabs strong {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 24px;
  padding: 0 7px;
  border-radius: 999px;
  background: #eef2f7;
  color: var(--ink);
  font-size: 12px;
  line-height: 1;
}

.timeline-platform-tabs button.active strong,
.timeline-platform-tabs button[aria-selected="true"] strong {
  background: #fff;
  color: var(--green);
}

.timeline-summary div {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  min-width: 0;
}

.timeline-summary strong {
  color: var(--ink);
  flex: 0 0 auto;
  line-height: 1.5;
}

.timeline-summary span {
  min-width: 0;
  color: var(--muted);
  line-height: 1.5;
}

.timeline-summary p {
  margin: 0;
  max-width: 1120px;
  line-height: 1.65;
  overflow-wrap: anywhere;
}

.knowledge-memo-layout {
  display: grid;
  grid-template-columns: minmax(320px, .9fr) minmax(0, 1.1fr);
  gap: 16px;
}

.knowledge-memo-layout.note-list-only {
  grid-template-columns: 1fr;
}

.knowledge-memo-composer-card,
.knowledge-memo-list-card,
.knowledge-approval-card {
  padding: 22px;
}

.knowledge-memo-form {
  display: grid;
  gap: 14px;
}

.knowledge-memo-textarea {
  min-height: 190px;
  resize: vertical;
}

.knowledge-memo-image-tools {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr);
  gap: 10px;
  align-items: start;
}

.knowledge-memo-image-tools .btn {
  white-space: nowrap;
}

.knowledge-memo-image-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
}

.floating-note-widget {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 90;
  pointer-events: none;
}

.floating-note-button {
  width: 58px;
  height: 58px;
  border: 0;
  border-radius: 999px;
  color: #fff;
  background: var(--teal);
  box-shadow: 0 18px 38px rgba(48, 125, 116, .28);
  display: grid;
  place-items: center;
  cursor: pointer;
  pointer-events: auto;
  transition: transform .16s ease, box-shadow .16s ease, background .16s ease;
}

.floating-note-button:hover {
  background: var(--teal-dark);
  box-shadow: 0 22px 46px rgba(48, 125, 116, .34);
  transform: translateY(-1px);
}

.floating-note-button .ai-spark-icon,
.floating-note-button .note-pencil-icon {
  width: 25px;
  height: 25px;
}

.floating-note-panel {
  position: absolute;
  right: 0;
  bottom: 70px;
  width: min(640px, calc(100vw - 32px));
  max-height: min(84vh, 820px);
  overflow: auto;
  pointer-events: auto;
}

.floating-note-panel[hidden] {
  display: none;
}

.floating-note-card {
  box-shadow:
    0 8px 20px rgba(15, 27, 45, .10),
    0 24px 70px rgba(15, 27, 45, .16);
}

.floating-note-card .knowledge-memo-textarea {
  min-height: 230px;
}

.floating-note-card .knowledge-memo-image-tools {
  grid-template-columns: 1fr;
}

.floating-note-card .knowledge-memo-image-tools .btn {
  width: 100%;
}

.knowledge-memo-image-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--cream);
  color: var(--muted);
  padding: 7px 10px;
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
  text-align: left;
  transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}

.knowledge-memo-image-chip:hover {
  border-color: rgba(45, 125, 110, .36);
  box-shadow: 0 8px 18px rgba(15, 27, 45, .08);
  transform: translateY(-1px);
}

.knowledge-memo-image-chip span {
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.knowledge-memo-image-chip small {
  color: var(--faint);
  white-space: nowrap;
}

.knowledge-memo-image-chip .attachment-icon {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
}

.knowledge-memo-image-preview-modal {
  width: min(760px, 100%);
}

.knowledge-memo-image-preview-frame {
  display: grid;
  place-items: center;
  min-height: 240px;
  max-height: min(56vh, 560px);
  overflow: auto;
  margin: 18px 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f8fafc;
}

.knowledge-memo-image-preview-frame img {
  display: block;
  max-width: 100%;
  max-height: min(52vh, 520px);
  object-fit: contain;
}

.knowledge-memo-list {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.knowledge-memo-list-filter {
  display: grid;
  gap: 6px;
  margin-top: 14px;
}

.knowledge-memo-list-filter label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.knowledge-memo-list.compact {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.knowledge-memo-list.compact > .empty {
  grid-column: 1 / -1;
  display: grid;
  place-items: center;
  min-height: 120px;
  width: 100%;
}

.knowledge-memo-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px;
  background: var(--paper);
}

.knowledge-memo-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.knowledge-memo-card-date {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.9;
}

.knowledge-memo-card-tags {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.knowledge-memo-card[data-knowledge-memo-detail] {
  cursor: pointer;
  transition: border-color .15s, box-shadow .15s, transform .15s;
}

.knowledge-memo-card[data-knowledge-memo-detail]:hover,
.knowledge-memo-card[data-knowledge-memo-detail]:focus {
  border-color: var(--teal);
  box-shadow: 0 8px 24px rgba(15, 27, 45, .08);
  outline: 0;
  transform: translateY(-1px);
}

.knowledge-memo-card p {
  margin: 12px 0 0;
  line-height: 1.7;
  font-weight: 400;
}

.knowledge-memo-group-editor {
  display: grid;
  gap: 6px;
  margin: 12px 0 18px;
}

.knowledge-memo-group-editor label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.knowledge-memo-card .btn {
  margin-top: 12px;
}

.knowledge-memo-detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0;
}

.knowledge-memo-detail-meta span {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--cream);
  color: var(--muted);
  padding: 6px 10px;
  font-size: 12px;
}

.knowledge-memo-detail-body {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--cream);
  padding: 18px;
  color: #253044;
  line-height: 1.9;
  white-space: pre-wrap;
}

.files-toolbar #fileSearch {
  flex: 1 1 420px;
  max-width: none;
  min-width: 220px !important;
}

.files-toolbar #fileKind {
  flex: 0 0 180px;
  width: 180px;
}

.files-toolbar #fileGroupFilter {
  flex: 0 0 220px;
  width: 220px;
}

.files-toolbar .file-view-toggle {
  width: 42px;
  min-width: 42px;
  padding: 0;
}

.view-mode-icon {
  width: 20px;
  height: 20px;
  display: block;
}

.file-drop-zone {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border-style: dashed;
  padding: 22px 28px;
  margin-bottom: 16px;
  min-height: 124px;
  cursor: pointer;
  transition: border-color .15s, background .15s, box-shadow .15s;
}

.file-drop-zone > div {
  min-width: 0;
}

.file-drop-zone h2 {
  margin: 3px 0 4px;
  font-size: 18px;
  font-weight: 600;
}

.file-drop-zone p {
  margin: 0;
  line-height: 1.6;
}

.file-drop-zone.dragging {
  border-color: var(--teal);
  background: var(--teal-soft);
  box-shadow: 0 0 0 3px rgba(39, 141, 132, .1);
}

.btn.active-soft {
  border-color: var(--teal);
  background: var(--teal-soft);
  color: var(--teal-dark);
}

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

.file-card {
  overflow: hidden;
}

.file-thumb {
  width: 100%;
  aspect-ratio: 5 / 3;
  padding: 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: var(--cream);
  display: grid;
  place-items: center;
  color: var(--muted);
  font-weight: 600;
  cursor: pointer;
  transition: filter .15s, opacity .15s;
}

.file-thumb:hover {
  filter: brightness(.97);
}

.file-thumb:focus-visible {
  outline: 3px solid rgba(59, 130, 246, .28);
  outline-offset: -3px;
}

.file-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.file-card-body {
  padding: 12px;
}

.file-card .split-title {
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 10px;
}

.file-card .badge {
  padding: 5px 8px;
  font-size: 11px;
}

.file-card h2 {
  margin: 0 0 4px;
  font-size: 14px;
  font-weight: 600;
  overflow-wrap: anywhere;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.file-table td:first-child strong {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.45;
}

.file-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
  font-size: 12px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.file-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 12px;
}

.file-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.file-actions .btn {
  min-height: 36px;
  padding: 8px 10px;
  font-size: 12px;
}

.file-table table {
  min-width: 980px;
}

.table-actions {
  display: flex;
  gap: 8px;
  flex-wrap: nowrap;
  align-items: center;
  white-space: nowrap;
}

.table-actions .btn {
  flex: 0 0 auto;
  white-space: nowrap;
  word-break: keep-all;
}

.table-actions .compact-btn {
  min-height: 36px;
  padding: 8px 12px;
  font-size: 13px;
}

.table-actions .publish-sns-btn {
  border-color: rgba(37, 99, 235, .36);
  background: #eff6ff;
  color: #1d4ed8;
}

.table-actions .publish-sns-btn:hover {
  border-color: rgba(37, 99, 235, .58);
  background: #dbeafe;
  color: #1e40af;
}

.table-actions .publish-sns-btn:disabled {
  border-color: var(--line);
  background: #f1f5f9;
  color: var(--faint);
}

.file-table td:last-child,
.file-table th:last-child {
  white-space: nowrap;
}

.file-view-modal {
  width: min(920px, 100%);
}

.file-view-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0 16px;
}

.file-view-meta span {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--cream);
  color: var(--muted);
  padding: 6px 10px;
  font-size: 12px;
}

.file-view-image {
  display: grid;
  place-items: center;
  min-height: 360px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--cream);
  color: var(--muted);
}

.file-view-image img {
  width: 100%;
  max-height: 560px;
  object-fit: contain;
  display: block;
}

.file-view-document {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
}

.file-view-document-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  background: var(--cream);
  padding: 12px 14px;
}

.file-view-document-head strong {
  font-size: 14px;
  font-weight: 600;
}

.file-view-document-head span {
  color: var(--muted);
  font-size: 12px;
}

.file-view-document pre {
  margin: 0;
  max-height: 460px;
  overflow: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  padding: 18px;
  color: #253044;
  font: 13px/1.8 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.blog-detail-actions {
  margin-bottom: 14px;
}

.blog-article-hero {
  display: grid;
  gap: 16px;
  padding: 34px 0 28px;
  border-bottom: 1px solid var(--line);
}

.blog-article-hero h1 {
  margin: 0;
  max-width: 820px;
  font-size: clamp(34px, 5vw, 56px);
  line-height: 1.12;
  letter-spacing: 0;
  font-weight: 700;
}

.blog-article-hero p {
  max-width: 760px;
  margin: 0;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.8;
}

.blog-author-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.blog-author-row strong,
.blog-author-row span {
  display: block;
}

.blog-author-row span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 13px;
}

.blog-article-body {
  display: grid;
  gap: 28px;
  padding: 34px 0 64px;
}

.blog-article-body section {
  display: grid;
  gap: 10px;
}

.blog-article-body h2 {
  margin: 0;
  font-size: 26px;
  line-height: 1.35;
  font-weight: 700;
}

.blog-article-body p {
  margin: 0;
  color: #344054;
  font-size: 16px;
  line-height: 2;
}

.blog-infographic {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border: 1px solid var(--line);
  background: #fff;
}

.blog-infographic div {
  padding: 20px;
  border-right: 1px solid var(--line);
}

.blog-infographic div:last-child {
  border-right: 0;
}

.blog-infographic span {
  display: block;
  color: var(--teal-dark);
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 14px;
}

.blog-infographic strong {
  display: block;
  margin-bottom: 8px;
  font-size: 18px;
  font-weight: 700;
}

.blog-infographic p {
  font-size: 13px;
  line-height: 1.7;
}

.badge.user {
  background: var(--teal-soft);
  color: var(--teal-dark);
}

.badge.active {
  background: #e4f5df;
  color: #467f37;
}

.badge.paused {
  background: #f6e9ca;
  color: #9a6c18;
}

.badge.warning {
  background: #fff4d9;
  color: #9a6c18;
}

.badge.danger {
  background: #feecec;
  color: #c24141;
}

.knowledge-layout {
  display: grid;
  grid-template-columns: minmax(320px, 420px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
  overflow: hidden;
}

.memory-board {
  overflow: hidden;
  margin-top: 16px;
  margin-bottom: 28px;
}

.memory-board-toolbar {
  min-height: 58px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 18px;
}

.memory-board-toolbar > div {
  display: flex;
  gap: 14px;
  align-items: center;
  flex-wrap: wrap;
}

.memory-board-toolbar .link-btn {
  font-size: 13px;
  font-weight: 400;
  color: var(--muted);
}

.memory-board-head {
  display: grid;
  grid-template-columns: minmax(280px, .95fr) minmax(320px, 1fr) minmax(360px, 1fr);
  gap: 12px;
  padding: 16px 18px;
  background: var(--cream);
}

.memory-board-head div {
  min-height: 44px;
  border-radius: 10px;
  background: var(--paper);
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  padding: 0 14px;
  color: var(--muted);
  font-weight: 500;
}

.knowledge-editor,
.extraction-panel,
.chat-panel,
.graph-detail {
  padding: 18px;
}

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

.columns-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
}

.preview-columns {
  display: grid;
  grid-template-columns: minmax(0, .8fr) minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px;
  margin-bottom: 12px;
  min-width: 0;
}

.preview-columns div {
  min-width: 0;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--cream);
  color: var(--muted);
  display: flex;
  align-items: center;
  padding: 0 12px;
  font-size: 13px;
  font-weight: 500;
}

.extraction-panel {
  min-width: 0;
  overflow: hidden;
}

.extraction-scroll {
  max-height: 720px;
  overflow: auto;
  padding-right: 4px;
}

.column-head {
  background: var(--paper);
  border-radius: 10px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  font-weight: 900;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 10px;
}

.extract-row {
  display: grid;
  grid-template-columns: minmax(280px, .95fr) minmax(320px, 1fr) minmax(360px, 1fr);
  gap: 16px;
  align-items: start;
  padding: 20px 18px;
  margin: 0;
  border-radius: 0;
  background: var(--paper);
  border: 0;
  border-top: 1px solid var(--line);
  min-width: 0;
}

.memo-card {
  align-self: start;
  line-height: 1.75;
  font-weight: 400;
  white-space: normal;
  border-bottom: 0;
  padding-bottom: 0;
}

.extract-row > div:not(.memo-card) {
  min-width: 0;
}

.memo-card strong {
  display: block;
  margin-bottom: 8px;
  font-weight: 650;
}

.memo-card p {
  max-width: 100%;
  color: var(--muted);
}

.chunk-delete-list {
  display: grid;
  gap: 8px;
  margin: 14px 0 12px;
}

.chunk-delete-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.chunk-delete-item strong {
  margin: 0 0 2px;
  color: var(--ink);
  font-size: 12px;
  line-height: 1.35;
}

.chunk-delete-item span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.memo-meta {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  color: var(--faint);
  font-weight: 800;
  margin-top: 16px;
}

.memo-delete-btn {
  margin-left: 4px;
}

.chip-list,
.edge-list {
  display: flex;
  flex-direction: column;
  gap: 9px;
  min-width: 0;
}

.chip-list {
  align-items: flex-start;
  flex-direction: row;
  flex-wrap: wrap;
}

.node-chip,
.edge-chip {
  border: 0;
  border-radius: 10px;
  background: var(--chip);
  color: var(--ink);
  padding: 10px 12px;
  min-height: 40px;
  font-weight: 850;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  min-width: 0;
}

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

.memory-composer {
  position: sticky;
  bottom: 0;
  z-index: 10;
  margin-top: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 10px;
  align-items: end;
  padding: 16px 18px;
  box-shadow: 0 -12px 28px rgba(15, 27, 45, .08);
}

.composer-resize-handle {
  position: absolute;
  left: 18px;
  right: 18px;
  top: -7px;
  height: 14px;
  cursor: ns-resize;
}

.composer-resize-handle::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 5px;
  width: 56px;
  height: 4px;
  transform: translateX(-50%);
  border-radius: 999px;
  background: var(--line-strong);
}

body.is-resizing-memo {
  cursor: ns-resize;
  user-select: none;
}

.memory-composer .textarea {
  min-height: 86px;
  height: 86px;
  max-height: 220px;
  resize: none;
  line-height: 1.5;
}

.node-chip.selected {
  outline: 3px solid rgba(92, 169, 155, .35);
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex: 0 0 auto;
}

.chip-close {
  color: #a69a80;
  font-weight: 700;
}

.edge-chip {
  width: 100%;
  justify-content: space-between;
}

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

.relation {
  color: var(--teal);
  font-weight: 950;
}

.mini-form {
  display: grid;
  gap: 10px;
  padding: 12px;
  margin-top: 14px;
  border-radius: 14px;
  background: var(--cream);
  border: 1px solid var(--line);
}

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

.full {
  grid-column: 1 / -1;
}

.graph-area {
  display: grid;
  grid-template-columns: 1.2fr .8fr;
  gap: 16px;
  align-items: start;
}

.graph-canvas {
  min-height: 430px;
  padding: 18px;
  position: relative;
  overflow: hidden;
}

.graph-svg {
  width: 100%;
  height: 390px;
  display: block;
}

.graph-node {
  cursor: pointer;
}

.json-preview {
  max-height: 320px;
  overflow: auto;
  margin: 0;
  background: #111827;
  color: #e5edf7;
  border-radius: 10px;
  padding: 14px;
  font-size: 12px;
  line-height: 1.55;
  max-width: 100%;
}

.api-sample {
  margin-top: 16px;
}

.api-sample summary {
  cursor: pointer;
  color: var(--muted);
  font-weight: 500;
  margin-bottom: 10px;
}

.chat-layout {
  --chat-history-width: 320px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 1px var(--chat-history-width);
  gap: 0;
  align-items: stretch;
  height: 100vh;
  height: 100dvh;
  min-height: 0;
  overflow: hidden;
}

.chat-panel {
  height: 100vh;
  height: 100dvh;
  min-height: 0;
  display: grid;
  grid-template-rows: 1fr auto;
  gap: 0;
  padding: 18px 22px;
  border-radius: 0;
  border-top: 0;
  border-bottom: 0;
  border-left: 0;
  border-right: 0;
  overflow: hidden;
}

.chat-resizer {
  width: 1px;
  height: 100vh;
  height: 100dvh;
  min-height: 0;
  background: transparent;
  cursor: col-resize;
  position: relative;
  z-index: 3;
}

.chat-resizer::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: -5px;
  width: 11px;
}

.chat-resizer::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 1px;
  background: var(--line);
}

body.is-resizing-chat {
  cursor: col-resize;
  user-select: none;
}

.messages {
  overflow: auto;
  min-height: 0;
  padding: 10px 0 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.message {
  max-width: 78%;
  padding: 14px 16px;
  border-radius: 16px;
  line-height: 1.7;
}

.message.user {
  align-self: flex-end;
  background: var(--teal);
  color: #fff;
  border-bottom-right-radius: 6px;
}

.message.assistant {
  align-self: flex-start;
  background: var(--cream);
  border: 1px solid var(--line);
  border-bottom-left-radius: 6px;
}

.message.pending {
  min-width: 74px;
}

.message-content {
  display: grid;
  gap: 8px;
}

.typing-dots {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 22px;
}

.typing-dots span {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--teal);
  opacity: 0.35;
  animation: typingDot 1.15s infinite ease-in-out;
}

.typing-dots span:nth-child(2) {
  animation-delay: 0.16s;
}

.typing-dots span:nth-child(3) {
  animation-delay: 0.32s;
}

@keyframes typingDot {
  0%,
  80%,
  100% {
    transform: translateY(0);
    opacity: 0.35;
  }

  40% {
    transform: translateY(-4px);
    opacity: 1;
  }
}

.message-content p {
  margin: 0;
}

.message-content ul {
  margin: 0;
  padding-left: 20px;
}

.message-content li + li {
  margin-top: 4px;
}

.message-content h3,
.message-content h4,
.message-content h5 {
  margin: 2px 0 0;
  font-size: 15px;
  line-height: 1.5;
  font-weight: 700;
}

.message-content code {
  border-radius: 6px;
  background: #eef3f5;
  padding: 2px 5px;
  font-size: .92em;
}

.rag-metrics {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.rag-source-tag {
  border: 0;
  cursor: pointer;
  font-family: inherit;
}

.rag-source-tag:hover {
  background: rgba(92, 169, 155, .2);
  color: var(--teal-dark);
}

.rag-source-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0 16px;
}

.evidence-list {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.modal-evidence-list {
  max-height: min(56vh, 520px);
  overflow: auto;
  padding-right: 4px;
}

.evidence {
  padding: 10px;
  border-radius: 12px;
  background: rgba(92, 169, 155, .11);
  border: 1px solid rgba(92, 169, 155, .25);
}

.evidence-head {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.evidence-type {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  background: rgba(92, 169, 155, .16);
  color: var(--teal-dark);
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 700;
}

.evidence p {
  margin: 7px 0 0;
}

.evidence a {
  display: inline-flex;
  margin-top: 8px;
  color: var(--teal-dark);
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
}

.chat-input {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px;
  background: var(--paper);
  position: sticky;
  bottom: 0;
  z-index: 4;
}

.chat-input .input {
  border: 0;
  min-height: 44px;
  box-shadow: none;
}

.chat-input .input:focus {
  box-shadow: none;
}

.chat-history {
  padding: 18px;
  height: 100vh;
  height: 100dvh;
  min-height: 0;
  overflow: auto;
  border-radius: 0;
  border-top: 0;
  border-right: 0;
  border-bottom: 0;
  border-left: 0;
  box-shadow: none;
}

.chat-workspace .chat-history {
  border-left: 0;
}

.chat-workspace .chat-panel {
  box-shadow: none;
}

.history-list {
  display: grid;
  gap: 8px;
}

.history-item {
  position: relative;
  width: 100%;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  padding: 12px 34px 12px 12px;
  text-align: left;
  color: var(--ink);
}

.history-item:hover,
.history-item.active {
  background: var(--cream);
  border-color: var(--line);
}

.history-item span,
.history-item small {
  display: block;
}

.history-item span {
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-item small {
  color: var(--faint);
  margin-top: 4px;
}

.history-item .history-delete {
  position: absolute;
  top: 10px;
  right: 10px;
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
}

.history-item .history-delete:hover {
  background: #fee2e2;
  color: #dc2626;
}

.side-stack {
  display: grid;
  gap: 16px;
}

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

.group-selector {
  padding: 20px;
  margin-bottom: 16px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
  gap: 18px;
  align-items: end;
}

.group-selector-main h2 {
  margin-bottom: 8px;
}

.group-selector-main p {
  max-width: 780px;
  line-height: 1.7;
}

.group-inline-stats {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.group-inline-stats span {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--cream);
  color: var(--muted);
  padding: 6px 10px;
  font-size: 12px;
}

.group-selector-controls {
  display: flex;
  gap: 10px;
  align-items: end;
}

.field.compact {
  flex: 1;
  margin-bottom: 0;
}

.field.compact span {
  font-size: 13px;
  color: var(--muted);
}

.group-card {
  padding: 20px;
  min-width: 0;
}

.group-card h2 {
  margin-bottom: 8px;
}

.group-card p {
  min-height: 56px;
  line-height: 1.7;
}

.group-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 18px 0;
  color: var(--muted);
  font-size: 13px;
}

.group-stats span {
  min-height: 54px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--cream);
  padding: 10px;
}

.group-stats b {
  display: block;
  color: var(--ink);
  font-size: 18px;
}

.group-actions,
.settings-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.settings-actions .btn {
  min-height: 44px;
  height: 44px;
  line-height: 1;
  white-space: nowrap;
}

.settings-actions .badge {
  line-height: 1;
}

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

.api-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px;
  margin-bottom: 16px;
}

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

.api-endpoint-list {
  display: grid;
  gap: 10px;
}

.api-endpoint-list div {
  display: grid;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--cream);
  padding: 12px;
}

.api-endpoint-list span {
  color: var(--muted);
  font-size: 13px;
}

.api-reference-card {
  display: grid;
  gap: 18px;
  margin-bottom: 16px;
}

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

.api-reference-section {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.api-reference-section h3 {
  margin: 0;
  font-size: 18px;
}

.api-reference-section p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.api-reference-table {
  display: grid;
  gap: 8px;
}

.api-reference-table > div {
  display: grid;
  grid-template-columns: minmax(210px, 300px) minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--cream);
  padding: 12px;
}

.api-reference-table code {
  width: max-content;
  max-width: 100%;
}

.api-reference-table span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.endpoint-reference-table > div {
  grid-template-columns: minmax(260px, 360px) minmax(0, 1fr);
}

.api-external-test-card {
  display: grid;
  gap: 16px;
  margin-bottom: 24px;
}

.api-external-test-grid {
  grid-template-columns: minmax(150px, 220px) minmax(0, 1fr);
}

.code-textarea {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  line-height: 1.55;
}

.api-external-test-preview {
  display: grid;
  gap: 12px;
}

.api-external-test-preview > div {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.api-external-test-preview strong,
.api-external-test-result-grid label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.api-external-test-preview code {
  display: block;
  width: 100%;
  min-width: 0;
  overflow-wrap: anywhere;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--cream);
  padding: 12px;
}

.api-external-test-result-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.api-external-test-result-grid > div {
  display: grid;
  gap: 8px;
  min-width: 0;
}

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

.learning-card {
  padding: 20px;
  display: grid;
  gap: 14px;
}

.learning-card h2 {
  margin: 0;
}

.learning-card p {
  min-height: 58px;
  line-height: 1.7;
}

.learning-meta {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 13px;
}

.course-mini-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 12px;
}

.course-mini-meta span {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  padding: 4px 8px;
}

.schedule-platform-label {
  align-self: center;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.learning-post-toolbar .btn,
.learning-post-toolbar .select,
.learning-post-table th,
.learning-post-table td:not(:first-child),
.learning-post-table .badge,
.learning-post-table .btn {
  white-space: nowrap;
}

.learning-post-toolbar .left {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) 170px 200px;
  flex: 1 1 auto;
  flex-wrap: nowrap;
  min-width: 0;
}

.learning-post-toolbar .right {
  flex: 0 0 auto;
}

.learning-post-toolbar #learningPostSearch {
  width: 100%;
  max-width: none;
  min-width: 0 !important;
}

.learning-post-toolbar #learningPostType {
  width: 170px;
}

.learning-post-toolbar #learningPostStatus {
  width: 200px;
}

.table-wrap td:first-child strong,
.table-wrap td:first-child .strong-link,
.learning-post-table td:first-child strong,
.learning-post-table td:first-child .strong-link {
  display: block;
}

.text-link {
  appearance: none;
  background: transparent;
  border: 0;
  color: inherit;
  cursor: pointer;
  font: inherit;
  padding: 0;
  text-align: left;
}

.strong-link {
  color: var(--ink);
  font-weight: 700;
}

.strong-link:hover {
  color: var(--teal-dark);
  text-decoration: underline;
}

.sns-post-table th {
  white-space: nowrap;
}

.sns-post-table th:nth-child(2),
.sns-post-table td:nth-child(2),
.sns-post-table th:nth-child(3),
.sns-post-table td:nth-child(3) {
  white-space: nowrap;
}

.article-post-table table {
  min-width: 1180px;
  table-layout: auto;
}

.article-post-table th,
.article-post-table td:not(:first-child),
.article-post-table .badge,
.article-post-table .btn {
  white-space: nowrap !important;
  word-break: keep-all !important;
  overflow-wrap: normal !important;
}

.article-post-table th:nth-child(2),
.article-post-table td:nth-child(2) {
  min-width: 92px;
}

.article-post-table th:nth-child(3),
.article-post-table td:nth-child(3) {
  min-width: 92px;
}

.article-post-table th:nth-child(6),
.article-post-table td:nth-child(6) {
  min-width: 108px;
}

.article-post-table td:last-child .btn {
  width: auto;
  min-width: 64px;
  padding-inline: 14px;
}

.learning-post-table table {
  min-width: 1280px;
  table-layout: auto;
}

.learning-post-table th,
.learning-post-table td:not(:first-child),
.learning-post-table .badge,
.learning-post-table .btn {
  white-space: nowrap !important;
  word-break: keep-all !important;
  overflow-wrap: normal !important;
}

.learning-post-table th:nth-child(3),
.learning-post-table td:nth-child(3) {
  min-width: 86px;
}

.learning-post-table th:nth-child(7),
.learning-post-table td:nth-child(7) {
  min-width: 108px;
}

.learning-post-table th:nth-child(8),
.learning-post-table td:nth-child(8) {
  min-width: 96px;
}

.learning-post-table th:nth-child(9),
.learning-post-table td:nth-child(9) {
  min-width: 76px;
}

.learning-post-table td:last-child .btn {
  width: auto;
  min-width: 64px;
  padding-inline: 14px;
}

.course-detail-layout {
  display: grid;
  gap: 16px;
}

.course-overview {
  padding: 22px;
}

.course-lesson-list {
  display: grid;
  gap: 10px;
}

.course-lesson {
  border: 1px solid var(--line);
  background: #fff;
  padding: 14px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
}

.course-lesson.active {
  border-color: var(--teal);
  background: #f4fbfa;
}

.lesson-index {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: var(--teal-soft);
  color: var(--teal-dark);
  font-weight: 700;
}

.course-lesson strong,
.course-lesson p {
  display: block;
}

.course-lesson p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.course-lesson-content {
  scroll-margin-top: 20px;
}

.course-builder {
  display: grid;
  gap: 14px;
}

.course-detail-sections {
  display: grid;
  gap: 14px;
}

.course-builder[hidden],
.course-detail-sections[hidden] {
  display: none;
}

.course-section-editor {
  background: #fff;
}

.course-section-editor .block-toolbar.compact {
  padding: 10px;
}

.course-section-editor .content-block {
  margin: 10px;
}

.course-rich-text {
  display: grid;
  gap: 12px;
}

.course-rich-text > * {
  margin: 0;
}

.course-builder-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
}

.course-article-picker,
.course-selected-panel {
  display: grid;
  gap: 10px;
}

.course-selected-list {
  display: grid;
  gap: 8px;
}

.course-article-picker label {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}

.course-autocomplete {
  position: relative;
}

.course-autocomplete-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 20;
  max-height: 280px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 18px 36px rgba(23, 32, 51, .12);
  padding: 6px;
}

.course-autocomplete-menu button {
  width: 100%;
  border: 0;
  border-radius: 6px;
  background: transparent;
  padding: 10px 12px;
  text-align: left;
  display: grid;
  gap: 4px;
  color: var(--ink);
  font: inherit;
  cursor: pointer;
}

.course-autocomplete-menu button:hover {
  background: var(--cream);
}

.course-autocomplete-menu b,
.course-autocomplete-menu small {
  display: block;
}

.course-autocomplete-menu small {
  color: var(--muted);
  font-size: 12px;
}

.course-selected-lesson {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 10px;
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  cursor: grab;
  transition: border-color .15s ease, box-shadow .15s ease, opacity .15s ease;
}

.course-selected-lesson:active {
  cursor: grabbing;
}

.course-selected-lesson.dragging {
  opacity: .55;
  border-color: var(--accent);
  box-shadow: 0 10px 24px rgba(23, 32, 51, .12);
}

.course-drag-handle {
  color: var(--muted);
  font-size: 16px;
  letter-spacing: -4px;
  line-height: 1;
  cursor: grab;
  user-select: none;
}

.course-selected-lesson strong,
.course-selected-lesson p {
  display: block;
}

.course-selected-lesson p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.course-order-actions {
  display: flex;
  gap: 4px;
}

.course-empty-note {
  margin: 0;
}

.analytics-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin-bottom: 16px;
  min-width: 0;
}

.analytics-status-tags {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  min-width: 0;
}

.analytics-status-tag {
  border: 0;
  cursor: pointer;
}

.analytics-status-tag:hover,
.analytics-status-tag:focus-visible {
  box-shadow: 0 0 0 3px rgba(39, 141, 132, .16);
}

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

.analytics-status-message {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff9eb;
  padding: 14px;
}

.analytics-status-message strong {
  display: block;
  margin-bottom: 6px;
}

.analytics-status-message p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.analytics-warning-raw {
  max-height: 180px;
  overflow: auto;
  line-height: 1.7;
}

.analytics-card {
  padding: 22px;
  min-width: 0;
  overflow: hidden;
}

.analytics-comparison-card {
  display: grid;
  gap: 16px;
  min-width: 0;
}

.analytics-comparison-list {
  display: grid;
  gap: 14px;
  min-width: 0;
}

.analytics-comparison-item {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--cream);
  padding: 14px;
  min-width: 0;
  overflow: hidden;
}

.analytics-comparison-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 10px;
}

.analytics-comparison-head strong,
.analytics-comparison-head span {
  display: block;
}

.analytics-comparison-head strong {
  font-size: 14px;
  font-weight: 600;
}

.analytics-comparison-head span {
  color: var(--muted);
  font-size: 12px;
  margin-top: 3px;
}

.analytics-comparison-controls {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.analytics-comparison-controls .input {
  width: 140px;
  min-height: 38px;
}

.analytics-comparison-controls .btn {
  min-height: 38px;
  white-space: nowrap;
}

.comparison-chart {
  height: 180px;
  padding-top: 14px;
}

.analytics-empty-chart {
  height: 100%;
  min-height: 120px;
  grid-column: 1 / -1;
  display: grid !important;
  place-items: center;
  border: 1px dashed var(--line);
  border-radius: 10px;
  background: #fff;
}

.analytics-empty-chart p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.automation-list-card,
.automation-queue {
  padding: 14px 16px;
  margin-bottom: 12px;
  display: grid;
  gap: 10px;
}

.automation-list-card .split-title {
  margin-bottom: 0;
}

.automation-list-card h2 {
  font-size: 18px;
}

.queue-list {
  display: grid;
  gap: 10px;
}

.queue-item {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--cream);
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.queue-item strong,
.queue-item span {
  display: block;
}

.queue-item span {
  color: var(--muted);
  margin-top: 3px;
}

.bar-chart {
  height: 260px;
  display: grid;
  grid-template-columns: repeat(var(--bar-count, 7), minmax(0, 1fr));
  gap: clamp(3px, .7vw, 12px);
  align-items: end;
  padding-top: 20px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: hidden;
  overflow-y: visible;
  padding-bottom: 8px;
}

.date-range-controls {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--cream);
  padding: 10px;
  margin-top: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.analytics-global-date-range {
  width: auto;
  margin-top: 0;
  background: #fff;
  flex: 0 1 auto;
}

.page-actions .analytics-global-date-range {
  justify-content: flex-end;
}

.date-range-controls .input,
.date-range-controls .select {
  width: auto;
  min-width: 150px;
}

.analytics-header-control-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 18px;
}

.analytics-header-toolbar-mount {
  flex: 1 1 520px;
  min-width: min(520px, 100%);
}

.analytics-header-status-toolbar {
  margin-bottom: 0;
  min-height: 58px;
  width: 100%;
}

.analytics-header-status-toolbar .analytics-status-tags {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.bar-chart div {
  height: 100%;
  display: grid;
  grid-template-rows: 1fr auto;
  gap: 8px;
  align-items: end;
  min-width: 0;
}

.bar-chart span {
  display: block;
  width: 100%;
  border-radius: 8px 8px 2px 2px;
  background: linear-gradient(180deg, #62c7bb, #278d84);
  position: relative;
  min-height: 28px;
}

.bar-chart span::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 50%;
  top: -34px;
  transform: translateX(-50%) translateY(4px);
  border-radius: 8px;
  background: #111827;
  color: #fff;
  padding: 6px 8px;
  font-size: 12px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity .15s ease, transform .15s ease;
  z-index: 3;
}

.bar-chart span:hover::after {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.bar-chart small {
  color: var(--muted);
  text-align: center;
  font-size: clamp(8px, .75vw, 11px);
  white-space: nowrap;
  min-width: 0;
  overflow: hidden;
  text-overflow: clip;
}

.insight-list {
  display: grid;
  gap: 12px;
}

.insight-list div {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--cream);
  padding: 14px;
}

.insight-list strong,
.insight-list span {
  display: block;
}

.insight-list span {
  margin-top: 6px;
  color: var(--muted);
  line-height: 1.6;
}

.analytics-detail {
  padding: 22px;
  margin-top: 16px;
}

.analytics-search-console {
  padding: 22px;
  margin-top: 16px;
}

.analytics-search-console .split-title {
  align-items: flex-start;
}

.analytics-search-console .split-title .badge {
  white-space: nowrap;
}

.analytics-search-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(130px, 1fr));
  gap: 12px;
  margin: 16px 0;
}

.analytics-search-metrics div {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--cream);
  padding: 14px;
}

.analytics-search-metrics span,
.analytics-search-metrics b {
  display: block;
}

.analytics-search-metrics span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.analytics-search-metrics b {
  margin-top: 4px;
  font-size: 24px;
}

.analytics-search-console-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.analytics-search-table {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}

.analytics-search-table h3 {
  margin: 0;
  padding: 14px 16px;
  font-size: 16px;
  border-bottom: 1px solid var(--line);
}

.analytics-search-table table {
  min-width: 560px;
}

.analytics-search-table th,
.analytics-search-table td {
  white-space: nowrap;
}

.analytics-search-table th:first-child,
.analytics-search-table td:first-child {
  min-width: 220px;
  white-space: normal;
}

.search-console-label {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.5;
}

.table-sort-button {
  appearance: none;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 0;
  cursor: pointer;
}

.table-sort-button:hover,
.table-sort-button:focus-visible,
.table-sort-button.active {
  color: var(--accent);
}

.table-sort-button:focus-visible {
  outline: 2px solid rgba(98, 199, 187, .45);
  outline-offset: 3px;
  border-radius: 6px;
}

.table-sort-button .sort-mark {
  min-width: 1em;
  color: var(--accent);
}

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

.insight-grid article {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--cream);
  padding: 16px;
}

.background-jobs-modal {
  max-width: 760px;
}

.background-jobs-modal > .split-title {
  align-items: flex-start;
  padding-right: 0;
}

.background-jobs-modal .background-jobs-close.icon-btn {
  flex: 0 0 42px;
  width: 42px;
  min-width: 42px;
  height: 42px;
  min-height: 42px;
  padding: 0;
  border-radius: 12px;
  line-height: 1;
  font-size: 24px;
  white-space: nowrap;
}

.background-jobs-list {
  display: grid;
  gap: 10px;
  margin-top: 16px;
  max-height: min(58vh, 560px);
  overflow: auto;
}

.background-job-item {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  padding: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.background-job-item strong,
.background-job-item p,
.background-job-item small {
  display: block;
}

.background-job-item p {
  color: var(--ink);
  margin: 4px 0;
  line-height: 1.5;
}

.background-job-item small {
  color: var(--muted);
}

.insight-grid strong,
.insight-grid p {
  display: block;
}

.insight-grid p {
  color: var(--muted);
  line-height: 1.7;
  margin: 8px 0 12px;
}

.sns-editor,
.article-editor {
  --editor-side-width: 360px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 1px var(--editor-side-width);
  gap: 0;
  align-items: stretch;
  min-height: 100vh;
  background: transparent;
}

.sns-editor-main,
.sns-editor-side,
.article-editor-main,
.article-editor-side {
  padding: 20px;
  display: grid;
  gap: 16px;
  align-content: start;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  min-width: 0;
  min-height: 100vh;
  overflow: auto;
}

.sns-editor-side,
.article-editor-side {
  border-left: 0;
}

.category-edit-control {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
}

.category-edit-control .input,
.category-edit-control .select {
  width: 100%;
}

.editor-resizer {
  width: 1px;
  min-height: 100vh;
  background: transparent;
  cursor: col-resize;
  position: relative;
  z-index: 3;
}

.editor-resizer::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: -5px;
  width: 11px;
}

.editor-resizer::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 1px;
  background: var(--line);
}

body.is-resizing-editor {
  cursor: col-resize;
  user-select: none;
}

.editor-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.editor-toolbar-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.rich-editor-strip {
  min-height: 44px;
  border: 1px solid var(--line);
  background: #f8fafc;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
}

.icon-tool {
  position: relative;
  width: 32px;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.editor-action-icon {
  width: 18px;
  height: 18px;
}

.icon-tool.active,
.icon-tool:hover {
  border-color: var(--teal);
  background: var(--teal-soft);
  color: var(--teal-dark);
}

.icon-tool.has-tooltip::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 8px);
  transform: translateX(-50%) translateY(4px);
  opacity: 0;
  pointer-events: none;
  white-space: nowrap;
  padding: 6px 8px;
  border-radius: 6px;
  background: #172033;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  box-shadow: 0 8px 20px rgba(15, 27, 45, .18);
  transition: opacity .15s ease, transform .15s ease;
  z-index: 20;
}

.icon-tool.has-tooltip::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: calc(100% + 3px);
  transform: translateX(-50%) translateY(4px);
  opacity: 0;
  pointer-events: none;
  border: 5px solid transparent;
  border-top-color: #172033;
  transition: opacity .15s ease, transform .15s ease;
  z-index: 20;
}

.icon-tool.has-tooltip:hover::after,
.icon-tool.has-tooltip:focus-visible::after,
.icon-tool.has-tooltip:hover::before,
.icon-tool.has-tooltip:focus-visible::before {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.ai-generate-inline {
  min-height: 32px;
  padding: 0 12px;
  font-size: 12px;
}

.editor-strip-note {
  margin-left: 4px;
  color: var(--muted);
  font-size: 12px;
}

.sns-body-input {
  min-height: 360px;
  resize: vertical;
  line-height: 1.75;
}

.editor-field-meta {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
}

.platform-editor-list {
  display: grid;
  gap: 16px;
}

.platform-editor {
  border: 1px solid var(--line);
  border-radius: 0;
  background: var(--cream);
  padding: 16px;
  display: grid;
  gap: 14px;
}

.platform-editor h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
}

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

.upload-control .btn {
  white-space: nowrap;
}

.video-compression-row {
  border-top: 1px solid var(--line);
  padding-top: 14px;
  display: grid;
  grid-template-columns: auto minmax(180px, 240px);
  gap: 14px;
  align-items: end;
}

.video-compression-row .field {
  margin-bottom: 0;
}

.platform-editor-actions {
  border-top: 1px solid var(--line);
  padding-top: 14px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.sns-preview-card {
  border: 1px solid var(--line);
  background: #fff;
  padding: 14px;
}

.sns-preview-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.sns-preview-head b,
.sns-preview-head small {
  display: block;
}

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

.article-title-input {
  min-height: 54px;
  font-size: 24px;
  font-weight: 600;
}

.article-excerpt-input,
.seo-description-input {
  min-height: 110px;
  resize: vertical;
  line-height: 1.7;
}

.block-editor {
  border: 1px solid var(--line);
  border-radius: 0;
  background: var(--paper);
  overflow: visible;
  position: relative;
}

.block-toolbar {
  border-bottom: 1px solid var(--line);
  background: #fff;
  padding: 10px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 4;
}

.block-tool-btn {
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  display: inline-grid;
  place-items: center;
  font-size: 12px;
  font-weight: 650;
  cursor: pointer;
}

.block-tool-btn svg {
  width: 19px;
  height: 19px;
}

.block-tool-btn:hover {
  border-color: var(--teal);
  background: var(--teal-soft);
  color: var(--teal-dark);
}

.block-list {
  padding: 16px;
  display: grid;
  gap: 12px;
  min-height: 520px;
  align-content: start;
}

.content-block {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.block-head {
  min-height: 38px;
  border-bottom: 1px solid var(--line);
  background: #f8fafc;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.block-input {
  min-height: 64px;
  padding: 14px;
  line-height: 1.8;
  outline: none;
  white-space: pre-wrap;
}

.content-block[data-block-type="heading2"] .block-input {
  font-size: 24px;
  font-weight: 650;
  line-height: 1.35;
}

.content-block[data-block-type="heading3"] .block-input {
  font-size: 20px;
  font-weight: 650;
  line-height: 1.4;
}

.content-block[data-block-type="heading4"] .block-input {
  font-size: 17px;
  font-weight: 650;
  line-height: 1.45;
}

.content-block[data-block-type="quote"] .block-input {
  border-left: 4px solid var(--teal);
  color: var(--muted);
  font-style: italic;
}

.content-block[data-block-type="html"] .block-input {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 12px;
  background: #111827;
  color: #e5edf7;
}

.block-input:empty::before {
  content: attr(data-placeholder);
  color: var(--faint);
}

.block-input b,
.block-input strong {
  font-weight: 700;
}

.block-input a {
  color: var(--teal-dark);
  text-decoration: underline;
}

.block-input ul,
.block-input ol {
  margin: 6px 0;
  padding-left: 1.35em;
}

.block-input li {
  margin: 2px 0;
}

.block-image-preview {
  min-height: 180px;
  background: #f8fafc;
  border-bottom: 1px solid var(--line);
  display: grid;
  place-items: center;
  color: var(--muted);
}

.block-image-preview img {
  display: block;
  width: 100%;
  max-height: 360px;
  object-fit: contain;
  background: #fff;
}

.image-caption {
  min-height: 48px;
  color: var(--muted);
  font-size: 13px;
}

.floating-format-toolbar {
  position: fixed;
  z-index: 80;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0f1b2d;
  box-shadow: 0 14px 40px rgba(15, 27, 45, .22);
}

.floating-format-toolbar[hidden] {
  display: none;
}

.floating-format-toolbar button {
  min-width: 32px;
  height: 30px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #fff;
  font-size: 12px;
  font-weight: 650;
  cursor: pointer;
}

.floating-format-toolbar button:hover {
  background: rgba(255, 255, 255, .14);
}

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

.platform-option {
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--cream);
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--ink);
  cursor: pointer;
  position: relative;
}

.platform-option span {
  font-weight: 600;
}

.platform-option input,
.switch-row input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.check-icon {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  border: 1.5px solid var(--line-strong);
  border-radius: 4px;
  color: transparent;
  background: #fff;
  transition: background .15s, border-color .15s, color .15s;
}

.platform-logo {
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--muted);
  background: #fff;
  padding: 4px;
  transition: background .15s, border-color .15s, color .15s;
}

.platform-option input:checked + .check-icon,
.switch-row input:checked + .check-icon {
  border-color: #2f80ed;
  background: #2f80ed;
  color: #fff;
}

.platform-option input:checked + .platform-logo {
  border-color: #111827;
  background: #111827;
  color: #fff;
}

.platform-option:has(input:focus-visible),
.switch-row:has(input:focus-visible) {
  box-shadow: 0 0 0 3px rgba(84, 184, 173, .18);
}

.platform-rules,
.sns-preview,
.automation-panel,
.article-preview {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--cream);
  padding: 14px;
}

.platform-rules strong,
.sns-preview strong,
.automation-panel strong,
.article-preview strong {
  display: block;
  margin-bottom: 12px;
  font-weight: 600;
}

.automation-panel {
  display: grid;
  gap: 14px;
}

.schedule-rule-list {
  display: grid;
  gap: 8px;
}

.schedule-rule {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  padding: 12px 16px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
}

.schedule-rule .modal-grid {
  grid-template-columns: 118px 118px 118px 118px 150px;
  gap: 8px;
}

.schedule-rule[data-frequency="daily"] [data-schedule-weekday-field],
.schedule-rule[data-frequency="daily"] [data-schedule-month-day-field],
.schedule-rule[data-frequency="weekly"] [data-schedule-month-day-field],
.schedule-rule[data-frequency="monthly"] [data-schedule-weekday-field] {
  display: none;
}

.schedule-rule .field {
  gap: 4px;
  margin-bottom: 0;
}

.schedule-rule label {
  font-size: 11px;
}

.schedule-rule .input,
.schedule-rule .select {
  min-height: 34px;
  padding: 0 10px;
  font-size: 13px;
}

.schedule-platforms {
  display: flex;
  gap: 6px;
  flex-wrap: nowrap;
  align-items: center;
  align-self: center;
  justify-self: end;
  justify-content: flex-end;
}

.platform-option.compact {
  min-height: 34px;
  width: 34px;
  padding: 0;
  justify-content: center;
  border: 0;
  background: transparent;
  font-size: 12px;
}

.platform-option.compact .check-icon {
  width: 15px;
  height: 15px;
  flex-basis: 15px;
  border-radius: 4px;
}

.platform-option.compact .platform-logo {
  width: 28px;
  height: 28px;
  flex-basis: 28px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: #fff;
  padding: 3px;
}

.platform-option.compact input:checked + .platform-logo {
  background: #111827;
  color: #fff;
  border-color: #111827;
  box-shadow: none;
}

.platform-option.compact::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 8px);
  transform: translateX(-50%) translateY(4px);
  padding: 5px 8px;
  border-radius: 6px;
  background: #111827;
  color: #fff;
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity .15s, transform .15s;
  z-index: 20;
}

.platform-option.compact:hover::after {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.schedule-remove {
  align-self: center;
  width: 34px;
  height: 34px;
  border: 1px solid #f3c6c2;
  border-radius: 8px;
  background: #fff7f6;
  display: inline-grid;
  place-items: center;
  align-items: center;
  color: var(--red);
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
}

.schedule-remove svg {
  width: 18px;
  height: 18px;
}

.schedule-remove:hover {
  background: var(--red-soft);
  border-color: #ef9f98;
  color: #b42318;
}

.automation-panel .split-title {
  align-items: flex-start;
}

.automation-panel p {
  margin: 4px 0 0;
}

.switch-row {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  padding: 7px 11px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  position: relative;
}

.learning-type-switch {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  padding: 3px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  white-space: nowrap;
}

.learning-type-switch button {
  min-height: 32px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  padding: 0 14px;
  color: var(--muted);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.learning-type-switch button.active {
  background: var(--ink);
  color: #fff;
}

.platform-rules div {
  border-top: 1px solid var(--line);
  padding: 10px 0;
}

.platform-rules div:first-of-type {
  border-top: 0;
  padding-top: 0;
}

.platform-rules span {
  display: block;
  font-weight: 600;
}

.platform-rules small {
  color: var(--muted);
}

.sns-preview p {
  margin: 0;
  color: var(--ink);
  white-space: pre-wrap;
  line-height: 1.7;
}

.wp-publish-settings {
  display: grid;
  gap: 14px;
  background: #fff;
}

.wp-publish-settings .split-title {
  align-items: flex-start;
}

.wp-publish-settings p {
  margin: 6px 0 0;
}

.wp-featured-row {
  justify-content: flex-start;
  min-height: 42px;
}

.featured-image-panel {
  display: grid;
  gap: 12px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.featured-image-panel strong {
  font-weight: 600;
}

.featured-image-preview {
  aspect-ratio: 16 / 9;
  width: 100%;
  border: 1px dashed var(--line-strong);
  border-radius: 10px;
  background: var(--cream);
  display: grid;
  place-items: center;
  color: var(--muted);
  overflow: hidden;
  font-size: 13px;
}

.featured-image-preview.has-image {
  border-style: solid;
  background: var(--paper);
}

.featured-image-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.featured-image-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.wp-editor-actions {
  margin-top: 0;
}

.article-publish-panel {
  border-color: rgba(39, 141, 132, 0.28);
}

.article-publish-panel .wp-editor-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.article-publish-panel .wp-editor-actions .primary {
  grid-column: 1 / -1;
}

.compact-note {
  margin-top: 10px !important;
  font-size: 13px;
}

.article-preview h2 {
  margin: 0 0 8px;
  font-size: 20px;
  font-weight: 600;
}

.article-preview p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.editor-health {
  display: grid;
  gap: 10px;
}

.editor-health div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  border-top: 1px solid var(--line);
  padding-top: 10px;
  color: var(--muted);
}

.editor-health b {
  color: var(--ink);
  font-weight: 600;
}

.editor-health .integration-error-text {
  color: #b91c1c;
  text-align: right;
  max-width: 70%;
  line-height: 1.5;
}

.progress-track {
  height: 8px;
  border-radius: 999px;
  background: var(--cream);
  overflow: hidden;
}

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

.timeline-loading-card {
  padding: 30px;
}

.timeline-loading-content {
  width: min(420px, 100%);
  margin: 0 auto;
  display: grid;
  gap: 14px;
}

.timeline-loading-label {
  color: var(--muted);
  font-weight: 800;
  text-align: center;
}

.timeline-loading-progress {
  position: relative;
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: #eef3f2;
}

.timeline-loading-progress span {
  position: absolute;
  inset: 0 auto 0 0;
  width: 42%;
  border-radius: inherit;
  background: var(--teal);
  animation: timeline-loading-progress 1.25s ease-in-out infinite;
}

@keyframes timeline-loading-progress {
  0% {
    transform: translateX(-110%);
  }
  55% {
    transform: translateX(80%);
  }
  100% {
    transform: translateX(250%);
  }
}

.article-layout {
  max-width: 980px;
  margin: 0 auto;
  display: grid;
  gap: 18px;
}

.article-hero,
.article-body {
  padding: 32px;
}

.article-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  margin: 18px 0;
}

.article-hero h1 {
  font-size: clamp(30px, 5vw, 48px);
  line-height: 1.15;
  margin-bottom: 16px;
  font-weight: 600;
}

.article-hero p {
  color: var(--muted);
  font-size: 17px;
  line-height: 1.8;
  max-width: 760px;
}

.article-body {
  font-size: 16px;
  line-height: 1.9;
}

.article-body h2 {
  margin-top: 28px;
  margin-bottom: 10px;
}

.article-body ul {
  padding-left: 1.3em;
}

.infographic-embed {
  margin: 30px 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(135deg, #f8fafc, #eef8f6);
  padding: 22px;
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1fr;
  gap: 14px;
  align-items: stretch;
  outline: none;
}

.infographic-embed:focus {
  box-shadow: 0 0 0 4px rgba(84, 184, 173, .14);
}

.info-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
  padding: 18px;
}

.info-card span {
  color: var(--teal-dark);
  font-size: 12px;
  font-weight: 600;
}

.info-card strong {
  display: block;
  margin: 8px 0;
  font-size: 18px;
  font-weight: 600;
}

.info-card p {
  color: var(--muted);
  margin: 0;
  line-height: 1.7;
}

.info-arrow {
  display: grid;
  place-items: center;
  color: var(--teal-dark);
  font-size: 24px;
}

.wp-block-gallery {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin: 30px 0;
}

.wp-block-gallery figure {
  margin: 0;
}

.wp-image-placeholder {
  aspect-ratio: 16 / 9;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: linear-gradient(135deg, #dff6f2, #f8fafc);
  display: grid;
  place-items: center;
  color: var(--teal-dark);
  font-size: 22px;
  font-weight: 600;
}

.wp-image-placeholder.alt {
  background: linear-gradient(135deg, #eef2ff, #f8fafc);
  color: #5b5fc7;
}

.wp-block-gallery figcaption {
  color: var(--muted);
  font-size: 13px;
  margin-top: 8px;
}

.wp-quote {
  margin: 30px 0;
  border-left: 4px solid var(--teal);
  background: var(--cream);
  border-radius: 0 12px 12px 0;
  padding: 22px 24px;
}

.wp-quote p {
  margin: 0 0 10px;
  font-size: 19px;
  line-height: 1.75;
}

.wp-quote cite {
  color: var(--muted);
  font-style: normal;
  font-size: 13px;
}

.wp-callout,
.wp-warning {
  margin: 22px 0;
  border-radius: 12px;
  padding: 18px 20px;
}

.wp-callout {
  border: 1px solid #b7ebcf;
  background: #ecfdf3;
}

.wp-warning {
  border: 1px solid #fed7aa;
  background: #fff7ed;
}

.wp-callout strong,
.wp-warning strong {
  display: block;
  margin-bottom: 6px;
  font-weight: 600;
}

.wp-callout p,
.wp-warning p {
  margin: 0;
}

.wp-paragraph {
  font-size: 16px;
  line-height: 1.95;
  color: #344054;
}

.wp-paragraph p {
  margin: 0 0 1em;
}

.wp-paragraph p:last-child {
  margin-bottom: 0;
}

.wp-paragraph strong,
.wp-paragraph b {
  color: var(--ink);
  font-weight: 700;
}

.wp-paragraph em,
.wp-paragraph i {
  color: var(--ink);
}

.wp-paragraph a {
  color: var(--teal-dark);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.wp-heading-section {
  margin-top: 38px;
  margin-bottom: 16px;
}

.wp-heading {
  color: var(--ink);
  letter-spacing: 0;
}

.wp-heading.heading2 {
  font-size: 28px;
  line-height: 1.35;
  font-weight: 650;
}

.wp-heading.heading3 {
  font-size: 22px;
  line-height: 1.45;
  font-weight: 650;
  padding-left: 14px;
  border-left: 4px solid var(--teal);
}

.wp-heading.heading4 {
  font-size: 18px;
  line-height: 1.5;
  font-weight: 650;
  color: var(--muted);
}

.wp-quote-section .wp-quote {
  margin: 0;
}

.wp-single-image {
  margin: 28px 0;
}

.wp-single-image img,
.wp-block-gallery img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--soft);
}

.wp-single-image figcaption {
  color: var(--muted);
  font-size: 13px;
  margin-top: 8px;
}

.article-component-section {
  margin: 32px 0;
}

.infographic-generated {
  display: grid;
  gap: 24px;
}

.infographic-generated > h2 {
  margin: 0;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
  font-size: 28px;
  line-height: 1.35;
  font-weight: 650;
}

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

.infographic-generated-card {
  min-height: 180px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  padding: 26px 20px;
  display: grid;
  align-content: center;
  justify-items: center;
  text-align: center;
  gap: 14px;
}

.infographic-generated-card span {
  color: var(--teal);
  font-size: 30px;
  line-height: 1;
  font-weight: 750;
}

.infographic-generated-card strong {
  color: var(--ink);
  font-size: 18px;
  line-height: 1.4;
  font-weight: 700;
}

.infographic-generated-card p {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.65;
  margin: 0;
}

.infographic-generated-callout {
  margin-top: 8px;
}

.wp-table {
  width: 100%;
  min-width: 0;
  margin: 30px 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}

.wp-table th,
.wp-table td {
  padding: 14px 16px;
}

.wp-code {
  margin: 30px 0;
  border-radius: 12px;
  background: #111827;
  color: #e5edf7;
  padding: 18px;
  overflow: auto;
  font-size: 13px;
  line-height: 1.7;
}

.wp-cta {
  margin: 34px 0;
  border-radius: 16px;
  background: #111827;
  color: #fff;
  padding: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.wp-cta h2,
.wp-cta p {
  color: #fff;
  margin-bottom: 6px;
}

.wp-cta .btn.primary {
  background: #fff;
  color: #111827;
  border-color: #fff;
}

.wp-faq {
  margin-top: 34px;
}

.wp-faq details {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 16px;
  margin-top: 10px;
  background: var(--paper);
}

.wp-faq summary {
  cursor: pointer;
  font-weight: 600;
}

.wp-faq p {
  margin: 12px 0 0;
}

.settings-card {
  padding: 22px;
  min-width: 0;
}

.social-settings-card {
  grid-column: 1 / -1;
  display: grid;
  gap: 20px;
}

.full-width-settings-card {
  grid-column: 1 / -1;
}

.social-settings-card .social-provider-block + .social-provider-block {
  margin-top: 0;
}

.social-provider-block {
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  padding: 20px 0 0;
  display: grid;
  gap: 14px;
}

.social-provider-block:first-of-type {
  border-top: 0;
  padding-top: 0;
}

.oauth-callback-summary + .social-provider-block {
  border-top: 0;
  padding-top: 0;
}

.social-provider-block h3 {
  margin: 0 0 4px;
  font-size: 18px;
  font-weight: 600;
}

.advanced-settings {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 14px;
  background: var(--cream);
}

.advanced-settings summary {
  cursor: pointer;
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
}

.advanced-settings p {
  margin: 10px 0 14px;
}

.api-provider-settings-card {
  gap: 0;
  padding: 26px 28px;
}

.api-provider-settings-card > .page-kicker {
  margin-bottom: 18px;
}

.api-provider-settings-card .social-provider-block {
  grid-template-columns: minmax(180px, 280px) minmax(0, 1fr);
  align-items: start;
  gap: 18px 28px;
  padding: 24px 0;
}

.api-provider-settings-card .social-provider-block:first-of-type {
  padding-top: 0;
}

.api-provider-settings-card .social-provider-block .split-title {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  align-items: start;
  margin: 0;
}

.api-provider-settings-card .social-provider-block .split-title .badge {
  justify-self: start;
}

.api-provider-settings-card .social-provider-block .connection-actions {
  justify-content: flex-start;
}

.api-provider-settings-card .social-provider-block .connection-actions .btn {
  min-height: 34px;
  padding: 6px 12px;
  font-size: 13px;
}

.api-provider-settings-card .social-provider-block .modal-grid {
  align-items: start;
  gap: 18px 22px;
}

.api-provider-settings-card .social-provider-block .field {
  margin-bottom: 0;
}

.api-provider-settings-card .social-provider-block .field small {
  display: block;
  margin-top: 4px;
  line-height: 1.5;
}

.api-provider-settings-card .settings-helper-field label {
  white-space: normal;
  line-height: 1.35;
}

.api-provider-settings-card .settings-helper-field small {
  margin-top: 2px;
  color: var(--faint);
  font-size: 11px;
  line-height: 1.45;
  letter-spacing: 0;
}

.api-provider-settings-card .settings-actions,
.api-provider-settings-card .settings-test-result {
  margin-top: 20px;
}

.ai-generation-model-card {
  display: grid;
  gap: 16px;
}

.ai-generation-model-grid {
  align-items: stretch;
}

.ai-generation-model-field {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  padding: 16px;
}

.ai-generation-model-row {
  display: grid;
  grid-template-columns: minmax(120px, 160px) minmax(0, 1fr);
  gap: 10px;
  margin-bottom: 8px;
}

.ai-generation-model-field small {
  display: block;
  line-height: 1.5;
}

@media (max-width: 960px) {
  .api-provider-settings-card .social-provider-block {
    grid-template-columns: 1fr;
  }

  .ai-generation-model-row {
    grid-template-columns: 1fr;
  }
}

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

.connection-summary {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 13px;
}

.connection-summary strong {
  color: var(--text);
  font-weight: 600;
}

.local-llm-panel {
  display: grid;
  gap: 14px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.local-llm-panel h3 {
  margin: 0 0 4px;
  font-size: 18px;
  font-weight: 600;
}

.setup-steps {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.setup-steps span {
  border-radius: 999px;
  background: var(--chip);
  color: var(--muted);
  padding: 7px 10px;
  font-size: 12px;
  font-weight: 500;
}

.setup-steps span.done {
  background: var(--teal-soft);
  color: var(--teal-dark);
}

.local-llm-readiness {
  display: grid;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px;
  background: #fff;
}

.local-llm-readiness.ready {
  border-color: rgba(45, 150, 132, .28);
  background: rgba(45, 150, 132, .06);
}

.local-llm-readiness.blocked {
  border-color: rgba(220, 83, 83, .28);
  background: rgba(220, 83, 83, .06);
}

.local-llm-readiness-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 13px;
}

.local-llm-readiness-title strong {
  color: var(--text);
  font-size: 15px;
  font-weight: 600;
}

.local-llm-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.local-llm-checks span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 10px;
  background: #fff;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.local-llm-checks span.ok {
  border-color: rgba(45, 150, 132, .3);
  color: var(--teal-dark);
}

.local-llm-checks span.warning {
  border-color: rgba(212, 163, 69, .34);
  color: #9a6d14;
}

.local-llm-checks span.error {
  border-color: rgba(220, 83, 83, .36);
  color: var(--red);
}

.local-llm-progress {
  max-width: 520px;
}

.local-model-select {
  min-height: 46px;
  height: 46px;
}

.settings-test-result {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--cream);
  padding: 14px;
}

.settings-test-result > strong {
  display: block;
  margin-bottom: 10px;
  font-weight: 600;
}

.settings-test-result-grid {
  display: grid;
  gap: 8px;
}

.settings-test-result-row {
  display: grid;
  grid-template-columns: minmax(110px, 160px) auto 1fr;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.settings-test-result-row strong {
  font-weight: 600;
}

.settings-test-result-row small {
  color: var(--muted);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.analytics-json-input {
  min-height: 150px;
  resize: vertical;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 12px;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(15, 27, 45, .46);
  display: grid;
  place-items: center;
  padding: 24px;
}

#knowledgeMemoImagePreviewModal {
  z-index: 140;
}

.modal {
  width: min(640px, 100%);
  max-height: min(760px, 92vh);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--paper);
  box-shadow: 0 24px 80px rgba(15, 27, 45, .24);
  padding: 22px;
  position: relative;
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--muted);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(15, 27, 45, .04);
}

.modal-close:hover {
  border-color: var(--line-strong);
  color: var(--ink);
  background: var(--cream);
}

.wide-modal {
  width: min(1080px, 100%);
}

.confirm-modal {
  width: min(520px, 100%);
}

.structured-files-modal {
  width: min(980px, 100%);
}

.structured-file-table {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  margin-top: 16px;
}

.structured-file-table table {
  min-width: 820px;
}

.structured-file-table th,
.structured-file-table td {
  white-space: nowrap;
}

.structured-file-table td strong,
.structured-file-table td small {
  display: block;
}

.structured-file-table td small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
}

.structured-file-empty {
  margin-top: 16px;
  padding: 22px;
  border: 1px dashed var(--line-strong);
  border-radius: 10px;
  color: var(--muted);
  background: var(--cream);
  text-align: center;
}

.ai-generate-modal {
  width: min(720px, 100%);
}

.modal-form {
  display: grid;
  gap: 14px;
}

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

.group-description-input {
  min-height: 112px;
  resize: vertical;
}

.ai-generate-prompt {
  min-height: 150px;
  resize: vertical;
}

.ai-generate-check {
  justify-content: flex-start;
  min-height: 48px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}

.ai-generate-reference {
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.ai-generate-reference p {
  margin: 6px 0 0;
}

.permission-panel {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--cream);
  padding: 14px;
}

.permission-panel strong {
  display: block;
  margin-bottom: 10px;
  font-weight: 500;
}

.permission-list {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.permission-list span {
  border: 1px solid #b7ebcf;
  border-radius: 999px;
  background: #ecfdf3;
  color: #047857;
  padding: 6px 10px;
  font-size: 12px;
}

.permission-list span.disabled {
  border-color: var(--line);
  background: #eef2f7;
  color: var(--faint);
}

.reset-warning {
  border: 1px solid #f4b6b1;
  border-radius: 10px;
  background: var(--red-soft);
  padding: 14px;
  margin: 18px 0 8px;
}

.reset-warning strong {
  display: block;
  color: var(--red);
  font-weight: 600;
  margin-bottom: 10px;
}

.confirm-box {
  display: grid;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--cream);
  padding: 14px;
  margin: 18px 0 12px;
}

.confirm-box strong {
  font-size: 15px;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.confirm-box span {
  color: var(--muted);
  font-size: 13px;
}

.readonly-field {
  min-height: 44px;
  display: flex;
  align-items: center;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  background: var(--cream);
  color: var(--muted);
  padding: 0 14px;
  font-size: 14px;
}

.users-table-card {
  margin-top: 14px;
}

.users-table-card table {
  min-width: 900px;
}

.users-table-card td,
.users-table-card th {
  vertical-align: middle;
}

.full-field {
  grid-column: 1 / -1;
}

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

.settings-oauth-notice {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

.settings-oauth-notice strong {
  font-weight: 700;
}

.settings-oauth-notice span {
  color: var(--muted);
}

.settings-oauth-notice.success {
  border-color: rgba(86, 188, 177, .45);
  background: rgba(86, 188, 177, .08);
}

.settings-oauth-notice.warning {
  border-color: rgba(245, 158, 11, .42);
  background: rgba(245, 158, 11, .08);
}

.settings-oauth-notice.error {
  border-color: rgba(239, 68, 68, .32);
  background: rgba(239, 68, 68, .07);
}

.oauth-callback-summary {
  display: grid;
  grid-template-columns: minmax(240px, .65fr) minmax(0, 1fr);
  gap: 14px 18px;
  align-items: end;
  padding: 14px 0 20px;
  border-bottom: 1px solid var(--line);
}

.oauth-callback-summary strong,
.oauth-callback-summary span {
  display: block;
}

.oauth-callback-summary strong {
  margin-bottom: 4px;
  font-weight: 700;
}

.oauth-callback-summary span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.oauth-callback-field .readonly-field {
  background: #f8fafc;
  color: var(--ink);
  overflow-wrap: anywhere;
  word-break: break-all;
}

@media (max-width: 640px) {
  .settings-oauth-notice,
  .oauth-callback-summary {
    grid-template-columns: 1fr;
  }

  .copy-inline {
    grid-template-columns: 1fr;
  }
}

.system-diagnostics-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.system-diagnostic-card,
.system-command-card {
  padding: 18px;
}

.system-diagnostic-log-card {
  margin-bottom: 28px;
}

.production-readiness-banner {
  display: grid;
  grid-template-columns: minmax(240px, 320px) minmax(0, 1fr);
  align-items: stretch;
  gap: 16px;
  margin-bottom: 16px;
  padding: 18px;
  border-left: 0;
}

.production-readiness-banner > div:first-child {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--cream);
}

.production-readiness-banner.ready {
  border-left: 0;
}

.production-readiness-banner.ready {
  grid-template-columns: minmax(240px, 360px);
}

.production-readiness-banner.paused {
  border-left: 0;
}

.production-readiness-banner.danger {
  border-left: 0;
}

.system-diagnostic-history-card {
  margin-bottom: 24px;
  overflow-x: auto;
  padding: 0;
}

.system-diagnostic-history-card .section-head {
  padding: 18px 18px 0;
}

.system-diagnostic-history-card table,
.system-cron-history-card table {
  min-width: 880px;
}

.system-diagnostic-history-card th,
.system-diagnostic-history-card td,
.system-cron-history-card th,
.system-cron-history-card td {
  vertical-align: middle;
}

.system-diagnostic-history-card th:last-child,
.system-diagnostic-history-card td:last-child,
.system-cron-history-card th:last-child,
.system-cron-history-card td:last-child {
  width: 1%;
  white-space: nowrap;
}

.system-diagnostic-history-card td:nth-child(6),
.system-cron-history-card td:nth-child(4),
.system-cron-history-card td:nth-child(5) {
  max-width: 360px;
}

.system-diagnostic-history-card code,
.system-cron-history-card code {
  display: inline-block;
  max-width: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
  line-height: 1.5;
}

.system-diagnostic-history-card .btn.compact {
  min-height: 38px;
  padding: 0 14px;
  white-space: nowrap;
  word-break: keep-all;
}

.system-cron-history-card {
  overflow-x: auto;
  margin-bottom: 32px;
}

.system-cron-command-card {
  margin-bottom: 28px;
}

.system-log-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 14px 0 10px;
}

.system-log-actions .btn {
  white-space: nowrap;
  word-break: keep-all;
}

.system-log-path {
  margin-top: 0;
}

.modal-readiness-list {
  margin-bottom: 16px;
}

.production-readiness-banner h2 {
  margin: 4px 0;
  font-size: 24px;
  font-weight: 650;
}

.production-readiness-banner p {
  margin: 0;
}

.admin-production-alert {
  margin: 0 0 16px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  background: #fff;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
}

.workspace > .admin-production-alert {
  margin: 24px 40px 0;
}

.workspace > .admin-production-alert + .page-header {
  padding-top: 18px;
}

.admin-production-alert.danger {
  border-color: rgba(220, 76, 70, .35);
  background: rgba(220, 76, 70, .06);
}

.admin-production-alert.paused {
  border-color: rgba(204, 151, 38, .35);
  background: rgba(204, 151, 38, .08);
}

.admin-production-alert strong {
  color: var(--ink);
  font-weight: 650;
  white-space: nowrap;
}

.admin-production-alert span {
  color: var(--muted);
  min-width: 0;
  flex: 1;
}

.readiness-list {
  display: grid;
  gap: 0;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper);
  overflow: hidden;
}

.readiness-list div {
  display: grid;
  grid-template-columns: minmax(190px, .34fr) minmax(0, 1fr);
  gap: 14px;
  padding: 10px 12px;
  border-top: 1px solid var(--line);
}

.readiness-list div:first-child {
  border-top: 0;
}

.readiness-list strong {
  min-width: 0;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.readiness-list span {
  color: var(--muted);
  min-width: 0;
  overflow-wrap: anywhere;
}

.system-diagnostic-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.system-diagnostic-head h2,
.system-command-card h2 {
  margin: 4px 0 0;
  font-size: 20px;
  font-weight: 650;
}

.system-check-list {
  display: grid;
  gap: 10px;
}

.system-check-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) minmax(120px, .65fr);
  gap: 12px;
  align-items: start;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}

.system-check-row:first-child {
  border-top: 0;
}

.system-check-row p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.system-check-row code {
  color: var(--ink);
  overflow-wrap: anywhere;
  font-size: 12px;
}

.system-log-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 14px 0;
}

.system-log-summary div {
  border: 1px solid var(--line);
  background: var(--soft);
  padding: 12px;
}

.system-log-summary span {
  display: block;
  color: var(--faint);
  font-size: 12px;
  font-weight: 650;
  margin-bottom: 4px;
}

.system-log-summary strong {
  overflow-wrap: anywhere;
  font-weight: 650;
}

.setup-wrap {
  min-height: 100vh;
  background: var(--sand);
  padding: 42px;
  display: grid;
  gap: 18px;
  align-content: start;
}

.setup-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  max-width: 1180px;
  width: 100%;
  margin: 0 auto;
}

.setup-hero h1 {
  margin: 6px 0 8px;
  font-size: 42px;
  letter-spacing: 0;
}

.setup-hero p {
  margin: 0;
  color: var(--muted);
  font-size: 16px;
}

.setup-stepper,
.setup-panel {
  max-width: 1180px;
  width: 100%;
  margin: 0 auto;
}

.setup-stepper {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  padding: 12px;
}

.setup-stepper button {
  border: 0;
  background: transparent;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px;
  font: inherit;
  font-weight: 650;
  cursor: pointer;
  border-radius: 8px;
  white-space: nowrap;
}

.setup-stepper button span {
  width: 26px;
  height: 26px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: var(--chip);
  color: var(--muted);
  font-size: 12px;
}

.setup-stepper button.active {
  background: var(--teal-soft);
  color: var(--teal-dark);
}

.setup-stepper button.done span,
.setup-stepper button.active span {
  background: var(--teal);
  color: #fff;
}

.setup-panel {
  padding: 24px;
}

.setup-panel-head {
  margin-bottom: 18px;
}

.setup-panel-head h2 {
  margin: 4px 0 8px;
  font-size: 28px;
  font-weight: 680;
}

.setup-panel-head p {
  margin: 0;
  color: var(--muted);
}

.setup-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.setup-form .btn,
.setup-form .check-row {
  align-self: end;
}

.setup-notice {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  background: var(--chip);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px;
  margin-bottom: 18px;
}

.setup-notice p {
  margin: 0;
  color: var(--muted);
}

.setup-command {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
}

.setup-command label {
  color: var(--muted);
  font-weight: 650;
}

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

.setup-summary div {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 16px;
  background: var(--chip);
}

.setup-summary span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 8px;
}

.setup-summary strong {
  font-size: 20px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 4px;
}

.settings-card h2 {
  margin-bottom: 8px;
}

.setting-row {
  min-height: 52px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 13px 0;
}

.setting-row > span:first-child {
  color: var(--ink);
  font-weight: 650;
}

.notification-settings-list {
  display: block;
  margin-top: 16px;
  border-bottom: 1px solid var(--line);
}

.notification-setting-row {
  display: grid;
  grid-template-columns: minmax(320px, 1fr) auto;
  align-items: center;
  gap: 18px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}

.notification-setting-row:last-child {
  border-bottom: 0;
}

.compact-select {
  min-width: 130px;
}

.compact-switch {
  white-space: nowrap;
}

.notification-rule-main {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.notification-rule-main h3 {
  color: var(--ink);
  font-weight: 700;
  margin: 0;
  font-size: 15px;
}

.notification-rule-main p,
.notification-rule-main small {
  color: var(--muted);
  line-height: 1.35;
  margin: 0;
}

.notification-rule-main p {
  font-size: 13px;
}

.notification-rule-main small {
  font-size: 11px;
}

.notification-rule-form {
  margin-top: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: nowrap;
}

.notification-rule-form .field {
  margin: 0;
  min-width: 0;
}

.notification-rule-form .field > label:not(.switch-row) {
  display: none;
}

.notification-rule-form .switch-row {
  min-height: 36px;
  padding: 0 12px;
}

.notification-rule-form .switch-row span:last-child {
  white-space: nowrap;
}

.notification-rule-form .select {
  width: 116px;
  min-height: 36px;
  padding: 0 34px 0 12px;
}

.notification-channel-field {
  grid-column: auto;
}

.notification-channel-title {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.notifications-toolbar {
  align-items: flex-start;
  flex-wrap: wrap;
  overflow: visible;
}

.notifications-toolbar .left {
  flex: 1 1 720px;
  flex-wrap: wrap;
}

.notifications-toolbar .right {
  flex: 0 0 auto;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.notifications-toolbar .input {
  flex: 1 1 220px;
  min-width: 180px;
  max-width: 360px;
}

.notifications-toolbar .select {
  min-width: 150px;
  max-width: 220px;
}

.notifications-toolbar .compact-switch {
  flex: 0 0 auto;
  justify-content: center;
}

.notification-channel-toggles,
.delivery-list {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.notification-channel-toggles {
  justify-content: flex-start;
  flex-wrap: nowrap;
}

.notification-channel-title {
  flex: 0 0 auto;
  text-align: left;
  margin-right: 2px;
}

.mini-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 76px;
  min-height: 36px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  background: #fff;
  cursor: pointer;
  transition: border-color .16s ease, background .16s ease, color .16s ease;
}

.mini-check input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.mini-check:has(input:checked) {
  border-color: var(--accent);
  color: var(--ink);
  background: var(--accent-soft);
}

@media (max-width: 1120px) {
  .notification-setting-row {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .notification-rule-form {
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .notification-channel-toggles {
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  .notification-channel-title {
    text-align: left;
  }
}

.notification-delivery-panel {
  margin-top: 18px;
  border-top: 1px solid var(--line);
  padding-top: 16px;
}

.notification-detail-modal {
  max-width: 880px;
}

.notification-detail-section {
  margin-top: 18px;
}

.notification-detail-section h3 {
  margin: 0 0 10px;
}

.notification-detail-body {
  margin: 0;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: #f8fafc;
  white-space: pre-wrap;
}

.notification-detail-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.notification-detail-list > div {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.notification-detail-list span,
.notification-related-list small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.notification-detail-list strong {
  display: block;
  margin-top: 4px;
  overflow-wrap: anywhere;
}

.notification-related-list {
  display: grid;
  gap: 10px;
}

.notification-related-list article {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  align-items: flex-start;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.notification-related-list p {
  margin: 4px 0;
  color: var(--muted);
}

.notification-raw-details {
  margin-top: 16px;
}

.notification-raw-details summary {
  color: var(--muted);
  font-weight: 800;
  cursor: pointer;
}

.notification-raw-details .textarea {
  margin-top: 10px;
}

.notification-technical-json {
  margin: 10px 0 0;
  max-height: 340px;
  overflow: auto;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0f172a;
  color: #e2e8f0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 12px;
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.notification-delivery-panel h3 {
  margin-bottom: 10px;
}

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

.delivery-row {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) auto auto;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
}

.delivery-row strong,
.delivery-row span {
  display: block;
}

.delivery-error {
  grid-column: 1 / -1;
  color: var(--danger);
}

code {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--cream);
  color: #344054;
  padding: 7px 9px;
  font-size: 13px;
  overflow-wrap: anywhere;
}

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

.bottom-composer {
  position: sticky;
  bottom: 0;
  z-index: 2;
  background: var(--paper);
  border-radius: 12px;
  border: 1px solid var(--line);
  padding: 14px;
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 12px;
  align-items: center;
  box-shadow: 0 -8px 30px rgba(23, 32, 51, .06);
}

.counter {
  color: var(--faint);
  font-weight: 850;
  min-width: 74px;
  text-align: right;
}

.toast {
  position: fixed;
  right: 20px;
  top: 20px;
  max-width: min(520px, calc(100vw - 40px));
  background: #2f756d;
  color: #fff;
  padding: 13px 16px;
  border-radius: 14px;
  box-shadow: var(--shadow);
  font-weight: 850;
  line-height: 1.55;
  overflow-wrap: anywhere;
  z-index: 200;
}

.auto-task {
  position: fixed;
  right: 0;
  bottom: 140px;
  writing-mode: vertical-rl;
  background: var(--teal-dark);
  color: #fff;
  border-radius: 16px 0 0 16px;
  padding: 16px 12px;
  font-weight: 900;
  box-shadow: var(--shadow);
}

.auto-task span {
  writing-mode: horizontal-tb;
  margin-top: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .18);
  padding: 5px 8px;
}

@media (max-width: 1120px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .top-actions {
    margin-left: 0;
    justify-content: flex-start;
  }

  .knowledge-layout,
  .graph-area,
  .chat-layout,
  .system-diagnostics-grid {
    grid-template-columns: 1fr;
  }

  .production-readiness-banner {
    grid-template-columns: 1fr;
  }

  .readiness-list {
    min-width: 0;
    width: 100%;
  }

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

  .columns-3 {
    display: none;
  }

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

  .analytics-search-console-grid {
    grid-template-columns: 1fr;
  }

  .system-log-summary {
    grid-template-columns: 1fr;
  }

  .notifications-toolbar {
    grid-template-columns: minmax(220px, 1fr) repeat(2, minmax(150px, 1fr));
  }
}

@media (max-width: 760px) {
  .auth-wrap {
    grid-template-columns: 1fr;
    align-content: start;
    min-height: 100svh;
    background: linear-gradient(180deg, #0a0f1a 0%, #0f1b2d 32%, #f8fafc 32%, #f8fafc 100%);
  }

  .auth-visual {
    display: flex;
    justify-content: flex-start;
    min-height: auto;
    padding: 24px 18px 18px;
  }

  .auth-panel {
    min-height: auto;
    border-left: 0;
    padding: 0 16px 24px;
    background: transparent;
    align-items: flex-start;
  }

  .auth-panel-inner {
    max-width: none;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: var(--paper);
    box-shadow: 0 18px 42px rgba(15, 23, 42, .14);
    padding: 22px 18px;
  }

  .auth-panel-top {
    margin-bottom: 22px;
  }

  .auth-panel-title {
    font-size: 30px;
    line-height: 1.18;
  }

  .auth-panel-desc {
    font-size: 14px;
  }

  .auth-form {
    gap: 16px;
  }

  .auth-form .input,
  .auth-form .select {
    min-height: 52px;
    font-size: 16px;
  }

  .auth-submit {
    min-height: 52px;
    font-size: 16px;
  }

  .auth-switch {
    flex-wrap: wrap;
    margin-top: 20px;
  }

  .auth-visual-bg::before,
  .auth-visual-grid,
  .auth-visual-footer {
    display: none;
  }

  .auth-visual-content {
    width: 100%;
    max-width: none;
    text-align: left;
  }

  .auth-visual-logo {
    margin-bottom: 14px;
  }

  .auth-logo-mark {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    font-size: 20px;
  }

  .auth-visual-heading {
    font-size: 26px;
    line-height: 1.22;
    margin-bottom: 10px;
  }

  .auth-visual-sub {
    max-width: 420px;
    margin-bottom: 0;
    font-size: 13px;
    line-height: 1.65;
  }

  .auth-visual-stats {
    display: none;
  }

  .main {
    padding: 16px;
  }

  .admin-production-alert {
    margin: 0 0 12px;
    align-items: flex-start;
    flex-direction: column;
  }

  .workspace > .admin-production-alert {
    margin: 16px 16px 0;
  }

  .workspace > .admin-production-alert + .page-header {
    padding-top: 16px;
  }

  .nav-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .toolbar-card {
    overflow-x: auto;
  }

  .timeline-summary {
    padding: 14px 16px;
  }

  .timeline-summary div {
    align-items: flex-start;
    flex-direction: column;
  }

  .users-toolbar {
    flex-wrap: wrap;
    overflow: visible;
  }

  .users-toolbar .left {
    flex: 1 1 100%;
    flex-wrap: wrap;
  }

  .users-toolbar .right {
    margin-left: auto;
  }

  .notifications-toolbar {
    grid-template-columns: 1fr;
    overflow: visible;
  }

  .brand {
    min-width: 0;
  }

  .group-pill {
    min-width: 100%;
  }

  .metric-grid,
  .analytics-search-metrics,
  .member-progress-metrics,
  .mini-form.two {
    grid-template-columns: 1fr;
  }

  .profile-definition div {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .message {
    max-width: 94%;
  }

  .bottom-composer,
  .chat-input {
    grid-template-columns: 1fr;
  }

  .system-check-row {
    grid-template-columns: 1fr;
  }

  .setup-wrap {
    padding: 18px;
  }

  .setup-hero {
    flex-direction: column;
  }

  .setup-hero h1 {
    font-size: 32px;
  }

  .setup-stepper {
    grid-template-columns: 1fr;
    overflow-x: auto;
  }

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

/* Corporate application shell */
:root {
  --ink: #111827;
  --muted: #667085;
  --faint: #98a2b3;
  --line: #e3e8ef;
  --line-strong: #cbd5e1;
  --sand: #eef2f7;
  --chip: #f1f5f9;
  --teal: #54b8ad;
  --teal-dark: #338d84;
  --teal-soft: #e9f8f6;
  --shadow: 0 12px 30px rgba(15, 27, 45, .08);
}

body {
  background: var(--sand);
  color: var(--ink);
}

.app-shell {
  grid-template-rows: none;
  grid-template-columns: 280px minmax(0, 1fr);
}

.sidebar {
  min-height: 100vh;
  height: 100vh;
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  padding: 24px 18px;
  background: linear-gradient(180deg, #0f1b2d, #14243a);
  color: #e5edf7;
  overflow: hidden;
}

.mobile-menu-btn,
.sidebar-backdrop {
  display: none;
}

.side-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 36px;
  flex: 0 0 auto;
}

.side-brand > div:not(.side-logo) {
  min-width: 0;
}

.side-logo {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  overflow: hidden;
}

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

.side-brand strong {
  display: block;
  font-size: 20px;
  line-height: 1.2;
  font-weight: 700;
}

.side-eyebrow {
  display: block;
  color: #91a1b6;
  font-size: 12px;
  margin-bottom: 3px;
}

.side-brand-action,
.side-brand-notice {
  width: 38px;
  height: 38px;
  border: 1px solid rgba(145, 161, 182, 0.28);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
  color: #c5cfdd;
  display: grid;
  place-items: center;
  position: relative;
  cursor: pointer;
  transition: color 0.18s ease, border-color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}

.side-brand-action {
  margin-left: auto;
}

.side-brand-action:hover,
.side-brand-notice:hover {
  color: #ffffff;
  border-color: rgba(109, 184, 174, 0.55);
  background: rgba(109, 184, 174, 0.16);
  transform: translateY(-1px);
}

.side-brand-action svg,
.side-brand-notice svg {
  width: 20px;
  height: 20px;
}

.job-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 18px;
  height: 18px;
  border-radius: 999px;
  display: inline-grid;
  place-items: center;
  padding: 0 5px;
  background: #62c7bb;
  color: #0f172a;
  font-size: 10px;
  font-style: normal;
  font-weight: 800;
  line-height: 1;
}

.side-nav {
  display: flex;
  flex-direction: column;
  gap: 22px;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 4px;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

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

.side-nav-tabs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(42px, 1fr));
  gap: 6px;
  padding: 4px;
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 12px;
  background: rgba(255, 255, 255, .05);
}

.side-nav-tabs button {
  position: relative;
  min-width: 0;
  min-height: 38px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #8fa0b7;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.side-nav-tabs button.active,
.side-nav-tabs button:hover {
  background: rgba(255, 255, 255, .12);
  color: #fff;
}

.side-nav-tabs svg {
  width: 19px;
  height: 19px;
  display: block;
  margin: 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.side-nav-tabs button::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 50%;
  top: calc(100% + 8px);
  z-index: 30;
  transform: translateX(-50%) translateY(-2px);
  opacity: 0;
  pointer-events: none;
  min-width: max-content;
  border-radius: 8px;
  background: #0b1322;
  color: #fff;
  padding: 6px 9px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  box-shadow: 0 12px 30px rgba(0, 0, 0, .24);
  transition: opacity .15s ease, transform .15s ease;
}

.side-nav-tabs button::before {
  content: "";
  position: absolute;
  left: 50%;
  top: calc(100% + 3px);
  z-index: 31;
  width: 8px;
  height: 8px;
  background: #0b1322;
  transform: translateX(-50%) rotate(45deg);
  opacity: 0;
  pointer-events: none;
  transition: opacity .15s ease;
}

.side-nav-tabs button:hover::after,
.side-nav-tabs button:focus-visible::after,
.side-nav-tabs button:hover::before,
.side-nav-tabs button:focus-visible::before {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.side-nav-tabs button:hover::before,
.side-nav-tabs button:focus-visible::before {
  transform: translateX(-50%) rotate(45deg);
}

.side-nav-section {
  display: grid;
  gap: 8px;
}

.side-nav-section[data-nav-panel] {
  display: none;
}

.side-nav-section[data-nav-panel].active {
  display: grid;
}

.side-nav-label {
  color: #7f90a6;
  font-size: 12px;
  padding: 0 12px;
  margin-bottom: 2px;
}

.side-nav-group-label {
  color: #7f90a6;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .08em;
  padding: 12px 12px 2px;
}

.side-nav-section > .side-nav-group-label:first-child,
.side-nav-label + .side-nav-group-label {
  padding-top: 4px;
}

.side-nav button {
  min-height: 44px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #c5cfdd;
  padding: 0 12px;
  text-align: left;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 12px;
}

.nav-badge {
  margin-left: auto;
  min-width: 22px;
  height: 22px;
  border-radius: 999px;
  display: inline-grid;
  place-items: center;
  padding: 0 7px;
  background: #ef4444;
  color: #fff;
  font-size: 11px;
  font-style: normal;
  font-weight: 700;
  line-height: 1;
}

.side-nav button span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #5ea9a1;
  opacity: .85;
}

.side-nav button.active,
.side-nav button:hover {
  background: rgba(255, 255, 255, .08);
  color: #fff;
}

.side-account {
  margin-top: auto;
  position: sticky;
  bottom: 0;
  flex: 0 0 auto;
  padding-top: 18px;
  background: linear-gradient(180deg, rgba(20, 36, 58, 0), #14243a 28%);
  z-index: 2;
}

.side-user {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, .12);
  background: rgba(255, 255, 255, .06);
  border-radius: 12px;
  padding: 12px;
  display: flex;
  gap: 10px;
  align-items: center;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.side-user:hover {
  background: rgba(255, 255, 255, .1);
}

.side-user .avatar {
  width: 38px;
  height: 38px;
  background: rgba(84, 184, 173, .18);
  color: #9de0d8;
}

.side-user strong {
  display: block;
  font-size: 14px;
  font-weight: 700;
}

.side-user span {
  display: block;
  color: #9aa9bc;
  font-size: 12px;
  margin-top: 2px;
}

.account-menu {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(100% + 8px);
  display: grid;
  gap: 4px;
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 10px;
  background: #111c2d;
  box-shadow: 0 18px 40px rgba(0, 0, 0, .28);
  z-index: 20;
}

.account-menu[hidden] {
  display: none;
}

.account-menu button {
  width: 100%;
  min-height: 38px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #d8e2ef;
  text-align: left;
  padding: 0 10px;
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}

.account-menu button:hover {
  background: rgba(255, 255, 255, .08);
  color: #fff;
}

.account-menu button.danger {
  color: #f2b8b8;
}

.account-menu button.danger:hover {
  background: rgba(216, 79, 79, .16);
  color: #fff;
}

.workspace {
  min-width: 0;
}

.page-header {
  padding: 36px 40px 22px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
}

.page-header > div:first-child {
  flex: 1 1 auto;
  min-width: 0;
}

.page-header.is-hidden {
  display: none;
}

.page-kicker {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.page-header h1 {
  font-size: 34px;
  line-height: 1.15;
  margin: 0 0 8px;
  font-weight: 750;
}

.page-header p {
  color: var(--muted);
  margin: 0;
  font-weight: 400;
}

.page-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.main {
  padding: 0 40px 40px;
}

.chat-workspace .main {
  padding: 0;
}

.editor-workspace .main {
  min-height: 100vh;
}

.btn,
.icon-btn,
.tab-btn {
  border-radius: 8px;
  min-height: 40px;
  padding: 9px 14px;
  font-weight: 650;
  box-shadow: 0 1px 2px rgba(15, 27, 45, .04);
}

.btn.primary {
  background: #111827;
  border-color: #111827;
}

.metric {
  border-radius: 12px;
  border: 1px solid var(--line);
  box-shadow: 0 1px 2px rgba(15, 27, 45, .04);
}

.metric span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
}

.metric b {
  font-size: 30px;
  font-weight: 600;
  letter-spacing: 0;
}

.metric small {
  display: block;
  color: var(--faint);
  margin-top: 6px;
  font-weight: 500;
}

.card,
.extract-row,
.column-head {
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 1px 2px rgba(15, 27, 45, .04);
}

.extract-row {
  background: var(--paper);
}

h2 {
  font-size: 20px;
  font-weight: 600;
}

h3 {
  font-size: 15px;
  font-weight: 600;
}

.memo-card,
.node-chip,
.edge-chip,
.badge,
.field label,
.column-head,
.avatar-cell {
  font-weight: 500;
}

.memo-card p,
.muted,
td,
.message,
.evidence,
.input,
.textarea,
.select {
  font-weight: 400;
}

.relation {
  font-weight: 500;
}

.chat-workspace .card,
.chat-workspace .chat-panel,
.chat-workspace .chat-history {
  border-radius: 0;
}

.editor-workspace .card {
  border-radius: 0;
}

/* Prevent knowledge preview overflow */
.knowledge-layout,
.knowledge-layout > *,
.extraction-panel,
.extraction-scroll,
.extract-row,
.extract-row > * {
  min-width: 0;
}

.node-chip,
.edge-chip,
.mini-form,
.json-preview,
.bottom-composer,
.input,
.textarea,
.select {
  border-radius: 8px;
}

.node-chip,
.edge-chip {
  background: var(--chip);
}

.mini-form,
.message.assistant,
th {
  background: var(--cream);
}

.json-preview {
  background: #111827;
  color: #e5edf7;
}

.auto-task {
  display: none;
}

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

  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    z-index: 40;
    width: 280px;
    height: 100vh;
    min-height: 100vh;
    transform: translateX(-100%);
    transition: transform .2s ease;
    box-shadow: 16px 0 40px rgba(15, 27, 45, .28);
  }

  body.sidebar-open .sidebar {
    transform: translateX(0);
  }

  .mobile-menu-btn {
    display: grid;
    place-items: center;
    position: fixed;
    left: 14px;
    top: 14px;
    z-index: 35;
    width: 42px;
    height: 42px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--paper);
    color: var(--ink);
    box-shadow: var(--shadow);
    font-size: 20px;
  }

  .sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 30;
    background: rgba(15, 27, 45, .42);
  }

  body.sidebar-open .sidebar-backdrop {
    display: block;
  }

  .side-nav {
    display: flex;
    flex-direction: column;
  }

  .page-header {
    padding: 70px 20px 16px;
    flex-direction: column;
  }

  .main {
    padding: 0 20px 28px;
  }

  .chat-workspace .main {
    padding-top: 64px;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
  }

  .chat-layout {
    height: calc(100vh - 64px);
    height: calc(100dvh - 64px);
    min-height: 0;
    overflow: hidden;
  }

  .chat-panel {
    height: calc(100vh - 64px);
    height: calc(100dvh - 64px);
    min-height: 0;
  }

  .chat-resizer {
    display: none;
  }

  .chat-history {
    height: auto;
    min-height: 0;
    max-height: 320px;
  }

  .editor-workspace .main {
    padding-top: 64px;
  }

  .group-grid,
  .api-layout,
  .api-reference-grid,
  .learning-grid,
  .member-profile-layout,
  .member-learning-grid,
  .user-edit-page,
  .timeline-reply,
  .knowledge-memo-layout,
  .knowledge-memo-list.compact,
  .file-grid,
  .settings-layout,
  .analytics-layout,
  .sns-editor,
  .article-editor,
  .group-selector {
    grid-template-columns: 1fr;
  }

  .editor-resizer {
    display: none;
  }

  .infographic-embed {
    grid-template-columns: 1fr;
  }

  .blog-infographic,
  .wp-block-gallery,
  .wp-cta {
    grid-template-columns: 1fr;
    flex-direction: column;
    align-items: flex-start;
  }

  .blog-infographic div {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .blog-infographic div:last-child {
    border-bottom: 0;
  }

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

  .info-arrow {
    transform: rotate(90deg);
  }

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

  .notification-detail-list,
  .notification-related-list article {
    grid-template-columns: 1fr;
  }

  .schedule-rule {
    grid-template-columns: 1fr;
  }

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

  .api-scope-grid {
    grid-template-columns: 1fr;
  }

  .api-reference-table > div,
  .endpoint-reference-table > div {
    grid-template-columns: 1fr;
  }

  .api-external-test-grid,
  .api-external-test-result-grid {
    grid-template-columns: 1fr;
  }

  .group-selector-controls {
    align-items: stretch;
    flex-direction: column;
  }

  .knowledge-memo-image-tools {
    grid-template-columns: 1fr;
  }

  .memory-board {
    overflow-x: auto;
  }

  .memory-board-head,
  .extract-row {
    min-width: 980px;
  }

  .memory-composer {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 761px) and (max-width: 1120px) {
  .auth-wrap {
    grid-template-columns: 1fr minmax(360px, 480px);
  }

  .auth-visual-heading {
    font-size: 28px;
  }

  .auth-visual-sub {
    font-size: 13px;
  }

  .auth-visual {
    padding: 40px 32px;
  }

  .auth-visual-stats {
    padding: 16px 20px;
  }

  .auth-stat strong {
    font-size: 20px;
  }
}

@media (max-width: 420px) {
  .auth-panel {
    padding-inline: 12px;
  }

  .auth-panel-inner {
    padding: 20px 14px;
    border-radius: 14px;
  }

  .auth-panel-title {
    font-size: 28px;
  }

  .auth-visual {
    padding-inline: 14px;
  }

  .auth-visual-heading {
    font-size: 24px;
  }
}

/* ── Refined typography ── */
html {
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-weight: 400;
  line-height: 1.65;
  letter-spacing: .01em;
}

h1, h2, h3 {
  letter-spacing: -.015em;
  line-height: 1.25;
}

.page-header h1 {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -.02em;
  line-height: 1.2;
}

h2 {
  font-size: 18px;
  font-weight: 650;
}

h3 {
  font-size: 14px;
  font-weight: 650;
  text-transform: none;
}

p, td, .message, .evidence, .memo-card p {
  font-size: 14px;
  line-height: 1.7;
}

/* ── Weight hierarchy ── */
.brand,
.side-brand strong {
  font-weight: 650;
}

.brand-mark,
.help-mark,
.side-logo {
  font-weight: 600;
}

.btn,
.icon-btn,
.tab-btn {
  font-size: 13px;
  font-weight: 600;
}

.group-pill {
  font-weight: 600;
}

.field label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .03em;
  text-transform: uppercase;
  color: var(--faint);
}

.avatar-cell {
  font-weight: 600;
  font-size: 14px;
}

.badge {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .02em;
}

.column-head {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}

.node-chip,
.edge-chip {
  font-size: 13px;
  font-weight: 550;
}

.memo-meta {
  font-size: 12px;
  font-weight: 500;
  color: var(--faint);
}

.counter {
  font-size: 12px;
  font-weight: 600;
  color: var(--faint);
}

.toast {
  font-size: 13px;
  font-weight: 600;
}

.auto-task {
  font-weight: 600;
}

.side-nav button {
  font-size: 14px;
  font-weight: 500;
}

.side-nav button.active,
.side-nav button:hover {
  font-weight: 600;
}

.side-user strong {
  font-size: 13px;
  font-weight: 600;
}

.side-user span {
  font-size: 11px;
}

.page-kicker {
  font-size: 11px;
  font-weight: 650;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--teal-dark);
}

.preview-columns div {
  font-size: 12px;
  font-weight: 500;
}

.memo-card strong {
  font-size: 14px;
  font-weight: 600;
}

.history-item span {
  font-size: 13px;
  font-weight: 550;
}

.history-item small {
  font-size: 11px;
}

.setting-row > span:first-child {
  font-size: 14px;
  font-weight: 600;
}

.group-stats b {
  font-size: 20px;
  font-weight: 650;
}

.group-stats {
  font-size: 12px;
}

.relation {
  font-weight: 600;
  font-size: 12px;
}

.metric span {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--faint);
}

.metric b {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -.02em;
}

.metric small {
  font-size: 12px;
  font-weight: 400;
}

/* ── Table refinement ── */
th {
  font-size: 11px;
  font-weight: 650;
  letter-spacing: .04em;
  text-transform: uppercase;
}

td {
  font-size: 13px;
}

th, td {
  padding: 14px 16px;
}

/* ── Input refinement ── */
.input,
.textarea,
.select {
  font-size: 14px;
  border-radius: 10px;
  border-width: 1.5px;
}

.input:focus,
.textarea:focus,
.select:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(84, 184, 173, .12);
}

/* ── Spacing refinement ── */
.page-header {
  padding: 32px 40px 20px;
}

.page-header p {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.6;
  margin-top: 4px;
}

.metric-grid {
  gap: 14px;
  margin-bottom: 20px;
}

.metric {
  padding: 20px;
}

.card {
  box-shadow: 0 1px 3px rgba(15, 27, 45, .04), 0 4px 12px rgba(15, 27, 45, .03);
}

.toolbar-card {
  padding: 12px 16px;
  margin-bottom: 16px;
}

.memory-board-toolbar {
  padding: 0 20px;
  min-height: 52px;
}

.memory-board-toolbar strong {
  font-size: 13px;
  font-weight: 600;
}

.memory-board-toolbar .link-btn {
  font-size: 12px;
}

.memory-board-head div {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .02em;
}

.extract-row {
  padding: 18px 20px;
}

.memo-card {
  line-height: 1.7;
}

.group-selector {
  padding: 24px;
}

.group-selector-main p {
  font-size: 14px;
  line-height: 1.65;
}

.group-inline-stats span {
  font-size: 11px;
  font-weight: 500;
}

.settings-card {
  padding: 24px;
}

.settings-card h2 {
  margin-bottom: 6px;
}

.setting-row {
  padding: 14px 0;
}

.group-card {
  padding: 24px;
}

.group-card p {
  font-size: 13px;
  line-height: 1.65;
}

.chat-panel {
  padding: 20px 24px;
}

.message {
  font-size: 14px;
  padding: 12px 16px;
  line-height: 1.65;
}

.evidence {
  font-size: 13px;
  padding: 10px 12px;
}

.evidence strong {
  font-weight: 600;
}

.json-preview {
  font-size: 12px;
  line-height: 1.6;
}

code {
  font-size: 12px;
  padding: 4px 7px;
}

.empty {
  font-size: 14px;
  padding: 32px;
}

/* ── Sidebar polish ── */
.side-brand {
  margin-bottom: 32px;
}

.side-brand strong {
  font-size: 18px;
  line-height: 1.25;
}

.side-eyebrow {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: #7b8ea5;
  margin-bottom: 2px;
}

.side-nav {
  gap: 18px;
}

.side-nav button {
  min-height: 42px;
  border-radius: 8px;
  padding: 0 14px;
  transition: background .15s, color .15s;
}

.side-user {
  padding: 14px;
}

/* ── Auth page polish (overridden by redesign) ── */

.link-btn {
  font-size: 13px;
  font-weight: 600;
}

/* ── Blog Redesign ── */

/* Category color badges */
.badge.cat-knowledge { background: #e9f8f6; color: var(--teal-dark); }
.badge.cat-ai { background: #eef0ff; color: #5b5fc7; }
.badge.cat-ops { background: #fef3e2; color: #9a6c18; }

/* Blog list — featured hero card */
.blog-index-shell {
  width: 100%;
  margin: 0 auto;
}

.blog-index-shell .toolbar-card {
  margin-bottom: 20px;
}

.blog-featured {
  display: grid;
  grid-template-columns: 1fr 1fr;
  overflow: hidden;
  margin-bottom: 24px;
  cursor: pointer;
  transition: box-shadow .2s ease, transform .15s ease;
}
.blog-featured:hover {
  box-shadow: 0 12px 40px rgba(15, 27, 45, .1);
  transform: translateY(-2px);
}
.blog-featured-img {
  position: relative;
  min-height: 280px;
  background: linear-gradient(135deg, #0f1b2d 0%, #1a3a4a 50%, #278d84 100%);
  display: grid;
  place-items: center;
  overflow: hidden;
}
.blog-featured-img img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.blog-featured-img::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 25% 40%, rgba(98, 199, 187, .3) 0, transparent 50%),
    radial-gradient(circle at 70% 60%, rgba(129, 92, 244, .2) 0, transparent 40%);
}
.blog-featured-gradient {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(15, 27, 45, .04) 0%, rgba(15, 27, 45, .5) 100%);
}
.blog-featured-badge {
  position: absolute;
  top: 20px;
  left: 20px;
  z-index: 2;
}
.blog-featured-body {
  padding: 32px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 16px;
}
.blog-featured-title {
  font-size: 24px;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -.02em;
  margin: 0;
}
.blog-featured-summary {
  font-size: 14px;
  line-height: 1.7;
  color: var(--muted);
  margin: 0;
}

/* Blog list — card grid */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 360px));
  gap: 20px;
  justify-content: start;
}

.blog-card {
  display: grid;
  grid-template-rows: auto 1fr;
  width: 100%;
  max-width: 360px;
  overflow: hidden;
  transition: box-shadow .2s ease, transform .15s ease;
}
.blog-card:hover {
  box-shadow: 0 8px 28px rgba(15, 27, 45, .08);
  transform: translateY(-2px);
}
.blog-card-thumb {
  position: relative;
  height: 140px;
  display: grid;
  place-items: center;
  font-size: 28px;
  font-weight: 700;
  color: rgba(255, 255, 255, .7);
  overflow: hidden;
}
.blog-card-thumb img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.blog-card-thumb::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(15, 27, 45, .02), rgba(15, 27, 45, .38));
}
.blog-card-thumb span {
  position: relative;
  z-index: 1;
}
.blog-card-thumb.cat-knowledge {
  background: linear-gradient(135deg, #1a3a4a, #278d84);
}
.blog-card-thumb.cat-ai {
  background: linear-gradient(135deg, #2d2b5e, #5b5fc7);
}
.blog-card-thumb.cat-ops {
  background: linear-gradient(135deg, #4a3520, #c4813a);
}
.blog-card-content {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.blog-card-content .badge {
  align-self: flex-start;
}
.blog-card-title {
  font-size: 16px;
  font-weight: 650;
  line-height: 1.4;
  letter-spacing: -.01em;
  margin: 0;
}
.blog-card-summary {
  font-size: 13px;
  line-height: 1.65;
  color: var(--muted);
  margin: 0;
  flex: 1;
}
.blog-card-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 4px;
}
.blog-card-avatar {
  width: 32px;
  height: 32px;
  font-size: 13px;
  border-radius: 50%;
}
.blog-card-meta-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.blog-card-meta-text strong {
  font-size: 13px;
  font-weight: 600;
}
.blog-card-meta-text span {
  font-size: 11px;
  color: var(--faint);
}

/* ── Blog Detail ── */
.blog-detail-reading-bar {
  position: sticky;
  top: 0;
  z-index: 10;
  height: 3px;
  background: var(--line);
}
.blog-detail-reading-bar span {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--teal), #62c7bb);
  transition: width .1s linear;
}

.blog-detail-workspace {
  background: #fbfcfe;
}

.blog-detail-layout {
  max-width: 920px;
  margin: 0 auto;
  padding-top: 28px;
  padding-bottom: 72px;
}

.blog-detail-back {
  margin-bottom: 20px;
}
.blog-detail-back .btn {
  font-size: 13px;
  gap: 6px;
}

.blog-detail-hero {
  display: grid;
  gap: 16px;
  margin-bottom: 28px;
}
.blog-detail-hero .badge {
  justify-self: start;
}
.blog-detail-title {
  font-size: clamp(28px, 4vw, 40px);
  font-weight: 750;
  line-height: 1.2;
  letter-spacing: -.025em;
  margin: 0;
}
.blog-detail-lead {
  font-size: 16px;
  line-height: 1.75;
  color: var(--muted);
  margin: 0;
  max-width: 720px;
}
.blog-detail-author {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-top: 8px;
}
.blog-detail-author-avatar {
  width: 44px;
  height: 44px;
  font-size: 16px;
  border-radius: 50%;
}
.blog-detail-author-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.blog-detail-author-info strong {
  font-size: 14px;
  font-weight: 650;
}
.blog-detail-author-info span {
  font-size: 12px;
  color: var(--faint);
}
.blog-detail-read-time {
  margin-left: auto;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 12px;
  background: var(--cream);
}

.blog-detail-cover {
  border-radius: 14px;
  overflow: hidden;
  margin-bottom: 36px;
  aspect-ratio: 21 / 8;
  position: relative;
  background: var(--cream);
}
.blog-detail-cover::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(15, 27, 45, 0) 45%, rgba(15, 27, 45, .18) 100%);
  z-index: 1;
}

.blog-detail-cover img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

/* Body with TOC sidebar */
.blog-detail-body-wrap {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  gap: 40px;
  align-items: start;
}
.blog-detail-toc {
  position: sticky;
  top: 20px;
}
.blog-detail-toc strong {
  display: block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--faint);
  margin-bottom: 12px;
}
.blog-detail-toc ol {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 6px;
  border-left: 2px solid var(--line);
  padding-left: 14px;
}
.blog-detail-toc li a {
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  line-height: 1.5;
  display: block;
  padding: 4px 0;
  transition: color .15s;
}
.blog-detail-toc li a:hover {
  color: var(--teal-dark);
}

/* Article body content */
.blog-detail-content {
  min-width: 0;
}
.blog-detail-section {
  margin-bottom: 36px;
}
.blog-detail-section h2 {
  font-size: 20px;
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: -.01em;
  margin: 0 0 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.blog-detail-section .wp-heading.heading2 {
  font-size: 28px;
  line-height: 1.35;
  font-weight: 650;
  letter-spacing: 0;
}

.blog-detail-section .wp-heading.heading3 {
  font-size: 22px;
  line-height: 1.45;
  font-weight: 650;
  letter-spacing: 0;
  padding: 0 0 0 14px;
  border-bottom: 0;
  border-left: 4px solid var(--teal);
}

.blog-detail-section .wp-heading.heading4 {
  font-size: 18px;
  line-height: 1.5;
  font-weight: 650;
  letter-spacing: 0;
  color: var(--muted);
  border-bottom: 0;
  padding-bottom: 0;
}

.blog-detail-section p {
  font-size: 15px;
  line-height: 1.9;
  color: #344054;
  margin: 0;
}

.blog-detail-section .wp-paragraph,
.blog-detail-section .wp-paragraph p {
  font-size: 16px;
  line-height: 1.95;
  color: #344054;
}

.blog-detail-section .wp-paragraph p {
  margin: 0 0 1em;
}

.blog-detail-section .wp-paragraph p:last-child {
  margin-bottom: 0;
}

.blog-detail-section .wp-quote p {
  font-size: 19px;
  line-height: 1.75;
  color: var(--ink);
}

.blog-detail-section .wp-paragraph > :where(p, ul, ol, blockquote, pre, table) {
  margin: 0 0 1em;
}

.blog-detail-section .wp-paragraph > :last-child {
  margin-bottom: 0;
}

.blog-detail-section :where(ul, ol) {
  margin: 14px 0 0;
  padding-left: 1.45em;
  display: grid;
  gap: 8px;
}

.blog-detail-section li {
  font-size: 16px;
  line-height: 1.9;
  color: #344054;
  padding-left: 4px;
}

.blog-detail-section li::marker {
  color: var(--teal-dark);
  font-weight: 800;
}

.blog-detail-section strong,
.blog-detail-section b {
  color: var(--ink);
  font-weight: 800;
}

.blog-detail-section em,
.blog-detail-section i {
  color: var(--teal-dark);
  font-style: normal;
  font-weight: 650;
}

.blog-detail-section a {
  color: var(--teal-dark);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}

.blog-detail-section a:hover {
  color: var(--ink);
}

.blog-detail-section code {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f8fafc;
  color: #475467;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: .92em;
  padding: 2px 6px;
}

.blog-detail-section pre {
  margin: 18px 0 0;
  padding: 18px 20px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #101828;
  color: #f8fafc;
  line-height: 1.75;
}

.blog-detail-section pre code {
  border: 0;
  border-radius: 0;
  background: transparent;
  color: inherit;
  padding: 0;
}

.blog-detail-section .wp-quote,
.blog-detail-section blockquote {
  margin: 0;
  border-left: 4px solid var(--teal);
  border-radius: 10px;
  background: #f3faf8;
  padding: 22px 24px;
  box-shadow: inset 0 0 0 1px rgba(107, 190, 181, .18);
}

.blog-detail-section .wp-quote p,
.blog-detail-section blockquote p {
  margin: 0 0 .8em;
  font-size: 18px;
  line-height: 1.85;
  color: var(--ink);
}

.blog-detail-section .wp-quote > :last-child,
.blog-detail-section blockquote > :last-child {
  margin-bottom: 0;
}

.blog-detail-section hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 34px 0;
}

.blog-detail-section table {
  width: 100%;
  margin: 18px 0 0;
  border-collapse: separate;
  border-spacing: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
}

.blog-detail-section th,
.blog-detail-section td {
  padding: 12px 14px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  font-size: 14px;
  line-height: 1.7;
}

.blog-detail-section th:last-child,
.blog-detail-section td:last-child {
  border-right: 0;
}

.blog-detail-section tr:last-child td {
  border-bottom: 0;
}

.blog-detail-section th {
  background: #f8fafc;
  color: var(--ink);
  font-weight: 750;
}

.blog-detail-section .wp-single-image {
  margin: 0;
}

.blog-detail-section .wp-single-image img,
.blog-detail-section > img {
  display: block;
  width: 100%;
  max-height: 560px;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #f8fafc;
}

.blog-detail-section .wp-single-image figcaption {
  margin-top: 10px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.article-body .learning-detail-section {
  margin: 0 0 28px;
}

.article-body .learning-detail-section:last-child {
  margin-bottom: 0;
}

.article-body .learning-detail-section.wp-heading-section {
  margin-top: 34px;
  margin-bottom: 14px;
}

.article-body .learning-detail-section.wp-heading-section:first-child {
  margin-top: 0;
}

.article-body .learning-detail-section.wp-html-section > .infographic-embed,
.article-body .learning-detail-section.wp-html-section > .blog-detail-steps,
.article-body .learning-detail-section.wp-html-section > .blog-detail-callout,
.article-body .learning-detail-section.wp-html-section > .infographic-generated {
  margin-top: 0;
  margin-bottom: 0;
}

/* Step cards (infographic replacement) */
.blog-detail-steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-top: 16px;
}
.blog-step-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
  padding: 18px 16px;
  display: grid;
  gap: 8px;
  text-align: center;
  transition: border-color .2s, box-shadow .2s;
}
.blog-step-card:hover {
  border-color: var(--teal);
  box-shadow: 0 4px 16px rgba(84, 184, 173, .12);
}
.blog-step-num {
  display: block;
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -.02em;
  color: var(--teal);
}
.blog-step-card strong {
  font-size: 15px;
  font-weight: 700;
}
.blog-step-card p {
  font-size: 12px;
  color: var(--muted);
  margin: 0;
  line-height: 1.5;
}

/* Callout */
.blog-detail-callout {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  padding: 22px 24px;
  border-radius: 14px;
  background: linear-gradient(135deg, #e9f8f6, #f0faf8);
  border: 1px solid rgba(84, 184, 173, .25);
}
.blog-detail-callout-icon {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--teal);
  color: #fff;
  display: grid;
  place-items: center;
}
.blog-detail-callout strong {
  display: block;
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--teal-dark);
}
.blog-detail-callout p {
  font-size: 14px;
  line-height: 1.7;
  color: #344054;
  margin: 0;
}

/* Share bar */
.blog-detail-share {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}
.blog-detail-share > span {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}
.blog-detail-share-btns {
  display: flex;
  gap: 8px;
}

/* Related articles */
.blog-detail-related {
  margin-top: 48px;
  padding-top: 32px;
  border-top: 1px solid var(--line);
}
.blog-detail-related > h2 {
  font-size: 18px;
  font-weight: 700;
  margin: 0 0 20px;
}
.blog-detail-related-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  align-items: stretch;
}
.blog-detail-related-grid .blog-card {
  max-width: none;
  min-width: 0;
  height: 100%;
}
.blog-detail-related-grid .blog-card-thumb {
  height: 112px;
}
.blog-detail-related-grid .blog-card-content {
  padding: 16px;
  gap: 8px;
}
.blog-detail-related-grid .blog-card-title {
  display: -webkit-box;
  min-height: 42px;
  overflow: hidden;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.blog-detail-related-grid .blog-card-summary {
  display: -webkit-box;
  overflow: hidden;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.blog-detail-related-grid .blog-card-meta {
  min-width: 0;
}
.blog-detail-related-grid .blog-card-meta-text {
  min-width: 0;
}
.blog-detail-related-grid .blog-card-meta-text span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── Blog responsive ── */
@media (max-width: 980px) {
  .blog-featured {
    grid-template-columns: 1fr;
  }
  .blog-featured-img {
    min-height: 180px;
  }
  .blog-grid {
    grid-template-columns: 1fr;
  }
  .blog-detail-body-wrap {
    grid-template-columns: 1fr;
    gap: 0;
  }
  .blog-detail-toc {
    position: static;
    margin-bottom: 28px;
    padding: 16px;
    border-radius: 10px;
    background: var(--cream);
    border: 1px solid var(--line);
  }
  .blog-detail-toc ol {
    border-left: 0;
    padding-left: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 4px 12px;
  }
  .blog-detail-steps {
    grid-template-columns: repeat(2, 1fr);
  }
  .infographic-generated-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .blog-detail-share {
    flex-direction: column;
    align-items: flex-start;
  }
}
@media (max-width: 720px) {
  .blog-detail-related-grid {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 600px) {
  .blog-detail-steps {
    grid-template-columns: 1fr;
  }
  .infographic-generated-grid {
    grid-template-columns: 1fr;
  }
  .blog-detail-cover {
    aspect-ratio: 16 / 7;
  }
}

.publish-result-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.publish-result-list.expanded {
  margin-top: 8px;
}

.sns-topic-modal {
  width: min(860px, 100%);
}

.sns-topic-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.sns-topic-row {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--cream);
  padding: 12px;
}

.sns-topic-index {
  width: 30px;
  height: 30px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: #eff6ff;
  color: #1d4ed8;
  font-weight: 700;
  font-size: 12px;
}

.sns-topic-row strong,
.sns-topic-row p,
.sns-topic-row small {
  display: block;
}

.sns-topic-row p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.sns-topic-row small {
  margin-top: 5px;
  color: var(--faint);
}

.badge.publish-result {
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.badge.publish-result.success {
  background: #ecfdf5;
  color: #047857;
}
.badge.publish-result.failed {
  background: #fef2f2;
  color: #dc2626;
}
.badge.publish-result.skipped {
  background: #f8fafc;
  color: #64748b;
}

.file-badge-stack {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.public-url-box {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 16px 0;
}
.public-url-field,
#filePublicUrlValue {
  overflow-wrap: anywhere;
  font-size: 13px;
}
.compact-actions {
  margin-top: 10px;
  gap: 8px;
}
.inline-switch {
  min-height: 44px;
  justify-content: flex-start;
}
.file-view-image video {
  width: 100%;
  max-height: 420px;
  border-radius: 8px;
  background: #0f172a;
}

.backup-operations-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(420px, .88fr);
  gap: 24px;
  align-items: start;
  margin-bottom: 24px;
}

.backup-control-card,
.backup-validate-card {
  display: grid;
  gap: 22px;
  min-width: 0;
  overflow: visible;
  padding: 28px;
}

.backup-control-card {
  align-content: start;
}

.backup-control-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  min-width: 0;
}

.backup-control-head > div:first-child {
  min-width: 0;
}

.backup-control-head h2 {
  margin: 4px 0 0;
  line-height: 1.25;
}
.backup-head-actions,
.backup-form-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: flex-end;
  flex-wrap: wrap;
  min-width: 0;
  flex: 0 0 auto;
}

.backup-head-actions .btn,
.backup-form-actions .btn,
.backup-card-actions .btn {
  white-space: nowrap;
}

.backup-settings-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 16px;
  align-items: end;
}

.backup-settings-grid label {
  display: grid;
  gap: 7px;
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .02em;
}

.backup-settings-grid > label {
  grid-column: span 2;
}

.backup-settings-grid > .backup-toggle {
  grid-column: span 3;
}

.backup-toggle {
  display: flex !important;
  align-items: center;
  gap: 10px;
  min-height: 56px;
  padding: 10px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
  text-transform: none;
  letter-spacing: 0;
  line-height: 1.45;
}

.backup-file-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
  align-items: stretch;
}

.backup-file-picker {
  display: grid;
  gap: 10px;
  min-width: 0;
  padding: 18px;
  border: 1px dashed var(--line-strong);
  border-radius: 12px;
  background: #f8fafc;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.backup-file-picker input[type="file"] {
  width: 100%;
  min-height: 50px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.backup-file-picker small {
  display: block;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.backup-table-card,
.restore-table-card {
  overflow-x: auto;
  padding: 0;
  margin-bottom: 24px;
}

.backup-table-card table,
.restore-table-card table {
  min-width: 1120px;
}

.backup-table-card .section-head,
.restore-table-card .section-head {
  padding: 24px 28px 18px;
  margin: 0;
}

.backup-table-card th,
.restore-table-card th {
  white-space: nowrap;
}

.backup-table-card th,
.backup-table-card td,
.restore-table-card th,
.restore-table-card td {
  vertical-align: middle;
  padding: 16px 22px;
}

.backup-table-card td:nth-child(4),
.backup-table-card td:nth-child(6) {
  max-width: 280px;
  overflow-wrap: anywhere;
}

.backup-table-card .table-actions,
.restore-table-card .table-actions {
  flex-wrap: nowrap;
  gap: 8px;
}

@media (max-width: 1180px) {
  .backup-operations-grid {
    grid-template-columns: 1fr;
  }

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

  .backup-settings-grid > label,
  .backup-settings-grid > .backup-toggle {
    grid-column: span 1;
  }
}

.inline-form .input {
  min-width: 0;
}
.backup-validation {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: #fff;
  min-width: 0;
}
.backup-validation.is-invalid {
  border-color: #fecaca;
}
.compact-table {
  margin-top: 14px;
  box-shadow: none;
}
.summary-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}
.summary-list div {
  border: 1px solid var(--line);
  background: #fff;
  padding: 12px;
}
.summary-list span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 4px;
}
.summary-list strong {
  font-size: 18px;
  font-weight: 650;
}
.table-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.test-account-card {
  display: grid;
  grid-template-columns: minmax(220px, 320px) minmax(0, 1fr);
  gap: 18px;
  padding: 18px;
  margin-bottom: 16px;
  align-items: start;
}

.test-account-card h2 {
  margin: 4px 0 6px;
}

.test-account-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.test-account-item {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 12px;
}

.test-account-item strong,
.test-account-item small {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.test-account-item strong {
  margin-bottom: 8px;
}

.test-account-item small {
  margin-top: 8px;
  color: var(--muted);
}

.detail-action-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.detail-action-row .btn {
  width: auto;
}

.segmented {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  max-width: 100%;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f8fafc;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .65);
}

.segmented button {
  min-height: 34px;
  padding: 0 14px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0;
  white-space: nowrap;
  cursor: pointer;
  transition: background .15s ease, color .15s ease, box-shadow .15s ease;
}

.segmented button:hover {
  color: var(--ink);
  background: rgba(255, 255, 255, .75);
}

.segmented button.active,
.segmented button[aria-selected="true"] {
  background: #fff;
  color: var(--ink);
  box-shadow: 0 1px 2px rgba(15, 27, 45, .08), 0 0 0 1px rgba(15, 27, 45, .04);
}

.segmented button:focus-visible {
  outline: 2px solid rgba(91, 188, 178, .45);
  outline-offset: 2px;
}

@media (max-width: 760px) {
  .backup-operations-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .backup-control-card,
  .backup-validate-card {
    padding: 20px;
  }
  .backup-control-head,
  .backup-head-actions,
  .backup-file-form,
  .backup-form-actions {
    align-items: stretch;
    flex-direction: column;
  }
  .backup-file-form {
    display: flex;
  }
  .backup-settings-grid {
    grid-template-columns: 1fr;
  }
  .backup-settings-grid > label,
  .backup-settings-grid > .backup-toggle {
    grid-column: auto;
  }
  .summary-list {
    grid-template-columns: 1fr;
  }
  .test-account-card,
  .test-account-list {
    grid-template-columns: 1fr;
  }
  .settings-test-result-row {
    grid-template-columns: 1fr;
    align-items: flex-start;
  }
  .settings-test-result-row small {
    white-space: normal;
  }
  .detail-action-row {
    align-items: flex-start;
    flex-direction: column;
  }
}

/* Calendar page layout guards. Keep these near the end so shared card/form rules do not break the calendar. */
.calendar-page {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  padding-bottom: 32px;
}

.calendar-page .card {
  box-sizing: border-box;
}

.calendar-page .calendar-toolbar.card,
.calendar-page .calendar-nav.card,
.calendar-page .calendar-layout.card,
.calendar-page .calendar-agenda.card {
  width: 100%;
  min-width: 0;
  padding: 20px;
}

.calendar-page .calendar-toolbar {
  align-items: flex-start;
  flex-wrap: wrap;
}

.calendar-page .calendar-toolbar > div:first-child {
  flex: 1 1 360px;
  min-width: 240px;
}

.calendar-page .calendar-toolbar h1 {
  max-width: 100%;
  overflow-wrap: anywhere;
}

.calendar-page .calendar-toolbar-actions {
  flex: 0 1 auto;
  max-width: 100%;
  margin-left: auto;
}

.calendar-page .segmented {
  display: inline-flex;
  max-width: 100%;
  overflow: hidden;
  flex-wrap: nowrap;
}

.calendar-page .segmented button,
.calendar-page .calendar-nav .btn {
  white-space: nowrap;
}

.calendar-page .calendar-nav {
  align-items: center;
  flex-wrap: wrap;
}

.calendar-page .calendar-nav > div {
  min-width: 220px;
  margin-right: auto;
}

.calendar-page .calendar-layout {
  overflow-x: auto;
}

.calendar-page .calendar-weekdays,
.calendar-page .calendar-month-grid,
.calendar-page .calendar-week-board,
.calendar-page .calendar-week-grid {
  width: 100%;
}

.calendar-page .calendar-day-cell {
  box-sizing: border-box;
  min-width: 0;
  overflow: hidden;
  position: relative;
  padding-top: 44px;
}

.calendar-page .calendar-day-cell > span {
  position: absolute;
  top: 10px;
  left: 10px;
}

.calendar-page .calendar-day-cell .calendar-date-number {
  position: absolute !important;
  top: 12px !important;
  left: 12px !important;
  margin: 0 !important;
  transform: none !important;
}

.calendar-page .calendar-day-cell small,
.calendar-page .calendar-day-cell em,
.calendar-page .calendar-compact-event,
.calendar-page .calendar-event-card > div:nth-child(2) {
  max-width: 100%;
  min-width: 0;
}

.calendar-page .calendar-event-card {
  min-width: 0;
}

@media (max-width: 1100px) {
  .calendar-page .calendar-weekdays,
  .calendar-page .calendar-month-grid,
  .calendar-page .calendar-week-board,
  .calendar-page .calendar-week-grid {
    min-width: 760px;
  }
}

@media (max-width: 720px) {
  .toast {
    top: 14px;
    right: 14px;
    left: 14px;
    max-width: none;
  }

  .floating-note-widget {
    right: 14px;
    bottom: 14px;
  }

  .floating-note-button {
    width: 52px;
    height: 52px;
  }

  .floating-note-panel {
    right: 0;
    bottom: 62px;
    width: calc(100vw - 28px);
    max-height: 82vh;
  }

  .calendar-page .calendar-toolbar,
  .calendar-page .calendar-nav {
    display: grid;
    grid-template-columns: 1fr;
  }

  .calendar-page .calendar-toolbar-actions {
    justify-content: stretch;
    margin-left: 0;
  }

  .calendar-page .segmented {
    width: 100%;
  }

  .calendar-page .segmented button {
    flex: 1 1 0;
  }

  .calendar-page .calendar-year-grid {
    grid-template-columns: 1fr;
  }
}

/* Calendar day numbers must stay pinned to the cell corner, even when events exist. */
.calendar-page .calendar-month-grid .calendar-day-cell {
  align-items: flex-start !important;
  justify-content: flex-start !important;
  padding: 50px 12px 12px !important;
  position: relative !important;
  text-align: left !important;
}

.calendar-page .calendar-month-grid .calendar-day-cell > .calendar-date-number {
  left: 12px !important;
  margin: 0 !important;
  position: absolute !important;
  top: 12px !important;
  transform: none !important;
}
