:root {
  --bg: #e8f1f2;
  --panel: #ffffff;
  --panel-soft: #f9f9f9;
  --line: #c9dadd;
  --text: #12343b;
  --muted: #49666d;
  --primary: #004f62;
  --accent: #1f93b4;
  --active: #004f62;
  --active-soft: #dff0f4;
  --shadow: 0 1px 6px rgba(0, 79, 98, 0.14);
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  touch-action: none;
  user-select: none;
}

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

.app-shell {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  width: 100vw;
  height: 100dvh;
}

body.is-presentation-mode {
  background: #0f1f24;
}

body.is-presentation-mode .app-shell {
  grid-template-columns: minmax(0, 1fr);
}

.page-rail {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 10px 8px;
  border-right: 1px solid var(--line);
  background: #dcebed;
}

.page-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
  padding-bottom: 8px;
}

.page-thumb-row {
  display: grid;
  gap: 4px;
  padding: 4px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.3);
  transition: border-color 120ms ease, background 120ms ease, box-shadow 120ms ease, transform 120ms ease;
}

.page-thumb {
  display: grid;
  place-items: center;
  height: 48px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  color: var(--muted);
  box-shadow: none;
}

.page-thumb canvas {
  position: static;
  display: block;
  width: 52px;
  height: 40px;
  border: 1px solid #e4e7ec;
  background: #fff;
}

.page-thumb-row.is-active {
  border-color: rgba(0, 79, 98, 0.26);
  background: rgba(255, 255, 255, 0.7);
  box-shadow: inset 0 0 0 1px rgba(31, 147, 180, 0.14);
}

.page-thumb-row.is-active .page-thumb {
  border-color: var(--active);
  color: var(--active);
  box-shadow: inset 0 0 0 2px rgba(0, 79, 98, 0.2);
}

.page-thumb-row.is-dragging {
  opacity: 0.68;
  transform: scale(0.98);
}

.page-thumb-row.is-drop-target {
  border-color: var(--accent);
  background: rgba(223, 240, 244, 0.9);
  box-shadow: 0 0 0 2px rgba(31, 147, 180, 0.16);
}

.page-thumb-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  min-height: 18px;
}

.page-thumb-label {
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.page-thumb-row.is-active .page-thumb-label {
  color: var(--active);
}

.page-thumb-delete {
  min-width: 18px;
  min-height: 18px;
  padding: 0;
  border: 1px solid rgba(0, 79, 98, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.88);
  color: #7b5a61;
  font-size: 14px;
  line-height: 1;
}

.page-thumb-delete:active {
  border-color: #c44d3b;
  background: rgba(196, 77, 59, 0.1);
  color: #9a3020;
}

.board-area {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-width: 0;
  min-height: 0;
}

body.is-presentation-mode .page-rail,
body.is-presentation-mode .toolbar {
  display: none;
}

.toolbar {
  display: grid;
  gap: 8px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  background: var(--panel-soft);
  box-shadow: var(--shadow);
  z-index: 2;
}

.toolbar-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex-wrap: wrap;
}

.tool-group {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}

.tool-button,
.icon-button,
.swatch {
  min-width: 36px;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
}

.tool-button {
  padding: 0 10px;
}

.icon-button {
  padding: 0 9px;
}

.icon-tool-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.symbol-button {
  min-width: 36px;
  padding: 0 7px;
  font-size: 18px;
  line-height: 1;
}

.tool-button.is-active,
.icon-button.is-active,
.icon-button:active,
.tool-button:active {
  border-color: var(--active);
  background: var(--active-soft);
  color: var(--active);
}

.tool-button:disabled,
.icon-button:disabled {
  opacity: 0.42;
  cursor: default;
}

.toolbar-icon {
  position: relative;
  z-index: 1;
  display: block;
  width: 20px;
  height: 20px;
  background-color: currentColor;
  mask-position: center;
  mask-repeat: no-repeat;
  mask-size: contain;
  -webkit-mask-position: center;
  -webkit-mask-repeat: no-repeat;
  -webkit-mask-size: contain;
}

.toolbar-icon--select {
  mask-image: url("../SVG/select.svg");
  -webkit-mask-image: url("../SVG/select.svg");
}

.toolbar-icon--pen {
  mask-image: url("../SVG/pen.svg");
  -webkit-mask-image: url("../SVG/pen.svg");
}

.toolbar-icon--marker {
  width: 22px;
  height: 22px;
  mask-image: url("../SVG/marker.svg");
  -webkit-mask-image: url("../SVG/marker.svg");
}

.toolbar-icon--eraser {
  width: 22px;
  height: 22px;
  mask-image: url("../SVG/eraser.svg");
  -webkit-mask-image: url("../SVG/eraser.svg");
}

.toolbar-icon--text {
  mask-image: url("../SVG/text.svg");
  -webkit-mask-image: url("../SVG/text.svg");
}

.toolbar-icon--text-add {
  mask-image: url("../SVG/text-add.svg");
  -webkit-mask-image: url("../SVG/text-add.svg");
}

.toolbar-icon--plus {
  mask-image: url("../SVG/plus.svg");
  -webkit-mask-image: url("../SVG/plus.svg");
}

.toolbar-icon--stamp {
  mask-image: url("../SVG/stamp.svg");
  -webkit-mask-image: url("../SVG/stamp.svg");
}

.toolbar-icon--undo {
  mask-image: url("../SVG/undo.svg");
  -webkit-mask-image: url("../SVG/undo.svg");
}

.toolbar-icon--clear {
  mask-image: url("../SVG/clear.svg");
  -webkit-mask-image: url("../SVG/clear.svg");
}

.toolbar-icon--export-pdf {
  mask-image: url("../SVG/export-pdf.svg");
  -webkit-mask-image: url("../SVG/export-pdf.svg");
}

.toolbar-icon--more {
  mask-image: url("../SVG/more.svg");
  -webkit-mask-image: url("../SVG/more.svg");
}

.toolbar-icon--ruler {
  mask-image: url("../SVG/ruler.svg");
  -webkit-mask-image: url("../SVG/ruler.svg");
}

.toolbar-icon--coordinate {
  mask-image: url("../SVG/coordinate.svg");
  -webkit-mask-image: url("../SVG/coordinate.svg");
}

.toolbar-icon--triangle {
  mask-image: url("../SVG/triangle.svg");
  -webkit-mask-image: url("../SVG/triangle.svg");
}

.toolbar-icon--timer {
  mask-image: url("../SVG/timer.svg");
  -webkit-mask-image: url("../SVG/timer.svg");
}

.toolbar-icon--clock {
  mask-image: url("../SVG/clock.svg");
  -webkit-mask-image: url("../SVG/clock.svg");
}

.toolbar-icon--keyboard {
  mask-image: url("../SVG/keyboard.svg");
  -webkit-mask-image: url("../SVG/keyboard.svg");
}

.toolbar-icon--focus-text {
  mask-image: url("../SVG/focus-text.svg");
  -webkit-mask-image: url("../SVG/focus-text.svg");
}

.toolbar-icon--calculator {
  mask-image: url("../SVG/calculator.svg");
  -webkit-mask-image: url("../SVG/calculator.svg");
}

.marker-button {
  border-color: var(--line);
  background: #fff;
  color: var(--text);
  box-shadow: none;
}

.marker-button::before {
  content: none;
}

.tool-button--colorized .toolbar-icon {
  color: inherit;
}

.tool-button--colorized.marker-button::before {
  content: "";
  position: absolute;
  left: 7px;
  right: 7px;
  bottom: 8px;
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.28);
  transform: rotate(-10deg);
}

.marker-button .toolbar-icon {
  color: inherit;
}

.marker-button.is-active,
.marker-button:active {
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18);
}

