:root {
  --bg: #f8f7f4;
  --panel: #ffffff;
  --panel-soft: #f2f1ed;
  --line: #e4e0d8;
  --line-strong: #cfc8bc;
  --text: #202124;
  --muted: #6f716d;
  --green: #2f7d57;
  --green-soft: #e3f3ea;
  --blue: #356f94;
  --blue-soft: #e2eff7;
  --rose: #a84c5d;
  --rose-soft: #f8e5ea;
  --gold: #9a6b21;
  --gold-soft: #f5ecd7;
  --ink: #202124;
  --teal: #1d8178;
  --teal-soft: #ddf3f0;
  --violet: #7256a4;
  --violet-soft: #ece7f7;
  --orange: #b45f25;
  --orange-soft: #f8e8dc;
  --cyan: #2b7d9b;
  --cyan-soft: #e0f1f6;
  --gray: #647067;
  --gray-soft: #edf0ed;
  --shadow: 0 18px 42px rgba(32, 33, 36, 0.08);
  --radius: 8px;
  --font: Inter, "Helvetica Neue", Arial, "Noto Sans KR", "Apple SD Gothic Neo", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  letter-spacing: 0;
}

body {
  margin: 0;
  min-height: 100vh;
}

.lock-screen {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  background: radial-gradient(circle at center top, #30363a, #101315 55%, #050607);
  padding: 18px;
}

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

.lock-card {
  width: min(360px, 100%);
  display: grid;
  gap: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius);
  background: #fff;
  padding: 22px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.28);
}

.lock-card img {
  width: 54px;
  height: 54px;
  border-radius: 10px;
  background: #111;
}

.lock-card h1 {
  margin: 0;
  font-size: 22px;
}

.lock-message {
  min-height: 18px;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

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

button {
  cursor: pointer;
  appearance: none;
  line-height: 1;
  transition: background-color 140ms ease, border-color 140ms ease, color 140ms ease, box-shadow 140ms ease, transform 120ms ease;
}

button:hover {
  transform: translateY(-1px);
}

button:active {
  transform: translateY(0);
}

button:focus-visible,
a.compact-action:focus-visible {
  outline: 2px solid rgba(37, 99, 235, 0.25);
  outline-offset: 2px;
}

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

.sidebar {
  background: #202124;
  color: #f7faf6;
  padding: 14px 10px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow-y: auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}

.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: #101315;
  border: 1px solid rgba(255, 255, 255, 0.16);
  overflow: hidden;
}

.brand-mark img {
  width: 100%;
  height: 100%;
  display: block;
}

.brand strong,
.brand span {
  display: block;
}

.brand strong {
  font-size: 15px;
}

.brand span,
.sidebar-section h2 {
  color: #b5c4bc;
  font-size: 12px;
  font-weight: 600;
}

.nav {
  display: grid;
  gap: 5px;
}

.nav button {
  min-height: 29px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #dbe7df;
  padding: 6px 8px;
  display: flex;
  align-items: center;
  gap: 7px;
  text-align: left;
  font-size: 11px;
  font-weight: 560;
}

.nav-icon {
  width: 18px;
  flex: 0 0 18px;
  display: inline-grid;
  place-items: center;
  font-size: 14px;
  line-height: 1;
}

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

.nav button.active,
.nav button:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: none;
}

.sidebar-logout {
  width: 100%;
  min-height: 30px;
  margin-top: auto;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.06);
  color: #f1d5d2;
  padding: 7px 8px;
  text-align: left;
  font-size: 11px;
  font-weight: 600;
}

.sidebar-logout:hover {
  background: rgba(180, 35, 24, 0.18);
  border-color: rgba(244, 166, 158, 0.28);
  color: #ffe7e4;
  transform: none;
}

.sidebar-section {
  display: grid;
  gap: 10px;
}

.sidebar-section h2 {
  margin: 0;
  text-transform: uppercase;
}

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

.sync-item {
  width: 100%;
  min-height: 28px;
  border: 0;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.08);
  padding: 5px 7px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #d9e4dd;
  font-size: 12px;
  text-align: left;
}

.sync-item.muted {
  opacity: 0.42;
}

.workspace {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(330px, 388px);
  gap: 14px;
  padding: 14px;
}

.calendar-panel,
.settings-view,
.module-view,
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.calendar-panel {
  min-width: 0;
  display: grid;
  grid-template-rows: auto auto;
  align-content: start;
  overflow: hidden;
}

.calendar-panel[hidden],
.settings-view[hidden],
.module-view[hidden],
.side-rail[hidden] {
  display: none;
}

.module-view,
.settings-view {
  grid-column: 1 / -1;
}

