
:root {
  --ink: #15201e;
  --muted: #6c7774;
  --line: #d9e2dc;
  --paper: #fbfaf4;
  --panel: rgba(255, 255, 248, 0.86);
  --panel-strong: #ffffff;
  --teal: #006c67;
  --teal-soft: #cce7df;
  --amber: #f0b429;
  --red: #c2412d;
  --green: #18794e;
  --slate: #22312e;
  --shadow: 0 24px 70px rgba(26, 41, 37, 0.14);
  --radius: 22px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: "IBM Plex Sans KR", "Noto Sans KR", "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 14% 8%, rgba(240, 180, 41, 0.28), transparent 28rem),
    radial-gradient(circle at 82% 0%, rgba(0, 108, 103, 0.18), transparent 30rem),
    linear-gradient(135deg, #f4f1e6 0%, #edf4ef 52%, #f8f4e7 100%);
}

button, input, select, a { font: inherit; }
button, a.download { cursor: pointer; }

.app-shell {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 24px;
  width: min(1880px, calc(100vw - 28px));
  margin: 14px auto;
}

.rail {
  position: sticky;
  top: 14px;
  height: calc(100vh - 28px);
  padding: 22px;
  border: 1px solid rgba(21, 32, 30, 0.12);
  border-radius: 28px;
  background: linear-gradient(180deg, rgba(34, 49, 46, 0.96), rgba(20, 31, 29, 0.92));
  color: #f7f3df;
  box-shadow: var(--shadow);
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  border-radius: 24px;
  background: linear-gradient(135deg, var(--amber), #ffe6a1);
  color: #1d241f;
  font-weight: 900;
  letter-spacing: -0.08em;
  font-size: 24px;
}

.rail nav {
  display: grid;
  gap: 8px;
  margin-top: 42px;
}

.rail a {
  color: rgba(247, 243, 223, 0.68);
  text-decoration: none;
  padding: 12px 14px;
  border-radius: 14px;
  font-size: 14px;
  letter-spacing: 0.02em;
}

.rail a.active, .rail a:hover {
  color: #fff8d6;
  background: rgba(255, 255, 255, 0.09);
}

.rail-note {
  position: absolute;
  left: 22px;
  right: 22px;
  bottom: 22px;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.16);
  color: rgba(247, 243, 223, 0.62);
  font-size: 12px;
  line-height: 1.5;
}

.workspace { min-width: 0; }

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: flex-start;
  padding: 18px 8px 22px;
}

h1, h2, p { margin: 0; }

h1 {
  font-size: clamp(28px, 3vw, 48px);
  letter-spacing: -0.06em;
  line-height: 1.05;
}

.topbar p, .panel-title p, .table-toolbar p, .split-panel p {
  color: var(--muted);
  margin-top: 8px;
  line-height: 1.45;
}

.status-pill {
  white-space: nowrap;
  border: 1px solid rgba(0, 108, 103, 0.25);
  background: rgba(204, 231, 223, 0.55);
  color: var(--teal);
  padding: 10px 14px;
  border-radius: 999px;
  font-weight: 800;
}

.panel, .metric-grid article {
  border: 1px solid rgba(21, 32, 30, 0.1);
  background: var(--panel);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
  border-radius: var(--radius);
}

.panel { padding: 22px; }

.panel-title {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  margin-bottom: 18px;
}

.panel-title > span {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  border-radius: 14px;
  background: var(--slate);
  color: #fff8d6;
  font-weight: 900;
}

.panel-title h2, .table-toolbar h2, .split-panel h2 {
  font-size: 20px;
  letter-spacing: -0.04em;
}

.panel-title.compact { justify-content: space-between; align-items: flex-start; }
.panel-title.compact h2 { margin-bottom: 0; }

.upload-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr auto;
  gap: 12px;
  align-items: end;
}

.dropzone, .field {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.dropzone {
  padding: 18px;
  border: 1px dashed rgba(0, 108, 103, 0.45);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.55);
}

.dropzone input { max-width: 100%; }
.dropzone strong { font-size: 16px; }
.dropzone span, .field span { color: var(--muted); font-size: 12px; }

input, select {
  min-width: 0;
  height: 42px;
  border: 1px solid rgba(21, 32, 30, 0.14);
  border-radius: 13px;
  padding: 0 12px;
  background: rgba(255, 255, 255, 0.86);
  color: var(--ink);
}

