:root {
  color-scheme: light;
  --ink: #1f1b18;
  --muted: #6f6a66;
  --line: #d8d2cc;
  --panel: #ffffff;
  --page: #f6f5f3;
  --oracle: #c74634;
  --teal: #2c5967;
  --green: #2f6f4e;
  --soft-blue: #e9f3f7;
  --soft-red: #fbebe8;
  font-family: "Oracle Sans", Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--page);
  color: var(--ink);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.app-shell {
  width: min(1120px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 28px 0;
}

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

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

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 22px;
  min-width: 0;
}

.oci-logo {
  width: 230px;
  height: 54px;
  flex: 0 0 auto;
  object-fit: contain;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--oracle);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(26px, 3.2vw, 40px);
  line-height: 1.05;
  letter-spacing: 0;
  max-width: 850px;
}

.status-pill {
  min-width: 110px;
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 999px;
  padding: 8px 12px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  text-align: center;
}

.status-pill.ok {
  color: var(--green);
  border-color: #b8d2c1;
  background: #edf7f0;
}

.status-pill.error {
  color: var(--oracle);
  border-color: #efbbb2;
  background: var(--soft-red);
}

.auth-pill {
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  border: 1px solid #b8d2c1;
  background: #edf7f0;
  color: var(--green);
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 800;
}

.logout-link {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--teal);
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
}

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

.tool-panel,
.result-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 12px 32px rgba(31, 27, 24, 0.08);
}

.tool-panel {
  padding: 18px;
}

.drop-zone {
  position: relative;
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 16px;
  align-items: center;
  min-height: 160px;
  border: 1px dashed #b9b2ac;
  border-radius: 8px;
  background: #fbfaf9;
  padding: 22px;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.drop-zone.dragging {
  border-color: var(--teal);
  background: var(--soft-blue);
}

.drop-zone input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.file-icon {
  display: grid;
  place-items: center;
  width: 64px;
  height: 78px;
  border-radius: 6px;
  background: var(--teal);
  color: #fff;
  font-weight: 800;
  letter-spacing: 0;
}

.drop-zone label {
  display: block;
  margin-bottom: 6px;
  font-weight: 800;
  font-size: 18px;
}

.drop-zone p {
  margin: 0;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.readiness-panel {
  display: grid;
  gap: 8px;
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfaf9;
  padding: 14px;
}

.readiness-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 800;
}

.readiness-badge {
  border-radius: 999px;
  padding: 5px 9px;
  font-size: 12px;
  font-weight: 800;
}

.readiness-badge.neutral {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
}

.readiness-badge.ok {
  border: 1px solid #b8d2c1;
  background: #edf7f0;
  color: var(--green);
}

.readiness-badge.warning {
  border: 1px solid #d9c68b;
  background: #fff7df;
  color: #6f5a19;
}

.readiness-badge.error {
  border: 1px solid #efbbb2;
  background: var(--soft-red);
  color: var(--oracle);
}

.readiness-panel p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.readiness-panel ul {
  display: grid;
  gap: 5px;
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.flow-panel {
  display: grid;
  gap: 6px;
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfaf9;
  padding: 8px;
}

.tab-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  padding: 3px;
}

.tab-button {
  min-height: 24px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}

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

.tab-content {
  display: none;
  gap: 12px;
}

.tab-content.active {
  display: grid;
}

.tab-content h2 {
  margin: 0;
  font-size: 16px;
  line-height: 1.2;
}

.flow-art-wrap {
  display: grid;
  gap: 8px;
  margin: 0;
}

.flow-art {
  display: block;
  width: min(100%, 580px);
  height: auto;
  margin: 0 auto;
  object-fit: contain;
  border: 1px solid #d8d2cc;
  border-radius: 8px;
  background: #fff;
}

.flow-art-wrap figcaption {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-align: center;
}

.structure-grid {
  display: grid;
  gap: 10px;
}

.structure-grid div {
  display: grid;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  padding: 11px;
}

.structure-grid strong {
  color: var(--ink);
  font-size: 13px;
}

.structure-grid span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.action-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 120px;
  gap: 10px;
}

.primary-action,
.secondary-action {
  min-height: 48px;
  border-radius: 6px;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.primary-action {
  border: 0;
  background: var(--oracle);
  color: #fff;
}

.secondary-action {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--teal);
}

.primary-action:disabled,
.secondary-action:disabled {
  opacity: 0.62;
  cursor: wait;
}

.result-panel {
  min-height: 0;
  overflow: hidden;
}

.result-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--line);
  padding: 14px 16px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

.history-header {
  border-top: 1px solid var(--line);
}

.history-header button {
  border: 0;
  background: transparent;
  color: var(--teal);
  font: inherit;
  font-weight: 800;
  text-transform: uppercase;
  cursor: pointer;
}

.result-body {
  padding: 10px;
}

.empty-state,
.success-state,
.error-state {
  display: grid;
  gap: 6px;
  min-height: 0;
  align-content: center;
  border-radius: 8px;
  padding: 12px;
}