.swatch {
  position: relative;
  display: inline-grid;
  width: 26px;
  min-width: 26px;
  height: 26px;
  padding: 3px;
  place-items: stretch;
  border: 1px solid rgba(0, 79, 98, 0.16);
  border-radius: 9px;
  background: linear-gradient(180deg, rgba(255,255,255,0.96), rgba(239,246,247,0.96));
  box-shadow: inset 0 -1px 0 rgba(0, 79, 98, 0.06);
}

.swatch-color {
  display: block;
  width: 100%;
  min-height: 18px;
  border-radius: 6px;
  background: var(--swatch, #fff);
  box-shadow:
    inset 0 0 0 1px rgba(0, 0, 0, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.36);
  pointer-events: none;
}

.swatch-color.has-border {
  box-shadow: inset 0 0 0 1px #98a2b3;
}

.swatch.is-active {
  border-color: var(--active);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.86),
    0 0 0 2px rgba(31, 147, 180, 0.18);
  transform: translateY(-1px);
}

.swatch.is-pressed {
  border-color: var(--active);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.86),
    0 0 0 3px rgba(31, 147, 180, 0.22);
}

.swatch--detailed {
  width: 100%;
  min-width: 0;
  height: auto;
  min-height: 32px;
  grid-template-columns: 20px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 10px;
  text-align: left;
}

.swatch--detailed .swatch-color {
  min-height: 18px;
  width: 18px;
  border-radius: 999px;
}

.swatch-label {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
}

.swatch-variant-menu {
  position: fixed;
  width: 188px;
  max-width: calc(100vw - 16px);
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid rgba(0, 79, 98, 0.16);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 14px 30px rgba(0, 79, 98, 0.2);
  backdrop-filter: blur(10px);
  z-index: 24;
}

.swatch-variant-menu[hidden] {
  display: none;
}

.swatch-variant-title {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.swatch-variant-grid {
  display: grid;
  gap: 6px;
}

.swatch-variant-button {
  min-height: 34px;
}

.color-menu {
  position: relative;
}

.stamp-menu,
.insert-menu {
  position: relative;
}

.color-menu summary,
.stamp-menu summary,
.insert-menu summary,
.overflow-menu summary {
  display: grid;
  min-width: 44px;
  min-height: 34px;
  padding: 0 9px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  cursor: pointer;
  list-style: none;
}

.color-menu summary::-webkit-details-marker,
.stamp-menu summary::-webkit-details-marker,
.insert-menu summary::-webkit-details-marker,
.overflow-menu summary::-webkit-details-marker {
  display: none;
}

.color-menu[open] summary,
.stamp-menu[open] summary,
.insert-menu[open] summary,
.overflow-menu[open] summary {
  border-color: var(--active);
  background: var(--active-soft);
  color: var(--active);
}

.color-menu-panel,
.stamp-menu-panel,
.insert-menu-panel,
.overflow-menu-panel {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  display: grid;
  grid-template-columns: repeat(6, 20px);
  gap: 6px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
  z-index: 10;
}

.color-menu-panel {
  min-width: 180px;
  grid-template-columns: minmax(150px, 1fr);
  gap: 8px;
  padding: 10px;
}

.color-menu-summary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.color-menu-chip {
  display: inline-block;
  width: 14px;
  height: 14px;
  border-radius: 999px;
  background: var(--swatch, #fff);
  box-shadow:
    inset 0 0 0 1px rgba(0, 0, 0, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.36);
}

.stamp-menu-panel {
  grid-template-columns: repeat(4, 44px);
}

.insert-menu-panel {
  grid-template-columns: minmax(168px, 1fr);
}

.overflow-menu {
  position: relative;
  margin-left: auto;
}

.overflow-menu-panel {
  left: auto;
  right: 0;
  min-width: 250px;
  max-width: min(286px, calc(100vw - 16px));
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
  padding: 10px;
}

.overflow-menu-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}

.overflow-menu-tab {
  min-height: 32px;
  padding: 0 8px;
  border: 1px solid rgba(0, 79, 98, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.overflow-menu-tab.is-active,
.overflow-menu-tab:active {
  border-color: var(--active);
  background: var(--active-soft);
  color: var(--active);
}

.overflow-menu-section {
  display: none;
  gap: 8px;
}

.overflow-menu-section.is-active {
  display: grid;
}

.about-panel {
  display: grid;
  gap: 10px;
  padding: 4px 2px 2px;
  color: var(--text);
  font-size: 13px;
  line-height: 1.45;
}

.about-panel h3 {
  margin: 0;
  font-size: 14px;
}

.about-panel p {
  margin: 0;
}

.about-panel a {
  color: var(--active);
  font-weight: 600;
  text-decoration: none;
}

.about-panel a:hover,
.about-panel a:focus-visible {
  text-decoration: underline;
}

.insert-menu-button {
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  text-align: left;
}

.insert-menu-button.is-active,
.insert-menu-button:active {
  border-color: var(--primary);
  background: var(--active-soft);
}

.icon-menu-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.icon-menu-button .toolbar-icon {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

.stamp-button {
  min-width: 44px;
  min-height: 42px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  font-size: 24px;
  line-height: 1;
}

.stamp-button.is-active,
.stamp-button:active {
  border-color: var(--primary);
  background: var(--active-soft);
}

.size-control {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 150px;
  color: var(--muted);
  font-size: 13px;
}

.size-control select {
  min-height: 34px;
  min-width: 92px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  padding: 0 8px;
}

.size-control--compact {
  min-width: auto;
}

.select-control {
  display: grid;
  gap: 3px;
  color: var(--muted);
  font-size: 12px;
}

.select-control span,
.size-control span {
  white-space: nowrap;
}

.select-control--zoom {
  min-width: 126px;
}

.select-control select {
  min-height: 34px;
  max-width: 140px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  padding: 0 8px;
}

.canvas-wrap {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: auto;
  background: #d6e5e8;
  padding: 24px;
  overscroll-behavior: contain;
}

body.is-presentation-mode .canvas-wrap {
  padding: 10px;
  background:
    radial-gradient(circle at top, rgba(31, 147, 180, 0.12), transparent 30%),
    #112127;
}

.context-menu {
  position: fixed;
  min-width: 244px;
  max-width: min(280px, calc(100vw - 16px));
  padding: 10px;
  border: 1px solid rgba(0, 79, 98, 0.18);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 14px 30px rgba(0, 79, 98, 0.2);
  backdrop-filter: blur(10px);
  z-index: 30;
}

.presentation-controls {
  position: fixed;
  right: 16px;
  top: 16px;
  z-index: 36;
  display: flex;
  gap: 8px;
  padding: 8px;
  border: 1px solid rgba(214, 229, 232, 0.24);
  border-radius: 14px;
  background: rgba(10, 24, 29, 0.72);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.22);
  backdrop-filter: blur(12px);
}

.presentation-controls[hidden] {
  display: none;
}

.presentation-control-button {
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid rgba(223, 240, 244, 0.22);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: #f3fbfd;
  font-size: 13px;
  font-weight: 700;
}

.presentation-control-button.is-active,
.presentation-control-button:active {
  border-color: #7ee7ff;
  background: rgba(126, 231, 255, 0.18);
  color: #dffaff;
}

.pen-tool-menu {
  position: fixed;
  z-index: 26;
  display: grid;
  gap: 6px;
  width: 176px;
  max-width: calc(100vw - 16px);
  padding: 10px;
  border: 1px solid rgba(0, 79, 98, 0.16);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 14px 30px rgba(0, 79, 98, 0.2);
  backdrop-filter: blur(10px);
}

.pen-tool-menu[hidden] {
  display: none;
}

.pen-tool-menu-button {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 10px;
  border: 1px solid rgba(0, 79, 98, 0.12);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.94);
  color: var(--text);
  text-align: left;
}

.pen-tool-menu-button.is-active,
.pen-tool-menu-button:active {
  border-color: var(--active);
  background: var(--active-soft);
  color: var(--active);
}

.pen-tool-menu-glyph {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: rgba(31, 147, 180, 0.1);
  font-size: 15px;
  line-height: 1;
}

.pen-tool-menu-label {
  font-size: 13px;
  font-weight: 700;
}

.context-menu-section + .context-menu-section {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid #e2eaec;
}

.context-menu-title {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.context-tool-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.context-menu-button {
  min-height: 36px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  cursor: pointer;
}

.context-menu-button:active {
  border-color: var(--primary);
  background: var(--active-soft);
}

.context-menu-button.is-active {
  border-color: var(--active);
  background: var(--active-soft);
  color: var(--active);
}

.page-stage {
  position: relative;
  margin: 0 auto;
}

.board-page {
  position: relative;
  background: #fff;
  box-shadow: 0 3px 18px rgba(0, 79, 98, 0.18);
  transform-origin: top left;
}

.board-page.is-portrait {
  width: 794px;
  height: 1123px;
}

.board-page.is-landscape {
  width: 1123px;
  height: 794px;
}

.board-page > canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background: transparent;
  touch-action: none;
}

.board-page-meta {
  position: absolute;
  top: 14px;
  right: 18px;
  z-index: 2;
  color: rgba(73, 102, 109, 0.72);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  pointer-events: none;
  user-select: none;
}

.laser-pointer {
  position: absolute;
  z-index: 8;
  width: 22px;
  height: 22px;
  transform: translate(-50%, -50%) scale(0.92);
  border-radius: 50%;
  background:
    radial-gradient(circle, rgba(255, 245, 220, 0.94) 0 16%, rgba(255, 92, 92, 0.74) 24%, rgba(255, 0, 0, 0.22) 52%, transparent 72%);
  box-shadow:
    0 0 8px rgba(255, 64, 64, 0.2),
    0 0 16px rgba(255, 82, 82, 0.1);
  opacity: 0;
  pointer-events: none;
  transition: opacity 1.4s ease, transform 0.14s ease;
}

.laser-pointer.is-visible {
  opacity: 0.92;
  transform: translate(-50%, -50%) scale(1);
}

.laser-pointer.is-visible.is-fading {
  opacity: 0;
  transform: translate(-50%, -50%) scale(1.04);
}

.laser-pointer-trail {
  position: absolute;
  z-index: 7;
  width: 14px;
  height: 14px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background:
    radial-gradient(circle, rgba(255, 238, 214, 0.5) 0 14%, rgba(255, 92, 92, 0.22) 34%, rgba(255, 0, 0, 0.04) 68%, transparent 74%);
  opacity: 0.72;
  pointer-events: none;
  transition: opacity 0.9s ease, transform 0.9s ease;
}

.laser-pointer-trail.is-fading {
  opacity: 0;
  transform: translate(-50%, -50%) scale(1.45);
}

#paintCanvas {
  background: #fff;
}

.image-controls {
  position: absolute;
  z-index: 4;
  display: grid;
  gap: 4px;
  padding: 4px;
  border: 1px solid rgba(0, 79, 98, 0.26);
  border-radius: 6px;
  background: rgba(232, 241, 242, 0.94);
  box-shadow: 0 2px 8px rgba(0, 79, 98, 0.18);
}

.image-controls-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  padding: 0 6px 0 8px;
  border-radius: 5px;
  background: rgba(223, 240, 244, 0.96);
  cursor: move;
}

