:root {
  color-scheme: light;
  --ink: #0c1222;
  --muted: #647089;
  --line: #dbe2ef;
  --panel: #ffffff;
  --soft: #f4f7fb;
  --blue: #2563eb;
  --blue-2: #0f4fd7;
  --green: #0f9f6e;
  --amber: #b7791f;
  --red: #c2413a;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 8% 0%, rgba(37, 99, 235, 0.12), transparent 28rem),
    linear-gradient(180deg, #f8fbff 0%, #edf2fa 100%);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.shell {
  display: grid;
  min-height: 100vh;
  grid-template-columns: 300px 1fr;
}

.sidebar {
  border-right: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(18px);
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.mark {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  color: white;
  background: linear-gradient(135deg, #0f172a, #2563eb);
  font-weight: 900;
}

.brand p,
.brand span,
.trust p,
.trust span {
  margin: 0;
}

.brand p {
  font-weight: 900;
}

.brand span,
.trust span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.doc-list {
  display: grid;
  gap: 8px;
  overflow-y: auto;
  padding-right: 4px;
}

.doc-tab {
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  padding: 13px;
  text-align: left;
  display: grid;
  gap: 3px;
  color: var(--ink);
}

.doc-tab span {
  line-height: 1.25;
}

.doc-tab span {
  font-weight: 800;
}

.doc-tab small {
  color: var(--muted);
}

.doc-tab.active,
.doc-tab:hover {
  background: #fff;
  border-color: var(--line);
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.06);
}

.trust {
  margin-top: auto;
  border: 1px solid #cfe0ff;
  background: #eef5ff;
  border-radius: 8px;
  padding: 14px;
}

.trust p {
  color: var(--blue-2);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.workspace {
  padding: 24px;
  min-width: 0;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: start;
  margin: 0 auto 18px;
  max-width: 1280px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--blue);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  max-width: 760px;
  font-size: clamp(34px, 5vw, 66px);
  line-height: 0.95;
  letter-spacing: 0;
}

.actions {
  display: flex;
  gap: 10px;
}

.primary,
.icon-btn {
  min-height: 42px;
  border-radius: 999px;
  border: 1px solid transparent;
  padding: 0 17px;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.primary {
  background: var(--blue);
  color: white;
  box-shadow: 0 14px 30px rgba(37, 99, 235, 0.22);
}

.icon-btn {
  background: white;
  color: var(--ink);
  border-color: var(--line);
}

.notice,
.grid {
  max-width: 1280px;
  margin-left: auto;
  margin-right: auto;
}

.notice {
  display: flex;
  gap: 12px;
  align-items: start;
  border: 1px solid #f3d69a;
  background: #fff8e8;
  border-radius: 8px;
  padding: 12px 14px;
  color: #5f4014;
}

.notice strong {
  white-space: nowrap;
}

.notice span {
  line-height: 1.55;
}

.grid {
  display: grid;
  grid-template-columns: minmax(320px, 0.9fr) minmax(420px, 1.1fr);
  gap: 18px;
  margin-top: 18px;
}

.panel {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.9);
  border-radius: 8px;
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.08);
}

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

.panel-head span,
.editor-label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.fields {
  padding: 16px;
  display: grid;
  gap: 13px;
}

label {
  display: grid;
  gap: 7px;
  color: #283247;
  font-size: 13px;
  font-weight: 800;
}

input,
textarea {
  width: 100%;
  border: 1px solid #ccd6e6;
  border-radius: 8px;
  background: #fbfdff;
  padding: 12px;
  color: var(--ink);
  outline: none;
}

input:focus,
textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

textarea {
  min-height: 92px;
  resize: vertical;
  line-height: 1.55;
}

.wide {
  width: calc(100% - 32px);
  margin: 0 16px 16px;
}

.review-panel {
  min-height: 760px;
  display: flex;
  flex-direction: column;
}

.score-row {
  padding: 16px;
  display: grid;
  gap: 10px;
}

.score-row small {
  display: block;
  color: var(--muted);
  font-weight: 800;
  margin-bottom: 3px;
}

.score-row strong {
  font-size: 30px;
}

.meter {
  height: 8px;
  border-radius: 999px;
  overflow: hidden;
  background: #e7edf6;
}

.meter span {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--blue), var(--green));
  transition: width 0.25s ease;
}

.warnings {
  margin: 0 16px 14px;
  border: 1px solid #f0d7a4;
  background: #fffaf0;
  border-radius: 8px;
  padding: 12px;
  color: #684a17;
  font-size: 13px;
  line-height: 1.55;
}

.warnings p {
  margin: 0;
}

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

.editor-label {
  padding: 0 16px 8px;
}

.draft {
  flex: 1;
  margin: 0 16px 16px;
  width: calc(100% - 32px);
  min-height: 420px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 15px;
  line-height: 1.72;
  color: #111827;
  background: #fff;
}

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

  .sidebar {
    position: static;
  }

  .doc-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .grid,
  .topbar {
    grid-template-columns: 1fr;
  }

  .topbar {
    flex-direction: column;
  }
}

@media (max-width: 620px) {
  .workspace,
  .sidebar {
    padding: 16px;
  }

  .doc-list {
    grid-template-columns: 1fr;
  }

  .grid {
    display: block;
  }

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

  .notice,
  .actions {
    flex-direction: column;
  }
}

@media print {
  body {
    background: white;
  }

  .sidebar,
  .topbar,
  .form-panel,
  .notice,
  .score-row,
  .warnings,
  .panel-head,
  .editor-label {
    display: none !important;
  }

  .shell,
  .workspace,
  .grid,
  .review-panel {
    display: block;
    padding: 0;
    margin: 0;
    min-height: 0;
    box-shadow: none;
    border: 0;
  }

  .draft {
    border: 0;
    margin: 0;
    width: 100%;
    min-height: auto;
    resize: none;
    font-size: 12pt;
    line-height: 1.65;
  }
}