.calendar-header {
  min-height: 72px;
  padding: 13px 14px;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.settings-view {
  min-width: 0;
  align-content: start;
  overflow: auto;
}

.settings-header {
  padding-bottom: 13px;
  border-bottom: 1px solid var(--line);
}

.settings-header h1 {
  margin: 0;
  font-size: 24px;
  line-height: 1.15;
}

.settings-header p:last-child {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.settings-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 14px;
  padding-top: 14px;
}

.module-header {
  padding-bottom: 13px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.module-header h1 {
  margin: 0;
  font-size: 24px;
  line-height: 1.15;
}

.module-header p:last-child {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.module-grid {
  display: grid;
  grid-template-columns: minmax(260px, 0.7fr) minmax(0, 1.3fr);
  gap: 14px;
  padding-top: 14px;
}

.module-form,
.inline-form {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}

.inline-form {
  grid-template-columns: minmax(0, 1fr) auto auto;
}

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

.module-item {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  padding: 10px;
  display: grid;
  gap: 7px;
}

.module-item.selected {
  border-color: #2f6f57;
  box-shadow: 0 0 0 2px rgba(47, 111, 87, 0.12);
}

.module-item header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}

.module-item strong {
  font-size: 13px;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.module-item p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.module-actions {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}

.shopping-create {
  padding-top: 14px;
}

.shopping-place-form {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(0, 300px) auto;
  gap: 8px;
  align-items: center;
  margin-bottom: 12px;
}

.shopping-place-form .swatch-grid.compact {
  margin-top: 0;
}

.shopping-board {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  padding-top: 2px;
  align-items: start;
}

.shopping-place {
  border: 1px solid var(--line);
  border-left: 5px solid var(--swatch-color);
  border-radius: var(--radius);
  background: #fff;
  padding: 10px;
  display: grid;
  gap: 9px;
  min-width: 0;
}

.shopping-place > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.shopping-place > header strong {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  font-size: 13px;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.shopping-add-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 7px;
}

.shopping-items {
  display: grid;
  gap: 6px;
}

.shopping-row {
  display: grid;
  grid-template-columns: auto minmax(90px, 1fr) auto;
  gap: 6px;
  align-items: center;
  min-width: 0;
  padding: 6px;
  border: 1px solid color-mix(in srgb, var(--swatch-color) 24%, var(--line));
  border-radius: 8px;
  background: var(--swatch-soft);
}

.shopping-row.done {
  opacity: 0.62;
}

.shopping-row.done .shopping-title-input {
  color: var(--muted);
  text-decoration: line-through;
}

.shopping-check {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.shopping-check input {
  min-height: 0;
}

.shopping-telegram-btn {
  min-height: 24px;
  border-radius: 999px;
  padding: 0 10px;
  background: #2f80ed;
  border-color: #2f80ed;
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0;
}

.shopping-telegram-btn:hover {
  background: #1f6ed4;
  border-color: #1f6ed4;
  color: #fff;
}

.sort-button {
  width: 24px;
  min-height: 24px;
  height: 24px;
  border-radius: 999px;
  padding: 0;
  background: #f7f9fb;
  border-color: #d9e1e8;
  color: #52616b;
  font-size: 12px;
  font-weight: 650;
  line-height: 1;
}

.shopping-title-input {
  min-height: 30px;
  border-color: transparent;
  background: rgba(255, 255, 255, 0.78);
  font-size: 12px;
}

.shopping-title-input:focus {
  border-color: color-mix(in srgb, var(--swatch-color) 60%, var(--line));
  outline: none;
}

.compact-empty {
  padding: 8px;
  box-shadow: none;
}

.packing-layout {
  display: grid;
  grid-template-columns: minmax(240px, 0.5fr) minmax(0, 1.5fr);
  gap: 14px;
  padding-top: 14px;
  align-items: start;
}

.packing-inventory-panel,
.packing-lists-panel {
  min-width: 0;
}

.packing-add-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  margin-bottom: 12px;
}

.packing-inventory-list,
.packing-lists,
.packing-items {
  display: grid;
  gap: 8px;
}

.packing-inventory-list {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.packing-inventory-list > .empty-todo {
  grid-column: 1 / -1;
}

.packing-lists {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: start;
}

.packing-items {
  grid-template-columns: minmax(0, 1fr);
}

.packing-lists > .empty-todo {
  grid-column: 1 / -1;
}

.packing-inventory-item {
  min-height: 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  padding: 4px 5px 4px 7px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 22px;
  gap: 4px;
  align-items: center;
  cursor: grab;
}

.packing-inventory-item.dragging {
  opacity: 0.48;
}

.packing-inventory-item span {
  min-width: 0;
  color: var(--text);
  font-size: 11px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.packing-inventory-item .bookmark-delete-button {
  width: 22px;
  min-height: 22px;
  height: 22px;
}

.packing-list-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  padding: 10px;
  display: grid;
  gap: 9px;
  min-width: 0;
}

.packing-list-card.active {
  border-color: #2f6f57;
  box-shadow: 0 0 0 2px rgba(47, 111, 87, 0.12);
}

.packing-list-card.drag-over {
  border-color: #2f80ed;
  background: #f3f8ff;
}

.packing-list-card > header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.packing-title-input {
  min-height: 32px;
  border-color: transparent;
  background: #f8faf8;
  font-size: 13px;
  font-weight: 600;
}

.packing-title-input:focus {
  border-color: #9fc7b2;
  background: #fff;
  outline: none;
}

.packing-drop-hint {
  border: 1px dashed var(--line-strong);
  border-radius: 7px;
  background: #fbfaf8;
  color: var(--muted);
  padding: 7px 9px;
  font-size: 11px;
}

.packing-item-row {
  display: grid;
  grid-template-columns: auto minmax(120px, 1fr) auto;
  gap: 6px;
  align-items: center;
  min-width: 0;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfaf8;
}

.packing-item-row.packed {
  opacity: 0.64;
}

.packing-item-row.packed .shopping-title-input {
  color: var(--muted);
  text-decoration: line-through;
}

.bookmark-layout {
  grid-template-columns: minmax(250px, 0.55fr) minmax(0, 1.45fr);
}

.bookmark-table {
  display: grid;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: #fff;
}

.bookmark-table-head,
.bookmark-table-row {
  display: grid;
  grid-template-columns: minmax(140px, 0.9fr) minmax(220px, 1.2fr) minmax(160px, 1fr) 104px;
  gap: 8px;
  align-items: center;
  padding: 8px 10px;
}

.bookmark-table-head {
  background: #f8faf8;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.bookmark-table-row {
  border-bottom: 1px solid var(--line);
  font-size: 12px;
}

.bookmark-table-row:last-child {
  border-bottom: 0;
}

.bookmark-table-row span,
.bookmark-table-row a {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bookmark-table-row a {
  color: #2563a9;
  text-decoration: none;
}

.bookmark-table-row a:hover {
  text-decoration: underline;
}

.bookmark-table-actions {
  display: flex;
  gap: 5px;
  align-items: center;
  justify-content: flex-end;
}

.bookmark-edit-button {
  min-height: 24px;
  padding: 0 7px;
  font-size: 11px;
}

.bookmark-delete-button {
  width: 24px;
  min-height: 24px;
  height: 24px;
  border-radius: 999px;
}

.memo-layout {
  grid-template-columns: minmax(280px, 0.55fr) minmax(0, 1.45fr);
}

.memo-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  padding: 11px;
  display: grid;
  gap: 6px;
}

.memo-card time {
  color: var(--muted);
  font-size: 11px;
}

.memo-card h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
}

.memo-card p {
  margin: 0;
  color: #3f464d;
  font-size: 12px;
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.memo-actions {
  display: flex;
  justify-content: flex-end;
  gap: 5px;
  margin-top: 2px;
}

.memo-list-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  align-items: start;
}

.memo-layout .form-action-button {
  justify-self: start;
}

.subscription-layout,
.decision-layout {
  grid-template-columns: minmax(280px, 0.55fr) minmax(0, 1.45fr);
}

.split-fields {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 96px;
  gap: 8px;
}

.module-filters {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) minmax(120px, 0.5fr) minmax(120px, 0.5fr);
  gap: 8px;
  margin-bottom: 10px;
}

.data-table {
  display: grid;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  overflow: hidden;
}

.data-table-head,
.data-table-row {
  display: grid;
  gap: 8px;
  align-items: center;
  padding: 8px 10px;
}

.subscription-table .data-table-head,
.subscription-table .data-table-row {
  grid-template-columns: minmax(150px, 1fr) minmax(110px, 0.7fr) minmax(110px, 0.7fr) minmax(130px, 0.8fr) 90px 190px;
}

.data-table-head {
  background: #f8faf8;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.data-table-row {
  border-bottom: 1px solid var(--line);
  font-size: 12px;
}

.data-table-row:last-child {
  border-bottom: 0;
}

.data-table-row strong,
.data-table-row span,
.data-table-row small {
  min-width: 0;
  overflow-wrap: anywhere;
}

.data-table-row strong,
.data-table-row small {
  display: block;
}

.data-table-row small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

.data-table-row mark,
.decision-card mark {
  border-radius: 999px;
  background: #edf5ef;
  color: #2f6f57;
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 600;
}

.subscription-row.soon {
  background: #fffaf0;
}

.subscription-row.overdue {
  background: #fff1f1;
}

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

.decision-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  padding: 11px;
  display: grid;
  gap: 7px;
}

.decision-card header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}

