:root {
  font:
    15px/1.5 system-ui,
    "Tahoma",
    sans-serif;
  color: #17243a;
  background: #f0f3f8;
  --blue: #1757c6;
  --edge: #cbd5e1;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
a {
  color: #1757c6;
}
.top {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 22px;
  background: white;
  border-bottom: 1px solid var(--edge);
  flex-wrap: wrap;
}
.brand {
  font-weight: 800;
  letter-spacing: 0.5px;
  font-size: 20px;
  color: #153358;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
}
.brand small {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0;
}
.logo {
  display: grid;
  place-items: center;
  background: #1757c6;
  color: #fff;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  font-size: 23px;
}
.tag {
  font-size: 12px;
  background: #e9eff7;
  border-radius: 20px;
  padding: 3px 10px;
  color: #42536c;
}
.top h1 {
  font-size: 17px;
  margin: 0;
  flex: 1;
}
.home {
  max-width: 1110px;
  margin: 0 auto;
  padding: 48px 22px 30px;
}
.eyebrow {
  font-size: 12px;
  font-weight: 800;
  color: var(--blue);
  letter-spacing: 2px;
}
.home h1 {
  font-size: clamp(30px, 5vw, 52px);
  line-height: 1.16;
  letter-spacing: -0.5px;
  margin: 8px 0 16px;
}
.lead {
  max-width: 690px;
  color: #52627a;
  font-size: 17px;
}
.grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin: 30px 0;
}
.tile {
  display: block;
  background: white;
  border: 1px solid var(--edge);
  border-radius: 16px;
  padding: 22px;
  color: #17243a;
  text-decoration: none;
  transition:
    transform 0.15s,
    border 0.15s;
}
.tile:hover {
  transform: translateY(-3px);
  border-color: #1757c6;
}
.tile i {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border-radius: 14px;
  color: white;
  font: 700 25px system-ui;
}
.tile h2 {
  font-size: 19px;
  margin: 12px 0 4px;
}
.tile p {
  color: #52627a;
  margin: 0 0 14px;
}
.tile span {
  color: #1757c6;
  font-weight: 600;
}
.blue {
  background: #2563eb;
}
.green {
  background: #16804d;
}
.orange {
  background: #bc4d27;
}
.purple {
  background: #7546bc;
}
.navy {
  background: #174d82;
}
.teal {
  background: #147b82;
}
.notice {
  padding: 14px 18px;
  border: 1px solid #b6c6dc;
  background: #eaf1fa;
  border-radius: 10px;
  color: #283e59;
}
footer {
  padding: 14px 22px;
  color: #52627a;
  font-size: 13px;
}
.editor {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}
.toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  padding: 9px 12px;
  background: #fff;
  border-bottom: 1px solid var(--edge);
}
button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}
button,
select,
input:not([type="file"]):not([type="range"]):not([type="checkbox"]),
textarea {
  border: 1px solid #b9c6d7;
  border-radius: 6px;
  background: white;
  padding: 5px 8px;
  min-height: 36px;
  max-width: 100%;
}
button {
  cursor: pointer;
}
button:hover {
  background: #e8f0fc;
}
button.primary {
  background: #1757c6;
  color: white;
  border-color: #1757c6;
}
button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid #1763e6;
  outline-offset: 2px;
}
label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
}
input[type="color"] {
  width: 40px;
  padding: 2px !important;
}
input[type="number"] {
  width: 77px;
}
input[type="range"] {
  width: 100px;
}
.workspace {
  flex: 1;
  min-width: 0;
  min-height: 0;
  overflow: auto;
  padding: 16px;
}
.status {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  background: #fff;
  border-top: 1px solid var(--edge);
  flex-wrap: wrap;
}
.paper {
  width: min(100%, 794px);
  min-height: 1050px;
  background: white;
  margin: 12px auto;
  padding: 56px;
  box-shadow: 0 2px 10px #0002;
  outline: none;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
  color: #111;
}
.paper p {
  margin: 0 0 10px;
}
.paper table {
  border-collapse: collapse;
  width: 100%;
}
.paper td {
  border: 1px solid #555;
  padding: 5px;
}
.sheet-scroll {
  overflow: auto;
  max-height: 65vh;
  background: white;
}
.sheet {
  border-collapse: collapse;
  table-layout: fixed;
  width: max-content;
}
.sheet th,
.sheet td {
  border: 1px solid #d9e0e9;
  padding: 0;
  background: white;
}
.sheet th {
  position: sticky;
  top: 0;
  background: #e8edf4;
  font-weight: 600;
  min-width: 42px;
  z-index: 1;
}
.sheet td input {
  width: 110px;
  border: 0 !important;
  border-radius: 0 !important;
  min-height: 30px !important;
  padding: 4px !important;
}
.tabs,
.layers,
.panel {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
  background: #fff;
  padding: 9px;
  border: 1px solid var(--edge);
  border-radius: 8px;
  margin: 8px 0;
}
.active {
  background: #dce9ff !important;
  border-color: #1757c6 !important;
}
.canvas-wrap {
  display: grid;
  place-items: center;
  overflow: auto;
  background: #dce3ec;
  min-height: 240px;
  border-radius: 10px;
  padding: 12px;
}
.canvas-wrap canvas {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 65vh;
  object-fit: contain;
  touch-action: none;
  background-color: #fff;
  background-image: conic-gradient(
    #e3e8ed 25%,
    white 0 50%,
    #e3e8ed 0 75%,
    white 0
  );
  background-size: 18px 18px;
  box-shadow: 0 2px 10px #0002;
}
.studio-layout {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr) 215px;
  gap: 12px;
}
.side {
  background: white;
  border: 1px solid var(--edge);
  padding: 12px;
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: stretch;
}
.side h2 {
  font-size: 14px;
  margin: 0;
}
.side label {
  flex-wrap: wrap;
}
.side input:not([type="color"]),
.side textarea,
.side select {
  width: 100%;
}
.side textarea {
  min-height: 80px;
}
.side button {
  text-align: left;
}
.timeline {
  display: flex;
  overflow: auto;
  gap: 8px;
  padding: 12px;
  background: #dbe5ee;
  border-radius: 10px;
}
.clip {
  min-width: 170px;
  background: #fff;
  padding: 8px;
  border: 1px solid #a9bfd5;
  border-radius: 7px;
  display: grid;
  gap: 5px;
}
.clip input {
  width: 100px !important;
}
.clip strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 160px;
}
.guide {
  max-width: 850px;
  margin: 0 auto;
  padding: 24px;
}
.guide h2 {
  margin-top: 30px;
}
@media (max-width: 850px) {
  .studio-layout {
    grid-template-columns: 1fr;
  }
  .side {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
  }
  .side input:not([type="color"]),
  .side textarea,
  .side select {
    width: auto;
    max-width: 180px;
  }
  .grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .paper {
    min-height: 650px;
    padding: 20px;
  }
}
@media (max-width: 430px) {
  .grid {
    grid-template-columns: 1fr;
  }
  .home {
    padding: 24px 15px;
  }
  .workspace {
    padding: 8px;
  }
  .top {
    gap: 8px;
    padding: 8px;
  }
  .tile {
    padding: 16px;
  }
}
@media print {
  body.editor header,
  body.editor .toolbar,
  body.editor footer,
  .side,
  .tabs,
  .layers {
    display: none !important;
  }
  .workspace {
    padding: 0;
    overflow: visible;
  }
  .paper {
    margin: 0;
    width: 100%;
    min-height: 0;
    box-shadow: none;
    padding: 0;
  }
  .canvas-wrap {
    background: white;
    padding: 0;
  }
  .canvas-wrap canvas {
    max-height: none;
    box-shadow: none;
  }
  .studio-layout {
    display: block;
  }
  @page {
    size: A4;
    margin: 16mm;
  }
}
/* 0.2.1: grouped commands and a canvas-first compact layout */
.module-help {
  margin: 12px 16px 0;
  padding: 10px 14px;
  background: #eaf1fa;
  border: 1px solid #b6c6dc;
  border-radius: 10px;
  font-size: 14px;
}
.module-help p {
  margin: 8px 0 0;
  max-width: 1000px;
}
summary {
  cursor: pointer;
  font-weight: 650;
  min-height: 32px;
  display: list-item;
  align-content: center;
}
.toolbar {
  align-items: flex-start;
  background: #f8faff;
}
.toolbar-group {
  flex: 1 1 240px;
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid #d9e2ef;
  border-radius: 9px;
  background: #fff;
}
.toolbar-group summary {
  font-size: 13px;
  color: #43546d;
}
.toolbar-items {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  padding-top: 7px;
}
.toolbar-items > label {
  min-width: 0;
  max-width: 100%;
}
.toolbar-items input[type="text"] {
  min-width: 0;
  width: 180px;
}
.inspector {
  min-width: 0;
  background: #fff;
  border: 1px solid var(--edge);
  border-radius: 10px;
  padding: 10px;
}
.inspector > .side {
  border: 0;
  padding: 3px 0;
  margin: 0;
}
.inspector > .side > h2:first-child {
  display: none;
}
.sheet input:focus {
  background: #eaf2ff !important;
  outline: 2px solid #1757c6;
  outline-offset: -2px;
}
button,
select,
input:not([type="file"]):not([type="range"]):not([type="checkbox"]) {
  min-height: 40px;
}
@media (max-width: 850px) {
  .toolbar {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  .toolbar-group {
    grid-column: 1/-1;
    width: 100%;
  }
  .toolbar-group:not([open]) {
    padding: 5px 10px;
  }
  .studio-layout {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }
  .studio-layout > .canvas-wrap {
    grid-column: 1/-1;
    grid-row: 1;
  }
  .inspector {
    grid-column: 1/-1;
  }
  .inspector .side {
    align-items: flex-start;
  }
  .side label {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    max-width: 100%;
  }
  .side .side {
    width: 100%;
    min-width: 0;
  }
  .module-help {
    margin: 8px 8px 0;
  }
  .paper {
    min-height: 580px;
    margin: 0 auto;
  }
  .panel > label {
    min-width: 0;
    flex: 1;
  }
  .panel input[type="text"] {
    min-width: 0;
    width: 100%;
  }
  .status {
    font-size: 12px;
    padding: 10px;
  }
  .canvas-wrap {
    min-height: 180px;
    padding: 8px;
  }
  .canvas-wrap canvas {
    max-height: 55vh;
  }
}
@media print {
  .module-help,
  .inspector {
    display: none !important;
  }
}