input:focus, select:focus {
  outline: 3px solid rgba(0, 108, 103, 0.16);
  border-color: rgba(0, 108, 103, 0.55);
}

.primary, .secondary, .pager button {
  border: 0;
  border-radius: 14px;
  height: 42px;
  padding: 0 16px;
  font-weight: 800;
}

.primary {
  color: #fffdf0;
  background: linear-gradient(135deg, #004f4c, #00877f);
  box-shadow: 0 10px 28px rgba(0, 108, 103, 0.24);
}

.secondary, .pager button, .download {
  border: 1px solid rgba(21, 32, 30, 0.14);
  color: var(--ink);
  background: rgba(255, 255, 255, 0.78);
}

.progress-block {
  margin-top: 14px;
  display: grid;
  gap: 8px;
}

.progress-line {
  color: var(--muted);
  font-size: 13px;
}

.progress-track {
  overflow: hidden;
  height: 10px;
  border-radius: 999px;
  background: rgba(21, 32, 30, 0.09);
  border: 1px solid rgba(21, 32, 30, 0.08);
}

.progress-fill {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--teal), var(--amber));
  transition: width 180ms ease;
}

.progress-fill.processing {
  width: 100%;
  background-size: 220% 100%;
  animation: progress-stripes 1.2s linear infinite;
}

@keyframes progress-stripes {
  0% { background-position: 0% 50%; }
  100% { background-position: 220% 50%; }
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin: 16px 0;
}

.metric-grid article {
  padding: 18px;
  min-height: 104px;
}

.metric-grid span {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.metric-grid strong {
  display: block;
  margin-top: 12px;
  font-size: clamp(22px, 3vw, 34px);
  letter-spacing: -0.06em;
}

.visual-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 16px;
  margin-bottom: 16px;
}

.chart-card.full { grid-column: 1 / -1; }
.chart { min-height: 320px; }
.chart.tall { min-height: 440px; }

.table-panel { margin-bottom: 16px; }
.table-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  margin-bottom: 16px;
}
.toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.table-wrap {
  overflow: auto;
  max-height: 600px;
  border: 1px solid rgba(21, 32, 30, 0.1);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.68);
}
.event-wrap { max-height: 420px; }

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.data-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  text-align: left;
  background: #eef4ed;
  color: #34433f;
  padding: 11px 10px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

.data-table td {
  padding: 8px 10px;
  border-bottom: 1px solid rgba(21, 32, 30, 0.08);
  vertical-align: top;
}

.data-table tr:hover td { background: rgba(204, 231, 223, 0.24); }
.data-table tr.selected td { background: rgba(240, 180, 41, 0.18); }

.data-table input, .data-table select {
  height: 32px;
  border-radius: 10px;
  width: 100%;
  min-width: 110px;
  font-size: 12px;
}

.decision-chip {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 4px 9px;
  font-weight: 800;
  font-size: 12px;
}
.decision-chip.exception { background: rgba(194, 65, 45, 0.12); color: var(--red); }
.decision-chip.non { background: rgba(24, 121, 78, 0.12); color: var(--green); }
.decision-chip.review { background: rgba(240, 180, 41, 0.22); color: #8a5b00; }


.pivot-panel {
  padding-bottom: 18px;
}

.pivot-actions input { min-width: 250px; }

.pivot-stats {
  margin: -4px 0 12px;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(34, 49, 46, 0.07);
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.pivot-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 14px;
  align-items: stretch;
}

.pivot-wrap {
  max-height: 72vh;
  min-height: 520px;
}

.pivot-table {
  font-size: 12px;
  table-layout: auto;
}

.pivot-table th, .pivot-table td {
  white-space: nowrap;
}

.pivot-table th:nth-child(n+3):nth-child(-n+9),
.pivot-table td:nth-child(n+3):nth-child(-n+9) {
  text-align: right;
}

.pivot-label {
  min-width: 260px;
  max-width: 460px;
}

.pivot-label span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pivot-row .pivot-label {
  white-space: normal;
}

.pivot-group td {
  background: rgba(204, 231, 223, 0.38);
  font-weight: 900;
}

.group-toggle {
  width: 24px;
  height: 24px;
  margin-right: 8px;
  border: 1px solid rgba(21, 32, 30, 0.16);
  border-radius: 8px;
  background: #fff;
  font-weight: 900;
}

.pivot-number {
  min-width: 58px;
  height: 28px;
  border: 1px solid rgba(0, 108, 103, 0.14);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.86);
  color: var(--teal);
  font-weight: 900;
  text-align: right;
}

