:root {
  --ink: #17211f;
  --muted: #63716d;
  --line: #dfe7e3;
  --soft: #f4f7f5;
  --panel: #ffffff;
  --brand: #176b56;
  --brand-dark: #0d4e3e;
  --accent: #dff3e9;
  --warning: #9a5f08;
  --danger: #a53b38;
  --shadow: 0 18px 55px rgba(28, 49, 42, .08);
  --radius: 18px;
}

* { box-sizing: border-box; }
html { max-width: 100%; background: #f7f9f8; }
body {
  max-width: 100%;
  margin: 0;
  overflow-x: hidden;
  color: var(--ink);
  background:
    radial-gradient(circle at 85% 0%, rgba(196, 230, 216, .55), transparent 32rem),
    #f7f9f8;
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }

.app-shell {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  min-height: 100vh;
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
}
.sidebar {
  min-width: 0;
  max-width: 100%;
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 28px 20px 20px;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--line);
  background: rgba(255, 255, 255, .86);
  backdrop-filter: blur(18px);
}
.brand { min-width: 0; display: flex; gap: 12px; align-items: center; padding: 0 10px 22px; }
.brand-mark {
  width: 42px; height: 42px; display: grid; place-items: center;
  border-radius: 13px; color: white; font-weight: 800; font-size: 20px;
  background: linear-gradient(145deg, var(--brand), #259678);
  box-shadow: 0 8px 20px rgba(23, 107, 86, .22);
}
.brand-copy { min-width: 0; }
.brand strong, .brand small { display: block; }
.brand strong { font-size: 17px; letter-spacing: -.02em; }
.brand small {
  margin-top: 2px;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sidebar-quick-add { width: 100%; margin: 0 0 20px; }
.nav-list { min-width: 0; display: grid; gap: 18px; }
.nav-group { min-width: 0; display: grid; gap: 5px; }
.nav-group-label {
  padding: 0 12px 3px;
  color: #8a9692;
  font-size: 9px;
  font-weight: 850;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.nav-list a {
  min-height: 44px; padding: 0 12px; border-radius: 12px;
  display: flex; align-items: center; justify-content: space-between;
  color: #4e5c58; font-size: 14px; font-weight: 600;
}
.nav-list a.active { background: var(--accent); color: var(--brand-dark); }
.nav-list a[aria-disabled="true"] { opacity: .55; cursor: default; }
.nav-list em {
  font-style: normal; font-size: 10px; color: var(--muted);
  padding: 3px 6px; border: 1px solid var(--line); border-radius: 999px;
}
.sidebar-note {
  margin-top: auto; padding: 13px 12px; border: 1px solid var(--line);
  background: var(--soft); border-radius: 14px; display: flex; align-items: center; gap: 10px;
}
.status-dot {
  width: 9px; height: 9px; border-radius: 50%; background: #24a378;
  box-shadow: 0 0 0 5px rgba(36, 163, 120, .12);
}
.sidebar-note strong, .sidebar-note small { display: block; }
.sidebar-note strong { font-size: 12px; }
.sidebar-note small { margin-top: 2px; color: var(--muted); font-size: 10px; }
.user-panel {
  margin-top: 14px; padding: 12px 8px 0; border-top: 1px solid var(--line);
  display: flex; align-items: center; gap: 10px;
}
.avatar {
  width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center;
  color: var(--brand-dark); background: var(--accent); font-weight: 800;
}
.user-copy { flex: 1; min-width: 0; }
.user-copy strong, .user-copy small { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-copy strong { font-size: 12px; }
.user-copy small { color: var(--muted); font-size: 10px; margin-top: 2px; }
.icon-button {
  border: 0; color: var(--muted); background: transparent; font-size: 11px; padding: 7px;
}
.main-content { width: 100%; min-width: 0; max-width: 100%; padding: 44px clamp(28px, 5vw, 78px) 64px; }
.page-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 28px; }
.eyebrow { color: var(--brand); text-transform: uppercase; letter-spacing: .12em; font-size: 11px; font-weight: 800; }
h1 { margin: 7px 0 8px; font-size: clamp(30px, 4vw, 46px); line-height: 1.05; letter-spacing: -.045em; }
h2 { margin: 0; font-size: 22px; letter-spacing: -.025em; }
.lede { margin: 0; max-width: 680px; color: var(--muted); line-height: 1.7; font-size: 14px; }
.button {
  border: 1px solid transparent; border-radius: 11px; min-height: 42px; padding: 0 16px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-size: 13px; font-weight: 700;
}
.button-primary { color: white; background: var(--brand); box-shadow: 0 8px 18px rgba(23,107,86,.18); }
.button-primary:hover { background: var(--brand-dark); }
.button-secondary { border-color: var(--line); background: white; color: var(--ink); }
.button-danger { color: white; background: var(--danger); }
.panel { border: 1px solid var(--line); background: rgba(255,255,255,.92); border-radius: var(--radius); box-shadow: var(--shadow); }
.messages { display: grid; gap: 8px; margin-bottom: 20px; }
.message { padding: 12px 14px; border: 1px solid var(--line); background: white; border-radius: 11px; font-size: 13px; }
.message-error { color: var(--danger); border-color: #efcecc; background: #fff5f4; }
.message-success { color: var(--brand-dark); border-color: #c8e7db; background: #effbf6; }
.message-warning { color: #80500b; border-color: #eed8ad; background: #fff8e8; }
.field { display: grid; gap: 7px; }
.field label { color: #44514d; font-size: 12px; font-weight: 700; }
.field input, .field select, .field textarea {
  width: 100%; min-height: 44px; border: 1px solid #d7e0dc; border-radius: 11px;
  padding: 10px 12px; color: var(--ink); background: white; outline: none;
}
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: #5aa68f; box-shadow: 0 0 0 4px rgba(38, 146, 115, .11);
}
.errorlist { margin: 5px 0 0; padding: 0; list-style: none; color: var(--danger); font-size: 12px; }
.helptext { color: var(--muted); font-size: 11px; line-height: 1.5; }
.empty-state { padding: 64px 30px; text-align: center; }
.empty-state .empty-mark {
  width: 58px; height: 58px; display: grid; place-items: center; margin: 0 auto 16px;
  border-radius: 18px; background: var(--accent); color: var(--brand); font-weight: 900; font-size: 22px;
}
.empty-state p { color: var(--muted); margin: 10px auto 20px; max-width: 420px; line-height: 1.65; }
.badge {
  display: inline-flex; align-items: center; min-height: 25px; padding: 0 9px;
  border-radius: 999px; background: var(--soft); color: #52605c; font-size: 10px; font-weight: 800;
}
.badge-pass { background: #e7f7f0; color: #176b56; }
.badge-warn { background: #fff2d9; color: #8a5508; }
.badge-block { background: #fde8e7; color: #9b3632; }
.login-page {
  min-height: 100vh; display: grid; grid-template-columns: minmax(320px, 1fr) minmax(430px, .9fr);
  background: #eef4f0;
}
.login-visual {
  position: relative; overflow: hidden; padding: clamp(38px, 7vw, 90px);
  display: flex; flex-direction: column; justify-content: space-between;
  color: white; background:
    linear-gradient(135deg, rgba(10,55,44,.97), rgba(20,108,84,.91)),
    #0e5e49;
}
.login-visual::after {
  content: ""; position: absolute; width: 520px; height: 520px; right: -170px; bottom: -180px;
  border: 1px solid rgba(255,255,255,.18); border-radius: 50%;
  box-shadow: 0 0 0 65px rgba(255,255,255,.035), 0 0 0 140px rgba(255,255,255,.025);
}
.login-logo { display: flex; gap: 12px; align-items: center; position: relative; z-index: 1; }
.login-logo .brand-mark { background: white; color: var(--brand-dark); box-shadow: none; }
.login-pitch { position: relative; z-index: 1; max-width: 590px; padding: 80px 0; }
.login-pitch h1 { font-size: clamp(42px, 6vw, 72px); margin-bottom: 20px; }
.login-pitch p { color: rgba(255,255,255,.72); font-size: 16px; line-height: 1.8; max-width: 520px; }
.trust-list { display: flex; flex-wrap: wrap; gap: 10px; position: relative; z-index: 1; }
.trust-list span { padding: 8px 11px; border: 1px solid rgba(255,255,255,.2); border-radius: 999px; color: rgba(255,255,255,.83); font-size: 11px; }
.login-form-wrap { padding: clamp(30px, 7vw, 90px); display: grid; place-items: center; background: #fbfdfc; }
.login-card { width: min(420px, 100%); }
.login-card h2 { font-size: 30px; margin-bottom: 10px; }
.login-card > p { color: var(--muted); line-height: 1.65; margin: 0 0 30px; }
.form-stack { display: grid; gap: 17px; }
.login-card .button { width: 100%; min-height: 48px; margin-top: 4px; }
.private-hint { margin-top: 22px; padding: 13px 14px; border-radius: 12px; background: var(--soft); color: var(--muted); font-size: 11px; line-height: 1.6; }
.login-eyebrow { color: #aee4d0; }
.login-logo strong, .login-logo small { display: block; }
.login-logo small { margin-top: 3px; color: rgba(255,255,255,.62); font-size: 10px; }
.narrow-page { width: min(760px, 100%); margin: 0 auto; }
.form-panel { padding: clamp(24px, 4vw, 38px); }
.form-spaced { margin-top: 26px; }
.form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 8px; }
.source-examples h2 { margin: 7px 0 16px; }
.source-examples pre {
  margin: 0 0 14px;
  padding: 16px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--soft);
  line-height: 1.8;
}
.breadcrumb { margin-bottom: 22px; color: var(--muted); font-size: 12px; font-weight: 700; }
.catalog-page { width: min(1240px, 100%); margin: 0 auto; }
.filter-bar {
  display: grid;
  grid-template-columns: minmax(220px, 1.6fr) minmax(150px, .7fr) minmax(150px, .7fr) auto auto;
  gap: 11px;
  align-items: end;
  padding: 15px;
  margin-bottom: 24px;
  box-shadow: none;
}
.filter-bar label { display: grid; gap: 6px; }
.filter-bar label span { color: var(--muted); font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
.filter-bar input, .filter-bar select {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0 11px;
  background: white;
  color: var(--ink);
  outline: none;
}
.filter-bar input:focus, .filter-bar select:focus { border-color: #60a990; box-shadow: 0 0 0 4px rgba(38,146,115,.1); }
.skill-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.skill-card {
  min-width: 0;
  min-height: 262px;
  display: flex;
  flex-direction: column;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: rgba(255,255,255,.9);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.skill-card:hover { transform: translateY(-2px); border-color: #bdd7cc; box-shadow: var(--shadow); }
.skill-card-top { display: flex; align-items: center; gap: 11px; }
.skill-icon {
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 13px;
  color: var(--brand-dark);
  background: linear-gradient(145deg, #e6f5ee, #cdeadd);
  font-size: 18px;
  font-weight: 900;
}
.skill-icon-large { width: 68px; height: 68px; border-radius: 20px; font-size: 28px; }
.skill-card-title { flex: 1; min-width: 0; }
.skill-card-title h2 { font-size: 16px; margin-bottom: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
code { color: #48615a; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11px; overflow-wrap: anywhere; }
.skill-summary { min-height: 65px; margin: 18px 0 14px; color: var(--muted); line-height: 1.65; font-size: 13px; }
.badge-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.skill-card-footer {
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 11px;
}
.skill-card-footer a { margin-left: auto; color: var(--brand); font-weight: 800; }
.tool-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.tool-card { min-height: 284px; }
.tool-source {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  margin: 15px 0;
  color: var(--muted);
  font-size: 11px;
}
.tool-source a {
  min-width: 0;
  overflow: hidden;
  color: var(--brand);
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.security-notice {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 15px 16px;
  border: 1px solid #eed8ad;
  border-radius: 13px;
  background: #fff8e8;
  color: #70480d;
  font-size: 12px;
  line-height: 1.65;
}
.security-notice strong { display: block; margin-bottom: 2px; color: #80500b; }
.security-notice p { margin: 0; }
.tool-list-notice { margin-bottom: 24px; }
.security-notice-mark {
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: #f9e8c4;
  color: var(--warning);
  font-weight: 900;
}
.pagination { margin-top: 24px; display: flex; align-items: center; justify-content: center; gap: 12px; color: var(--muted); font-size: 12px; }
.detail-page { width: min(1180px, 100%); margin: 0 auto; }
.detail-hero { padding: clamp(24px, 4vw, 38px); display: flex; align-items: flex-end; justify-content: space-between; gap: 26px; }
.detail-title-row { display: flex; align-items: flex-start; gap: 18px; }
.detail-title-row h1 { margin-bottom: 10px; }
.detail-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 8px; }
.detail-grid { display: grid; grid-template-columns: minmax(260px, .7fr) minmax(0, 1.3fr); gap: 16px; margin-top: 16px; }
.detail-section { padding: 24px; box-shadow: none; }
.detail-section h2 { margin-bottom: 18px; }
.rich-copy { color: var(--muted); font-size: 13px; line-height: 1.75; }
.metadata-list { display: grid; grid-template-columns: 100px 1fr; gap: 12px; margin: 24px 0 0; padding-top: 20px; border-top: 1px solid var(--line); font-size: 12px; }
.metadata-list dt { color: var(--muted); }
.metadata-list dd { margin: 0; font-weight: 650; }
.table-scroll { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 11px; }
.data-table th { padding: 10px; color: var(--muted); text-align: left; font-size: 9px; text-transform: uppercase; letter-spacing: .08em; border-bottom: 1px solid var(--line); }
.data-table td { padding: 13px 10px; vertical-align: top; border-bottom: 1px solid #edf1ef; }
.table-scroll .data-table { min-width: 760px; }
.import-filter-bar {
  grid-template-columns: minmax(180px, .8fr) minmax(200px, 1fr) auto auto;
  justify-content: start;
}
.import-table-panel { padding: 8px 16px; box-shadow: none; }
.import-table { min-width: 860px !important; }
.import-table td { vertical-align: middle; }
.import-table strong, .table-subline, .table-error { display: block; }
.table-subline { margin-top: 5px; color: var(--muted); font-size: 9px; }
.table-error { margin-top: 5px; color: var(--danger); font-size: 9px; font-weight: 750; }
.table-link { color: var(--brand); font-weight: 800; white-space: nowrap; }
.task-name-link { color: var(--ink); }
.task-name-link:hover { color: var(--brand); }
.table-scroll-hint {
  display: none;
  margin: 4px 10px 8px;
  color: var(--muted);
  font-size: 10px;
}
.progress-track {
  width: 92px;
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: #e7eeeb;
}
.progress-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--brand), #3ca786);
}
.empty-actions { justify-content: center; }
.inline-empty { padding: 30px; border-radius: 12px; background: var(--soft); color: var(--muted); text-align: center; font-size: 12px; }
.favorite-form { margin-top: 16px; }
.inline-action-form { display: inline-flex; margin: 0; }
.confirm-panel { padding: 38px; margin-top: 60px; }
.confirm-panel h1 { font-size: 30px; }
.confirm-panel p { color: var(--muted); line-height: 1.7; }
.review-card { min-height: 280px; }
.scan-metrics { display: flex; flex-wrap: wrap; gap: 7px; margin: 4px 0 16px; }
.scan-metrics span { padding: 8px 10px; border-radius: 9px; background: var(--soft); color: var(--muted); font-size: 9px; font-weight: 800; }
.scan-metrics strong { color: var(--ink); font-size: 14px; margin-right: 3px; }
.scan-metrics-large { margin: 0 0 15px; }
.scan-metrics-large span { padding: 11px 13px; }
.digest-line { color: var(--muted); font-size: 11px; margin: 0 0 18px; }
.metadata-list-wide { grid-template-columns: 120px minmax(0, 1fr); }
.review-decision-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 16px; }
.review-decision-grid textarea { min-height: 105px; resize: vertical; }
.review-decision-grid button:disabled { opacity: .45; cursor: not-allowed; }
.review-history { margin-top: 16px; }
.history-row { display: flex; align-items: flex-start; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.history-row:last-child { border-bottom: 0; }
.history-row small { display: block; color: var(--muted); margin-top: 4px; }
.history-row p { margin: 7px 0 0; color: var(--muted); font-size: 12px; }

.library-filter-bar {
  display: grid;
  gap: 13px;
  padding: 15px;
  margin-bottom: 24px;
  box-shadow: none;
}
.library-search-row {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto auto;
  gap: 11px;
  align-items: end;
}
.library-search-field,
.library-filter-options label {
  min-width: 0;
  display: grid;
  gap: 6px;
}
.library-search-field > span,
.library-filter-options label > span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.library-search-field input,
.library-filter-options select {
  width: 100%;
  min-width: 0;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0 11px;
  outline: none;
  color: var(--ink);
  background: white;
}
.library-search-field input:focus,
.library-filter-options select:focus {
  border-color: #60a990;
  box-shadow: 0 0 0 4px rgba(38,146,115,.1);
}
.library-filter-disclosure { min-width: 0; }
.library-filter-toggle,
.library-filter-summary { display: none; }
.library-filter-summary {
  color: var(--brand-dark);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}
.filter-count {
  margin-left: 7px;
  padding: 3px 7px;
  border-radius: 999px;
  color: var(--warning);
  background: #fff2d9;
  font-size: 9px;
}
.library-filter-options {
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(130px, 1fr)) auto;
  gap: 11px;
  align-items: end;
  padding-top: 2px;
}
.library-card { min-height: 300px; }
.library-card-kind {
  display: block;
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.library-card-source {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 15px 0 0;
  color: var(--muted);
  font-size: 10px;
}
.library-card-source code {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.table-link.source-link {
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.quick-add-form { gap: 20px; }
.quick-add-field-content textarea,
.quick-add-field-content input {
  min-height: 150px;
  line-height: 1.65;
  resize: vertical;
}
.quick-add-field-note textarea { min-height: 92px; resize: vertical; }
.quick-add-submit { min-width: 150px; }
.quick-add-explainer {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}
.quick-add-explainer div {
  min-width: 0;
  padding: 15px 16px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(255,255,255,.7);
}
.quick-add-explainer strong,
.quick-add-explainer span { display: block; }
.quick-add-explainer strong { margin-bottom: 5px; color: var(--brand-dark); font-size: 11px; }
.quick-add-explainer span { color: var(--muted); font-size: 10px; line-height: 1.6; }

@media (max-width: 900px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar {
    width: 100%;
    position: relative;
    height: auto;
    padding: 18px;
    overflow: hidden;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .brand { max-width: calc(100% - 118px); padding: 0 0 15px; }
  .sidebar-quick-add {
    width: auto;
    position: absolute;
    top: 18px;
    right: 18px;
    margin: 0;
  }
  .nav-list {
    width: 100%;
    max-width: 100%;
    display: flex;
    gap: 15px;
    padding: 2px 0 9px;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scrollbar-color: #bad1c8 transparent;
    scrollbar-width: thin;
  }
  .nav-group { display: flex; flex: 0 0 auto; gap: 5px; }
  .nav-group + .nav-group { padding-left: 12px; border-left: 1px solid var(--line); }
  .nav-group-label { display: none; }
  .nav-list a { flex: 0 0 auto; white-space: nowrap; }
  .sidebar-note { display: none; }
  .user-panel {
    display: flex;
    margin: 14px 0 0;
    padding: 10px 8px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--soft);
  }
  .main-content { padding: 28px 18px 50px; }
  .login-page { grid-template-columns: 1fr; }
  .login-visual { min-height: 340px; padding: 30px; }
  .login-pitch { padding: 40px 0; }
  .login-pitch h1 { font-size: 43px; }
  .login-form-wrap { padding: 45px 24px; }
  .page-header { align-items: flex-start; flex-direction: column; }
  .filter-bar { grid-template-columns: 1fr 1fr; }
  .library-filter-options { grid-template-columns: 1fr 1fr; }
  .import-filter-bar { grid-template-columns: 1fr 1fr; }
  .search-field { grid-column: 1 / -1; }
  .skill-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tool-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .detail-hero { align-items: flex-start; flex-direction: column; }
  .detail-actions { justify-content: flex-start; }
  .detail-grid { grid-template-columns: 1fr; }
  .review-decision-grid { grid-template-columns: 1fr; }
  .table-scroll-hint { display: block; }
}

@media (max-width: 620px) {
  .main-content { padding: 25px 14px 96px; }
  .brand small { display: none; }
  .page-header { gap: 18px; margin-bottom: 22px; }
  .page-header > .button { width: 100%; }
  .library-search-row { grid-template-columns: 1fr auto; }
  .library-search-field { grid-column: 1 / -1; }
  .library-filter-disclosure {
    position: relative;
    padding-top: 11px;
    border-top: 1px solid var(--line);
  }
  .library-filter-toggle {
    width: 1px;
    height: 1px;
    position: absolute;
    top: 13px;
    left: 1px;
    display: block;
    opacity: 0;
  }
  .library-filter-summary { display: inline-flex; align-items: center; }
  .library-filter-summary::before {
    content: "▸";
    margin-right: 7px;
    transition: transform .16s ease;
  }
  .library-filter-toggle:focus-visible + .library-filter-summary {
    outline: 2px solid #5aa68f;
    outline-offset: 4px;
    border-radius: 4px;
  }
  .library-filter-toggle:checked + .library-filter-summary {
    margin-bottom: 12px;
  }
  .library-filter-toggle:checked + .library-filter-summary::before {
    transform: rotate(90deg);
  }
  .library-filter-options { display: none; grid-template-columns: 1fr; }
  .library-filter-toggle:checked + .library-filter-summary + .library-filter-options {
    display: grid;
  }
  .filter-bar { grid-template-columns: 1fr; }
  .import-filter-bar { grid-template-columns: 1fr; }
  .search-field { grid-column: auto; }
  .skill-grid { grid-template-columns: 1fr; }
  .tool-grid { grid-template-columns: 1fr; }
  .skill-card { min-height: 235px; }
  .library-card { min-height: 270px; }
  .tool-card { min-height: 250px; }
  .detail-title-row { flex-direction: column; }
  .detail-hero,
  .detail-section,
  .form-panel,
  .confirm-panel { padding: 22px 18px; }
  .detail-actions,
  .detail-actions .button,
  .inline-action-form { width: 100%; }
  .inline-action-form .button { width: 100%; }
  .metadata-list { grid-template-columns: 1fr; gap: 4px; }
  .metadata-list dd { min-width: 0; overflow-wrap: anywhere; }
  .quick-add-field input,
  .quick-add-field textarea { font-size: 16px; }
  .quick-add-explainer { grid-template-columns: 1fr; }
}