.image-controls-title {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  color: var(--primary);
  font-size: 12px;
  font-weight: 700;
}

.image-controls-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.image-selection {
  position: absolute;
  z-index: 3;
  border: 2px solid var(--accent);
  box-shadow: 0 0 0 2px rgba(31, 147, 180, 0.18);
  pointer-events: none;
}

.image-control-button,
.image-controls button {
  min-width: 32px;
  min-height: 28px;
  padding: 0 7px;
  border: 1px solid rgba(0, 79, 98, 0.22);
  border-radius: 4px;
  background: #fff;
  color: var(--primary);
  font-weight: 700;
}

.image-control-button--close {
  min-width: 28px;
  padding: 0;
}

.image-controls button:active,
.image-control-button:active {
  background: var(--primary);
  color: #fff;
}

.embed-card {
  position: absolute;
  z-index: 3;
  display: grid;
  grid-template-rows: 34px minmax(0, 1fr);
  min-width: 280px;
  min-height: 180px;
  overflow: hidden;
  border: 1px solid rgba(0, 79, 98, 0.22);
  border-radius: 10px;
  background: #ffffff;
  box-shadow: 0 8px 20px rgba(0, 79, 98, 0.12);
  resize: both;
}

.embed-card.is-active {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(31, 147, 180, 0.18), 0 8px 20px rgba(0, 79, 98, 0.16);
}

.embed-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 0 6px 0 10px;
  border: 0;
  border-bottom: 1px solid rgba(0, 79, 98, 0.14);
  background: linear-gradient(180deg, rgba(223, 240, 244, 0.96), rgba(214, 229, 232, 0.96));
  color: var(--primary);
  cursor: move;
  text-align: left;
}

.embed-title {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 12px;
  font-weight: 700;
}

.embed-actions {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex: 0 0 auto;
}

.embed-control-button {
  min-width: 24px;
  min-height: 24px;
  padding: 0;
  border: 1px solid rgba(0, 79, 98, 0.16);
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.86);
  color: var(--primary);
  font-size: 14px;
  line-height: 1;
}

.embed-frame {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: #fff;
}

.calculator-card {
  position: absolute;
  z-index: 3;
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr);
  min-width: 220px;
  min-height: 280px;
  overflow: hidden;
  border: 1px solid rgba(0, 79, 98, 0.22);
  border-radius: 18px;
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.34), transparent 22%),
    linear-gradient(180deg, #eff6f7, #ffffff 16%, #f4f9fa 100%);
  box-shadow: 0 12px 28px rgba(0, 79, 98, 0.14);
  resize: both;
}

.calculator-card.is-active {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(31, 147, 180, 0.18), 0 12px 28px rgba(0, 79, 98, 0.18);
}

.calculator-card-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 0 10px 0 14px;
  border-bottom: 1px solid rgba(0, 79, 98, 0.12);
  background: linear-gradient(180deg, rgba(223, 240, 244, 0.96), rgba(214, 229, 232, 0.96));
  color: var(--primary);
  cursor: move;
}

.calculator-card-title {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 13px;
  font-weight: 800;
}

.calculator-card-actions {
  display: inline-flex;
  gap: 4px;
}

.calculator-card-close,
.calculator-tab-button,
.calculator-button,
.calculator-key {
  min-height: 32px;
  border: 1px solid rgba(0, 79, 98, 0.18);
  border-radius: 10px;
  background: #fff;
  color: var(--text);
}

.calculator-card-close {
  min-width: 30px;
  padding: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.86);
  color: var(--primary);
  font-size: 18px;
  line-height: 1;
}

.calculator-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 4px 6px 0;
}

.calculator-tab-button {
  min-height: 16px;
  padding: 0 6px;
  border: 1px solid rgba(11, 109, 134, 0.22);
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(233, 244, 247, 0.94));
  color: #0b5f75;
  font-size: 6px;
  font-weight: 800;
  letter-spacing: 0.03em;
  box-shadow: inset 0 -1px 0 rgba(11, 109, 134, 0.1);
}

.calculator-tab-button.is-active {
  border-color: #0b6d86;
  background:
    linear-gradient(180deg, rgba(215, 239, 244, 1), rgba(191, 228, 236, 0.98));
  color: #084f61;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.58),
    0 0 0 1px rgba(11, 109, 134, 0.12);
}

.calculator-tab-button:not(.is-active) {
  opacity: 0.92;
}

.calculator-screen {
  display: grid;
  gap: 3px;
  margin: 4px 6px 0;
  padding: 5px;
  border: 1px solid rgba(24, 35, 19, 0.16);
  border-radius: 10px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.34), transparent 24%),
    linear-gradient(180deg, #deebcb, #c8d7b2);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.calculator-screen.is-hidden {
  display: none;
}