.decision-card time,
.decision-card small {
  color: var(--muted);
  font-size: 11px;
}

.decision-card h3 {
  margin: 3px 0 0;
  font-size: 14px;
  font-weight: 600;
}

.decision-card p,
.decision-result {
  margin: 0;
  font-size: 12px;
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.decision-result {
  color: #202124;
}

.essay-view,
.pms-popup-view {
  min-height: calc(100vh - 28px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.essay-frame {
  width: 100%;
  min-height: 70vh;
  height: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-top: 14px;
  background: #fff;
}

.pms-popup-target {
  min-height: 70vh;
  height: 100%;
  border: 1px dashed #c9d3df;
  border-radius: var(--radius);
  margin-top: 14px;
  background: linear-gradient(135deg, #fbfaf8, #eef5f0);
  display: grid;
  place-items: center;
  padding: 18px;
}

.pms-popup-card {
  width: min(420px, 100%);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  padding: 18px;
  display: grid;
  gap: 10px;
  box-shadow: var(--shadow);
}

.pms-popup-icon {
  width: 42px;
  height: 42px;
  border-radius: 999px;
  background: var(--gold-soft);
  color: var(--gold);
  display: grid;
  place-items: center;
  font-size: 21px;
}

.pms-popup-card h2,
.pms-popup-card p {
  margin: 0;
}

.pms-popup-card h2 {
  font-size: 18px;
}

.pms-popup-card p,
.pms-popup-status {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.todo-list-full {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  align-items: start;
  padding-top: 14px;
}

.todo-list-full > .empty-todo {
  grid-column: 1 / -1;
}

.email-layout {
  grid-template-columns: 250px minmax(360px, 1fr) minmax(320px, 0.85fr);
  align-items: stretch;
  min-height: calc(100vh - 168px);
}

.email-layout > section {
  min-height: 0;
}

.email-sidebar-pane,
.email-list-pane,
.email-preview-pane {
  display: grid;
  min-width: 0;
  align-content: start;
}

.email-sidebar-pane {
  display: block;
}

#gmailAccountList {
  gap: 4px;
}

.email-sidebar-pane,
.email-list-pane {
  grid-template-rows: auto minmax(0, 1fr);
}

.email-list-pane {
  grid-template-rows: auto minmax(0, 1fr) auto;
}

.email-list-pane,
.email-preview-pane {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  overflow: hidden;
}

.email-list {
  max-height: none;
  min-height: 0;
  overflow: auto;
  gap: 0;
  align-content: start;
  grid-auto-rows: 43px;
}

.email-inbox-toolbar {
  min-height: 58px;
  border-bottom: 1px solid var(--line);
  background: #fbfaf8;
  padding: 9px 10px;
  display: grid;
  grid-template-columns: minmax(120px, 0.55fr) minmax(180px, 1fr) auto auto;
  align-items: center;
  gap: 8px;
}

.email-inbox-toolbar h2,
.email-inbox-toolbar p {
  margin: 0;
}

.email-inbox-toolbar h2 {
  font-size: 15px;
  font-weight: 650;
}

.email-inbox-toolbar p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

.email-search {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px;
}

.email-search input {
  min-height: 30px;
  border-radius: 999px;
  background: #f1f3f4;
  border-color: transparent;
  padding-left: 13px;
}

.email-page-controls {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}

.email-page-controls .icon-button:disabled {
  opacity: 0.35;
  cursor: default;
}

.email-page-controls .icon-button:disabled:hover {
  transform: none;
}

.email-guide {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfaf8;
  padding: 12px;
  margin-bottom: 12px;
  display: grid;
  gap: 8px;
}

.email-guide[hidden] {
  display: none;
}

.email-guide h2 {
  margin: 0;
  font-size: 14px;
}

.email-guide ol {
  margin: 0;
  padding-left: 18px;
  color: var(--text);
  font-size: 12px;
  line-height: 1.55;
}

.email-guide li {
  margin: 2px 0;
}

.email-security-note {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.gmail-account-row {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  padding: 6px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 6px;
}

.gmail-account-row.selected {
  border-color: rgba(37, 99, 235, 0.34);
  background: #f6f9ff;
  box-shadow: inset 3px 0 0 #2563eb;
}

.gmail-account-select {
  width: 100%;
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  padding: 0;
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr);
  align-items: start;
  gap: 7px;
  text-align: left;
}

.gmail-account-select:hover {
  transform: none;
}

.gmail-avatar {
  width: 26px;
  height: 26px;
  border-radius: 999px;
  background: #2563eb;
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 700;
}

.gmail-account-copy {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.gmail-account-copy strong,
.gmail-account-copy small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gmail-account-copy strong {
  font-size: 12px;
  font-weight: 650;
}

.gmail-account-copy small {
  color: var(--muted);
  font-size: 11px;
}

.gmail-account-row-actions {
  display: inline-flex;
  align-items: flex-start;
  gap: 4px;
}

.gmail-message-row {
  width: 100%;
  height: 43px;
  min-height: 43px;
  max-height: 43px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: #fff;
  color: var(--text);
  padding: 0 10px;
  display: grid;
  grid-template-columns: 10px minmax(120px, 0.28fr) minmax(0, 1fr) 74px;
  align-items: center;
  gap: 9px;
  text-align: left;
  line-height: 1.2;
  overflow: hidden;
}

.gmail-message-row:hover,
.gmail-message-row.selected {
  background: #f1f5fb;
  transform: none;
}

.gmail-message-row.selected {
  box-shadow: inset 3px 0 0 #2563eb;
}

.gmail-row-marker {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: #c8d0dc;
}

.gmail-message-row.selected .gmail-row-marker {
  background: #2563eb;
}

.gmail-row-from,
.gmail-row-content,
.gmail-row-date {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gmail-row-from,
.gmail-row-subject {
  font-size: 12px;
  font-weight: 650;
}

.gmail-row-content {
  color: var(--muted);
  font-size: 12px;
}

.gmail-row-subject {
  color: var(--text);
}

.gmail-row-subject,
.gmail-row-snippet {
  white-space: nowrap;
}

.gmail-row-date {
  color: var(--muted);
  font-size: 11px;
  text-align: right;
}

.email-preview {
  min-height: 100%;
  border: 0;
  border-radius: 0;
  background: #fff;
  margin-top: 0;
  padding: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow-wrap: anywhere;
  font-size: 12px;
  line-height: 1.5;
}

.email-preview-header {
  border-bottom: 1px solid var(--line);
  background: #fbfaf8;
  padding: 14px;
}

.email-preview-header h2 {
  margin: 0 0 10px;
  font-size: 18px;
  font-weight: 620;
  line-height: 1.3;
}

.email-preview-meta {
  display: grid;
  gap: 2px;
  color: var(--muted);
  font-size: 11px;
}

.email-preview-meta strong {
  color: var(--text);
  font-size: 12px;
}

.email-preview-body {
  min-height: 0;
  padding: 16px;
  overflow: auto;
  font-size: 13px;
  line-height: 1.65;
}

.email-image-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.email-image-strip a {
  display: block;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f8fafc;
  overflow: hidden;
}

.email-image-strip img {
  width: 100%;
  max-height: 220px;
  display: block;
  object-fit: contain;
}

.email-body-text {
  white-space: pre-wrap;
}

.email-attachments {
  border-top: 1px solid var(--line);
  margin-top: 16px;
  padding-top: 14px;
}

.email-attachments h3 {
  margin: 0 0 9px;
  font-size: 13px;
  font-weight: 650;
}

.email-attachment-list {
  display: grid;
  gap: 8px;
}

.email-attachment-chip {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfaf8;
  color: var(--text);
  padding: 9px;
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  text-decoration: none;
}

.email-attachment-chip:hover {
  border-color: #bfccdd;
  background: #f1f5fb;
}

.email-attachment-icon {
  width: 40px;
  height: 32px;
  border-radius: 6px;
  background: #e2eff7;
  color: #225474;
  display: grid;
  place-items: center;
  font-size: 10px;
  font-weight: 750;
}

.email-attachment-chip strong,
.email-attachment-chip small {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.email-attachment-chip strong {
  font-size: 12px;
}

.email-attachment-chip small {
  color: var(--muted);
  font-size: 11px;
}

.email-empty-state,
.email-empty-preview {
  color: var(--muted);
  font-size: 12px;
}

.email-empty-state {
  padding: 16px;
}

.email-empty-preview {
  min-height: 260px;
  display: grid;
  place-items: center;
  padding: 18px;
  text-align: center;
}

.settings-card {
  min-width: 0;
}

.settings-note {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.oauth-setup-box {
  display: grid;
  gap: 5px;
  margin: 10px 0;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f9faf8;
}

.oauth-setup-box span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}

.oauth-setup-box code {
  display: block;
  color: #1f2937;
  font-size: 12px;
  line-height: 1.45;
  overflow-wrap: anywhere;
  white-space: normal;
}

.google-calendar-list {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.google-calendar-account {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px;
  background: #fbfcfa;
}

.google-calendar-account h3 {
  margin: 0;
  font-size: 13px;
}

.google-calendar-account p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.inline-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.google-calendar-items {
  display: grid;
  gap: 8px;
  margin-top: 9px;
}

.google-calendar-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(150px, 210px);
  gap: 8px;
  align-items: center;
}

.google-calendar-row small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.sync-progress-card {
  display: grid;
  gap: 8px;
  margin-top: 10px;
  padding: 10px;
  border: 1px solid #dbe5ee;
  border-radius: 8px;
  background: #f8fbfd;
}

.sync-progress-card.ok {
  border-color: #d8eadf;
  background: #f7fcf8;
}

.sync-progress-card.active {
  border-color: #cfe0f8;
  background: #f6f9ff;
}

.sync-progress-card.warning {
  border-color: #f1d0ca;
  background: #fff8f6;
}

.sync-progress-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: #24313d;
  font-size: 12px;
}

.sync-progress-head strong {
  font-size: 12px;
  font-weight: 700;
}

.sync-progress-head span {
  color: #2563eb;
  font-size: 12px;
  font-weight: 750;
}

.sync-progress-track {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #e6ebf1;
}

.sync-progress-track span {
  display: block;
  height: 100%;
  min-width: 4px;
  border-radius: inherit;
  background: linear-gradient(90deg, #3b82f6, #22c55e);
  transition: width 220ms ease;
}

.sync-progress-card.warning .sync-progress-track span {
  background: linear-gradient(90deg, #f97316, #ef4444);
}

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

.sync-progress-grid span {
  min-width: 0;
  padding: 6px 7px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.68);
  color: #536170;
  font-size: 11px;
}

.sync-progress-grid b {
  color: #1f2937;
  font-weight: 750;
}

.sync-progress-card p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.font-choice-list {
  display: grid;
  gap: 8px;
}

.font-choice {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--text);
  padding: 10px 11px;
  text-align: left;
}

.font-choice strong,
.font-choice span {
  display: block;
}

.font-choice strong {
  margin-bottom: 4px;
  font-size: 14px;
  font-weight: 600;
}

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

.font-choice.active {
  border-color: #2f6f57;
  box-shadow: 0 0 0 2px rgba(47, 111, 87, 0.14);
  background: #f6fbf8;
}

.menu-order-list {
  display: grid;
  gap: 7px;
}

.menu-order-item {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  padding: 6px 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.menu-order-item strong {
  min-width: 0;
  font-size: 12px;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.menu-order-item .sort-button:disabled {
  opacity: 0.35;
  cursor: default;
}

.menu-order-item .sort-button:disabled:hover {
  transform: none;
}

.font-choice[data-font-choice="inter"] {
  font-family: Inter, "Helvetica Neue", Arial, "Noto Sans KR", sans-serif;
}

.font-choice[data-font-choice="google"] {
  font-family: "Google Sans Text", "Google Sans", Roboto, Arial, "Noto Sans KR", sans-serif;
}

.font-choice[data-font-choice="system"] {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans KR", sans-serif;
}

.font-choice[data-font-choice="claude"] {
  font-family: "Avenir Next", "Helvetica Neue", Arial, "Noto Sans KR", sans-serif;
}

.eyebrow {
  margin: 0 0 3px;
  color: var(--green);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.calendar-sync-stamp {
  margin: 0 0 3px;
  color: #59656f;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0;
}

.calendar-header h1 {
  margin: 0;
  font-size: 24px;
  line-height: 1.15;
}

.calendar-header p:last-child {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.calendar-controls,
.form-actions,
.section-row,
.print-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.calendar-controls {
  justify-content: flex-end;
}

.calendar-controls .ghost,
.calendar-controls .primary {
  min-height: 27px;
  border-radius: 6px;
  padding: 0 8px;
  font-size: 11px;
  font-weight: 560;
}

.calendar-controls .icon-button {
  width: 27px;
  min-height: 27px;
  border-color: #d7dce2;
  color: #47515a;
}

#todayBtn {
  background: #eef6ff;
  border-color: #c7def6;
  color: #245f88;
}

#zoomOutBtn,
#zoomInBtn {
  background: #f6f3ed;
  border-color: #ddd7cc;
  color: #555f5a;
}

#printPreviewBtn {
  background: #f5f7fb;
  border-color: #dce3ee;
  color: #455468;
}

#newEventBtn {
  background: #2563eb;
  border-color: #2563eb;
  color: #fff;
}

.primary,
.ghost,
.danger,
.icon-button,
.pill {
  min-height: 32px;
  border-radius: 7px;
  border: 1px solid transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 10px;
  white-space: nowrap;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0;
}

.compact-action {
  min-height: 26px;
  padding: 0 8px;
  font-size: 11px;
  font-weight: 600;
}

a.primary,
a.ghost {
  text-decoration: none;
}

.form-action-button {
  min-height: 28px;
  border-radius: 999px;
  padding: 0 12px;
  font-size: 11px;
  font-weight: 620;
  letter-spacing: 0;
  box-shadow: none;
}

.form-action-button.primary,
a.form-action-button.primary {
  background: #2563eb;
  border-color: #2563eb;
  color: #fff;
}

.form-action-button.primary:hover,
a.form-action-button.primary:hover {
  background: #1d4ed8;
  border-color: #1d4ed8;
  color: #fff;
}

.secondary-form-action {
  background: #f8fafc;
  border-color: #d8dee6;
  color: #475569;
}

.secondary-form-action:hover {
  background: #eef2f7;
  border-color: #cbd5e1;
  color: #334155;
}

.primary {
  background: #2563eb;
  border-color: #2563eb;
  color: #fff;
  box-shadow: 0 1px 1px rgba(37, 99, 235, 0.12);
}

.ghost {
  background: #ffffff;
  border-color: #d8dee6;
  color: #30363d;
}

.danger {
  background: #fff7f6;
  border-color: #f3c5bd;
  color: #b42318;
}

.danger-icon {
  background: #fff7f6;
  border-color: #f3c5bd;
  color: #b42318;
}

.icon-button {
  width: 32px;
  padding: 0;
  background: #fff;
  border-color: #d8dee6;
  color: #3f4a54;
  font-weight: 650;
}

.primary:hover {
  background: #1d4ed8;
  border-color: #1d4ed8;
  box-shadow: 0 4px 10px rgba(37, 99, 235, 0.18);
}

.ghost:hover,
.icon-button:hover {
  background: #f6f8fb;
  border-color: #cbd5e1;
  color: #1f2937;
}

.danger:hover,
.danger-icon:hover {
  background: #fff0ee;
  border-color: #eeaaa0;
  color: #931f14;
}

.form-action-button,
.form-action-button:hover {
  box-shadow: none;
}

.icon-button.small {
  width: 24px;
  min-height: 24px;
  height: 24px;
  border-radius: 999px;
  font-size: 12px;
}

.pill {
  min-height: 28px;
  background: var(--green-soft);
  color: #1d5d3d;
  font-size: 12px;
  font-weight: 800;
}

.pill.blue {
  background: var(--blue-soft);
  color: #225474;
}

.side-rail {
  display: grid;
  gap: 14px;
  align-content: start;
  min-width: 0;
}

.pad {
  padding: 14px;
}

.section-row {
  justify-content: space-between;
  margin-bottom: 12px;
}

.section-row h2 {
  margin: 0;
  font-size: 16px;
}

.hint {
  color: var(--muted);
  font-size: 12px;
}

label,
.todo-form,
.event-form,
.account-form,
.settings-form {
  display: grid;
  gap: 7px;
}

label span,
.label-text {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.field-help {
  margin-top: -3px;
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.35;
}

input,
select,
textarea {
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--text);
  padding: 5px 8px;
  min-width: 0;
  font-size: 12px;
}

textarea {
  resize: vertical;
}

.todo-form,
.account-form,
.settings-form {
  margin-bottom: 13px;
}

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

.custom-reminder {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 8px;
}

.custom-reminder[hidden] {
  display: none;
}

.event-form .form-actions .primary,
.event-form .form-actions .ghost,
.event-form .form-actions .danger {
  min-height: 28px;
  padding: 0 9px;
  font-size: 11px;
  font-weight: 600;
}

.event-form .form-actions .primary {
  background: #2563eb;
  border-color: #2563eb;
}

.event-form .form-actions .ghost {
  background: #ffffff;
}

.full {
  grid-column: 1 / -1;
}

.todo-list,
.account-list {
  display: grid;
  gap: 9px;
}

.todo-account-group {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  overflow: hidden;
}

.todo-account-group.drop-over {
  border-color: #2563eb;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.12);
}

.todo-account-group header {
  min-height: 30px;
  padding: 7px 9px;
  background: #f9faf8;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

.todo-account-group header span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.todo-group-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.todo-account-items {
  display: grid;
  gap: 7px;
  padding: 7px;
}

.empty-todo {
  padding: 8px;
  color: var(--muted);
  font-size: 12px;
}

.todo-item,
.account-row {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.todo-item {
  padding: 11px;
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) auto auto;
  gap: 9px;
  align-items: start;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.todo-item:hover {
  border-color: #cbd5e1;
  box-shadow: 0 5px 14px rgba(15, 23, 42, 0.06);
}

.todo-item.done {
  background: #fbfcfa;
  opacity: 0.68;
}

.todo-check {
  width: 20px;
  height: 20px;
  border-radius: 6px;
  border: 1px solid var(--line-strong);
  background: #fff;
}

.todo-item.done .todo-check {
  background: var(--green);
  border-color: var(--green);
}

.todo-copy strong,
.account-copy strong {
  display: block;
  overflow-wrap: anywhere;
  font-size: 13px;
}

.todo-copy span,
.account-copy span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.todo-copy p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.priority {
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 800;
  background: var(--gray-soft);
  color: var(--gray);
}

.priority.high {
  background: var(--gold-soft);
  color: var(--gold);
}

.priority.urgent {
  background: var(--rose-soft);
  color: var(--rose);
}

.account-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: 8px;
  padding: 8px;
}

.account-editor {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.account-edit-swatches {
  gap: 5px;
}

.swatch.small {
  width: 22px;
  height: 22px;
  border-radius: 6px;
}

.drag-handle {
  color: var(--muted);
  cursor: grab;
  font-weight: 900;
  font-size: 12px;
}

.row-actions {
  grid-column: 2;
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.swatch-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.swatch-grid.compact {
  margin-top: 7px;
}

.swatch {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px var(--line);
  background: var(--swatch-color);
}

.swatch.active {
  box-shadow: 0 0 0 2px var(--ink);
}

.telegram-account-list {
  display: grid;
  gap: 7px;
  margin-top: 7px;
}

.check-row {
  min-height: 28px;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 5px 8px;
  background: #fff;
}

.check-row input {
  min-height: 0;
}

.check-row span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--swatch-color);
  flex: 0 0 auto;
}

.account-calendar {
  display: grid;
  grid-template-columns: 142px repeat(7, minmax(122px, 1fr));
  grid-auto-rows: auto;
  align-content: start;
  align-items: stretch;
  overflow: auto;
  background: #fff;
  border-top: 1px solid var(--line);
}

.calendar-head,
.calendar-account,
.calendar-cell {
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.calendar-head {
  min-height: 44px;
  padding: 6px 7px;
  background: #f9faf8;
  display: grid;
  align-content: center;
  gap: 2px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  position: sticky;
  top: 0;
  z-index: 4;
}

.calendar-head:first-child {
  left: 0;
  z-index: 7;
}

.calendar-head strong {
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
}

.calendar-head.saturday {
  color: var(--blue);
  background: #eef7fc;
}

.calendar-head.sunday,
.calendar-head.holiday {
  color: var(--rose);
  background: #fff0f3;
}

.holiday-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 10px;
}

.calendar-account {
  min-height: 0;
  padding: 6px 8px 6px 7px;
  background: var(--swatch-soft, #f9faf8);
  border-left: 4px solid var(--swatch-color, transparent);
  display: grid;
  align-content: start;
  gap: 3px;
  position: sticky;
  left: 0;
  z-index: 3;
  box-shadow: 1px 0 0 var(--line);
}

.calendar-account[draggable="true"] {
  cursor: grab;
}

.calendar-account strong {
  font-size: 13px;
  font-weight: 500;
}

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

.calendar-cell {
  min-height: 0;
  padding: 5px 4px;
  display: grid;
  gap: 4px;
  align-content: start;
  background: #fff;
  transition: background 120ms ease, box-shadow 120ms ease;
}

.calendar-cell:nth-child(even) {
  background: #fbfcfa;
}

.calendar-cell.saturday {
  background: #f6fbfe;
}

.calendar-cell.sunday,
.calendar-cell.holiday {
  background: #fff8f9;
}

.calendar-cell.over {
  background: #edf7f1;
  box-shadow: inset 0 0 0 2px #9fcdb1;
}

.calendar-cell.range-selecting {
  background: #eaf4ff;
  box-shadow: inset 0 0 0 1px #9fc5f8;
}

.calendar-cell.range-start,
.calendar-cell.range-end {
  box-shadow: inset 0 0 0 2px #4f86c6;
}

.calendar-event {
  border: 1px solid var(--line);
  border-left: 5px solid var(--swatch-color);
  border-radius: 7px;
  background: var(--swatch-soft);
  padding: 5px 6px;
  display: grid;
  gap: 2px;
  font-size: 12px;
  cursor: grab;
}

.calendar-event.selected {
  box-shadow: 0 0 0 2px var(--ink);
}

.calendar-event.dragging {
  opacity: 0.55;
}

.calendar-event.span-start {
  margin-right: -8px;
  border-radius: 7px 0 0 7px;
  position: relative;
  z-index: 2;
}

.calendar-event.span-middle {
  margin-left: -8px;
  margin-right: -8px;
  border-left-width: 1px;
  border-radius: 0;
  position: relative;
  z-index: 2;
}

.calendar-event.span-end {
  margin-left: -8px;
  border-left-width: 1px;
  border-radius: 0 7px 7px 0;
  position: relative;
  z-index: 2;
}

.event-meta {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.event-origin {
  border-radius: 999px;
  padding: 1px 5px;
  background: rgba(255, 255, 255, 0.74);
  border: 1px solid rgba(15, 23, 42, 0.08);
  color: #475569;
  font-size: 9px;
  font-weight: 700;
  line-height: 1.4;
  width: fit-content;
}

.event-origin.google {
  color: #2563eb;
}

.event-origin.erp {
  color: #2f6f57;
}

.event-time,
.calendar-event span {
  color: var(--muted);
  font-size: 11px;
}

.event-notes {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.25;
  white-space: normal;
  overflow-wrap: anywhere;
}

.calendar-event strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.event-mini-badge {
  min-height: 20px;
  border-radius: 999px;
  padding: 2px 6px;
  background: rgba(255, 255, 255, 0.72);
  color: inherit;
  font-size: 10px;
  font-weight: 800;
  width: fit-content;
}

.toggle-row {
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
}

.toggle-row input {
  min-height: 0;
}

.telegram-preview {
  border: 1px solid #c0d7e4;
  border-radius: var(--radius);
  background: #f4f9fc;
  padding: 10px;
  color: #225474;
  font-size: 12px;
  line-height: 1.45;
}

.sync-diagnostic {
  margin-top: 8px;
  display: grid;
  gap: 4px;
  border-radius: 8px;
  padding: 8px;
  background: rgba(255, 255, 255, 0.7);
}

.sync-diagnostic.ok {
  border: 1px solid rgba(52, 137, 103, 0.24);
  color: #1f674e;
}

.sync-diagnostic.warning {
  border: 1px solid rgba(196, 143, 45, 0.28);
  color: #73531c;
}

.sync-diagnostic ul {
  margin: 2px 0 0;
  padding-left: 18px;
}

.print-dialog {
  width: min(1100px, calc(100vw - 28px));
  border: 0;
  border-radius: var(--radius);
  padding: 0;
  box-shadow: 0 24px 70px rgba(23, 32, 27, 0.22);
}

.event-dialog,
.todo-dialog {
  width: min(620px, calc(100vw - 28px));
  border: 0;
  border-radius: var(--radius);
  padding: 0;
  background: transparent;
  box-shadow: 0 24px 70px rgba(23, 32, 27, 0.22);
}

.todo-dialog {
  width: min(430px, calc(100vw - 28px));
}

.event-dialog::backdrop,
.todo-dialog::backdrop {
  background: rgba(23, 32, 27, 0.42);
}

.event-dialog .panel,
.todo-dialog .panel {
  box-shadow: none;
}

.dialog-title-actions {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.print-dialog::backdrop {
  background: rgba(23, 32, 27, 0.42);
}

.print-panel {
  padding: 16px;
}

.print-controls {
  align-items: end;
  margin-bottom: 14px;
}

.print-preview,
.print-area {
  background: #fff;
}

.print-sheet {
  padding: 20px;
  color: #111;
}

.print-sheet h2 {
  margin: 0 0 10px;
}

.print-grid {
  display: grid;
  grid-template-columns: 110px repeat(var(--print-days), minmax(90px, 1fr));
  border-left: 1px solid #bbb;
  border-top: 1px solid #bbb;
}

.print-grid > div {
  min-height: 52px;
  border-right: 1px solid #bbb;
  border-bottom: 1px solid #bbb;
  padding: 6px;
  font-size: 11px;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  max-width: min(360px, calc(100vw - 36px));
  border-radius: var(--radius);
  background: var(--ink);
  color: #fff;
  padding: 11px 13px;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity 160ms ease, transform 160ms ease;
  font-size: 13px;
  z-index: 20;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.print-area {
  display: none;
}

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

  .side-rail {
    grid-template-columns: 1fr;
  }

  .settings-grid {
    grid-template-columns: 1fr;
  }

  .module-grid {
    grid-template-columns: 1fr;
  }

  .email-layout {
    grid-template-columns: 220px minmax(0, 1fr);
  }

  .email-preview-pane {
    grid-column: 1 / -1;
    min-height: 360px;
  }

  .packing-layout {
    grid-template-columns: minmax(220px, 0.7fr) minmax(0, 1.3fr);
  }

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

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

  .todo-list-full,
  .memo-list-grid,
  .decision-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .bookmark-table,
  .data-table {
    overflow-x: auto;
  }

  .bookmark-table-head,
  .bookmark-table-row {
    grid-template-columns: minmax(120px, 0.9fr) minmax(180px, 1.2fr) minmax(140px, 1fr) 100px;
    min-width: 650px;
  }

  .bookmark-table-actions {
    justify-content: flex-start;
  }

  .subscription-table .data-table-head,
  .subscription-table .data-table-row {
    grid-template-columns: minmax(140px, 1fr) 120px 120px 130px 90px 180px;
    min-width: 840px;
  }
}

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

  .sidebar {
    display: none;
  }

  .workspace,
  .side-rail {
    grid-template-columns: 1fr;
  }

  .email-layout {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .email-inbox-toolbar {
    grid-template-columns: 1fr;
  }

  .gmail-message-row {
    grid-template-columns: 8px minmax(78px, 0.34fr) minmax(0, 1fr);
  }

  .gmail-row-date {
    display: none;
  }

  .calendar-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .calendar-controls {
    justify-content: flex-start;
  }

  .event-form {
    grid-template-columns: 1fr;
  }

  .module-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .inline-form {
    grid-template-columns: 1fr;
  }

  .packing-layout,
  .packing-add-form,
  .packing-list-card > header,
  .packing-item-row {
    grid-template-columns: 1fr;
  }

  .packing-lists {
    grid-template-columns: 1fr;
  }

  .shopping-place-form,
  .shopping-row {
    grid-template-columns: 1fr;
  }

  .shopping-board {
    grid-template-columns: 1fr;
  }

  .todo-list-full,
  .memo-list-grid,
  .decision-list {
    grid-template-columns: 1fr;
  }

  .module-filters,
  .split-fields {
    grid-template-columns: 1fr;
  }

  .shopping-check,
  .shopping-row .module-actions {
    justify-content: flex-start;
  }

  .account-calendar {
    grid-template-columns: 112px repeat(7, minmax(118px, 1fr));
  }
}

@media print {
  body > *:not(.print-area) {
    display: none !important;
  }

  .print-area {
    display: block;
  }

  .print-sheet {
    padding: 0;
  }

  @page {
    size: landscape;
    margin: 10mm;
  }
}