.pivot-number:hover:not(:disabled) {
  background: rgba(204, 231, 223, 0.75);
}

.pivot-number:disabled {
  color: rgba(21, 32, 30, 0.28);
  background: rgba(21, 32, 30, 0.04);
  border-color: rgba(21, 32, 30, 0.06);
}

.mini-button {
  height: 30px;
  padding: 0 10px;
  border-radius: 10px;
  font-size: 12px;
}

.edit-inspector {
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 14px;
  border: 1px solid rgba(21, 32, 30, 0.11);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.68);
  min-height: 520px;
}

.edit-inspector h3 {
  margin: 0;
  font-size: 17px;
  letter-spacing: -0.03em;
}

.edit-inspector p {
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.edit-inspector label {
  display: grid;
  gap: 5px;
}

.edit-inspector label span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.edit-inspector textarea {
  min-height: 82px;
  resize: vertical;
  border: 1px solid rgba(21, 32, 30, 0.14);
  border-radius: 13px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.86);
  color: var(--ink);
  font: inherit;
  font-size: 13px;
}

.pivot-pager {
  margin-top: 10px;
}

.split-panel {
  display: grid;
  grid-template-columns: 1.25fr 0.75fr;
  gap: 20px;
  margin-bottom: 16px;
}
.ai-row, .export-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 14px;
}
.ai-row input:first-child { flex: 1 1 280px; }
.ai-row input:nth-child(2) { width: 160px; }
.ai-row input[type="number"] { width: 86px; }
.ai-check { display: inline-flex; align-items: center; gap: 6px; min-height: 42px; color: var(--muted); font-size: 13px; font-weight: 900; }
.ai-check input { width: auto !important; }

.download {
  display: inline-flex;
  height: 42px;
  align-items: center;
  text-decoration: none;
  padding: 0 14px;
  border-radius: 14px;
  font-weight: 800;
}
.download.disabled {
  opacity: 0.45;
  pointer-events: none;
}


.model-help a {
  color: var(--teal);
  font-weight: 900;
}

.logic-note {
  margin: 10px 0 12px;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(0, 108, 103, 0.08);
  border: 1px solid rgba(0, 108, 103, 0.16);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}
.logic-note strong {
  color: var(--teal);
  margin-right: 6px;
}

.feedback-panel {
  margin-bottom: 16px;
}
.feedback-toolbar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 12px 0;
}
.feedback-toolbar input {
  flex: 1 1 320px;
  min-width: 240px;
}
.feedback-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 16px;
  align-items: start;
}
.feedback-table-wrap {
  min-height: 360px;
  max-height: 560px;
}
.feedback-editor {
  position: sticky;
  top: 16px;
  display: grid;
  gap: 10px;
  padding: 14px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(21, 32, 30, 0.12);
}
.feedback-editor h3 {
  margin: 0;
}
.feedback-editor p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}
.feedback-editor label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}
.feedback-editor input,
.feedback-editor select,
.feedback-editor textarea {
  width: 100%;
  border: 1px solid rgba(21, 32, 30, 0.14);
  border-radius: 13px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.88);
  color: var(--ink);
  font: inherit;
  font-size: 13px;
}
.feedback-editor textarea {
  min-height: 68px;
  resize: vertical;
}
.feedback-buttons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.danger-button {
  min-height: 38px;
  border: 0;
  border-radius: 13px;
  padding: 0 13px;
  color: #fff8f3;
  background: linear-gradient(135deg, #9f2d20, #d65031);
  font-weight: 900;
}
.feedback-pager {
  margin-top: 10px;
}

.muted { color: var(--muted); font-size: 13px; margin-top: 8px; }
.pager {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  align-items: center;
  margin-top: 12px;
  color: var(--muted);
}

code {
  background: rgba(21, 32, 30, 0.08);
  padding: 2px 5px;
  border-radius: 6px;
}


.linklike {
  border: 0;
  background: transparent;
  color: var(--teal);
  padding: 0;
  font-weight: 900;
  text-align: left;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.event-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(15, 24, 22, 0.32);
  backdrop-filter: blur(3px);
}

.event-drawer {
  position: fixed;
  z-index: 41;
  top: 8px;
  right: 8px;
  bottom: 8px;
  width: min(1680px, calc(100vw - 16px));
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr) auto;
  gap: 12px;
  padding: 18px;
  border: 1px solid rgba(21, 32, 30, 0.14);
  border-radius: 26px;
  background: rgba(251, 250, 244, 0.98);
  box-shadow: 0 34px 100px rgba(15, 24, 22, 0.28);
  transform: translateX(calc(100% + 28px));
  transition: transform 220ms ease;
}