.calculator-screen-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  color: #46513a;
  font-size: 6px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.calculator-expression {
  width: 100%;
  min-height: 24px;
  border: 1px solid rgba(24, 35, 19, 0.16);
  border-radius: 6px;
  padding: 5px 6px;
  background: rgba(255, 255, 255, 0.24);
  color: #182313;
  resize: none;
  font: 8px/1.25 "Courier New", monospace;
}

.calculator-result {
  color: #111b0d;
  font: 800 11px/1 "Courier New", monospace;
  text-align: right;
}

.calculator-note {
  min-height: 8px;
  color: rgba(24, 35, 19, 0.8);
  font-size: 6px;
  font-weight: 700;
  text-align: right;
}

.calculator-history {
  display: grid;
  gap: 2px;
  max-height: 22px;
  overflow: auto;
  padding-top: 2px;
  border-top: 1px solid rgba(24, 35, 19, 0.12);
}

.calculator-history-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px;
  color: #26311e;
  font-size: 6px;
  font-family: "Courier New", monospace;
}

.calculator-history-expression {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.calculator-history-empty {
  color: rgba(38, 49, 30, 0.56);
  font-size: 6px;
}

.calculator-panel {
  display: grid;
  align-content: start;
  min-height: 0;
  padding: 4px 6px 6px;
  overflow: auto;
}

.calculator-actions-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 4px;
}

.calculator-button {
  min-height: 18px;
  padding: 0 6px;
  font-size: 7px;
  font-weight: 700;
  border-radius: 6px;
}

.calculator-button.is-accent,
.calculator-key.is-accent {
  border-color: #0b6d86;
  background: #0b6d86;
  color: #ffffff;
}

.calculator-button.is-warn,
.calculator-key.is-warn {
  border-color: #b96332;
  background: #fff0e6;
  color: #7b3b16;
}

.calculator-keypad {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 3px;
}

.calculator-key {
  min-height: 14px;
  padding: 0 2px;
  background: #ffffff;
  font-size: 6px;
  font-weight: 700;
  border-radius: 6px;
}

.calculator-key.is-operator {
  background: #dff0f4;
  color: var(--primary);
}

.calculator-key.is-wide {
  grid-column: span 2;
}

.calculator-key.is-double {
  grid-column: span 2;
}

.calculator-key.is-active {
  border-color: var(--active);
  background: var(--active-soft);
  color: var(--active);
}

.calculator-device {
  display: grid;
  gap: 5px;
}

.calculator-device-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
}

.calculator-device-grid--compact {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.calculator-device-field {
  display: grid;
  gap: 2px;
}

.calculator-device-label {
  color: var(--muted);
  font-size: 6px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.calculator-device-input {
  min-height: 18px;
  border: 1px solid rgba(0, 79, 98, 0.18);
  border-radius: 6px;
  padding: 0 5px;
  background: #ffffff;
  color: var(--text);
  font-size: 7px;
}

.calculator-device-status {
  min-height: 9px;
  color: var(--muted);
  font-size: 6px;
  font-weight: 700;
}

.calculator-table-results {
  overflow: auto;
}

.calculator-table {
  width: 100%;
  border-collapse: collapse;
  background: #ffffff;
}

.calculator-table th,
.calculator-table td {
  padding: 4px 5px;
  border: 1px solid rgba(0, 79, 98, 0.12);
  text-align: left;
  font: 6px/1.2 "Courier New", monospace;
}

.calculator-table th {
  background: #eef6f8;
  color: var(--primary);
}

.calculator-plot-canvas {
  width: 100%;
  min-height: 120px;
  border: 1px solid rgba(0, 79, 98, 0.14);
  border-radius: 8px;
  background: #fbfcfd;
}

.calculator-pq-result {
  display: grid;
  gap: 2px;
  padding: 6px;
  border: 1px solid rgba(0, 79, 98, 0.12);
  border-radius: 8px;
  background: #ffffff;
  color: var(--text);
  font-size: 6px;
}

.calculator-pq-math math {
  width: 100%;
  color: var(--text);
  font-size: 1.15em;
}

.calculator-pq-note {
  margin: 0;
  color: var(--text);
  font-size: 1em;
}

.calculator-pq-result p {
  margin: 0;
}

.text-box {
  position: absolute;
  z-index: 3;
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  min-width: 180px;
  max-width: none;
  min-height: 70px;
  overflow: visible;
  border: 1px solid transparent;
  border-radius: 4px;
  background: transparent;
  box-shadow: none;
  resize: none;
  touch-action: none;
  user-select: text;
}

.text-box:not(.is-active) {
  pointer-events: none;
}

.text-box.is-active {
  grid-template-rows: 28px auto minmax(0, 1fr);
  border-color: var(--active);
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 0 0 2px rgba(31, 147, 180, 0.22);
  overflow: visible;
  resize: none;
  min-width: 420px;
  min-height: 260px;
}

.text-box.is-pinned {
  resize: none;
}

.text-box.is-pinned.is-active {
  border-color: #9db7bd;
}

.text-box.is-pinned .text-handle {
  cursor: default;
  background: #e8f1f2;
  color: var(--primary);
}

.text-handle {
  display: none;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 6px;
  grid-column: 1;
  grid-row: 1;
  min-height: 28px;
  padding: 0 8px;
  border: 0;
  border-bottom: 1px solid rgba(0, 79, 98, 0.25);
  border-radius: 0;
  background: rgba(223, 240, 244, 0.95);
  color: var(--active);
  cursor: move;
  font-size: 12px;
  touch-action: none;
}

.text-box.is-active .text-handle {
  display: grid;
}

.text-controls {
  display: flex;
  justify-content: flex-end;
  gap: 3px;
  touch-action: manipulation;
}

.text-control-button {
  min-width: 26px;
  min-height: 24px;
  padding: 0;
  border: 1px solid rgba(0, 79, 98, 0.22);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--active);
  font-size: 16px;
  line-height: 1;
}

.text-control-button--label {
  min-width: 56px;
  padding: 0 8px;
  font-size: 12px;
  font-weight: 700;
}

.text-control-button:active {
  background: rgba(31, 147, 180, 0.14);
}

.text-control-button.is-active {
  border-color: var(--active);
  background: var(--active-soft);
}

.text-control-button:disabled {
  opacity: 0.42;
}

.text-resize-handle {
  position: absolute;
  right: 2px;
  bottom: 2px;
  z-index: 2;
  display: none;
  width: 20px;
  height: 20px;
  padding: 0;
  border: 0;
  border-radius: 0 0 4px 0;
  background:
    linear-gradient(135deg, transparent 0 46%, rgba(0, 79, 98, 0.3) 46% 54%, transparent 54%) center 11px / 10px 10px no-repeat,
    linear-gradient(135deg, transparent 0 46%, rgba(0, 79, 98, 0.46) 46% 54%, transparent 54%) center 7px / 10px 10px no-repeat;
  cursor: nwse-resize;
  touch-action: none;
}

.text-box.is-active .text-resize-handle {
  display: block;
}

.text-box.is-pinned .text-resize-handle,
.text-resize-handle:disabled {
  display: none;
}

.text-format-bar {
  display: none;
  grid-column: 1;
  grid-row: 2;
  padding: 6px 8px;
  border-bottom: 1px solid rgba(0, 79, 98, 0.14);
  background: linear-gradient(180deg, rgba(248, 251, 252, 0.98), rgba(241, 247, 249, 0.96));
  overflow: hidden;
  min-height: 34px;
  max-height: 44px;
  transition: max-height 140ms ease;
}

.text-box.is-active .text-format-bar {
  display: block;
}

.text-box.is-active.is-toolbar-expanded .text-format-bar {
  max-height: 140px;
  overflow: auto;
}

.text-format-bar .tox-tinymce-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0;
  border: 0;
  background: transparent;
  font-family: inherit;
  box-shadow: none;
}

