:root {
  --ink: #1f2523;
  --muted: #65736f;
  --line: #d5ded9;
  --surface: #fbfcfa;
  --panel: #eef4f1;
  --accent: #2f7d68;
  --accent-strong: #205d4c;
  --accent-soft: #dbece6;
  --danger: #b73535;
  --danger-bg: #f8e6e1;
  --focus: #1d6fa5;
  --shadow: 0 18px 48px rgba(23, 42, 38, 0.13);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    linear-gradient(rgba(31, 37, 35, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(31, 37, 35, 0.045) 1px, transparent 1px),
    #dfe7e4;
  background-size: 28px 28px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

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

button,
select {
  cursor: pointer;
}

.app-shell {
  display: grid;
  grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
  width: min(1180px, calc(100vw - 32px));
  min-height: calc(100vh - 32px);
  margin: 16px auto;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid rgba(39, 74, 66, 0.16);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.sidebar {
  display: flex;
  min-height: 0;
  flex-direction: column;
  border-right: 1px solid var(--line);
  background: var(--panel);
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 24px 22px 16px;
}

.eyebrow {
  margin: 0 0 3px;
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: 28px;
  line-height: 1.1;
}

.icon-button {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  flex: 0 0 auto;
  color: #fff;
  background: var(--accent);
  border: 0;
  border-radius: 8px;
  font-size: 28px;
  line-height: 1;
}

.icon-button:hover {
  background: var(--accent-strong);
}

.search-wrap {
  display: grid;
  grid-template-columns: 22px 1fr;
  align-items: center;
  gap: 8px;
  margin: 0 22px;
  padding: 10px 12px;
  color: var(--muted);
  background: rgba(251, 252, 250, 0.82);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.search-wrap input {
  width: 100%;
  min-width: 0;
  color: var(--ink);
  background: transparent;
  border: 0;
  outline: 0;
}

.note-stats {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 22px 10px;
  color: var(--muted);
  font-size: 13px;
}

.note-list {
  display: flex;
  min-height: 0;
  flex: 1;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
  padding: 0 14px 18px;
}

.note-item {
  display: grid;
  width: 100%;
  grid-template-rows: auto auto auto auto;
  gap: 5px;
  padding: 14px;
  text-align: left;
  color: var(--ink);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
}

.note-item:hover {
  background: rgba(251, 252, 250, 0.72);
}

.note-item.is-active {
  background: var(--surface);
  border-color: rgba(47, 125, 104, 0.34);
}

.note-item-title {
  overflow: hidden;
  font-size: 15px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.note-item-preview {
  display: -webkit-box;
  min-height: 37px;
  overflow: hidden;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.note-item-tags {
  min-height: 18px;
  overflow: hidden;
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.note-item-tags:empty {
  display: none;
}

.note-item-meta {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.empty-list {
  margin: 8px;
  color: var(--muted);
  font-size: 14px;
}

.editor {
  display: grid;
  min-width: 0;
  min-height: 0;
  grid-template-rows: auto auto auto auto 1fr;
  background:
    linear-gradient(90deg, transparent 0 54px, rgba(183, 53, 53, 0.14) 54px 55px, transparent 55px),
    repeating-linear-gradient(#fbfcfa 0 38px, #dfe8e3 39px 40px);
}

.editor-toolbar,
.writing-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: rgba(251, 252, 250, 0.95);
  border-bottom: 1px solid var(--line);
}

.editor-toolbar {
  min-height: 64px;
  padding: 14px 24px;
}

.writing-tools {
  min-height: 54px;
  padding: 9px 24px;
}

.current-meta,
.toolbar-actions,
.tool-group,
.template-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.current-meta {
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 13px;
}

.tool-button,
.danger-button,
.format-button,
.template-wrap select {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-weight: 800;
}

.tool-button,
.danger-button {
  padding: 0 14px;
}

.tool-button,
.format-button,
.template-wrap select {
  color: var(--accent-strong);
  background: #fff;
}

.tool-button.is-active,
.format-button:hover {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
}

.danger-button {
  color: var(--danger);
  background: var(--danger-bg);
  border-color: rgba(183, 53, 53, 0.22);
}

.format-button {
  min-width: 38px;
  padding: 0 10px;
}

.format-button-wide {
  min-width: 50px;
}

.template-wrap {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.template-wrap select {
  min-width: 128px;
  padding: 0 34px 0 12px;
}

.title-input,
.content-input,
.tag-wrap input {
  width: 100%;
  min-width: 0;
  color: var(--ink);
  background: transparent;
  border: 0;
  outline: 0;
}

.title-input {
  padding: 28px 36px 10px 76px;
  font-size: 34px;
  font-weight: 850;
  line-height: 1.18;
}

.tag-wrap {
  display: grid;
  grid-template-columns: 18px 1fr;
  align-items: center;
  gap: 8px;
  margin: 0 36px 4px 76px;
  padding: 8px 0 12px;
  color: var(--accent-strong);
  border-bottom: 1px solid rgba(47, 125, 104, 0.18);
  font-size: 14px;
  font-weight: 800;
}

.tag-wrap input {
  color: var(--muted);
  font-weight: 700;
}

.content-input {
  min-height: 0;
  resize: none;
  padding: 13px 36px 40px 76px;
  font-size: 18px;
  line-height: 40px;
}

.title-input::placeholder,
.content-input::placeholder,
.tag-wrap input::placeholder {
  color: rgba(101, 115, 111, 0.72);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

:focus-visible {
  outline: 3px solid rgba(29, 111, 165, 0.35);
  outline-offset: 2px;
}

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

.app-shell.is-focus-mode .sidebar {
  overflow: hidden;
  border-right: 0;
}

@media (max-width: 860px) {
  .editor-toolbar,
  .writing-tools {
    align-items: stretch;
    flex-direction: column;
  }

  .toolbar-actions,
  .tool-group,
  .template-wrap {
    width: 100%;
  }

  .toolbar-actions {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .tool-group {
    display: grid;
    grid-template-columns: repeat(8, minmax(0, 1fr));
  }

  .template-wrap select {
    flex: 1;
  }
}

@media (max-width: 760px) {
  .app-shell {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(230px, 34vh) 1fr;
    width: 100vw;
    min-height: 100vh;
    margin: 0;
    border: 0;
    border-radius: 0;
  }

  .app-shell.is-focus-mode {
    grid-template-columns: 1fr;
    grid-template-rows: 0 1fr;
  }

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

  .sidebar-header {
    padding: 18px 16px 12px;
  }

  .search-wrap {
    margin: 0 16px;
  }

  .note-stats {
    padding: 12px 16px 8px;
  }

  .note-list {
    padding: 0 10px 14px;
  }

  .editor-toolbar,
  .writing-tools {
    padding: 12px 16px;
  }

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

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

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

  .title-input {
    padding: 20px 20px 8px 34px;
    font-size: 28px;
  }

  .tag-wrap {
    margin: 0 20px 4px 34px;
  }

  .content-input {
    padding: 11px 20px 32px 34px;
    font-size: 17px;
  }

  .editor {
    background:
      linear-gradient(90deg, transparent 0 22px, rgba(183, 53, 53, 0.14) 22px 23px, transparent 23px),
      repeating-linear-gradient(#fbfcfa 0 38px, #dfe8e3 39px 40px);
  }
}


.image-board[hidden] {
  display: none;
}

.image-board {
  display: flex;
  min-height: 0;
  max-height: min(44vh, 430px);
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
  padding: 14px 36px 12px 76px;
  background: rgba(251, 252, 250, 0.78);
  border-bottom: 1px solid rgba(47, 125, 104, 0.16);
}

.image-block {
  display: grid;
  width: 100%;
  gap: 12px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(47, 125, 104, 0.22);
  border-radius: 8px;
}

.image-block-toolbar,
.image-block-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.image-block-toolbar {
  justify-content: space-between;
}

.image-block-title {
  overflow: hidden;
  color: var(--accent-strong);
  font-size: 13px;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.image-block-controls {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.image-control-wrap,
.image-range-control {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.image-range-control input {
  width: 84px;
  accent-color: var(--accent);
}

.image-range-control output {
  min-width: 34px;
  color: var(--accent-strong);
  text-align: right;
}

.image-control-select,
.image-action-button {
  min-height: 32px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 12px;
  font-weight: 800;
}

.image-control-select {
  max-width: 116px;
  padding: 0 26px 0 10px;
}

.image-action-button {
  display: grid;
  width: 32px;
  place-items: center;
  padding: 0;
}

.image-action-button:hover:not(:disabled) {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
}

.image-action-button:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

.image-block-body {
  display: grid;
  gap: 12px;
}

.image-block--side .image-block-body {
  grid-template-columns: minmax(190px, 38%) minmax(0, 1fr);
  align-items: stretch;
}

.image-media {
  overflow: hidden;
  background: #e6ece9;
  border-radius: 8px;
}

.image-media img {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  object-fit: cover;
}

.image-block--cover .image-media {
  aspect-ratio: 16 / 5;
}

.image-block--cover .image-media img,
.image-block--side .image-media img,
.image-grid-item img {
  width: 100%;
  height: 100%;
}

.image-block .image-media.image-crop--square,
.image-block .image-grid-item.image-crop--square {
  aspect-ratio: 1 / 1;
}

.image-block .image-media.image-crop--wide,
.image-block .image-grid-item.image-crop--wide {
  aspect-ratio: 16 / 9;
}

.image-block .image-media.image-crop--portrait,
.image-block .image-grid-item.image-crop--portrait {
  aspect-ratio: 4 / 5;
}

.image-block .image-media.image-crop--circle,
.image-block .image-grid-item.image-crop--circle {
  aspect-ratio: 1 / 1;
  border-radius: 999px;
}

.image-block .image-media.image-crop--square img,
.image-block .image-media.image-crop--wide img,
.image-block .image-media.image-crop--portrait img,
.image-block .image-media.image-crop--circle img,
.image-block .image-grid-item.image-crop--square img,
.image-block .image-grid-item.image-crop--wide img,
.image-block .image-grid-item.image-crop--portrait img,
.image-block .image-grid-item.image-crop--circle img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.image-block .image-media.image-crop--original,
.image-block .image-grid-item.image-crop--original {
  aspect-ratio: auto;
}

.image-block .image-media.image-crop--original img,
.image-block .image-grid-item.image-crop--original img {
  height: auto;
  object-fit: contain;
}

.image-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
  gap: 8px;
  padding: 8px;
}

.image-grid-item {
  aspect-ratio: 4 / 3;
  margin: 0;
  overflow: hidden;
  border-radius: 7px;
}

.image-text-panel {
  display: grid;
  align-content: start;
  gap: 8px;
  min-width: 0;
}

.image-caption-input,
.image-note-input {
  width: 100%;
  min-width: 0;
  color: var(--ink);
  background: rgba(251, 252, 250, 0.86);
  border: 1px solid rgba(101, 115, 111, 0.24);
  border-radius: 8px;
  outline: 0;
}

.image-caption-input {
  min-height: 38px;
  padding: 0 12px;
  font-size: 15px;
  font-weight: 850;
}

.image-note-input {
  min-height: 84px;
  resize: vertical;
  padding: 10px 12px;
  font-size: 14px;
  line-height: 1.55;
}

.image-caption-input::placeholder,
.image-note-input::placeholder {
  color: rgba(101, 115, 111, 0.72);
}

.image-style--paper {
  background: #fffdf6;
  border-color: #d8c990;
}

.image-style--paper .image-media {
  padding: 8px;
  background: #f6ecd0;
}

.image-style--marker {
  background: #f7fbff;
  border-left: 5px solid #e4a126;
}

.image-style--marker .image-caption-input {
  border-color: rgba(228, 161, 38, 0.38);
}

.image-style--shadow {
  background: #ffffff;
  border-color: #c5d0df;
  box-shadow: 0 12px 28px rgba(34, 54, 76, 0.14);
}

.content-input {
  min-height: 220px;
}


@media (max-width: 760px) {
  .image-board {
    max-height: 46vh;
    padding: 10px 20px 12px 34px;
  }

  .image-block-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .image-block-controls {
    justify-content: stretch;
  }

  .image-control-wrap,
  .image-range-control {
    flex: 1 1 120px;
  }

  .image-control-select {
    max-width: none;
    flex: 1 1 110px;
  }

  .image-block--side .image-block-body {
    grid-template-columns: 1fr;
  }
}


/* Notepad workspace refresh */
.editor {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  background: #f4f6f3;
}

.editor-toolbar {
  position: relative;
  z-index: 2;
  min-height: 58px;
  padding: 12px 20px;
  background: rgba(255, 255, 255, 0.96);
}

.editor-workspace {
  position: relative;
  display: grid;
  min-width: 0;
  min-height: 0;
  grid-template-columns: minmax(0, 1fr) clamp(252px, 27vw, 308px);
  background: #f4f6f3;
}

.editor-workspace.is-tools-collapsed {
  grid-template-columns: minmax(0, 1fr);
}

.note-paper {
  display: grid;
  min-width: 0;
  min-height: 0;
  grid-template-areas:
    "header"
    "images"
    "content";
  grid-template-rows: auto auto minmax(260px, 1fr);
  background: #fbfcfa;
}

.note-paper-header {
  display: grid;
  grid-area: header;
  gap: 0;
  padding: 22px 34px 14px 58px;
  background: #fff;
  border-bottom: 1px solid rgba(47, 125, 104, 0.16);
}

.note-title-field,
.note-paper .tag-wrap {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.note-title-field {
  padding-bottom: 10px;
}

.note-field-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.note-paper .title-input,
.note-paper .tag-wrap input {
  width: 100%;
  min-width: 0;
  color: var(--ink);
  background: transparent;
  border: 0;
  outline: 0;
}

.note-paper .title-input {
  padding: 0;
  font-size: clamp(26px, 3vw, 36px);
  font-weight: 850;
  line-height: 1.16;
}

.note-paper .tag-wrap {
  margin: 0;
  padding: 10px 0 0;
  border-top: 1px solid rgba(101, 115, 111, 0.16);
  border-bottom: 0;
}

.note-paper .tag-wrap input {
  color: var(--accent-strong);
  font-size: 14px;
  font-weight: 760;
}

.note-paper .image-board {
  grid-area: images;
  max-height: min(36vh, 380px);
  padding: 14px 34px 14px 58px;
  background: #f7faf7;
}

.note-paper .content-input {
  grid-area: content;
  min-height: 0;
  resize: none;
  padding: 18px 34px 52px 58px;
  color: #202624;
  background:
    linear-gradient(90deg, transparent 0 40px, rgba(183, 53, 53, 0.13) 40px 41px, transparent 41px),
    repeating-linear-gradient(#fbfcfa 0 31px, #e1e9e4 32px 33px);
  border: 0;
  outline: 0;
  font-size: 17px;
  line-height: 33px;
}

.editor .writing-tools {
  display: grid;
  align-content: start;
  gap: 16px;
  min-width: 0;
  min-height: 0;
  overflow-y: auto;
  padding: 18px;
  background: #edf2ef;
  border-left: 1px solid var(--line);
  border-bottom: 0;
}

.editor .writing-tools[hidden] {
  display: none;
}

.tool-panel-titlebar {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  margin: -6px -6px 0;
  padding: 0 7px 0 11px;
  color: #1f3831;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.8), rgba(255, 255, 255, 0)), #dbece6;
  border: 1px solid rgba(47, 125, 104, 0.16);
  border-radius: 7px;
  cursor: grab;
  user-select: none;
}

.tool-panel-titlebar:active {
  cursor: grabbing;
}

.tool-panel-title {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  font-weight: 900;
}

.tool-panel-hint {
  color: var(--muted);
  font-size: 11px;
  font-weight: 760;
}

.tool-panel-controls {
  display: flex;
  gap: 5px;
  margin-left: auto;
}

.tool-panel-control {
  display: grid;
  width: 24px;
  height: 24px;
  min-height: 0;
  place-items: center;
  padding: 0;
  color: #31423d;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(36, 55, 50, 0.2);
  border-radius: 5px;
  font-size: 13px;
  font-weight: 900;
  line-height: 1;
}

.tool-panel-control:hover {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
}

.tool-panel-control-close:hover {
  background: var(--danger);
  border-color: var(--danger);
}

.editor .writing-tools.is-tools-floating {
  position: absolute;
  width: min(320px, calc(100% - 24px));
  max-height: min(72vh, 620px);
  border: 1px solid rgba(47, 125, 104, 0.28);
  border-radius: 8px;
  box-shadow: 0 22px 54px rgba(23, 42, 38, 0.2);
}

.editor .writing-tools.is-tools-floating .tool-panel-titlebar {
  margin: -6px -6px 0;
}

.editor .writing-tools.is-tools-minimized {
  width: 220px;
  min-height: 0;
  overflow: hidden;
  padding: 0;
  border-left: 1px solid rgba(47, 125, 104, 0.28);
}

.editor .writing-tools.is-tools-minimized > :not(.tool-panel-titlebar) {
  display: none;
}

.editor .writing-tools.is-tools-minimized .tool-panel-titlebar {
  margin: 0;
  border: 0;
}

.tool-section {
  display: grid;
  gap: 9px;
  min-width: 0;
}

.tool-section + .tool-section {
  padding-top: 15px;
  border-top: 1px solid rgba(101, 115, 111, 0.18);
}

.tool-section-title {
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 900;
}

.tool-grid {
  display: grid;
  gap: 8px;
}

.tool-grid-format {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.tool-grid-insert {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.editor .format-button,
.editor .tool-button,
.editor .danger-button,
.editor .template-wrap select {
  border-radius: 7px;
}

.editor .format-button {
  min-width: 0;
  min-height: 38px;
  padding: 0 8px;
}

.editor .format-button-wide {
  min-width: 0;
}

.editor .template-wrap {
  display: grid;
  align-items: start;
  width: 100%;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
}

.editor .template-wrap select,
.editor .writing-tools .tool-button {
  width: 100%;
  min-width: 0;
}

.editor .template-wrap select {
  padding: 0 28px 0 10px;
}

.toolbar-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}

@media (max-width: 1040px) {
  .editor-workspace {
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(0, 1fr);
  }

  .editor .writing-tools {
    order: -1;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    overflow: visible;
    padding: 14px 18px;
    border-left: 0;
    border-bottom: 1px solid var(--line);
  }

  .tool-panel-titlebar {
    grid-column: 1 / -1;
  }

  .editor .writing-tools.is-tools-floating {
    grid-template-columns: 1fr;
    overflow-y: auto;
    padding: 14px;
    border-bottom: 1px solid rgba(47, 125, 104, 0.28);
  }

  .tool-section + .tool-section {
    padding-top: 0;
    border-top: 0;
  }
}

@media (max-width: 760px) {
  .editor-toolbar {
    padding: 10px 14px;
  }

  .current-meta {
    font-size: 12px;
  }

  .editor .writing-tools {
    grid-template-columns: 1fr 1fr;
    padding: 12px 14px;
  }

  .editor .writing-tools.is-tools-floating {
    left: 12px !important;
    right: 12px;
    top: 12px !important;
    width: auto !important;
    max-height: calc(100vh - 190px);
  }

  .editor .writing-tools.is-tools-minimized {
    left: auto !important;
    right: 12px;
    top: 12px !important;
    width: 210px !important;
  }

  .note-paper-header {
    padding: 18px 18px 12px 28px;
  }

  .note-title-field,
  .note-paper .tag-wrap {
    grid-template-columns: 42px minmax(0, 1fr);
    gap: 10px;
  }

  .note-paper .title-input {
    font-size: 27px;
  }

  .note-paper .image-board {
    padding: 12px 18px 12px 28px;
  }

  .note-paper .content-input {
    padding: 14px 18px 42px 28px;
    background:
      linear-gradient(90deg, transparent 0 18px, rgba(183, 53, 53, 0.13) 18px 19px, transparent 19px),
      repeating-linear-gradient(#fbfcfa 0 31px, #e1e9e4 32px 33px);
    font-size: 16px;
  }
}

@media (max-width: 520px) {
  .toolbar-actions {
    display: grid;
    width: 100%;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

}

/* Freeform memo canvas */
.note-paper {
  grid-template-areas:
    "header"
    "canvas";
  grid-template-rows: auto minmax(520px, 1fr);
}

.memo-canvas-wrap {
  position: relative;
  grid-area: canvas;
  min-width: 0;
  min-height: 0;
  overflow: auto;
  background:
    linear-gradient(rgba(47, 125, 104, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(47, 125, 104, 0.06) 1px, transparent 1px),
    #fbfcfa;
  background-size: 28px 28px;
}

.memo-canvas {
  position: relative;
  min-width: 1500px;
  min-height: 1100px;
  padding: 24px;
}

.content-backing {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  min-height: 0;
  opacity: 0;
  pointer-events: none;
}

.canvas-item {
  position: absolute;
  display: grid;
  min-width: 0;
  overflow: hidden;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(47, 125, 104, 0.24);
  border-radius: 8px;
  box-shadow: 0 12px 30px rgba(23, 42, 38, 0.11);
}

.canvas-item.is-active {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(47, 125, 104, 0.15), 0 16px 34px rgba(23, 42, 38, 0.15);
}

.canvas-item-grip {
  display: flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  color: var(--muted);
  background: rgba(238, 244, 241, 0.86);
  border-bottom: 1px solid rgba(101, 115, 111, 0.14);
  cursor: grab;
  font-size: 12px;
  font-weight: 850;
  user-select: none;
}

.canvas-item-grip:active {
  cursor: grabbing;
}

.canvas-text-content {
  min-height: 82px;
  padding: 13px 14px 18px;
  overflow-wrap: anywhere;
  outline: 0;
  white-space: pre-wrap;
  font-size: 16px;
  line-height: 1.65;
}

.canvas-text-content:empty::before {
  content: "여기에 쓰기";
  color: rgba(101, 115, 111, 0.68);
}

.canvas-image-stack {
  display: grid;
  min-height: 0;
}

.canvas-image-body {
  display: grid;
  min-height: 92px;
  overflow: hidden;
  background: #e7ece9;
}

.canvas-image-body img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.canvas-crop--square .canvas-image-body,
.canvas-crop--circle .canvas-image-body {
  aspect-ratio: 1 / 1;
}

.canvas-crop--wide .canvas-image-body {
  aspect-ratio: 16 / 9;
}

.canvas-crop--square .canvas-image-body img,
.canvas-crop--wide .canvas-image-body img,
.canvas-crop--circle .canvas-image-body img {
  object-fit: cover;
}

.canvas-crop--circle .canvas-image-body,
.canvas-crop--circle .canvas-image-body img {
  border-radius: 999px;
}

.canvas-image-caption {
  width: 100%;
  min-height: 36px;
  padding: 0 11px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.88);
  border: 0;
  border-top: 1px solid rgba(101, 115, 111, 0.18);
  outline: 0;
  font-size: 13px;
  font-weight: 760;
}

.canvas-resize-handle {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 18px;
  height: 18px;
  cursor: nwse-resize;
}

.canvas-resize-handle::before {
  position: absolute;
  right: 4px;
  bottom: 4px;
  width: 8px;
  height: 8px;
  border-right: 2px solid rgba(47, 125, 104, 0.72);
  border-bottom: 2px solid rgba(47, 125, 104, 0.72);
  content: "";
}

.canvas-theme--paper {
  background: #fffdf6;
  border-color: #d8c990;
}

.canvas-theme--paper .canvas-item-grip {
  background: #f6ecd0;
}

.canvas-theme--marker {
  border-left: 6px solid #e4a126;
}

.canvas-theme--marker .canvas-item-grip {
  background: #fff4d7;
}

.canvas-theme--dark {
  color: #f7fbf8;
  background: #202624;
  border-color: #3c4a45;
}

.canvas-theme--dark .canvas-item-grip,
.canvas-theme--dark .canvas-image-caption {
  color: #dce7e2;
  background: #2a332f;
  border-color: #44524d;
}

.canvas-theme--dark .canvas-text-content:empty::before {
  color: rgba(220, 231, 226, 0.62);
}

.canvas-context-menu {
  position: fixed;
  z-index: 100;
  display: grid;
  gap: 8px;
  width: 180px;
  padding: 10px;
  color: var(--ink);
  background: #fff;
  border: 1px solid rgba(47, 125, 104, 0.24);
  border-radius: 8px;
  box-shadow: 0 18px 46px rgba(23, 42, 38, 0.18);
}

.canvas-context-menu[hidden] {
  display: none;
}

.context-menu-group {
  display: grid;
  gap: 6px;
}

.context-menu-group + .context-menu-group {
  padding-top: 8px;
  border-top: 1px solid rgba(101, 115, 111, 0.16);
}

.context-menu-group span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.context-menu-group button {
  min-height: 32px;
  padding: 0 10px;
  text-align: left;
  color: var(--ink);
  background: #f7faf7;
  border: 1px solid rgba(101, 115, 111, 0.18);
  border-radius: 7px;
  font-size: 13px;
  font-weight: 760;
}

.context-menu-group button:hover {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
}

@media (max-width: 1040px) {
  .memo-canvas {
    min-width: 1120px;
  }
}

@media (max-width: 760px) {
  .note-paper {
    grid-template-rows: auto minmax(460px, 1fr);
  }

  .memo-canvas {
    min-width: 860px;
    min-height: 900px;
  }
}
/* End freeform memo canvas */
/* End notepad workspace refresh */

/* Public site structure */
.skip-link {
  position: absolute;
  left: 16px;
  top: 10px;
  z-index: 30;
  padding: 10px 14px;
  color: #fff;
  background: #1f2523;
  border-radius: 8px;
  transform: translateY(-160%);
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 64px;
  padding: 10px max(18px, calc((100vw - 1180px) / 2));
  background: rgba(251, 252, 250, 0.96);
  border-bottom: 1px solid rgba(39, 74, 66, 0.16);
  backdrop-filter: blur(14px);
}

.site-brand {
  flex: 0 0 auto;
  color: var(--ink);
  font-size: 18px;
  font-weight: 900;
  text-decoration: none;
}

.site-nav,
.site-footer nav {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.site-nav {
  justify-content: flex-end;
  overflow-x: auto;
}

.site-nav a,
.site-footer a,
.guide-card a,
.text-button {
  color: var(--accent-strong);
  font-weight: 850;
  text-decoration: none;
}

.site-nav a {
  flex: 0 0 auto;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 14px;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  background: var(--accent-soft);
}

.app-shell {
  min-height: calc(100vh - 96px);
  scroll-margin-top: 82px;
}

.site-content {
  display: grid;
  gap: 0;
}

.content-band {
  padding: 58px max(18px, calc((100vw - 1180px) / 2));
  background: #fbfcfa;
  border-top: 1px solid rgba(39, 74, 66, 0.12);
}

.content-band:nth-child(even) {
  background: #f3f7f4;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(320px, 1.08fr);
  align-items: center;
  gap: 34px;
}

.section-kicker {
  margin: 0 0 8px;
  color: #805700;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.content-band h2,
.article-content h1,
.article-content h2 {
  color: var(--ink);
  letter-spacing: 0;
}

.content-band h2 {
  max-width: 760px;
  margin: 0 0 16px;
  font-size: clamp(28px, 4vw, 46px);
  line-height: 1.12;
}

.content-band p,
.article-content p {
  color: #3e4b47;
}

.content-band p {
  max-width: 760px;
  margin: 0 0 14px;
  font-size: 17px;
  line-height: 1.75;
}

.feature-image {
  margin: 0;
}

.feature-image img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border: 1px solid rgba(39, 74, 66, 0.16);
  border-radius: 8px;
  box-shadow: 0 16px 34px rgba(23, 42, 38, 0.14);
}

.feature-image figcaption {
  margin-top: 10px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.section-heading {
  max-width: 820px;
  margin-bottom: 26px;
}

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

.guide-card {
  display: grid;
  align-content: start;
  gap: 10px;
  min-height: 210px;
  padding: 22px;
  background: #fff;
  border: 1px solid rgba(39, 74, 66, 0.16);
  border-radius: 8px;
}

.guide-card h3,
.principle-list h3,
.contact-panel h2 {
  margin: 0;
  font-size: 20px;
  line-height: 1.3;
}

.guide-card p {
  margin: 0;
  font-size: 15px;
  line-height: 1.65;
}

.guide-card a {
  align-self: end;
}

.principle-list {
  display: grid;
  gap: 20px;
}

.principle-list article {
  padding: 0 0 0 18px;
  border-left: 4px solid #2f7d68;
}

.principle-list p {
  margin-bottom: 0;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding: 30px max(18px, calc((100vw - 1180px) / 2));
  color: #43504c;
  background: #e8efec;
  border-top: 1px solid rgba(39, 74, 66, 0.16);
}

.site-footer p {
  margin: 6px 0 0;
}

.site-footer nav {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.site-footer a {
  padding: 4px 0;
}

.article-shell {
  min-height: calc(100vh - 190px);
  padding: 58px max(18px, calc((100vw - 860px) / 2));
  background: #fbfcfa;
}

.article-content {
  max-width: 860px;
}

.article-content h1 {
  margin: 0 0 18px;
  font-size: clamp(34px, 6vw, 56px);
  line-height: 1.08;
}

.article-content .lead {
  margin: 0 0 36px;
  color: #33403c;
  font-size: 20px;
  line-height: 1.7;
}

.article-content section {
  padding: 28px 0;
  border-top: 1px solid rgba(39, 74, 66, 0.14);
}

.article-content h2 {
  margin: 0 0 12px;
  font-size: 26px;
  line-height: 1.25;
}

.article-content p {
  margin: 0 0 16px;
  font-size: 17px;
  line-height: 1.85;
}

.contact-panel {
  padding: 22px;
  background: #eef4f1;
  border: 1px solid rgba(39, 74, 66, 0.16);
  border-radius: 8px;
}

.text-button {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 0 16px;
  color: #fff;
  background: var(--accent);
  border-radius: 8px;
}

.text-button:hover {
  background: var(--accent-strong);
}

@media (max-width: 960px) {
  .content-grid,
  .guide-grid {
    grid-template-columns: 1fr;
  }

  .guide-card {
    min-height: 0;
  }
}

@media (max-width: 760px) {
  .site-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
    min-height: 76px;
    padding: 10px 14px;
  }

  .site-nav {
    width: 100%;
    justify-content: flex-start;
    padding-bottom: 2px;
  }

  .site-nav a {
    padding: 7px 9px;
    font-size: 13px;
  }

  .app-shell {
    min-height: calc(100vh - 76px);
    scroll-margin-top: 86px;
  }

  .content-band,
  .article-shell {
    padding: 40px 18px;
  }

  .content-band h2,
  .article-content h1 {
    font-size: 32px;
  }

  .content-band p,
  .article-content p {
    font-size: 16px;
  }

  .article-content .lead {
    font-size: 18px;
  }

  .site-footer {
    flex-direction: column;
    padding: 24px 18px;
  }

  .site-footer nav {
    justify-content: flex-start;
  }
}


/* Virtual app window layer */
:root {
  --window-border: rgba(36, 55, 50, 0.24);
  --window-title-bg: #e9efec;
  --window-title-bg-active: #d7e8e1;
  --window-control-bg: #f8faf8;
  --window-shadow: 0 18px 38px rgba(23, 42, 38, 0.16);
}

.app-shell {
  position: relative;
  background:
    linear-gradient(rgba(31, 37, 35, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(31, 37, 35, 0.035) 1px, transparent 1px),
    #edf3f0;
  background-size: 20px 20px;
}

.window-frame {
  position: relative;
  border-color: var(--window-border);
  box-shadow: var(--window-shadow);
  transform: translate(var(--window-x, 0), var(--window-y, 0));
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.window-frame:hover,
.window-frame:focus-within {
  border-color: rgba(47, 125, 104, 0.5);
  box-shadow: 0 22px 46px rgba(23, 42, 38, 0.19);
}

.window-frame.is-window-maximized {
  position: absolute !important;
  inset: 14px;
  z-index: 95 !important;
  width: auto !important;
  height: auto !important;
  max-width: none !important;
  max-height: none !important;
  transform: none !important;
}

.window-frame.is-window-minimized {
  min-height: 0 !important;
  height: auto !important;
}

.window-frame.is-window-minimized > :not(.window-titlebar),
.window-frame.is-window-closed {
  display: none !important;
}

.window-titlebar {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 34px;
  padding: 0 8px 0 12px;
  color: #26332f;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.84), rgba(255, 255, 255, 0)),
    var(--window-title-bg);
  border-bottom: 1px solid rgba(36, 55, 50, 0.16);
  cursor: grab;
  font-size: 12px;
  font-weight: 900;
  user-select: none;
}

.window-frame:focus-within > .window-titlebar,
.window-frame:hover > .window-titlebar {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(255, 255, 255, 0)),
    var(--window-title-bg-active);
}

.window-titlebar:active {
  cursor: grabbing;
}

.window-title {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.window-controls,
.canvas-window-controls {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-left: auto;
}

.window-control,
.canvas-window-button {
  display: grid;
  width: 22px;
  height: 22px;
  min-height: 0;
  place-items: center;
  padding: 0;
  color: #31423d;
  background: var(--window-control-bg);
  border: 1px solid rgba(36, 55, 50, 0.2);
  border-radius: 5px;
  font-size: 13px;
  font-weight: 900;
  line-height: 1;
}

.window-control:hover,
.canvas-window-button:hover {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
}

.window-control--close:hover,
.canvas-window-button--close:hover {
  background: var(--danger);
  border-color: var(--danger);
}

.window-resizer {
  position: absolute;
  right: 0;
  bottom: 0;
  z-index: 4;
  width: 18px;
  height: 18px;
  cursor: nwse-resize;
}

.window-resizer::before {
  position: absolute;
  right: 4px;
  bottom: 4px;
  width: 8px;
  height: 8px;
  border-right: 2px solid rgba(47, 125, 104, 0.7);
  border-bottom: 2px solid rgba(47, 125, 104, 0.7);
  content: "";
}

.sidebar.window-frame {
  border-right: 1px solid var(--window-border);
}

.editor-toolbar.window-frame {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-rows: auto auto;
  align-items: center;
  padding: 0 20px 12px;
  overflow: visible;
}

.editor-toolbar.window-frame > .window-titlebar {
  grid-column: 1 / -1;
  margin: 0 -20px 10px;
}

.editor-toolbar.window-frame > .current-meta {
  grid-column: 1;
}

.editor-toolbar.window-frame > .toolbar-actions {
  grid-column: 2;
}

.note-paper.window-frame {
  grid-template-areas:
    "titlebar"
    "header"
    "canvas";
  grid-template-rows: auto auto minmax(520px, 1fr);
}

.note-paper.window-frame > .window-titlebar {
  grid-area: titlebar;
}

.editor .writing-tools.window-frame {
  padding: 0 18px 18px;
  border-left-color: var(--window-border);
}

.editor .writing-tools.window-frame > .window-titlebar {
  margin: 0 -18px 0;
}

.canvas-context-menu.window-frame {
  overflow: hidden;
  padding: 0 10px 10px;
}

.canvas-context-menu.window-frame > .window-titlebar {
  min-height: 30px;
  margin: 0 -10px 8px;
}

.window-dock {
  position: absolute;
  right: 14px;
  bottom: 12px;
  left: 14px;
  z-index: 110;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  pointer-events: none;
}

.window-dock[hidden] {
  display: none;
}

.window-dock-button {
  min-height: 34px;
  padding: 0 12px;
  color: #1f2523;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(36, 55, 50, 0.24);
  border-radius: 8px;
  box-shadow: 0 10px 22px rgba(23, 42, 38, 0.14);
  font-size: 12px;
  font-weight: 900;
  pointer-events: auto;
}

.window-dock-button:hover {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
}

.canvas-item {
  border-color: var(--window-border);
}

.canvas-item-grip {
  justify-content: space-between;
  gap: 10px;
  color: #26332f;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.8), rgba(255, 255, 255, 0)),
    var(--window-title-bg);
}

.canvas-item.is-active .canvas-item-grip,
.canvas-item:hover .canvas-item-grip {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.7), rgba(255, 255, 255, 0)),
    var(--window-title-bg-active);
}

.canvas-window-title {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.canvas-item.is-canvas-minimized {
  min-height: 0 !important;
  height: auto !important;
}

.canvas-item.is-canvas-minimized .canvas-text-content,
.canvas-item.is-canvas-minimized .canvas-image-stack,
.canvas-item.is-canvas-minimized .canvas-resize-handle {
  display: none;
}

.canvas-item.is-canvas-maximized {
  box-shadow: 0 0 0 3px rgba(47, 125, 104, 0.16), 0 26px 56px rgba(23, 42, 38, 0.22);
}

.canvas-item.is-canvas-maximized .canvas-resize-handle {
  display: none;
}

.canvas-theme--paper .canvas-item-grip {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(255, 255, 255, 0)),
    #f6ecd0;
}

.canvas-theme--marker .canvas-item-grip {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(255, 255, 255, 0)),
    #fff4d7;
}

.canvas-theme--dark .canvas-window-button {
  color: #edf7f2;
  background: #39443f;
  border-color: #56645f;
}

@media (max-width: 1040px) {
  .editor-toolbar.window-frame {
    grid-template-columns: 1fr;
  }

  .editor-toolbar.window-frame > .toolbar-actions {
    grid-column: 1;
  }

  .editor .writing-tools.window-frame {
    padding: 0 18px 14px;
  }
}

@media (max-width: 760px) {
  .window-frame {
    transform: none !important;
  }

  .window-resizer {
    display: none;
  }

  .window-titlebar {
    min-height: 32px;
  }

  .editor-toolbar.window-frame {
    padding: 0 14px 10px;
  }

  .editor-toolbar.window-frame > .window-titlebar {
    margin: 0 -14px 8px;
  }

  .note-paper.window-frame {
    grid-template-rows: auto auto minmax(460px, 1fr);
  }

  .editor .writing-tools.window-frame {
    padding: 0 14px 12px;
  }

  .editor .writing-tools.window-frame > .window-titlebar {
    margin: 0 -14px 0;
  }
}
/* End virtual app window layer */





/* Mini app launcher layer */
.app-launcher {
  position: absolute;
  top: 78px;
  right: 14px;
  z-index: 85;
  display: grid;
  gap: 7px;
  width: 66px;
  padding: 7px;
  background: rgba(242, 248, 245, 0.9);
  border: 1px solid rgba(47, 125, 104, 0.22);
  border-radius: 8px;
  box-shadow: 0 14px 34px rgba(23, 42, 38, 0.16);
  backdrop-filter: blur(14px);
}

.app-icon {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 4px;
  min-width: 0;
  min-height: 56px;
  padding: 6px 3px 5px;
  color: var(--accent-strong);
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid transparent;
  border-radius: 7px;
  font-size: 10px;
  font-weight: 820;
  line-height: 1.1;
}

.app-icon:hover,
.app-icon.is-selected {
  color: var(--accent-strong);
  background: #fff;
  border-color: rgba(47, 125, 104, 0.28);
  box-shadow: 0 7px 18px rgba(23, 42, 38, 0.1);
}

.app-icon.is-open::before,
.app-icon.is-minimized::before {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 7px;
  height: 7px;
  background: var(--accent);
  border: 2px solid #fff;
  border-radius: 999px;
  box-shadow: 0 0 0 1px rgba(47, 125, 104, 0.26);
  content: "";
}

.app-icon.is-minimized::before {
  background: #8aa39b;
}

.app-icon::after {
  position: absolute;
  right: calc(100% + 9px);
  top: 50%;
  z-index: 2;
  min-width: max-content;
  padding: 6px 8px;
  color: #fff;
  background: rgba(31, 37, 35, 0.92);
  border-radius: 6px;
  box-shadow: 0 8px 18px rgba(23, 42, 38, 0.18);
  content: attr(data-tooltip);
  font-size: 12px;
  font-weight: 760;
  opacity: 0;
  pointer-events: none;
  transform: translate(4px, -50%);
  transition: opacity 0.14s ease, transform 0.14s ease;
}

.app-icon:hover::after {
  opacity: 1;
  transform: translate(0, -50%);
}

.app-icon-glyph {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  color: inherit;
  background: rgba(219, 236, 230, 0.72);
  border: 1px solid rgba(47, 125, 104, 0.16);
  border-radius: 7px;
}

.app-icon-glyph svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.app-icon:hover .app-icon-glyph,
.app-icon.is-selected .app-icon-glyph,
.app-icon.is-open .app-icon-glyph {
  background: rgba(47, 125, 104, 0.12);
  border-color: rgba(47, 125, 104, 0.28);
}

.app-icon-label {
  display: block;
  max-width: 100%;
  overflow: hidden;
  color: #46645d;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 10px;
  letter-spacing: 0;
}

.mini-window-layer {
  position: absolute;
  inset: 0;
  z-index: 88;
  pointer-events: none;
}

.mini-app-window {
  position: absolute;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-height: 190px;
  max-height: min(70vh, 620px);
  overflow: hidden;
  color: var(--ink);
  background: rgba(251, 252, 250, 0.98);
  border: 1px solid rgba(47, 125, 104, 0.3);
  border-radius: 8px;
  box-shadow: 0 22px 54px rgba(23, 42, 38, 0.22);
  pointer-events: auto;
}

.mini-app-window[hidden] {
  display: none;
}

.mini-window-titlebar {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 34px;
  padding: 0 8px 0 12px;
  color: #1f3831;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.86), rgba(255, 255, 255, 0)), #d7e8e1;
  border-bottom: 1px solid rgba(47, 125, 104, 0.2);
  cursor: grab;
  font-size: 12px;
  font-weight: 900;
  user-select: none;
}

.mini-window-titlebar:active {
  cursor: grabbing;
}

.mini-window-title {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mini-window-controls {
  display: flex;
  gap: 5px;
  margin-left: auto;
}

.mini-window-control {
  display: grid;
  width: 23px;
  height: 23px;
  min-height: 0;
  place-items: center;
  padding: 0;
  color: #31423d;
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid rgba(36, 55, 50, 0.2);
  border-radius: 5px;
  font-size: 14px;
  font-weight: 900;
}

.mini-window-control:hover {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
}

.mini-window-control--close:hover {
  background: var(--danger);
  border-color: var(--danger);
}

.mini-window-body {
  display: grid;
  align-content: start;
  gap: 12px;
  min-height: 0;
  overflow: auto;
  padding: 14px;
}

.mini-window-note {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 760;
  line-height: 1.5;
}

.mini-command-grid,
.mini-sticker-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.mini-command-list {
  display: grid;
  gap: 8px;
}

.mini-command,
.mini-sticker-button,
.mini-image-thumb {
  min-height: 38px;
  padding: 0 10px;
  color: var(--accent-strong);
  background: #fff;
  border: 1px solid rgba(47, 125, 104, 0.2);
  border-radius: 8px;
  font-size: 13px;
  font-weight: 850;
}

.mini-command:hover,
.mini-sticker-button:hover,
.mini-image-thumb:hover {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
}

.mini-sticker-button {
  min-height: 64px;
  background: #fffdf6;
  border-color: #d8c990;
}

.mini-image-list {
  display: grid;
  gap: 8px;
}

.mini-image-thumb {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: center;
  justify-content: start;
  gap: 8px;
  min-height: 48px;
  text-align: left;
}

.mini-image-thumb img {
  width: 42px;
  height: 34px;
  object-fit: cover;
  border-radius: 6px;
}

.mini-image-thumb span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mini-window-resizer {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 18px;
  height: 18px;
  cursor: nwse-resize;
}

.mini-window-resizer::before {
  position: absolute;
  right: 4px;
  bottom: 4px;
  width: 8px;
  height: 8px;
  border-right: 2px solid rgba(47, 125, 104, 0.72);
  border-bottom: 2px solid rgba(47, 125, 104, 0.72);
  content: "";
}

@media (max-width: 760px) {
  .app-shell {
    overflow: hidden;
  }

  .app-launcher {
    right: 10px;
    left: 10px;
    top: auto;
    bottom: 10px;
    grid-auto-flow: column;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    width: auto;
    padding: 6px;
  }

  .app-icon::after {
    display: none;
  }

  .app-icon {
    min-height: 48px;
    font-size: 10px;
  }

  .app-icon-glyph {
    width: 24px;
    height: 24px;
  }

  .app-icon-glyph svg {
    width: 18px;
    height: 18px;
  }

  .mini-app-window {
    left: 12px !important;
    right: 12px;
    top: 96px !important;
    width: auto !important;
    max-height: calc(100vh - 190px);
  }

  .mini-window-resizer {
    display: none;
  }
}
/* End mini app launcher layer */
