* { box-sizing: border-box; }

html {
  background: var(--bg);
}

body {
  margin: 0;
  background:
    linear-gradient(180deg, #f7f9fb 0, var(--bg) 260px),
    var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: var(--font-size-14);
  line-break: strict;
}

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

button {
  border: 0;
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: .58;
}

.boot {
  min-height: 100vh;
  display: grid;
  place-content: center;
  gap: 12px;
  color: var(--muted);
}

.boot-mark {
  color: var(--ink);
  font-size: 24px;
  font-weight: 800;
}

.login-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 430px;
  background: #fff;
}

.login-visual {
  padding: 64px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background:
    linear-gradient(135deg, rgba(16, 47, 63, .96), rgba(23, 103, 194, .9)),
    #102f3f;
  color: #fff;
}

.login-kicker {
  display: inline-flex;
  width: fit-content;
  padding: 6px 10px;
  border: 1px solid rgba(255,255,255,.22);
  border-radius: 999px;
  color: rgba(255,255,255,.82);
  font-size: 12px;
  margin-bottom: 22px;
}

.login-visual h1 {
  margin: 0;
  font-size: 44px;
  line-height: 1.15;
  letter-spacing: 0;
}

.login-visual p {
  max-width: 680px;
  margin-top: 20px;
  line-height: 1.9;
  color: rgba(255,255,255,.86);
}

.login-meta {
  display: grid;
  gap: 4px;
  color: rgba(255,255,255,.7);
}

.login-meta b {
  color: #fff;
  font-weight: 700;
}

.login-card {
  background: var(--panel);
  padding: 56px 36px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  border-left: 1px solid rgba(16,47,63,.1);
}

.login-card h2 {
  margin: 0 0 8px;
  font-size: 26px;
}

.login-mode {
  margin-bottom: 22px;
}

.login-card .hint {
  margin-bottom: 26px;
}

.login-card .compact-hint {
  margin: 10px 0 0;
}

.login-notice {
  margin-top: 16px;
  margin-bottom: 0;
}

.mode-warning {
  margin-bottom: 18px;
  border-color: #f0c983;
  background: #fff9ee;
}

.mode-warning .btn {
  width: fit-content;
  margin-top: 10px;
  text-decoration: none;
}

.layout {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 252px minmax(0, 1fr);
}

.sidebar {
  background: var(--ink);
  color: #dce8ef;
  padding: 24px 16px;
  position: sticky;
  top: 0;
  height: 100vh;
  border-right: 1px solid rgba(255,255,255,.08);
}

.brand {
  font-size: 20px;
  font-weight: 850;
  color: #fff;
  margin-bottom: 5px;
}

.sidebar .muted {
  color: rgba(220,232,239,.7);
}

.role-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 999px;
  color: #fff;
  font-size: 12px;
  margin: 12px 0 22px;
  max-width: 100%;
}

.nav {
  display: grid;
  gap: 4px;
}

.nav button {
  width: 100%;
  min-height: 42px;
  text-align: left;
  padding: 0 12px;
  border-radius: 7px;
  background: transparent;
  color: #dce8ef;
  position: relative;
}

.nav button.active {
  background: rgba(255,255,255,.14);
  color: #fff;
  font-weight: 700;
}

.nav button.active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 9px;
  bottom: 9px;
  width: 3px;
  border-radius: 999px;
  background: #61d2c6;
}

.nav button:hover {
  background: rgba(255,255,255,.1);
  color: #fff;
}

.sidebar-footer {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 20px;
}

.main {
  padding: 26px 28px 42px;
  min-width: 0;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 20px;
}

.topbar h1 {
  margin: 0 0 5px;
  font-size: 27px;
  line-height: 1.25;
  letter-spacing: 0;
}

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

.hint {
  line-height: 1.6;
  font-size: 13px;
}

.page-hero {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 20px;
  padding: 22px;
  margin-bottom: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(16,47,63,.96), rgba(11,131,121,.88)),
    var(--ink);
  color: #fff;
  box-shadow: var(--shadow);
}

.page-kicker {
  width: fit-content;
  min-height: 24px;
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.22);
  color: rgba(255,255,255,.82);
  font-size: 12px;
  margin-bottom: 10px;
}