.text-format-bar .tox-editor-header,
.text-format-bar .tox-toolbar-overlord,
.text-format-bar .tox-toolbar__primary {
  background: transparent;
  border: 0;
  box-shadow: none;
}

.text-format-bar .tox {
  font-size: 11px;
  transform: none;
  zoom: 0.72;
}

.text-format-bar .tox-toolbar__group {
  margin: 0;
  border: 1px solid rgba(0, 79, 98, 0.14);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.text-format-bar .tox-tbtn,
.text-format-bar .tox-tbtn--select,
.text-format-bar .tox-listboxfield .tox-listbox--select {
  color: var(--active);
}

.text-format-bar .tox-tbtn {
  border-radius: 6px;
  min-width: 24px;
  min-height: 24px;
  padding: 0 3px;
  overflow: visible;
  line-height: 1;
}

.text-format-bar .tox .tox-toolbar__group {
  gap: 2px;
  padding: 2px;
}

.text-format-bar .tox .tox-toolbar__primary {
  gap: 4px;
}

.text-format-bar .tox .tox-tbtn--select,
.text-format-bar .tox .tox-listboxfield {
  max-width: 92px;
  min-height: 24px;
}

.text-format-bar .tox .tox-tbtn__select-label,
.text-format-bar .tox .tox-listboxfield .tox-listbox--select,
.text-format-bar .tox .tox-collection__item-label,
.text-format-bar .tox .tox-menu .tox-collection__item,
.text-format-bar .tox .tox-selectfield select,
.text-format-bar .tox .tox-textfield,
.text-format-bar .tox .tox-textarea,
.text-format-bar .tox .tox-dialog__body-content,
.text-format-bar .tox .tox-dialog__title {
  font-size: 11px;
  line-height: 1.2;
}

.text-format-bar .tox .tox-tbtn:hover,
.text-format-bar .tox .tox-tbtn:focus-visible,
.text-format-bar .tox .tox-tbtn--enabled,
.text-format-bar .tox .tox-tbtn--select:hover,
.text-format-bar .tox .tox-tbtn--select:focus-visible {
  background: var(--active-soft);
  color: var(--active);
}

.text-format-bar .tox .tox-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  overflow: visible;
}

.text-format-bar .tox .tox-icon svg {
  fill: currentColor;
  width: auto;
  height: auto;
  overflow: visible;
  vertical-align: middle;
}

.text-format-bar .tox .tox-collection--list .tox-collection__item--active,
.text-format-bar .tox .tox-menu .tox-collection__item--active {
  background: var(--active-soft);
}

.text-format-bar .tox .tox-menu,
.text-format-bar .tox .tox-collection--list,
.text-format-bar .tox .tox-dialog-wrap__backdrop,
.text-format-bar .tox .tox-dialog {
  z-index: 3000;
}

.text-format-bar .tox .tox-dialog {
  border-radius: 10px;
  max-width: 280px;
}

.text-format-bar .tox .tox-listboxfield .tox-listbox--select,
.text-format-bar .tox .tox-textfield,
.text-format-bar .tox .tox-textarea,
.text-format-bar .tox .tox-selectfield select {
  border-radius: 6px;
  min-height: 24px;
}

.text-format-bar .tox .tox-menu,
.text-format-bar .tox .tox-collection--list {
  min-width: 140px;
}

.text-format-bar .tox .tox-collection__item {
  min-height: 24px;
  padding: 4px 8px;
}

.text-format-bar .tox .tox-dialog__body-nav-item,
.text-format-bar .tox .tox-button,
.text-format-bar .tox .tox-button--secondary,
.text-format-bar .tox .tox-button--icon {
  min-height: 24px;
  font-size: 11px;
}

.text-format-bar .tox .tox-edit-area::before {
  display: none;
}

