:root {
  color-scheme: light;
  --bg: #f6f4ef;
  --ink: #1c2430;
  --muted: #657080;
  --line: #d8d2c6;
  --panel: #fffdf8;
  --panel-2: #eef3f1;
  --blue: #2457a6;
  --green: #16775f;
  --amber: #9b6410;
  --red: #b84138;
  --shadow: 0 16px 45px rgba(31, 36, 48, 0.12);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
}

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

button {
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--ink);
  border-radius: 8px;
  min-height: 38px;
  padding: 0 12px;
  cursor: pointer;
}

button:hover {
  border-color: #9da8b5;
}

button.primary {
  border-color: var(--blue);
  background: var(--blue);
  color: #ffffff;
}

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

.sidebar {
  background: #23313f;
  color: #f8fbff;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 56px;
}

.brand-mark {
  width: 46px;
  height: 46px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: #f0b84b;
  color: #1f2933;
  font-weight: 800;
}

.brand h1 {
  margin: 0;
  font-size: 22px;
  line-height: 1.1;
  letter-spacing: 0;
}

.brand p {
  margin: 5px 0 0;
  color: #b8c5d1;
  font-size: 13px;
}

.panel {
  background: var(--panel);
  color: var(--ink);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.panel-head {
  min-height: 56px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 1px solid var(--line);
}

.panel h2 {
  margin: 0;
  font-size: 15px;
  letter-spacing: 0;
}

.input-panel textarea {
  width: 100%;
  min-height: 360px;
  resize: vertical;
  border: 0;
  border-bottom: 1px solid var(--line);
  padding: 14px;
  line-height: 1.45;
  color: #15202b;
  background: #fffaf0;
  outline: none;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 13px;
}

.actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 12px 14px;
}

.status {
  margin: 0;
  padding: 0 14px 14px;
  min-height: 34px;
  color: var(--muted);
  font-size: 13px;
}

.history-panel {
  min-height: 180px;
  overflow: hidden;
}

.project-list {
  display: grid;
  max-height: 280px;
  overflow: auto;
}

.project-item {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  display: grid;
  gap: 4px;
  cursor: pointer;
}

.project-item:hover {
  background: var(--panel-2);
}

.project-item strong {
  font-size: 14px;
}

.project-item span {
  color: var(--muted);
  font-size: 12px;
}

.workspace {
  min-width: 0;
  padding: 24px;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 16px;
}

.summary-band {
  background: #fffdf8;
  border: 1px solid var(--line);
  border-radius: 8px;
  min-height: 92px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  box-shadow: var(--shadow);
}

.summary-band div {
  padding: 18px;
  display: grid;
  align-content: center;
  gap: 6px;
  border-right: 1px solid var(--line);
}

.summary-band div:last-child {
  border-right: 0;
}

.label {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.summary-band strong {
  font-size: 28px;
  line-height: 1;
}

.toolbar {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) 190px 220px;
  gap: 10px;
}

.toolbar input,
.toolbar select {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: #ffffff;
  color: var(--ink);
}

.table-wrap {
  min-height: 0;
  overflow: auto;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

th,
td {
  padding: 13px 14px;
  border-bottom: 1px solid #e6e1d8;
  vertical-align: top;
  text-align: left;
}

th {
  position: sticky;
  top: 0;
  background: #f9f7f2;
  color: #4c5968;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  z-index: 1;
}

td {
  font-size: 14px;
}

th:nth-child(1),
td:nth-child(1) {
  width: 24%;
}

th:nth-child(2),
td:nth-child(2) {
  width: 18%;
}

th:nth-child(3),
td:nth-child(3) {
  width: 18%;
}

th:nth-child(4),
td:nth-child(4) {
  width: 14%;
}

.domain {
  font-weight: 700;
  color: #10243f;
  overflow-wrap: anywhere;
}

.topic {
  color: var(--muted);
}

.score-cell {
  display: grid;
  gap: 7px;
}

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

.score-bar span {
  display: block;
  height: 100%;
  background: var(--green);
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  border-radius: 999px;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.badge.register {
  background: #def3eb;
  color: var(--green);
}

.badge.watch {
  background: #fff0cd;
  color: var(--amber);
}

.badge.skip {
  background: #f9dedb;
  color: var(--red);
}

.reasons {
  margin: 0;
  padding-left: 17px;
  color: #3f4b5a;
}

.reasons li {
  margin-bottom: 4px;
}

.empty {
  height: 240px;
  text-align: center;
  color: var(--muted);
  vertical-align: middle;
}

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

  .sidebar {
    min-height: auto;
  }

  .workspace {
    padding: 18px;
  }
}

@media (max-width: 760px) {
  .summary-band,
  .toolbar {
    grid-template-columns: 1fr;
  }

  .summary-band div {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .summary-band div:last-child {
    border-bottom: 0;
  }

  th:nth-child(2),
  td:nth-child(2),
  th:nth-child(5),
  td:nth-child(5) {
    display: none;
  }

  th:nth-child(1),
  td:nth-child(1),
  th:nth-child(3),
  td:nth-child(3),
  th:nth-child(4),
  td:nth-child(4) {
    width: auto;
  }
}