.page-hero h2 {
  margin: 0;
  font-size: 28px;
  line-height: 1.2;
  letter-spacing: 0;
}

.page-hero p {
  margin: 10px 0 0;
  color: rgba(255,255,255,.82);
  line-height: 1.75;
  max-width: 720px;
}

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

.quick-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.quick-card {
  min-height: 78px;
  text-align: left;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--text);
  box-shadow: 0 1px 0 rgba(16,47,63,.03);
}

.quick-card b,
.quick-card span {
  display: block;
}

.quick-card b {
  margin-bottom: 6px;
  color: var(--ink);
  font-size: 15px;
}

.quick-card span {
  color: var(--muted);
  line-height: 1.55;
}

.quick-card.warn {
  border-color: #f0c983;
  background: #fff9ee;
}

.announcement-bar {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
  padding: 12px 14px;
  border: 1px solid #cfe0ea;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 1px 0 rgba(16,47,63,.03);
  overflow: hidden;
}

.announcement-label {
  padding: 6px 10px;
  border-radius: 999px;
  background: #e8f4f2;
  color: var(--teal);
  font-weight: 850;
  white-space: nowrap;
}

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

.announcement-marquee {
  overflow: hidden;
  min-width: 0;
}

.announcement-track {
  display: inline-flex;
  gap: 36px;
  min-width: 100%;
  white-space: nowrap;
  animation: announcement-scroll 28s linear infinite;
}

.announcement-track span {
  color: var(--text);
}

.announcement-track b {
  margin-right: 8px;
  color: var(--ink);
}

.announcement-editor {
  margin-bottom: 14px;
  background: #fbfdff;
}

@keyframes announcement-scroll {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

.page-shell {
  max-width: 980px;
  margin: 0 auto;
}

.form-panel {
  padding: 22px;
}

.floating-action {
  position: fixed;
  right: 34px;
  bottom: 34px;
  min-height: 52px;
  padding: 0 22px;
  border-radius: 999px;
  background: var(--blue);
  color: #fff;
  font-weight: 850;
  box-shadow: 0 18px 34px rgba(16,47,63,.22);
  z-index: 12;
}

.floating-action.teal {
  background: var(--teal);
}

.floating-action:hover {
  filter: brightness(.98);
}

.grid {
  display: grid;
  gap: 16px;
}

.grid > *,
.metric-row > *,
.quick-row > *,
.detail-grid > *,
.archive-summary > *,
.template-guide > *,
.profile-menu > * {
  min-width: 0;
}

.grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.compact-grid { gap: 12px; }
.work-grid { align-items: start; margin-top: 16px; }

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  box-shadow: 0 1px 0 rgba(16,47,63,.03);
}

.panel + .panel {
  margin-top: 16px;
}

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

.panel-head > div {
  min-width: 0;
}

.panel h2, .panel h3 {
  margin: 0;
  line-height: 1.35;
}

.panel h2 { font-size: 18px; }
.panel h3 { font-size: 16px; }

.metric-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.metric-row.compact-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.metric-card {
  min-height: 112px;
  display: grid;
  align-content: center;
  text-align: left;
  gap: 6px;
  padding: 18px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 1px 0 rgba(16,47,63,.03);
}

.metric-action {
  width: 100%;
  cursor: pointer;
  transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease, background .16s ease;
}

.metric-action:hover,
.metric-action.active {
  border-color: var(--blue);
  box-shadow: var(--shadow);
}

.metric-action:hover {
  transform: translateY(-1px);
}

.metric-action.active {
  background: #f3f8ff;
}

.metric-row.compact-4 .metric-card {
  min-height: 92px;
  padding: 14px 16px;
}

.metric-row.compact-4 .metric-card b {
  font-size: 28px;
}

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

.metric-card b {
  color: var(--ink);
  font-size: 32px;
  line-height: 1;
}

.metric-card small {
  color: var(--subtle);
}