.text-format-group {
  display: inline-flex;
  flex-wrap: nowrap;
  align-items: stretch;
  border: 1px solid rgba(0, 79, 98, 0.14);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.text-format-button {
  min-width: 28px;
  min-height: 26px;
  padding: 0 6px;
  display: inline-grid;
  place-items: center;
  border: 0;
  border-right: 1px solid rgba(0, 79, 98, 0.1);
  border-radius: 0;
  background: transparent;
  color: var(--active);
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  transition: background-color 120ms ease, color 120ms ease, box-shadow 120ms ease;
}

.text-format-group > .text-format-button:last-child,
.text-format-group > .text-menu:last-child > .text-format-button {
  border-right: 0;
}

.text-format-button--menu {
  display: inline-grid;
  place-items: center;
  list-style: none;
  cursor: pointer;
  min-width: 34px;
  position: relative;
}

.text-format-button--menu::-webkit-details-marker {
  display: none;
}

.text-format-icon {
  display: inline-block;
  width: 15px;
  height: 15px;
  background: currentColor;
  mask-repeat: no-repeat;
  mask-position: center;
  mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  -webkit-mask-position: center;
  -webkit-mask-size: contain;
}

.text-format-icon--bold {
  mask-image: url("../SVG/text-bold.svg");
  -webkit-mask-image: url("../SVG/text-bold.svg");
}

.text-format-icon--italic {
  mask-image: url("../SVG/text-italic.svg");
  -webkit-mask-image: url("../SVG/text-italic.svg");
}

.text-format-icon--underline {
  mask-image: url("../SVG/text-underline.svg");
  -webkit-mask-image: url("../SVG/text-underline.svg");
}

.text-format-icon--strike {
  mask-image: url("../SVG/text-strike.svg");
  -webkit-mask-image: url("../SVG/text-strike.svg");
}

.text-format-icon--color {
  mask-image: url("../SVG/text-color.svg");
  -webkit-mask-image: url("../SVG/text-color.svg");
}

.text-format-icon--clear-format {
  mask-image: url("../SVG/text-clear-format.svg");
  -webkit-mask-image: url("../SVG/text-clear-format.svg");
}

.text-format-icon--list-bulleted {
  mask-image: url("../SVG/list-bulleted.svg");
  -webkit-mask-image: url("../SVG/list-bulleted.svg");
}

.text-format-icon--list-numbered {
  mask-image: url("../SVG/list-numbered.svg");
  -webkit-mask-image: url("../SVG/list-numbered.svg");
}

.text-format-icon--table {
  mask-image: url("../SVG/table.svg");
  -webkit-mask-image: url("../SVG/table.svg");
}

.text-format-icon--undo {
  mask-image: url("../SVG/undo.svg");
  -webkit-mask-image: url("../SVG/undo.svg");
}

.text-format-icon--redo {
  mask-image: url("../SVG/redo.svg");
  -webkit-mask-image: url("../SVG/redo.svg");
}

.text-format-icon--clipboard {
  mask-image: url("../SVG/clipboard.svg");
  -webkit-mask-image: url("../SVG/clipboard.svg");
}

.text-menu[data-text-menu='color'] .text-format-button--menu {
  position: relative;
  padding-bottom: 4px;
}

.text-menu[data-text-menu='color'] .text-format-button--menu::after {
  content: "";
  position: absolute;
  left: 6px;
  right: 6px;
  bottom: 4px;
  height: 3px;
  border-radius: 999px;
  background: var(--text-color-preview, var(--active));
}

.text-menu .text-format-button--menu::before {
  content: "";
  position: absolute;
  right: 4px;
  bottom: 4px;
  width: 6px;
  height: 6px;
  background: rgba(0, 79, 98, 0.64);
  clip-path: polygon(50% 100%, 0 0, 100% 0);
}

.text-format-button:active {
  background: rgba(31, 147, 180, 0.14);
}

.text-format-button.is-active {
  background: var(--active-soft);
}

.text-menu {
  position: relative;
}

.text-menu-panel {
  position: absolute;
  left: 0;
  top: calc(100% + 6px);
  z-index: 4;
  display: none;
  min-width: 138px;
  gap: 4px;
  padding: 6px;
  border: 1px solid rgba(0, 79, 98, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 10px 22px rgba(0, 79, 98, 0.16);
}

.text-menu[data-text-menu='color'] .text-menu-panel {
  grid-template-columns: repeat(7, minmax(0, 1fr));
  min-width: auto;
  gap: 6px;
  padding: 8px;
}

.text-menu[data-text-menu='table'] .text-menu-panel {
  grid-template-columns: repeat(2, minmax(56px, 1fr));
  min-width: 136px;
}

.text-menu[open] .text-menu-panel {
  display: grid;
}

.text-menu-action {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  min-height: 26px;
  padding: 0 8px;
  border: 1px solid rgba(0, 79, 98, 0.12);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
  text-align: left;
}

.text-menu-action:active {
  background: var(--active-soft);
  color: var(--active);
}

.text-color-button {
  place-items: center;
  width: 28px;
  min-width: 28px;
  min-height: 28px;
  padding: 0;
  border-radius: 999px;
}

.text-color-swatch {
  width: 16px;
  height: 16px;
  border: 1px solid rgba(0, 79, 98, 0.18);
  border-radius: 999px;
  background: var(--swatch);
}

.text-color-button.is-active {
  border-color: var(--active);
  background: var(--active-soft);
  box-shadow: inset 0 0 0 1px rgba(0, 79, 98, 0.08);
}

.text-color-button.is-active .text-color-swatch {
  border-color: rgba(0, 79, 98, 0.48);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.92);
}

.text-area {
  grid-column: 1;
  grid-row: 1;
  width: 100%;
  height: auto;
  min-height: 1.4em;
  border: 0;
  outline: none;
  background: transparent;
  color: inherit;
  touch-action: manipulation;
  user-select: text;
  overflow: visible;
}

.text-display {
  grid-column: 1;
  grid-row: 1;
  min-height: 1.4em;
  padding: var(--text-preview-offset-top, 80px) 8px 6px;
  box-sizing: border-box;
  color: inherit;
  white-space: normal;
  overflow-wrap: anywhere;
  cursor: text;
  pointer-events: auto;
}

.text-box.is-active .text-area {
  grid-row: 3;
  height: 100%;
  min-height: 42px;
  overflow: auto;
  background: rgba(255, 255, 255, 0.92);
}

.text-box.is-active .text-display {
  display: none;
}

.text-box:not(.is-active) .text-area {
  display: none;
}

.text-area {
  border: 0;
  font-family: inherit;
}

.text-area[contenteditable="true"] {
  min-height: 0;
  padding: 0;
  color: inherit;
  white-space: normal;
  overflow-wrap: anywhere;
  outline: none;
}

.text-box.is-active .text-area[contenteditable="true"] {
  min-height: 100%;
  padding: 6px 8px;
}

.text-area p,
.text-area ul,
.text-area ol {
  margin: 0;
}

.text-display p,
.text-display ul,
.text-display ol {
  margin: 0;
}

.text-area ul {
  margin: 0.2em 0 0.2em 1.2em;
  padding: 0;
}

.text-display ul {
  margin: 0.2em 0 0.2em 1.2em;
  padding: 0;
}

.text-area li {
  margin: 0.1em 0;
}

.text-display li {
  margin: 0.1em 0;
}

.text-area table {
  border-collapse: collapse;
  margin: 0.35em 0;
}

.text-display table {
  border-collapse: collapse;
  margin: 0.35em 0;
}

.text-area td,
.text-area th {
  min-width: 48px;
  padding: 0.28em 0.4em;
  border: 1px solid rgba(0, 79, 98, 0.28);
  vertical-align: top;
}

.text-display td,
.text-display th {
  min-width: 48px;
  padding: 0.28em 0.4em;
  border: 1px solid rgba(0, 79, 98, 0.28);
  vertical-align: top;
}

.text-area table {
  width: 100%;
}

.text-display table {
  width: 100%;
}

.text-trailing-line {
  min-height: 1.3em;
}

.template-card {
  --template-header: #004f62;
  --template-header-text: #ffffff;
  --template-surface: #ffffff;
  --template-border: rgba(0, 79, 98, 0.18);
  --template-text: #12343b;
  --template-accent-left: #2e8b57;
  --template-accent-right: #c44d3b;
  position: absolute;
  z-index: 3;
  display: grid;
  grid-template-rows: 36px minmax(0, 1fr);
  min-width: 260px;
  min-height: 160px;
  overflow: hidden;
  border: 1px solid var(--template-border);
  border-radius: 16px;
  background: var(--template-surface);
  box-shadow: 0 12px 28px rgba(0, 79, 98, 0.14);
  touch-action: none;
  resize: both;
}

.template-card.is-active,
.template-card:focus-within {
  box-shadow: 0 0 0 2px rgba(31, 147, 180, 0.22), 0 12px 28px rgba(0, 79, 98, 0.18);
}

.template-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 0 8px 0 12px;
  border: 0;
  background: linear-gradient(180deg, color-mix(in srgb, var(--template-header) 92%, white), var(--template-header));
  color: var(--template-header-text);
  text-align: left;
  font-size: 13px;
  font-weight: 800;
  cursor: move;
}

.template-controls {
  display: flex;
  gap: 4px;
}

.template-control-button {
  min-width: 24px;
  min-height: 24px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  color: inherit;
  font-size: 18px;
  line-height: 1;
}

.template-body {
  padding: 12px;
  color: var(--template-text);
  overflow: auto;
}

.template-editor,
.template-inline-editor {
  outline: none;
  user-select: text;
}

.template-editor {
  min-height: 80px;
  white-space: normal;
}

.template-editor p,
.template-editor ul {
  margin: 0 0 0.55em;
}

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

.template-table-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.template-table-button {
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid var(--template-border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--template-text);
  font-size: 12px;
  font-weight: 700;
}

.template-grid td {
  border: 1px solid var(--template-border);
  vertical-align: top;
  padding: 0;
  background: rgba(255, 255, 255, 0.48);
}

.template-grid tr.is-header-row td,
.template-grid td.is-header-cell {
  background: rgba(11, 109, 134, 0.1);
}

.template-grid td:first-child .template-editor {
  font-weight: 700;
}

.template-grid .template-editor {
  min-height: 36px;
  padding: 8px 9px;
}

.template-grid td:focus-within {
  box-shadow: inset 0 0 0 2px rgba(31, 147, 180, 0.24);
}

.template-two-column {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.template-column {
  display: grid;
  gap: 8px;
  padding: 10px;
  border-radius: 12px;
}

.template-column--pro {
  background: rgba(46, 139, 87, 0.08);
}

.template-column--con {
  background: rgba(196, 77, 59, 0.08);
}

.template-column-title {
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.template-column--pro .template-column-title {
  color: var(--template-accent-left);
}

.template-column--con .template-column-title {
  color: var(--template-accent-right);
}

.template-task-list {
  display: grid;
  gap: 8px;
}

.template-task-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid var(--template-border);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.56);
}

.template-task-row input {
  margin-top: 2px;
}

.template-task-row.is-done .template-inline-editor {
  text-decoration: line-through;
  opacity: 0.68;
}

.template-mindmap,
.template-worksheet,
.template-chart,
.template-quiz {
  display: grid;
  gap: 10px;
}

.template-mindmap-center {
  padding: 10px 12px;
  border: 1px solid var(--template-border);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.82);
  text-align: center;
}

.template-mindmap-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.template-mindmap-branch {
  display: grid;
  gap: 6px;
  padding: 10px;
  border-radius: 14px;
  border: 1px solid var(--template-border);
}

.template-mindmap-branch--a { background: rgba(21, 94, 239, 0.08); }
.template-mindmap-branch--b { background: rgba(3, 152, 85, 0.08); }
.template-mindmap-branch--c { background: rgba(217, 45, 32, 0.08); }
.template-mindmap-branch--d { background: rgba(181, 71, 8, 0.08); }

.template-mindmap-branch-title,
.template-chart-title {
  font-size: 13px;
  font-weight: 800;
}

