:root {
  --ink: #1c2430;
  --muted: #5c6b7a;
  --line: #c5d0db;
  --paper: #f7f5f0;
  --panel: #ffffff;
  --navy: #1b3a4b;
  --navy-2: #245066;
  --gold: #b4532a;
  --ok: #1f6b45;
  --ok-bg: #e5f3eb;
  --bad: #8d2b2b;
  --bad-bg: #f8e8e6;
  --simple: #8a5a12;
  --simple-bg: #f8efd8;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font: 16px/1.45 "Segoe UI", "Liberation Sans", sans-serif;
  background:
    linear-gradient(180deg, #d7e0e8 0%, #c5d0da 100%);
}

.desktop {
  min-height: 100vh;
  padding: 28px 16px 40px;
}

.window {
  position: relative;
  max-width: 1100px;
  min-height: 740px;
  margin: 0 auto;
  background: var(--paper);
  border: 1px solid #8ea0b0;
  box-shadow: 0 16px 40px rgba(28, 36, 48, 0.18);
  display: flex;
  flex-direction: column;
}

.titlebar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 10px 14px;
  background: var(--navy);
  color: white;
}

.titlebar-name {
  font-weight: 650;
  letter-spacing: 0.02em;
}

.titlebar-user {
  min-height: 1.2em;
  font-size: 14px;
  color: #f3d7b0;
}

.menubar {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 6px 8px;
  background: #e7edf2;
  border-bottom: 1px solid var(--line);
}

.menubar button,
.btn,
.btn-ghost {
  font: inherit;
  cursor: pointer;
}

.menubar button {
  border: 1px solid transparent;
  background: transparent;
  color: var(--ink);
  padding: 6px 10px;
}

.menubar button:hover,
.menubar button.active {
  background: white;
  border-color: var(--line);
}

#content {
  flex: 1;
  padding: 22px 24px 28px;
}

.statusbar {
  padding: 8px 14px;
  border-top: 1px solid var(--line);
  background: #eef2f5;
  color: var(--muted);
  font-size: 14px;
}

h1 {
  margin: 0 0 8px;
  font-size: 28px;
  font-weight: 650;
}

h2 {
  margin: 28px 0 10px;
  font-size: 20px;
}

.lead, .note {
  color: var(--muted);
  max-width: 760px;
}

.user-banner {
  margin: 16px 0;
  padding: 12px 14px;
  background: var(--navy);
  color: white;
}

.user-banner strong { color: #f3d7b0; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin: 16px 0;
}

.card, .file-card, form.panel, .callout {
  background: var(--panel);
  border: 1px solid var(--line);
}

.card, .file-card {
  padding: 12px 14px;
}

.card span, .file-card span {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.files {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
}

.file-card button {
  margin-top: 8px;
}

.preview {
  margin-top: 16px;
  padding: 14px;
  background: white;
  border: 1px solid var(--line);
  white-space: pre-wrap;
}

.preview img {
  max-width: 100%;
  height: auto;
  display: block;
}

form.panel {
  padding: 14px;
  margin: 12px 0 20px;
}

.forms {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}

label {
  display: block;
  margin: 10px 0 4px;
  font-size: 14px;
}

input, select {
  width: 100%;
  font: inherit;
  padding: 8px 10px;
  border: 1px solid #9aafbf;
  background: white;
}

.field-label {
  display: block;
  margin: 10px 0 4px;
  font-size: 14px;
}

.callout ul {
  margin: 6px 0 0;
  padding-left: 18px;
}

.modes {
  display: flex;
  gap: 16px;
  margin: 8px 0;
}

.modes label {
  margin: 0;
}

.btn, .btn-ghost {
  border: 1px solid var(--navy);
  background: var(--navy);
  color: white;
  padding: 8px 12px;
  margin-top: 12px;
}

.btn-ghost {
  background: white;
  color: var(--navy);
}

.btn:disabled,
.btn-ghost:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.access-yes {
  margin-top: 5px;
  color: var(--ok) !important;
  font-weight: 650;
}

.access-no {
  margin-top: 5px;
  color: var(--bad) !important;
  font-weight: 650;
}

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

.model-option {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 0;
  padding: 12px;
  border: 1px solid var(--line);
  background: white;
}

.model-option input {
  width: auto;
  margin-top: 4px;
}

.model-option span,
.model-option small {
  display: block;
}

.model-option small {
  color: var(--muted);
  margin-top: 2px;
}

.model-future {
  opacity: 0.62;
}

.table-wrap { overflow-x: auto; margin: 8px 0 16px; }

table {
  width: 100%;
  border-collapse: collapse;
  background: white;
  font-variant-numeric: tabular-nums;
}

th, td {
  border: 1px solid var(--line);
  padding: 8px 10px;
  text-align: left;
  vertical-align: top;
}

th { background: #e7eef3; }

td.num, th.num { text-align: right; white-space: nowrap; }

.badge {
  display: inline-block;
  padding: 2px 8px;
  font-size: 13px;
}

.badge-simple { background: var(--simple-bg); color: var(--simple); }
.badge-complex { background: var(--ok-bg); color: var(--ok); }

.msg {
  margin: 10px 0;
  padding: 8px 10px;
}

.msg-ok { background: var(--ok-bg); color: var(--ok); }
.msg-bad { background: var(--bad-bg); color: var(--bad); }

.check-list {
  margin: 10px 0 0;
  padding-left: 18px;
}

.check-list li.yes { color: var(--ok); }
.check-list li.no { color: var(--bad); }

.formula {
  display: inline-block;
  margin: 8px 0 14px;
  padding: 8px 12px;
  background: white;
  border-left: 4px solid var(--gold);
  font-family: "Liberation Mono", ui-monospace, monospace;
  font-size: 20px;
}

.callout {
  padding: 12px 14px;
  margin: 12px 0;
}

.callout ol { margin: 8px 0 0; padding-left: 20px; }

.conclusions li { margin: 8px 0; }

.modal-back {
  position: absolute;
  inset: 0;
  z-index: 20;
  background: rgba(20, 28, 36, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.dialog {
  width: min(460px, 100%);
  background: var(--paper);
  border: 1px solid #8ea0b0;
  box-shadow: 0 10px 28px rgba(28, 36, 48, 0.2);
  padding: 18px 18px 14px;
}

.dialog h2 { margin-top: 0; }

.mono { font-family: "Liberation Mono", ui-monospace, monospace; font-size: 13px; }

@media (max-width: 720px) {
  .desktop { padding: 0; }
  .window { min-height: 100vh; border: 0; }
  #content { padding: 16px; }
}