.event-drawer.open {
  transform: translateX(0);
}

.drawer-head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
}

.drawer-kicker {
  display: inline-block;
  margin-bottom: 5px;
  color: var(--teal);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.drawer-head h2 {
  font-size: 28px;
  line-height: 1.1;
  letter-spacing: -0.05em;
}

.drawer-head p {
  margin-top: 6px;
  color: var(--muted);
}

.icon-button {
  width: 42px;
  height: 42px;
  border: 1px solid rgba(21, 32, 30, 0.13);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.86);
  color: var(--ink);
  font-size: 26px;
  line-height: 1;
}

.event-summary-card {
  display: grid;
  grid-template-columns: minmax(220px, 0.8fr) minmax(0, 1.2fr);
  gap: 12px;
  align-items: center;
  padding: 14px 16px;
  border: 1px solid rgba(0, 108, 103, 0.16);
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(204, 231, 223, 0.62), rgba(255, 255, 255, 0.78));
}

.event-summary-card strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 18px;
}

.event-summary-card span {
  color: var(--muted);
  font-size: 13px;
}

.event-filter-bar {
  display: grid;
  grid-template-columns: 140px minmax(180px, 1fr) 110px auto auto auto;
  gap: 8px;
  align-items: center;
}

.drawer-table-wrap {
  max-height: none;
  height: 100%;
}

.drawer-pager {
  margin-top: 0;
}

.path-cell {
  min-width: 320px;
  max-width: 520px;
}

.path-cell strong {
  display: block;
  color: var(--ink);
  margin-bottom: 3px;
}

.path-cell span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  word-break: break-all;
}

.raw-log details {
  max-width: 360px;
}

.raw-log summary {
  cursor: pointer;
  color: var(--teal);
  font-weight: 800;
}

.raw-log div {
  margin-top: 6px;
  color: var(--muted);
  word-break: break-all;
  line-height: 1.45;
}

.action-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 52px;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(34, 49, 46, 0.09);
  font-weight: 900;
  font-size: 12px;
}