.template-worksheet-title,
.template-worksheet-info,
.template-worksheet-body,
.template-quiz-question,
.template-quiz-hint,
.template-chart-note {
  padding: 10px 12px;
  border: 1px solid var(--template-border);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.74);
}

.template-chart-preview {
  position: relative;
  min-height: 160px;
  padding: 12px 14px 34px 38px;
  border: 1px solid var(--template-border);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.78);
  overflow: hidden;
}

.template-chart-grid {
  position: absolute;
  inset: 14px 14px 32px 38px;
  background-image:
    linear-gradient(to right, rgba(0, 79, 98, 0.08) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(0, 79, 98, 0.08) 1px, transparent 1px);
  background-size: 22% 100%, 100% 22%;
}

.template-chart-axis {
  position: absolute;
  background: rgba(0, 79, 98, 0.56);
}

.template-chart-axis--x {
  left: 38px;
  right: 14px;
  bottom: 30px;
  height: 2px;
}

.template-chart-axis--y {
  left: 38px;
  top: 14px;
  bottom: 30px;
  width: 2px;
}

.template-chart-title,
.template-chart-x,
.template-chart-y {
  position: relative;
  z-index: 1;
}

.template-chart-x,
.template-chart-y {
  font-size: 12px;
  font-weight: 700;
}

.template-chart-y {
  position: absolute;
  left: 8px;
  top: 50%;
  transform: translateY(-50%) rotate(-90deg);
  transform-origin: left top;
}

.template-chart-x {
  position: absolute;
  right: 16px;
  bottom: 6px;
}

.template-chart-legend {
  display: grid;
  gap: 6px;
}

.template-chart-legend-row {
  display: grid;
  grid-template-columns: 14px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border: 1px solid var(--template-border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.68);
}

.template-chart-chip {
  width: 14px;
  height: 14px;
  border-radius: 999px;
}

.template-quiz-answers {
  display: grid;
  gap: 8px;
}

.template-quiz-answer {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 8px 10px;
  border: 1px solid var(--template-border);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.68);
}

.template-quiz-answer.is-correct {
  background: rgba(3, 152, 85, 0.08);
}

.template-picker {
  display: grid;
  gap: 6px;
  padding: 8px;
  border: 1px solid rgba(0, 79, 98, 0.12);
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(247, 252, 253, 0.98), rgba(238, 247, 249, 0.98));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.template-picker[hidden] {
  display: none;
}

.template-picker-button {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 10px;
  border: 1px solid rgba(0, 79, 98, 0.12);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--text);
  text-align: left;
  box-shadow: inset 0 -1px 0 rgba(0, 79, 98, 0.05);
}

.template-picker-button:active {
  border-color: var(--active);
  background: var(--active-soft);
  color: var(--active);
}

.template-picker-emoji {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 8px;
  background: rgba(31, 147, 180, 0.1);
  font-size: 16px;
}

.template-picker-label {
  font-size: 13px;
  font-weight: 700;
}

.instrument {
  position: absolute;
  z-index: 4;
  transform-origin: 40px 16px;
  border: 1px solid rgba(0, 79, 98, 0.42);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.56);
  box-shadow: 0 3px 10px rgba(0, 79, 98, 0.16);
  color: var(--primary);
  touch-action: none;
  user-select: none;
}

.instrument-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 30px;
  padding: 3px 5px;
  border-bottom: 1px solid rgba(0, 79, 98, 0.22);
  border-radius: 8px 8px 0 0;
  background: rgba(223, 240, 244, 0.88);
  cursor: move;
  font-size: 12px;
}

.instrument-controls {
  display: flex;
  justify-content: center;
  gap: 3px;
}

.instrument-footer {
  position: absolute;
  right: 6px;
  bottom: 4px;
  left: 6px;
  min-height: 28px;
  padding-top: 3px;
  border-top: 1px solid rgba(0, 79, 98, 0.18);
  background: rgba(232, 241, 242, 0.78);
}

.instrument-controls button {
  min-width: 30px;
  min-height: 24px;
  padding: 0 4px;
  border: 1px solid rgba(0, 79, 98, 0.22);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--primary);
}

.instrument-controls button:active {
  background: var(--primary);
  color: #fff;
}

.ruler {
  width: 660px;
  height: 92px;
  cursor: grab;
}

.ruler-scale {
  position: absolute;
  right: 10px;
  bottom: 42px;
  left: 10px;
  height: 36px;
  border-bottom: 2px solid var(--primary);
  opacity: 0.9;
}

.ruler-tick {
  position: absolute;
  bottom: 0;
  width: 1px;
  height: 12px;
  background: rgba(0, 79, 98, 0.72);
  color: var(--primary);
  font-size: 10px;
  line-height: 1;
}

.ruler-tick.is-mid {
  height: 18px;
}

.ruler-tick.is-major {
  width: 2px;
  height: 26px;
  background: var(--primary);
  font-size: 11px;
  font-weight: 700;
}

.ruler-tick.is-mid,
.ruler-tick.is-major {
  text-indent: 3px;
}

.ruler-marker {
  position: absolute;
  top: 0;
  z-index: 2;
  width: 12px;
  height: 50px;
  padding: 0;
  border: 1px solid var(--accent);
  border-radius: 4px;
  background: rgba(31, 147, 180, 0.28);
  cursor: ew-resize;
}

.ruler-readout {
  position: absolute;
  right: 10px;
  top: 6px;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(0, 79, 98, 0.88);
  color: #fff;
  font-size: 12px;
}

.triangle {
  width: 360px;
  height: 292px;
}

.coordinate-system {
  width: 420px;
  height: 320px;
  resize: both;
  overflow: hidden;
}

.coordinate-header {
  justify-content: space-between;
}

.coordinate-face {
  width: 100%;
  height: calc(100% - 72px);
  min-height: 180px;
  transform-origin: 50% 50%;
}

.coordinate-face svg {
  display: block;
  width: 100%;
  height: 100%;
}

.coordinate-face text {
  fill: var(--primary);
  font: 12px system-ui, sans-serif;
  font-weight: 700;
}

.coordinate-grid {
  stroke: rgba(0, 79, 98, 0.18);
  stroke-width: 1;
}

.coordinate-axis {
  stroke: #004f62;
  stroke-width: 2.5;
}

.coordinate-tick {
  stroke: rgba(0, 79, 98, 0.72);
  stroke-width: 1.4;
}

.coordinate-system .instrument-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.coordinate-scale-button {
  min-width: 42px;
}

.coordinate-stamp-scale {
  min-width: 72px;
  max-width: 72px;
  padding: 3px 4px;
  font-size: 11px;
}

.coordinate-stamp-button {
  min-width: 62px;
}

.coordinate-scale-label,
.coordinate-rotation-value {
  min-width: 54px;
  color: var(--primary);
  font-size: 11px;
  font-weight: 700;
  text-align: center;
}

.coordinate-rotation-slider {
  width: 86px;
  accent-color: var(--accent);
}

.triangle-face {
  width: 100%;
  height: 220px;
  transform-origin: 50% 50%;
}

.triangle-face svg {
  display: block;
  width: 100%;
  height: 100%;
}

.triangle-face text {
  fill: var(--primary);
  font: 14px system-ui, sans-serif;
  font-weight: 700;
}

.triangle .instrument-footer {
  align-items: center;
  gap: 4px;
}

.triangle-rotation-slider {
  width: 86px;
  accent-color: var(--accent);
}

.triangle-rotation-value {
  min-width: 48px;
  color: var(--primary);
  font-size: 11px;
  font-weight: 700;
  text-align: center;
}

.timer-panel {
  width: 280px;
  min-height: 186px;
  display: grid;
  grid-template-rows: auto auto auto auto;
  gap: 10px;
  padding-bottom: 12px;
  background: rgba(255, 255, 255, 0.92);
}

.timer-header {
  justify-content: space-between;
}

.timer-title {
  flex: 1 1 auto;
  text-align: center;
  font-size: 18px;
  font-weight: 700;
}