.empty-state {
  background: #f7f5f2;
  color: var(--muted);
}

.success-state {
  background: #edf7f0;
  color: var(--green);
}

.error-state {
  background: var(--soft-red);
  color: var(--oracle);
}

.empty-state strong,
.success-state strong,
.error-state strong {
  color: var(--ink);
  font-size: 16px;
}

.download-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  min-height: 40px;
  margin-top: 6px;
  border-radius: 6px;
  background: var(--teal);
  color: #fff;
  padding: 10px 14px;
  text-decoration: none;
  font-weight: 800;
}

.review-note {
  display: grid;
  gap: 3px;
  margin-top: 6px;
  border-left: 4px solid var(--oracle);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--muted);
  padding: 8px 10px;
  font-size: 11px;
  line-height: 1.4;
}

.review-note b {
  display: block;
  color: var(--ink);
  font-size: 12px;
}

.review-note span {
  display: block;
}

.history-list {
  display: grid;
  gap: 10px;
  max-height: 290px;
  overflow: auto;
  padding: 14px 16px 18px;
}

.history-empty {
  color: var(--muted);
  font-size: 14px;
}

.history-item {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #fbfaf9;
}

.history-item strong {
  color: var(--ink);
  font-size: 14px;
  overflow-wrap: anywhere;
}

.history-meta {
  color: var(--muted);
  font-size: 12px;
}

.history-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.history-actions a {
  border-radius: 6px;
  background: var(--soft-blue);
  color: var(--teal);
  padding: 7px 10px;
  text-decoration: none;
  font-size: 13px;
  font-weight: 800;
}

.signed-out-page {
  display: grid;
  place-items: center;
  padding: 24px;
}

.signed-out-shell {
  display: grid;
  gap: 14px;
  width: min(420px, 100%);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 12px 32px rgba(31, 27, 24, 0.08);
  padding: 28px;
}

.login-page {
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(90deg, rgba(199, 70, 52, 0.08) 0 22%, transparent 22% 100%),
    linear-gradient(180deg, #f7f5f2 0%, #eef5f6 100%);
}

.auth-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 420px);
  width: min(920px, 100%);
  min-height: 520px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 12px 32px rgba(31, 27, 24, 0.08);
  overflow: hidden;
}

.auth-brand {
  display: grid;
  align-content: space-between;
  gap: 28px;
  background:
    linear-gradient(135deg, rgba(44, 89, 103, 0.12), transparent 58%),
    #fbfaf9;
  padding: 34px;
}

.auth-logo {
  width: 246px;
  height: 58px;
  object-fit: contain;
}

.auth-brand h1 {
  font-size: clamp(38px, 6vw, 72px);
  max-width: 440px;
}

.auth-icon-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.auth-icon-strip span {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--teal);
  font-size: 13px;
  font-weight: 900;
}

.auth-icon-strip span:first-child {
  background: var(--oracle);
  color: #fff;
  border-color: var(--oracle);
}

.auth-icon-strip span:nth-child(2) {
  background: var(--teal);
  color: #fff;
  border-color: var(--teal);
}

.login-panel {
  display: grid;
  align-content: center;
  gap: 22px;
  padding: 28px;
}

.login-heading h2 {
  margin: 0 0 6px;
  font-size: 28px;
  line-height: 1.1;
}

.login-heading p {
  margin: 0;
  color: var(--muted);
}

.signed-out-logo {
  width: 220px;
  height: 52px;
  object-fit: contain;
}

.signed-out-shell p {
  margin: 0;
  color: var(--muted);
}

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

.login-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.login-form input {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 15px;
  padding: 10px 12px;
}

.login-error {
  margin: 0;
  border: 1px solid #efbbb2;
  border-radius: 6px;
  background: var(--soft-red);
  color: var(--oracle);
  padding: 10px 12px;
  font-size: 13px;
  font-weight: 800;
}

.primary-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  width: fit-content;
  border-radius: 6px;
  background: var(--oracle);
  color: #fff;
  padding: 10px 14px;
  text-decoration: none;
  font-weight: 800;
}

@media (max-width: 840px) {
  .workspace {
    grid-template-columns: 1fr;
  }

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

  .topbar-actions {
    justify-content: flex-start;
  }

  .auth-shell {
    grid-template-columns: 1fr;
  }

  .auth-brand {
    min-height: 300px;
  }
}

@media (max-width: 560px) {
  .app-shell {
    width: min(100vw - 20px, 1120px);
    padding: 14px 0;
  }

  .drop-zone,
  .action-row {
    grid-template-columns: 1fr;
  }

  .brand-lockup {
    align-items: flex-start;
  }

  .oci-logo {
    width: 190px;
    height: 44px;
  }

  .auth-brand,
  .login-panel,
  .signed-out-shell {
    padding: 22px;
  }

  .auth-logo,
  .signed-out-logo {
    width: 190px;
    height: 44px;
  }

  .file-icon {
    width: 56px;
    height: 68px;
  }

}