@media (max-width: 900px) {
  .event-drawer {
    top: 8px;
    right: 8px;
    bottom: 8px;
    width: calc(100vw - 16px);
    padding: 14px;
    border-radius: 20px;
  }
  .event-filter-bar, .event-summary-card {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1300px) {
  .pivot-layout {
    grid-template-columns: 1fr;
  }
  .edit-inspector {
    min-height: 0;
  }
}

@media (max-width: 1100px) {
  .app-shell { grid-template-columns: 1fr; width: min(100vw - 18px, 1000px); }
  .rail { position: static; height: auto; display: flex; align-items: center; gap: 18px; }
  .rail nav { display: flex; margin-top: 0; overflow-x: auto; }
  .rail-note { display: none; }
  .upload-grid, .visual-grid, .split-panel, .feedback-grid { grid-template-columns: 1fr; }
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .table-toolbar { flex-direction: column; }
  .toolbar-actions { justify-content: flex-start; }
}

@media (max-width: 680px) {
  .topbar { flex-direction: column; }
  .metric-grid { grid-template-columns: 1fr; }
  .panel { padding: 16px; }
  .rail { padding: 14px; border-radius: 20px; }
  .brand-mark { width: 52px; height: 52px; border-radius: 18px; }
  .chart, .chart.tall { min-height: 280px; }
}

.made-by {
  position: fixed;
  right: 14px;
  bottom: 12px;
  z-index: 80;
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(21, 32, 30, 0.72);
  color: #fff8d6;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.02em;
  backdrop-filter: blur(8px);
  box-shadow: 0 8px 24px rgba(21, 32, 30, 0.18);
}

/* Portal shell */
.portal-body { min-height: 100vh; background: radial-gradient(circle at top left, rgba(43, 108, 176, 0.14), transparent 34%), linear-gradient(135deg, #f5efe4 0%, #eef5f0 48%, #e9f0f7 100%); }
.portal-shell { display: grid; grid-template-columns: 220px minmax(0, 1fr); min-height: 100vh; }
.portal-rail { position: sticky; top: 0; height: 100vh; padding: 22px 16px; background: rgba(20, 36, 49, 0.94); color: #f8f3e9; display: flex; flex-direction: column; gap: 12px; box-shadow: 12px 0 30px rgba(12, 23, 31, 0.18); }
.portal-rail button, .portal-rail a { color: #f8f3e9; background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.12); border-radius: 14px; padding: 11px 12px; text-align: left; text-decoration: none; cursor: pointer; font-weight: 700; }
.portal-rail button.active, .portal-rail a:hover, .portal-rail button:hover { background: #f1b84b; color: #182431; }
.portal-main { min-width: 0; padding: 22px; }
.portal-topbar { margin-bottom: 16px; }
.portal-content { min-height: calc(100vh - 150px); }
.portal-panel { min-height: calc(100vh - 170px); }
.portal-frame { width: 100%; height: calc(100vh - 240px); min-height: 720px; border: 0; border-radius: 18px; background: #fff; box-shadow: inset 0 0 0 1px rgba(18, 32, 43, 0.08); }
.login-shell { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card { width: min(440px, 100%); padding: 34px; display: grid; gap: 16px; }
.login-card .brand-mark { margin-bottom: 4px; }
.login-card h1 { font-size: 24px; letter-spacing: -0.035em; line-height: 1.12; white-space: nowrap; }
.login-card p { color: #566675; line-height: 1.5; }
.portal-form { display: grid; gap: 12px; }
.portal-form label { display: grid; gap: 6px; font-weight: 700; color: #243646; }
.portal-form input, .portal-form select, .portal-toolbar input, .portal-toolbar select, .backup-settings input { border: 1px solid rgba(36, 54, 70, 0.18); border-radius: 12px; padding: 10px 12px; background: rgba(255,255,255,0.86); color: #1d2b38; }
.portal-toolbar { display: flex; gap: 10px; flex-wrap: wrap; margin: 14px 0; }
.portal-toolbar input { min-width: min(560px, 100%); flex: 1; }
.portal-two-col { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.portal-two-col.wide-left { grid-template-columns: minmax(0, 1.35fr) minmax(340px, 0.65fr); }
.mini-card { background: rgba(255,255,255,0.72); border: 1px solid rgba(36, 54, 70, 0.1); border-radius: 18px; padding: 16px; }
.portal-results h3 { margin: 22px 0 8px; }
.ghost-button { margin-top: auto; }
.link-button { border: 0; background: transparent; color: #0e5a9c; font-weight: 800; cursor: pointer; text-decoration: underline; }
.change-detail { max-height: calc(100vh - 330px); overflow: auto; }
.change-item { display: block; border: 1px solid rgba(36,54,70,0.12); border-radius: 14px; padding: 12px; margin: 10px 0; background: rgba(255,255,255,0.76); }
.change-item span { margin-left: 8px; font-weight: 800; color: #1f6b45; }
.change-item em { margin-left: 8px; color: #7c4a12; }
.change-item p { margin: 6px 0; color: #34495e; }
.main-compare { margin-top: 5px; padding: 6px 8px; border-radius: 10px; background: #eef4f7; font-size: 12px; }
.backup-settings { grid-template-columns: repeat(5, minmax(120px, 1fr)); align-items: end; margin-bottom: 16px; }
@media (max-width: 900px) { .portal-shell { grid-template-columns: 1fr; } .portal-rail { position: static; height: auto; flex-direction: row; flex-wrap: wrap; } .portal-two-col, .portal-two-col.wide-left, .backup-settings { grid-template-columns: 1fr; } .portal-frame { min-height: 620px; } }

/* Embedded full pages inside portal iframes */
html.embedded body { background: transparent; min-height: auto; }
html.embedded .app-shell { display: block; width: 100%; margin: 0; }
html.embedded .rail, html.embedded .topbar, html.embedded .made-by { display: none !important; }
html.embedded .workspace { padding: 0; }
html.embedded .workspace > section:first-child { margin-top: 0; }
html.embedded .panel { box-shadow: none; }
.portal-rail .rail-note { position: static; margin-top: auto; padding-top: 18px; border-top: 1px solid rgba(255, 255, 255, 0.16); }
.portal-rail .ghost-button { margin-top: 0; }

.user-settings-card { max-width: 760px; }
.inline-check { display: inline-flex !important; grid-template-columns: auto 1fr; align-items: center; gap: 8px !important; color: #243646; }
.inline-check input { width: auto; height: auto; }
.ai-run-row { align-items: center; }

.check-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.check-list .inline-check {
  padding: 6px 9px;
  border: 1px solid rgba(36, 54, 70, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  font-size: 13px;
}

.portal-form textarea,
.review-comment-box textarea {
  width: 100%;
  border: 1px solid rgba(36, 54, 70, 0.18);
  border-radius: 12px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.86);
  color: #1d2b38;
  resize: vertical;
}

.review-comment-box {
  display: grid;
  gap: 6px;
  margin: 10px 0;
  font-weight: 700;
  color: #243646;
}

.detail-actions {
  margin-top: 12px;
}

.review-note {
  margin: 7px 0;
  padding: 7px 9px;
  border-radius: 10px;
  background: #fff4d8;
  color: #64420b;
  font-size: 12px;
  font-weight: 800;
}

.item-editor-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed rgba(36, 54, 70, 0.18);
}

.item-editor-grid label {
  display: grid;
  gap: 4px;
  color: #243646;
  font-size: 12px;
  font-weight: 800;
}

.item-editor-grid input {
  min-width: 0;
  border: 1px solid rgba(36, 54, 70, 0.18);
  border-radius: 10px;
  padding: 8px 9px;
}

.item-editor-grid .wide-field {
  grid-column: 1 / -1;
}

.acl-section {
  margin-top: 16px;
}

.acl-table-wrap {
  max-height: 280px;
}

.acl-editor {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(36, 54, 70, 0.12);
}

.run-history {
  margin-top: 16px;
}

.run-history-wrap {
  max-height: 280px;
}

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

.stacked-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.admin-run-browser {
  margin: 16px 0;
}

.admin-run-list {
  max-height: 320px;
}

.admin-run-processes {
  max-height: 420px;
}

.admin-run-processes table {
  min-width: 1500px;
}

@media (max-width: 900px) {
  .branch-input-grid {
    grid-template-columns: 1fr;
  }
}


.group-layout {
  display: grid;
  grid-template-columns: minmax(420px, 0.9fr) minmax(520px, 1.1fr);
  gap: 14px;
  align-items: stretch;
}
.group-chart { min-height: 300px; }
.group-wrap { max-height: 360px; }

.directory-shell { width: min(1880px, calc(100vw - 28px)); }
.directory-panel { min-height: calc(100vh - 120px); }
.directory-layout {
  display: grid;
  grid-template-columns: minmax(460px, 0.9fr) minmax(640px, 1.1fr);
  gap: 16px;
  align-items: start;
}
.directory-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 10px 0 12px;
}
.folder-tree-card {
  overflow: auto;
  max-height: calc(100vh - 270px);
  min-height: 640px;
  border: 1px solid rgba(21, 32, 30, 0.1);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.72);
  padding: 10px;
}
.folder-node {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 8px 10px 8px calc(10px + var(--level, 0) * 22px);
  border-radius: 14px;
  border: 1px solid transparent;
}
.folder-node:hover { background: rgba(204, 231, 223, 0.28); }
.folder-node.selected { border-color: rgba(0, 108, 103, 0.36); background: rgba(240, 180, 41, 0.16); }
.folder-main { display: flex; gap: 9px; align-items: center; min-width: 0; }
.folder-icon {
  position: relative;
  width: 22px;
  height: 16px;
  flex: 0 0 auto;
  border-radius: 4px 4px 5px 5px;
  background: linear-gradient(180deg, #ffd66b, #f0a928);
  box-shadow: inset 0 -1px 0 rgba(100, 66, 11, 0.18);
}
.folder-icon::before {
  content: '';
  position: absolute;
  left: 2px;
  top: -5px;
  width: 10px;
  height: 7px;
  border-radius: 4px 4px 0 0;
  background: #ffe39a;
}
.folder-name {
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-weight: 850;
  text-align: left;
  word-break: break-all;
}
.folder-counts {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
}
.folder-counts span {
  padding: 4px 7px;
  border-radius: 999px;
  background: rgba(34, 49, 46, 0.07);
}
.folder-detail { margin: 0; }
.directory-filter-bar { grid-template-columns: 110px 140px minmax(160px, 1fr) 100px auto; }
.directory-event-wrap { max-height: calc(100vh - 420px); min-height: 420px; }
.folder-empty { padding: 18px; color: var(--muted); }
.scroll-jump {
  position: fixed;
  right: 18px;
  bottom: 44px;
  z-index: 70;
  display: grid;
  gap: 6px;
}
.scroll-jump button {
  border: 1px solid rgba(21, 32, 30, 0.14);
  border-radius: 999px;
  padding: 8px 10px;
  background: rgba(34, 49, 46, 0.9);
  color: #fff8d6;
  font-weight: 900;
  box-shadow: 0 10px 24px rgba(15, 24, 22, 0.22);
}
@media (max-width: 1300px) {
  .group-layout, .directory-layout { grid-template-columns: 1fr; }
  .folder-tree-card, .directory-event-wrap { max-height: 560px; min-height: 360px; }
}
html.embedded .directory-shell { display: block; width: 100%; margin: 0; }
html.embedded .directory-topbar { display: none; }

.feedback-import-panel { display: grid; gap: 10px; }
.feedback-import-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 8px; }
.feedback-import-actions input[type="file"] { max-width: 320px; }
.button-link { display: inline-flex; align-items: center; text-decoration: none; }
.feedback-import-preview { display: grid; gap: 12px; max-height: 520px; overflow: auto; }
.feedback-import-preview h3 { margin: 12px 0 4px; }
.feedback-import-preview select { border: 1px solid rgba(36, 54, 70, 0.18); border-radius: 10px; padding: 8px 10px; background: #fff; }

.directory-commit-bar { display: grid; grid-template-columns: minmax(120px, 1fr) minmax(120px, 1fr) minmax(160px, 1.2fr) auto auto; gap: 10px; align-items: center; margin: 12px 0; }
.directory-commit-bar input, #recommendFilter, #folderSort { border: 1px solid rgba(36, 54, 70, 0.18); border-radius: 12px; padding: 10px 12px; background: rgba(255,255,255,0.88); color: #1d2b38; }
.folder-select { width: 16px; height: 16px; accent-color: #006c67; }
.recommend-badge { border-radius: 999px; padding: 4px 8px; font-weight: 800; }
.recommend-badge.high { background: rgba(0, 108, 103, 0.14); color: #006c67; }
.recommend-badge.review { background: rgba(241, 184, 75, 0.22); color: #765000; }
.recommend-badge.low { background: rgba(70, 82, 94, 0.12); color: #46525e; }
.scope-badge { border-radius: 999px; padding: 4px 8px; font-weight: 800; background: rgba(36, 54, 70, 0.08); color: #324252; }
.scope-badge.inherited { background: rgba(241, 184, 75, 0.22); color: #765000; }
.scope-badge.mixed { background: rgba(0, 108, 103, 0.12); color: #006c67; }
.scope-badge.direct { background: rgba(70, 82, 94, 0.10); color: #46525e; }
.event-scope-note { caption-side: top; padding: 8px 10px; text-align: left; color: #324252; font-weight: 800; background: rgba(241, 184, 75, 0.14); border-radius: 10px; margin-bottom: 8px; }
.folder-reason {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin: 7px 0 0 calc(var(--level) * 18px + 46px);
  color: var(--muted);
  font-size: 12px;
}
.folder-reason-title { font-weight: 800; color: #1d2b38; }
.folder-reason-chip { border: 1px solid rgba(0, 108, 103, 0.14); border-radius: 999px; padding: 3px 8px; background: rgba(255, 255, 255, 0.74); color: #46525e; }
.more-folders { margin: 10px; width: calc(100% - 20px); }
@media (max-width: 900px) { .directory-commit-bar { grid-template-columns: 1fr; } }