.toolbar, .filter-bar {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.toolbar:last-child,
.filter-bar:last-child {
  margin-bottom: 0;
}

.control-row {
  align-items: stretch;
}

.control-row input,
.control-row select {
  flex: 1 1 220px;
  max-width: 320px;
}

.control-row .btn {
  flex: 0 0 auto;
}

.log-filter-row input,
.log-filter-row select {
  max-width: 210px;
}

.list-toolbar {
  display: grid;
  gap: 10px;
  margin-bottom: 12px;
}

.filter-bar {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.partner-filter-bar {
  display: grid;
  grid-template-columns: minmax(260px, 1.35fr) minmax(220px, 1.1fr) minmax(160px, .7fr) auto;
  align-items: stretch;
  gap: 12px;
}

.partner-filter-bar input,
.partner-filter-bar select,
.partner-filter-bar .btn {
  width: 100%;
  min-height: 44px;
}

.partner-switch-panel {
  padding: 10px 12px;
  margin-bottom: 14px;
}

.recommend-layout {
  display: grid;
  grid-template-columns: minmax(320px, .9fr) minmax(0, 1.25fr);
  gap: 14px;
  align-items: start;
}

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

.compact-chips {
  margin-top: 8px;
}

.compact-notice {
  margin: 12px 0;
}

.recommend-results {
  display: grid;
  gap: 12px;
}

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

.recommend-card {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.recommend-card-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
}

.recommend-card h3 {
  margin: 2px 0 0;
  color: var(--ink);
  font-size: 18px;
  line-height: 1.35;
}

.recommend-score {
  min-width: 112px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
  text-align: right;
}

.recommend-score b {
  display: block;
  color: var(--blue);
  font-size: 24px;
  line-height: 1;
}

.recommend-score span,
.recommend-score em {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.recommend-reason {
  margin: 10px 0 12px;
  color: var(--ink);
  line-height: 1.65;
}

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

.evidence-grid div {
  min-height: 66px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.evidence-grid span {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 12px;
}

.evidence-grid b {
  color: var(--ink);
  font-size: 13px;
  line-height: 1.45;
}

.risk-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.partner-table th:first-child,
.partner-table td:first-child {
  width: 62%;
}

.partner-table th:nth-child(2),
.partner-table td:nth-child(2) {
  width: 12%;
}

.partner-table th:nth-child(3),
.partner-table td:nth-child(3) {
  width: 17%;
}

.partner-table th:last-child,
.partner-table td:last-child {
  width: 9%;
}

.compact-filter {
  align-items: stretch;
  margin-bottom: 0;
}

.compact-filter input {
  flex: 1 1 260px;
  max-width: none;
}

.compact-filter select {
  flex: 0 0 150px;
  max-width: 150px;
}

.segmented {
  display: inline-flex;
  width: fit-content;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
  gap: 3px;
}

.segmented button {
  min-height: 32px;
  padding: 0 12px;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-weight: 750;
  white-space: nowrap;
}

.segmented button.active {
  background: var(--panel);
  color: var(--ink);
  box-shadow: 0 1px 4px rgba(16,47,63,.08);
}

.field {
  display: grid;
  gap: 6px;
  margin-bottom: 12px;
}

.grid > .field,
.grid > .subtle-section,
.grid > .notice-box {
  margin-bottom: 0;
}

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

.form-section {
  margin: 14px 0;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.form-panel > .toolbar,
.form-section + .toolbar {
  margin-top: 16px;
}

.form-section h3 {
  margin: 0 0 12px;
}

.subtle-section {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.chip-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.chip {
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  background: #eef4f7;
  color: #2d4a5a;
  border: 1px solid var(--line);
  font-weight: 700;
  white-space: nowrap;
}

.chip:hover {
  border-color: var(--blue);
  color: var(--blue-deep);
  background: #edf4ff;
}

.notice-box {
  padding: 13px 14px;
  margin-bottom: 16px;
  border: 1px solid #cfe0ef;
  border-radius: 8px;
  background: #f0f6fc;
  color: #244050;
}

.notice-box p {
  margin: 6px 0 0;
  color: var(--muted);
  line-height: 1.65;
}

.steps {
  display: grid;
  gap: 10px;
  margin: 12px 0 14px;
}

.steps > div {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.steps b {
  display: block;
  color: var(--ink);
  margin-bottom: 4px;
}

.steps p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.profile-maintenance {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, .95fr);
  gap: 16px;
  align-items: stretch;
}

.template-card {
  display: grid;
  gap: 16px;
}

.template-card-main {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.template-card-main h2 {
  margin: 8px 0 6px;
  font-size: 22px;
}

.template-card-main p {
  max-width: 560px;
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  background: #eef4f7;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.download-btn {
  min-width: 116px;
}

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

.template-guide > div {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.template-guide b,
.template-guide span {
  display: block;
}

.template-guide b {
  margin-bottom: 6px;
  color: var(--ink);
}

.template-guide span {
  color: var(--muted);
  line-height: 1.55;
}

.archive-card {
  min-height: 0;
}

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

.archive-summary > div {
  min-height: 78px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

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

.archive-summary b {
  color: var(--ink);
  line-height: 1.55;
}

.profile-home {
  display: block;
}

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

.menu-card {
  min-height: 92px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  text-align: left;
}

.menu-card:hover {
  border-color: var(--blue);
  box-shadow: var(--shadow);
}

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

.menu-card b {
  color: var(--ink);
  font-size: 17px;
  margin-bottom: 6px;
}

.menu-card small {
  color: var(--muted);
  line-height: 1.55;
}

.menu-card i {
  color: var(--muted);
  font-style: normal;
  font-size: 24px;
}

.list-note {
  margin: -2px 0 12px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

input, textarea, select {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: #fff;
  color: var(--text);
  padding: 9px 10px;
  outline: none;
  min-height: 38px;
}

textarea {
  min-height: 96px;
  resize: vertical;
  line-height: 1.65;
}

input:focus, textarea:focus, select:focus {
  border-color: var(--blue);
  box-shadow: var(--focus);
}

.upload-control {
  min-height: 48px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}

.upload-control:hover {
  border-color: var(--blue);
  box-shadow: var(--focus);
  background: #fbfdff;
}

.upload-control input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.upload-button {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 14px;
  border-radius: 7px;
  background: var(--blue);
  color: #fff;
  font-weight: 800;
  white-space: nowrap;
}

.upload-name {
  min-width: 0;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.btn {
  min-height: 36px;
  padding: 0 13px;
  border-radius: 7px;
  border: 0;
  background: #e8eef3;
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  white-space: nowrap;
  font-weight: 650;
  text-decoration: none;
}

.btn:hover {
  filter: brightness(.98);
}

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

.btn.primary { background: var(--blue); color: #fff; }
.btn.teal { background: var(--teal); color: #fff; }
.btn.green { background: var(--green); color: #fff; }
.btn.warn { background: var(--amber); color: #fff; }
.btn.danger { background: var(--red); color: #fff; }
.btn.ghost {
  background: transparent;
  color: #dce8ef;
  border: 1px solid rgba(255,255,255,.2);
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.table-wrap .toolbar {
  margin-bottom: 0;
}

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

th, td {
  padding: 12px 13px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
  font-size: 14px;
  line-height: 1.55;
  word-break: keep-all;
  overflow-wrap: normal;
}

th {
  position: sticky;
  top: 0;
  background: #f2f5f8;
  color: #4b5a68;
  font-weight: 800;
  z-index: 1;
}

tbody tr:hover {
  background: #f9fbfd;
}

tr:last-child td {
  border-bottom: 0;
}

td p {
  margin: 6px 0 0;
  color: var(--muted);
  line-height: 1.65;
  word-break: normal;
  overflow-wrap: anywhere;
}

td:last-child {
  white-space: nowrap;
}

td b,
td .muted,
td .hint,
th {
  word-break: keep-all;
  overflow-wrap: normal;
}

.demand-summary {
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  display: grid;
  gap: 4px;
  text-align: left;
  cursor: pointer;
}

.demand-summary:hover b {
  color: var(--blue-deep);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.demand-summary .muted,
.demand-summary .summary-text {
  display: block;
}

.demand-summary .summary-text {
  color: var(--muted);
  line-height: 1.65;
  word-break: normal;
  overflow-wrap: anywhere;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #edf4ff;
  color: #1258a8;
  margin: 2px 4px 2px 0;
  font-size: 12px;
  font-weight: 650;
  white-space: nowrap;
}

.tag.green { background: #e6f4eb; color: #236a3c; }
.tag.amber { background: #fff1d6; color: #825000; }
.tag.red { background: #ffe8e8; color: #963030; }

.score-pair {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.score-card {
  min-width: 138px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.score-card b {
  display: block;
  margin: 5px 0;
  color: var(--ink);
  font-size: 26px;
  line-height: 1;
}

.partner-hero {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 14px;
}

.partner-detail-panel {
  margin-top: 14px;
}

.partner-hero h2 {
  margin: 4px 0 8px;
  font-size: 24px;
  line-height: 1.35;
}

.detail-tabs {
  position: sticky;
  top: 0;
  background: rgba(255,255,255,.96);
  padding: 4px 0 10px;
  z-index: 2;
  border-bottom: 1px solid rgba(219,227,234,.72);
}

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

.kv {
  min-height: 76px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.kv span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 6px;
}

.kv b {
  font-size: 15px;
  line-height: 1.55;
  word-break: keep-all;
  overflow-wrap: anywhere;
}

.detail-section {
  margin-top: 18px;
}

.detail-section h3 {
  margin-bottom: 10px;
}

.long-text {
  line-height: 1.85;
  margin: 0;
  white-space: pre-wrap;
}

.dim-row {
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
}

.dim-row:last-child { border-bottom: 0; }

.dim-line {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.dim-line span {
  color: var(--blue-deep);
  font-weight: 800;
}

.dim-bar {
  height: 8px;
  border-radius: 999px;
  background: #e8eef3;
  overflow: hidden;
}

.dim-bar i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--teal), var(--blue));
}

.dim-row p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.7;
}

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

.case-card {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.case-card h3 {
  margin: 0;
  font-size: 16px;
  line-height: 1.45;
}

.case-card p {
  line-height: 1.75;
  margin: 10px 0;
}

.tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.tabs button {
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  background: #e8eef3;
  color: #334453;
  font-weight: 700;
}

.tabs button.active {
  background: var(--ink);
  color: #fff;
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  max-width: 380px;
  background: var(--ink);
  color: #fff;
  padding: 12px 14px;
  border-radius: 8px;
  box-shadow: 0 16px 34px rgba(16,47,63,.22);
  z-index: 20;
}

.empty {
  padding: 28px;
  text-align: center;
  color: var(--muted);
  background: var(--panel-soft);
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
}

.skeleton {
  min-height: 112px;
  border-radius: 8px;
  background: linear-gradient(90deg, #eef3f7, #f8fafb, #eef3f7);
  background-size: 220% 100%;
  animation: pulse 1.2s ease-in-out infinite;
}

.skeleton.line {
  min-height: 24px;
  width: 220px;
  margin-bottom: 16px;
}

.skeleton.table {
  min-height: 300px;
}

@keyframes pulse {
  0% { background-position: 0 0; }
  100% { background-position: 220% 0; }
}

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

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

.row-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 0;
}

.row-actions .btn {
  min-height: 34px;
}

.contact-box {
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px solid #bde4d1;
  border-radius: 8px;
  background: #f2fbf6;
}

.contact-box b {
  display: block;
  margin-bottom: 4px;
  color: #086042;
}

.contact-box .toolbar {
  margin-top: 8px;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(7, 27, 39, 0.36);
}

.modal-panel {
  width: min(560px, 100%);
  max-height: calc(100vh - 48px);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 24px 60px rgba(11, 31, 43, 0.28);
  padding: 18px;
}

.contact-modal .contact-box {
  margin-top: 14px;
}

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

.demand-detail-modal {
  width: min(860px, 100%);
}

.review-detail-modal,
.review-reject-modal {
  width: min(820px, 100%);
}

.detail-status-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0 4px;
}

.demand-detail-grid {
  margin-top: 14px;
}

.attachment-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.attachment-list a {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel-soft);
  color: var(--blue-deep);
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

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

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

.score-detail-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.score-detail-row span {
  color: var(--muted);
  font-weight: 700;
}

.score-detail-row b {
  color: var(--ink);
  white-space: nowrap;
}

.review-card-button {
  width: 100%;
  text-align: left;
  cursor: pointer;
}

.review-card-button:hover {
  border-color: var(--blue);
  box-shadow: var(--shadow);
}

.response-list {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.response-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdff;
  padding: 14px;
}

.response-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.response-card-head > div:first-child {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.response-content p {
  margin: 0 0 8px;
  color: var(--text);
}

.response-actions {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.inline-editor {
  margin-top: 16px;
  border-color: #cfe0ef;
  background: #fbfdff;
}

.status {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 1px 8px;
  border-radius: 999px;
  font-weight: 800;
  background: #eef2f5;
  white-space: nowrap;
}

.status.pending_review, .status.pending {
  color: var(--amber);
  background: #fff1d6;
}

.status.published, .status.approved, .status.active {
  color: var(--green);
  background: #e6f4eb;
}

.status.rejected, .status.closed {
  color: var(--red);
  background: #ffe8e8;
}

.status.replied {
  color: var(--blue);
  background: #edf4ff;
}

.status.archived {
  color: var(--muted);
  background: #eef2f5;
}

@media (max-width: 1180px) {
  .grid.cols-2 {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 980px) {
  .login-shell, .layout {
    grid-template-columns: 1fr;
  }

  .login-visual {
    min-height: 300px;
    padding: 36px;
  }

  .sidebar {
    position: static;
    height: auto;
  }

  .sidebar-footer {
    position: static;
    margin-top: 20px;
  }

  .metric-row,
  .metric-row.compact-4,
  .quick-row,
  .profile-maintenance,
  .profile-home,
  .profile-menu,
  .grid.cols-3,
  .detail-grid,
  .recommend-layout,
  .recommend-form-grid,
  .evidence-grid {
    grid-template-columns: 1fr;
  }

  .page-hero {
    align-items: flex-start;
    flex-direction: column;
  }

  .partner-hero {
    flex-direction: column;
  }

  .main {
    padding: 18px;
  }

  .announcement-bar {
    grid-template-columns: 1fr;
    align-items: flex-start;
  }
}

@media (max-width: 640px) {
  .login-shell {
    display: block;
  }

  .login-visual {
    display: none;
  }

  .login-card {
    min-height: 100vh;
    padding: 36px 22px;
  }

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

  .sidebar {
    padding: 16px;
  }

  .brand {
    font-size: 18px;
  }

  .role-pill {
    margin: 10px 0 14px;
  }

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

  .nav button {
    min-height: 38px;
    text-align: center;
  }

  .nav button.active::before {
    left: 10px;
  }

  .sidebar-footer {
    margin-top: 12px;
  }

  .toolbar,
  .filter-bar,
  .hero-actions,
  .upload-control,
  .pager {
    align-items: stretch;
  }

  .upload-control {
    flex-direction: column;
  }

  .template-card-main {
    display: grid;
  }

  .template-guide,
  .archive-summary {
    grid-template-columns: 1fr;
  }

  .pager {
    flex-direction: column;
  }

  .partner-filter-bar {
    grid-template-columns: 1fr;
  }

  .toolbar > *,
  .filter-bar > * {
    max-width: none !important;
  }

  .segmented {
    width: 100%;
  }

  .segmented button {
    flex: 1;
  }

  .btn {
    width: 100%;
  }

  .floating-action {
    left: 18px;
    right: 18px;
    bottom: 18px;
    width: auto;
  }
}

/* 2026-05 design system pass: quiet, dense, production-grade workspace */
body {
  background:
    linear-gradient(180deg, rgba(255,255,255,.84) 0, rgba(238,243,246,.72) 260px),
    repeating-linear-gradient(90deg, rgba(16,45,61,.035) 0 1px, transparent 1px 32px),
    repeating-linear-gradient(180deg, rgba(16,45,61,.028) 0 1px, transparent 1px 32px),
    var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

button,
.btn,
.tag,
.status,
.metric-card b {
  font-feature-settings: "tnum";
}

.layout {
  grid-template-columns: 244px minmax(0, 1fr);
}

.sidebar {
  padding: 28px 18px;
  background:
    linear-gradient(180deg, rgba(9,35,48,.98), rgba(13,52,65,.98)),
    var(--ink);
  border-right: 1px solid rgba(255,255,255,.12);
}

.brand {
  font-size: var(--font-size-22);
  line-height: 1.2;
}

.role-pill {
  min-height: 31px;
  padding: 0 var(--space-12);
  background: rgba(255,255,255,.09);
  border-color: rgba(255,255,255,.22);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.05);
}

.nav {
  gap: 7px;
}

.nav button {
  min-height: 44px;
  padding: 0 var(--space-14);
  border-radius: var(--radius-md);
  font-weight: var(--font-weight-medium);
  letter-spacing: 0;
}

.nav button.active {
  background: rgba(255,255,255,.16);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.06);
}

.nav button.active::before {
  top: 10px;
  bottom: 10px;
  width: 4px;
  background: #5cd5cc;
}

.main {
  padding: 30px 32px 54px;
}

.topbar {
  align-items: center;
  margin-bottom: 22px;
}

.topbar h1 {
  font-size: var(--font-size-30);
  font-weight: var(--font-weight-title);
}

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

.page-hero {
  min-height: 150px;
  padding: var(--space-24) 28px;
  border: 1px solid rgba(9, 75, 92, .18);
  border-radius: var(--radius-md);
  background:
    linear-gradient(135deg, rgba(12,48,62,.98), rgba(8,125,119,.92)),
    var(--ink);
  box-shadow: 0 18px 46px rgba(16,45,61,.12);
}

.page-kicker {
  min-height: 27px;
  padding: 3px 11px;
  background: rgba(255,255,255,.08);
  border-color: rgba(255,255,255,.26);
  font-weight: 800;
}

.page-hero h2 {
  font-size: var(--font-size-32);
  font-weight: 920;
}

.page-hero p {
  max-width: 820px;
  font-size: var(--font-size-15);
}

.panel,
.quick-card,
.metric-card,
.menu-card,
.announcement-bar,
.pager,
.table-wrap,
.file-item,
.kv,
.archive-summary > div,
.template-guide > div,
.steps > div,
.subtle-section,
.case-card,
.response-card,
.score-card,
.contact-box,
.notice-box {
  border-radius: var(--radius-md);
}

.panel {
  padding: var(--space-20);
  border-color: rgba(191,204,215,.82);
  box-shadow: var(--shadow-soft);
}

.panel-head {
  min-height: 42px;
}

.panel h2 {
  font-size: var(--font-size-19);
  font-weight: 880;
}

.panel h3 {
  font-weight: 820;
}

.metric-row {
  gap: var(--space-16);
}

.metric-card {
  min-height: 116px;
  padding: var(--space-18) var(--space-20);
  border-color: rgba(191,204,215,.86);
  box-shadow: var(--shadow-soft);
}

.metric-card span {
  font-size: var(--font-size-14);
  font-weight: 760;
}

.metric-card b {
  font-size: var(--font-size-34);
  font-weight: 920;
}

.metric-action:hover,
.metric-action.active {
  border-color: rgba(27,102,184,.75);
  box-shadow: 0 16px 38px rgba(27,102,184,.13);
}

.metric-action.active {
  background: linear-gradient(180deg, #f5f9ff, #ffffff);
}

.quick-row,
.profile-menu {
  gap: var(--space-14);
}

.quick-card,
.menu-card {
  min-height: 96px;
  padding: var(--space-18);
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}

.quick-card:hover,
.menu-card:hover,
.review-card-button:hover {
  transform: translateY(-1px);
}

.quick-card b,
.menu-card b {
  font-size: var(--font-size-17);
  font-weight: 860;
}

.filter-bar,
.list-toolbar .filter-bar {
  padding: var(--space-12);
  border-color: rgba(191,204,215,.86);
  background: rgba(246,249,251,.86);
}

input,
textarea,
select {
  min-height: 42px;
  border-radius: var(--radius-md);
  border-color: var(--line-strong);
  background: #fff;
  transition: border-color .14s ease, box-shadow .14s ease, background .14s ease;
}

input:hover,
textarea:hover,
select:hover {
  border-color: #aebdca;
}

textarea {
  min-height: 108px;
}

.btn {
  min-height: 38px;
  padding: 0 15px;
  border-radius: var(--radius-md);
  font-weight: 780;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.18);
  transition: transform .14s ease, box-shadow .14s ease, filter .14s ease;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(16,45,61,.10);
}

.btn.primary,
.btn.teal,
.btn.green,
.btn.warn,
.btn.danger {
  color: #fff;
}

.btn.primary { background: linear-gradient(180deg, var(--color-brand-primary-hover), var(--blue)); }
.btn.teal { background: linear-gradient(180deg, var(--color-accent-teal-hover), var(--teal)); }
.btn.green { background: linear-gradient(180deg, var(--color-state-success-hover), var(--green)); }
.btn.warn { background: linear-gradient(180deg, var(--color-state-warning-hover), var(--amber)); }
.btn.danger { background: linear-gradient(180deg, var(--color-state-danger-hover), var(--red)); }

.segmented {
  padding: var(--space-4);
  border-radius: var(--radius-md);
  background: #f2f6f8;
}

.segmented button {
  min-height: 36px;
  padding: 0 var(--space-14);
  border-radius: var(--radius-md);
}

.segmented button.active {
  box-shadow: 0 2px 10px rgba(16,45,61,.08);
}

.tabs {
  gap: var(--space-10);
}

.tabs button {
  min-height: 38px;
  padding: 0 15px;
  border-radius: var(--radius-pill);
}

.tabs button.active {
  background: var(--ink);
  box-shadow: 0 10px 24px rgba(16,45,61,.14);
}

.table-wrap {
  border-color: rgba(191,204,215,.86);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.72);
}

table {
  min-width: 1180px;
}

th,
td {
  padding: var(--space-14) 15px;
}

th {
  background: #eef3f7;
  color: #4a5c6c;
  font-size: var(--font-size-13);
  letter-spacing: 0;
}

tbody tr {
  transition: background .12s ease;
}

tbody tr:hover {
  background: #f6fafc;
}

.demand-summary b,
td > b {
  font-weight: 860;
}

.tag,
.status {
  min-height: 25px;
  padding: 2px 9px;
  font-weight: 800;
}

.tag {
  background: #eaf3ff;
  color: #155b9f;
}

.tag.green,
.status.published,
.status.approved,
.status.active {
  background: #e4f4ea;
  color: #23683d;
}

.tag.amber,
.status.pending_review,
.status.pending {
  background: #fff1d7;
  color: #7b570c;
}

.tag.red,
.status.rejected,
.status.closed {
  background: #ffe6e8;
  color: #9c2d33;
}

.status.replied {
  background: #e8f2ff;
  color: #185fa8;
}

.empty {
  padding: 34px;
  border-radius: var(--radius-md);
  background: #f7fafc;
}

.modal-backdrop {
  background: var(--color-backdrop);
  backdrop-filter: blur(6px);
}

.modal-panel {
  border-radius: var(--radius-md);
  border-color: rgba(191,204,215,.88);
  box-shadow: var(--shadow-modal);
  padding: 22px;
}

.action-modal {
  max-width: 560px;
}

.action-modal .notice-box {
  margin-bottom: 14px;
}

.modal-actions {
  justify-content: flex-end;
}

.toast {
  border-radius: var(--radius-md);
  box-shadow: 0 20px 50px rgba(16,45,61,.22);
}

.floating-action {
  min-height: 54px;
  box-shadow: var(--shadow-floating);
}

.announcement-bar {
  border-color: rgba(191,204,215,.86);
  box-shadow: var(--shadow-soft);
}

.announcement-label {
  background: #e4f4f1;
}

.detail-tabs {
  top: -1px;
}

@media (max-width: 980px) {
  .main {
    padding: 20px;
  }

  .page-hero {
    min-height: 0;
  }
}

@media (max-width: 640px) {
  .main {
    padding: 16px;
  }

  .panel,
  .form-panel {
    padding: 16px;
  }

  .page-hero h2 {
    font-size: 26px;
  }
}