.timer-display {
  margin: 0 14px;
  padding: 12px 10px;
  border: 1px solid rgba(0, 79, 98, 0.16);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(255,255,255,0.96), rgba(232,241,242,0.9));
  color: #004f62;
  font-size: 40px;
  font-weight: 800;
  line-height: 1;
  text-align: center;
  letter-spacing: 0.06em;
}

.timer-display.is-running {
  color: #0c708b;
}

.timer-display.is-empty {
  color: #8aa2a8;
}

.timer-panel.is-finished .timer-display {
  background: linear-gradient(180deg, rgba(255,243,219,0.98), rgba(255,228,176,0.94));
  color: #8f4c00;
}

.timer-inputs {
  display: flex;
  justify-content: center;
  gap: 10px;
  padding: 0 14px;
}

.timer-input-group {
  display: grid;
  gap: 4px;
  color: var(--primary);
  font-size: 11px;
  font-weight: 700;
  text-align: center;
}

.timer-input {
  width: 72px;
  min-height: 34px;
  padding: 4px 6px;
  border: 1px solid rgba(0, 79, 98, 0.22);
  border-radius: 8px;
  text-align: center;
  font-size: 18px;
  font-weight: 700;
}

.timer-controls {
  position: static;
  right: auto;
  bottom: auto;
  left: auto;
  min-height: 0;
  padding: 0 14px;
  border-top: 0;
  background: transparent;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px;
}

.timer-controls button {
  min-width: 56px;
}

.timer-close-button {
  flex: 0 0 auto;
}

.timer-controls button[disabled] {
  opacity: 0.42;
  cursor: default;
}

.clock-panel {
  --clock-scale: 1;
  width: 286px;
  display: grid;
  gap: 10px;
  padding-bottom: 12px;
  transform: scale(var(--clock-scale));
  transform-origin: top left;
  background: linear-gradient(180deg, rgba(255,255,255,0.96), rgba(240,246,247,0.92));
}

.clock-header {
  justify-content: space-between;
}

.clock-title {
  flex: 1 1 auto;
  text-align: center;
  font-size: 18px;
  font-weight: 700;
}

.clock-body {
  display: grid;
  justify-items: center;
  gap: 12px;
  padding: 2px 14px 0;
}

.clock-analog {
  display: grid;
  place-items: center;
}

.clock-face {
  position: relative;
  display: block;
  width: 152px;
  height: 152px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 35%, rgba(255,255,255,0.98), rgba(227,239,242,0.98) 72%, rgba(196,220,226,0.96));
  box-shadow:
    inset 0 0 0 5px rgba(0,79,98,0.1),
    inset 0 0 24px rgba(0,79,98,0.08),
    0 10px 24px rgba(0,79,98,0.12);
}

.clock-face-ring {
  position: absolute;
  inset: 12px;
  border: 1px solid rgba(0,79,98,0.14);
  border-radius: 50%;
}

.clock-tick-slot,
.clock-hand-slot {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 0;
  height: 0;
}

.clock-tick {
  position: absolute;
  border-radius: 999px;
  background: rgba(0,79,98,0.78);
}

.clock-hand {
  position: absolute;
  left: 0;
  bottom: 0;
  transform: translateX(-50%);
  border-radius: 999px;
}

.clock-hand--hour {
  width: 6px;
  height: 44px;
  background: #004f62;
}

.clock-hand--minute {
  width: 4px;
  height: 60px;
  background: #1f93b4;
}

.clock-hand--second {
  width: 2px;
  height: 66px;
  background: #c65a28;
}

.clock-center-dot {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 12px;
  height: 12px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: #004f62;
  box-shadow: 0 0 0 3px rgba(255,255,255,0.86);
}

.clock-digital {
  display: grid;
  gap: 4px;
  justify-items: center;
  width: 100%;
  padding: 10px 12px 12px;
  border: 1px solid rgba(0,79,98,0.14);
  border-radius: 12px;
  background: rgba(255,255,255,0.72);
}

.clock-time {
  color: #004f62;
  font-size: 32px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0.05em;
}

.clock-date {
  color: #365a63;
  font-size: 14px;
  font-weight: 700;
  text-align: center;
  text-transform: capitalize;
}

.clock-subtitle {
  color: #6a8a92;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.screen-keyboard {
  position: fixed;
  right: 12px;
  bottom: 12px;
  z-index: 20;
  display: grid;
  gap: 6px;
  padding: 10px;
  min-width: min(720px, calc(100vw - 24px));
  max-width: min(720px, calc(100vw - 24px));
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(232, 241, 242, 0.97);
  box-shadow: var(--shadow);
}

.screen-keyboard[hidden] {
  display: none;
}

.screen-keyboard.is-dragging {
  user-select: none;
}

.screen-keyboard-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-bottom: 4px;
  cursor: move;
}

.screen-keyboard-title {
  color: var(--primary);
  font-size: 13px;
  font-weight: 700;
}

.screen-keyboard-close {
  min-width: 28px;
  min-height: 28px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--primary);
  font-weight: 700;
}

.screen-keyboard-body {
  display: grid;
  gap: 6px;
}

.keyboard-row {
  display: flex;
  justify-content: center;
  gap: 6px;
}

.keyboard-key {
  min-width: 42px;
  min-height: 38px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  box-shadow: inset 0 -2px 0 rgba(0, 79, 98, 0.08);
  transition: background 80ms ease, border-color 80ms ease, color 80ms ease, transform 80ms ease;
}

.keyboard-key-letter {
  background: #ffffff;
}

.keyboard-key-number {
  border-color: #b7d4da;
  background: #f1f8fa;
}

.keyboard-key-special {
  border-color: #9bc7d2;
  background: #dff0f4;
  color: var(--primary);
}

.keyboard-key-shift {
  border-color: var(--accent);
  background: #cfeaf1;
  color: var(--primary);
}

.keyboard-key-wide {
  min-width: 74px;
}

.keyboard-key-extra-wide {
  min-width: 230px;
}

.keyboard-key.is-active,
.keyboard-key.is-pressed,
.keyboard-key:active {
  border-color: var(--primary);
  background: var(--primary);
  color: #ffffff;
  transform: translateY(1px);
  box-shadow: inset 0 2px 0 rgba(0, 0, 0, 0.12);
}

@media (max-width: 760px) {
  .app-shell {
    grid-template-columns: 56px minmax(0, 1fr);
  }

  .page-rail {
    padding: 8px 6px;
  }

  .toolbar {
    gap: 6px;
    padding: 6px;
  }

  .tool-button,
  .icon-button,
  .color-menu summary,
  .stamp-menu summary,
  .insert-menu summary,
  .overflow-menu summary {
    min-height: 34px;
    min-width: 34px;
  }

  .swatch {
    min-width: 20px;
    min-height: 20px;
  }

  .tool-button {
    padding: 0 7px;
  }

  .symbol-button {
    min-width: 34px;
    font-size: 17px;
  }

  .size-control {
    min-width: 126px;
  }

  .size-control select {
    min-width: 84px;
  }

  .select-control {
    flex: 1 1 120px;
  }

  .select-control select {
    max-width: none;
  }

  .overflow-menu {
    margin-left: 0;
  }

  .screen-keyboard {
    right: 6px;
    bottom: 6px;
    left: 6px;
    min-width: 0;
    max-width: none;
  }

  .screen-keyboard-body {
    overflow-x: auto;
  }

  .keyboard-key {
    min-width: 30px;
    min-height: 34px;
    padding: 0 6px;
  }

  .keyboard-key-wide {
    min-width: 58px;
  }

  .keyboard-key-extra-wide {
    min-width: 128px;
  }

  .calculator-card {
    min-width: 300px;
  }

  .calculator-device-grid,
  .calculator-device-grid--compact {
    grid-template-columns: 1fr;
  }

  .calculator-keypad {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .calculator-key.is-wide,
  .calculator-key.is-double {
    grid-column: span 2;
  }
}
