:root {
  --bg: #eef2f7;
  --panel: #ffffff;
  --line: #d9e1ea;
  --text: #0f172a;
  --muted: #64748b;
  --accent: #2563eb;
  --surface-soft: #f8fafc;
  --surface-tint: #eef6ff;
  --surface-tint-strong: #e0f2fe;
  --button-text: #14233b;
  --overlay: rgba(15, 23, 42, 0.18);
  --paper-shadow: 0 18px 38px rgba(15, 23, 42, 0.04);
  --floating-shadow: 0 18px 40px rgba(15, 23, 42, 0.08);
  --grid-stroke: rgba(15, 23, 42, 0.08);
}

:root[data-theme="dark"] {
  --bg: #0b1220;
  --panel: #111a2b;
  --line: #22324b;
  --text: #edf4ff;
  --muted: #91a3bd;
  --accent: #7db2ff;
  --surface-soft: #152033;
  --surface-tint: #16243a;
  --surface-tint-strong: #1b2f49;
  --button-text: #edf4ff;
  --overlay: rgba(2, 6, 23, 0.56);
  --paper-shadow: 0 20px 44px rgba(2, 6, 23, 0.42);
  --floating-shadow: 0 22px 48px rgba(2, 6, 23, 0.48);
  --grid-stroke: rgba(226, 232, 240, 0.12);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: "Manrope", sans-serif;
  color: var(--text);
  background: var(--bg);
  overflow-x: hidden;
}

body.workspace-page {
  min-height: 100vh;
}

body.login-page {
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at top left, rgba(37, 99, 235, 0.08), transparent 28%),
    var(--bg);
}

.texture,
body::before {
  display: none;
}

.workspace-shell {
  position: relative;
  min-height: 100vh;
  padding: 16px;
  overflow: hidden;
}

.menu-button {
  position: fixed;
  top: 16px;
  left: 16px;
  z-index: 40;
  width: 60px;
  height: 60px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--panel);
  display: grid;
  align-content: center;
  gap: 6px;
  padding: 0 18px;
  cursor: pointer;
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.12);
}

.menu-button span {
  display: block;
  height: 2px;
  border-radius: 999px;
  background: var(--text);
}

body.sidebar-open .menu-button,
body.drawer-open .menu-button {
  opacity: 0;
  pointer-events: none;
}

.sidebar-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  background: var(--overlay);
}

.sidebar-backdrop[hidden],
.widget-drawer[hidden] {
  display: none !important;
}

.sidebar,
.widget-drawer {
  position: fixed;
  top: 16px;
  bottom: 16px;
  z-index: 30;
  width: 392px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 20px;
  box-shadow: var(--floating-shadow);
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: #c7d2de transparent;
}

.sidebar::-webkit-scrollbar,
.widget-drawer::-webkit-scrollbar {
  width: 10px;
}

.sidebar::-webkit-scrollbar-thumb,
.widget-drawer::-webkit-scrollbar-thumb {
  background: #c7d2de;
  border-radius: 999px;
  border: 2px solid #ffffff;
}

.sidebar {
  left: 16px;
  display: grid;
  align-content: start;
  gap: 20px;
  transform: translateX(-120%);
  transition: transform 180ms ease;
}

.sidebar.is-open {
  transform: translateX(0);
}

.widget-drawer {
  right: 16px;
  display: grid;
  align-content: start;
  gap: 18px;
  cursor: default;
}

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

.brand-mark {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  overflow: hidden;
}

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

.sidebar-brand strong {
  display: block;
  font-size: 1.05rem;
}

.sidebar-brand p,
.profile-copy span,
.sidebar-label,
.drawer-label,
.widget-option span,
.canvas-toolbar p,
.widget-drawer-head p,
.drawer-helper,
.login-intro,
.login-help {
  margin: 0;
  color: var(--muted);
}

.profile-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border-radius: 18px;
  background: var(--surface-soft);
  border: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
  min-width: 0;
}

.profile-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--surface-tint);
  color: var(--accent);
  font-weight: 800;
  font-size: 1.35rem;
}

.profile-copy {
  min-width: 0;
}

.profile-copy strong {
  display: block;
  margin-bottom: 4px;
}

.profile-copy strong,
.profile-copy span {
  overflow-wrap: anywhere;
}

.sidebar-block,
.sidebar-actions {
  display: grid;
  gap: 12px;
}

.page-button {
  width: 100%;
  height: 48px;
  border: 1px solid color-mix(in srgb, var(--accent) 32%, var(--line));
  border-radius: 16px;
  background: var(--surface-tint);
  color: var(--button-text);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

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

.page-list-item {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid color-mix(in srgb, var(--line) 82%, transparent);
  border-radius: 14px;
  background: var(--panel);
  color: var(--text);
  text-align: left;
  display: grid;
  gap: 4px;
  cursor: pointer;
}

.page-list-item span {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #64748b;
}

.page-list-item strong {
  font-size: 0.95rem;
}

.page-list-item.is-active {
  border-color: color-mix(in srgb, var(--accent) 38%, var(--line));
  background: var(--surface-tint);
}

.sidebar-label,
.drawer-label {
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.field {
  display: grid;
  gap: 8px;
}

.field span {
  font-size: 0.88rem;
  font-weight: 700;
}

input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
  font: inherit;
  color: var(--text);
  background: var(--panel);
  outline: none;
}

input:focus {
  border-color: #93c5fd;
  box-shadow: 0 0 0 4px rgba(147, 197, 253, 0.25);
}

.logout-button,
.drawer-close {
  border: 1px solid color-mix(in srgb, var(--accent) 32%, var(--line));
  border-radius: 16px;
  background: var(--surface-tint-strong);
  color: var(--button-text);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.logout-button {
  height: 52px;
}

.widget-drawer-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
  cursor: grab;
  user-select: none;
}

.widget-drawer-head strong {
  font-size: 1.3rem;
}

.drawer-close {
  width: 42px;
  height: 42px;
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
}

.widget-drawer.is-dragging .widget-drawer-head {
  cursor: grabbing;
}

.drawer-helper {
  line-height: 1.7;
}

.widget-picker {
  display: grid;
  gap: 10px;
}

.widget-option {
  width: 100%;
  padding: 16px 18px;
  border: 1px solid rgba(219, 227, 236, 0.95);
  border-radius: 20px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(246, 250, 255, 0.98));
  text-align: left;
  cursor: pointer;
  display: grid;
  gap: 7px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.82);
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.widget-option strong {
  font-size: 1rem;
  letter-spacing: -0.02em;
}

.widget-option:hover {
  transform: translateY(-1px);
  border-color: rgba(191, 219, 254, 0.98);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.82),
    0 12px 26px rgba(164, 183, 207, 0.16);
}

.canvas-panel {
  width: calc(100vw - 44px);
  max-width: calc(100vw - 44px);
}

.canvas-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 4px 0 12px 96px;
}

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

.theme-toggle-button,
.save-button,
.add-widget-button {
  border: 1px solid color-mix(in srgb, var(--accent) 32%, var(--line));
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--panel) 92%, white), color-mix(in srgb, var(--surface-soft) 92%, var(--panel)));
  color: var(--button-text);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    0 10px 22px rgba(15, 23, 42, 0.12);
}

.canvas-toolbar strong {
  display: block;
  font-size: 1.15rem;
}

.theme-toggle-button,
.save-button,
.add-widget-button {
  width: 54px;
  height: 54px;
  border-radius: 18px;
  cursor: pointer;
}

.theme-toggle-button {
  width: auto;
  min-width: 88px;
  padding: 0 18px;
  font: inherit;
  font-weight: 800;
  font-size: 0.92rem;
}

.save-button {
  width: auto;
  min-width: 102px;
  padding: 0 20px;
  font: inherit;
  font-weight: 800;
  font-size: 0.96rem;
}

.add-widget-button {
  width: 52px;
  height: 52px;
  margin-right: 12px;
  font-size: 2rem;
  line-height: 1;
}

.paper-canvas {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 24px;
  min-height: calc(100vh - 64px);
  width: calc(100vw - 44px);
  padding: 8px;
  box-shadow: var(--paper-shadow);
}

.sheet-scroll {
  overflow: hidden;
  width: 100%;
  max-width: 100%;
  max-height: none;
  scrollbar-width: none;
}

.sheet-board {
  position: relative;
  width: calc(var(--grid-columns, 44) * var(--cell-size, 24px));
}

.grid-layer,
.widget-layer {
  display: grid;
  grid-template-columns: repeat(var(--grid-columns, 44), var(--cell-size, 24px));
  grid-template-rows: repeat(var(--grid-rows, 40), var(--cell-size, 24px));
  gap: 0;
  width: calc(var(--grid-columns, 44) * var(--cell-size, 24px));
}

.widget-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

body:not(.drawer-open) .grid-layer {
  opacity: 0;
  pointer-events: none;
}

body.drawer-open .grid-layer {
  opacity: 1;
  pointer-events: auto;
}

.grid-cell {
  position: relative;
  border-right: 1px solid var(--grid-stroke);
  border-bottom: 1px solid var(--grid-stroke);
  background: var(--panel);
  padding: 0;
  cursor: pointer;
  width: var(--cell-size, 24px);
  height: var(--cell-size, 24px);
}

.grid-cell.is-selected {
  background: color-mix(in srgb, var(--surface-tint) 78%, var(--panel));
  box-shadow: inset 0 0 0 1.5px #93c5fd;
}

.placed-widget {
  margin: 8px;
  padding: 14px 44px 40px 14px;
  border-radius: 28px;
  border: 1px solid rgba(205, 219, 234, 0.88);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(247, 251, 255, 0.98)),
    radial-gradient(circle at top left, rgba(198, 224, 248, 0.45), transparent 46%);
  display: grid;
  align-content: start;
  gap: 10px;
  pointer-events: auto;
  position: relative;
  cursor: grab;
  overflow: hidden;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.8),
    0 18px 40px rgba(153, 176, 199, 0.14);
  backdrop-filter: blur(22px);
}

.placed-widget.is-dragging {
  opacity: 0.92;
  box-shadow: 0 22px 44px rgba(91, 116, 145, 0.22);
  cursor: grabbing;
}

body:not(.drawer-open) .placed-widget {
  cursor: default;
}

.widget-delete-button {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 28px;
  height: 28px;
  border: 1px solid rgba(251, 191, 191, 0.95);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: #b91c1c;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 0;
  cursor: pointer;
  box-shadow: 0 10px 18px rgba(106, 126, 148, 0.14);
}

.widget-delete-button svg {
  width: 13px;
  height: 13px;
  display: block;
}

body.drawer-open .widget-delete-button {
  display: inline-flex;
}

.widget-resize-handle {
  position: absolute;
  right: 12px;
  bottom: 12px;
  width: 28px;
  height: 28px;
  border: 1px solid rgba(191, 219, 254, 0.95);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: #2957d4;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 0;
  cursor: nwse-resize;
  box-shadow: 0 10px 18px rgba(106, 126, 148, 0.14);
}

.widget-resize-handle svg {
  width: 13px;
  height: 13px;
  display: block;
}

body.drawer-open .widget-resize-handle {
  display: inline-flex;
}

.placed-widget.is-resizing .widget-resize-handle {
  cursor: nwse-resize;
}

.widget-shell {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 14px;
  height: 100%;
}

.widget-shell-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.widget-shell-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 0 12px 0 10px;
  border-radius: 999px;
  background: rgba(226, 238, 251, 0.9);
  color: #20408c;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.82);
}

.widget-shell-badge svg {
  width: 14px;
  height: 14px;
  display: block;
}

.widget-shell-meta {
  font-size: 0.72rem;
  font-weight: 700;
  color: #8090a3;
}

.widget-shell-copy {
  display: grid;
  gap: 4px;
}

.widget-shell-title {
  font-size: clamp(1rem, 1vw + 0.76rem, 1.32rem);
  line-height: 1.08;
  letter-spacing: -0.045em;
  color: #162133;
}

.widget-shell-subtitle {
  margin: 0;
  max-width: 26ch;
  font-size: 0.76rem;
  line-height: 1.45;
  color: #7f8ea2;
}

.widget-shell-body {
  min-height: 0;
  display: grid;
}

.widget-clock,
.widget-calendar,
.widget-journal,
.widget-weekly,
.widget-todo,
.widget-habit,
.widget-mood,
.widget-cycle,
.widget-photo {
  display: grid;
  min-height: 0;
  height: 100%;
}

.widget-clock {
  grid-template-rows: 1fr auto;
  align-content: space-between;
}

.widget-clock-digital {
  gap: 12px;
}

.widget-clock-time {
  font-size: clamp(1.5rem, 1.9vw + 1rem, 2.75rem);
  line-height: 0.94;
  letter-spacing: -0.08em;
  color: #16253e;
}

.widget-clock-date {
  margin: 0;
  font-size: 0.82rem;
  line-height: 1.4;
  color: #8090a3;
}

.widget-stat-strip {
  display: flex;
  gap: 8px;
}

.widget-stat-strip span {
  min-height: 28px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid rgba(219, 228, 238, 0.95);
  background: rgba(255, 255, 255, 0.78);
  display: inline-flex;
  align-items: center;
  font-size: 0.72rem;
  font-weight: 700;
  color: #5a6b80;
}

.widget-analog {
  grid-template-columns: minmax(0, 1fr) minmax(92px, 0.9fr);
  align-items: center;
  gap: 16px;
}

.widget-analog-face {
  position: relative;
  width: min(100%, 170px);
  aspect-ratio: 1;
  border-radius: 50%;
  border: 1px solid rgba(209, 221, 235, 0.9);
  background:
    radial-gradient(circle at 50% 35%, rgba(255, 255, 255, 0.98), rgba(240, 246, 252, 0.9) 64%, rgba(227, 236, 246, 0.8) 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.86),
    0 20px 38px rgba(166, 182, 204, 0.18);
}

.widget-analog-center {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #2563eb;
  transform: translate(-50%, -50%);
  z-index: 3;
}

.widget-analog-hand {
  position: absolute;
  left: 50%;
  bottom: 50%;
  transform-origin: bottom center;
  border-radius: 999px;
}

.widget-analog-hand.hour {
  width: 4px;
  height: 25%;
  background: #0f172a;
  z-index: 2;
}

.widget-analog-hand.minute {
  width: 3px;
  height: 34%;
  background: #2563eb;
  z-index: 2;
}

.widget-analog-hand.second {
  width: 2px;
  height: 38%;
  background: #ef4444;
  z-index: 2;
}

.widget-analog-mark {
  position: absolute;
  left: 50%;
  top: 8px;
  width: 2px;
  height: 12px;
  background: rgba(106, 125, 149, 0.6);
  transform-origin: center calc(85px - 8px);
}

.widget-analog-copy {
  display: grid;
  gap: 6px;
}

.widget-analog-copy strong {
  font-size: 1.9rem;
  line-height: 0.95;
  letter-spacing: -0.06em;
  color: #122240;
}

.widget-calendar {
  gap: 12px;
}

.widget-calendar-weekdays,
.widget-calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
}

.widget-calendar-weekdays span {
  font-size: 0.68rem;
  font-weight: 700;
  color: #8290a2;
  text-align: center;
}

.widget-calendar-day {
  min-height: 34px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.76);
  border: 1px solid rgba(233, 238, 244, 0.95);
  display: grid;
  place-items: center;
  font-size: 0.76rem;
  color: #223349;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.78);
}

.widget-calendar-day--note {
  min-height: 56px;
  align-content: start;
  gap: 4px;
  padding: 6px;
}

.widget-calendar-date {
  font-size: 0.72rem;
  font-weight: 700;
  color: inherit;
}

.widget-calendar-note {
  width: 100%;
  min-width: 0;
  border: 0;
  background: transparent;
  padding: 0;
  font: inherit;
  font-size: 0.66rem;
  line-height: 1.35;
  color: #405168;
  outline: none;
}

.widget-calendar-note::placeholder {
  color: #9aabc0;
}

.widget-calendar-day.is-empty {
  background: transparent;
  border-color: transparent;
}

.widget-calendar-day.is-today {
  background: linear-gradient(180deg, #202d63, #1e3c8f);
  border-color: transparent;
  color: #ffffff;
  font-weight: 800;
  box-shadow: 0 14px 24px rgba(29, 78, 216, 0.24);
}

.widget-journal {
  grid-template-rows: auto minmax(0, 1fr);
  gap: 12px;
}

.widget-journal-nav {
  display: grid;
  grid-template-columns: 36px 1fr 36px;
  align-items: center;
  gap: 10px;
}

.widget-journal-arrow {
  width: 36px;
  height: 36px;
  border: 1px solid rgba(219, 228, 238, 0.95);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  color: #3151c7;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 800;
  cursor: pointer;
}

.widget-journal-date {
  font-size: 0.82rem;
  text-align: center;
  color: #5f7084;
}

.widget-journal-textarea {
  width: 100%;
  min-height: 210px;
  height: 100%;
  resize: none;
  border: 1px solid rgba(219, 228, 238, 0.95);
  border-radius: 22px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(248, 251, 255, 0.98));
  padding: 18px 18px 20px;
  font: inherit;
  font-size: 0.9rem;
  line-height: 1.75;
  color: #162133;
  outline: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.widget-journal-textarea:focus {
  border-color: #93c5fd;
  box-shadow: 0 0 0 3px rgba(147, 197, 253, 0.18);
}

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

.widget-weekly-day {
  display: grid;
  gap: 8px;
  padding: 12px;
  border-radius: 18px;
  border: 1px solid rgba(225, 232, 240, 0.95);
  background: rgba(255, 255, 255, 0.72);
}

.widget-weekly-day strong {
  font-size: 0.76rem;
  letter-spacing: 0.02em;
  color: #536579;
}

.widget-weekly-day textarea,
.widget-mood-note {
  width: 100%;
  min-height: 74px;
  resize: none;
  border: 1px solid rgba(221, 229, 238, 0.95);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.88);
  padding: 10px 12px;
  font: inherit;
  font-size: 0.82rem;
  line-height: 1.55;
  outline: none;
}

.widget-todo-list {
  display: grid;
  gap: 10px;
}

.widget-todo-item {
  display: grid;
  grid-template-columns: 20px 1fr;
  align-items: center;
  gap: 10px;
  min-height: 46px;
  padding: 0 12px;
  border-radius: 16px;
  border: 1px solid rgba(223, 231, 239, 0.95);
  background: rgba(255, 255, 255, 0.76);
}

.widget-todo-item.is-done input[type="text"] {
  text-decoration: line-through;
  color: #93a1b1;
}

.widget-todo-item input[type="text"],
.widget-habit-row input[type="text"] {
  width: 100%;
  min-width: 0;
  border: 0;
  border-radius: 12px;
  background: transparent;
  padding: 0;
  font: inherit;
  font-size: 0.84rem;
  color: #172437;
  outline: none;
}

.widget-habit-head,
.widget-habit-row {
  display: grid;
  grid-template-columns: minmax(88px, 1fr) repeat(7, 20px);
  align-items: center;
  gap: 8px;
}

.widget-habit-head span {
  font-size: 0.66rem;
  font-weight: 700;
  text-align: center;
  color: #7c8da1;
}

.widget-habit-list {
  display: grid;
  gap: 10px;
}

.widget-habit-row {
  min-height: 46px;
  padding: 0 12px;
  border-radius: 16px;
  border: 1px solid rgba(223, 231, 239, 0.95);
  background: rgba(255, 255, 255, 0.76);
}

.widget-habit-row input[type="checkbox"],
.widget-todo-item input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: #2a57d5;
}

.widget-mood-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.widget-mood-option {
  width: 42px;
  height: 42px;
  border: 1px solid rgba(221, 229, 238, 0.95);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.76);
  font-size: 1.08rem;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.widget-mood-option.is-active {
  border-color: rgba(147, 197, 253, 0.95);
  background: linear-gradient(180deg, #eff6ff, #dbeafe);
  box-shadow: 0 10px 18px rgba(96, 132, 190, 0.16);
}

.widget-cycle {
  gap: 12px;
  grid-template-rows: auto auto auto minmax(0, 1fr);
}

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

.widget-cycle-stat,
.widget-cycle-field {
  display: grid;
  gap: 6px;
  padding: 12px 14px;
  border-radius: 18px;
  border: 1px solid rgba(223, 231, 239, 0.95);
  background: rgba(255, 255, 255, 0.76);
}

.widget-cycle-stat span,
.widget-cycle-field span {
  font-size: 0.72rem;
  font-weight: 700;
  color: #7b8ba0;
}

.widget-cycle-stat strong {
  font-size: 0.98rem;
  line-height: 1.3;
  color: #16253e;
}

.widget-cycle-progress {
  position: relative;
  height: 10px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(222, 230, 240, 0.82);
}

.widget-cycle-progress-fill {
  position: absolute;
  inset: 0 auto 0 0;
  border-radius: inherit;
  background: linear-gradient(90deg, #f472b6, #fb7185);
}

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

.widget-cycle-field input,
.widget-cycle-note {
  width: 100%;
  border: 1px solid rgba(221, 229, 238, 0.95);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.88);
  padding: 10px 12px;
  font: inherit;
  font-size: 0.82rem;
  line-height: 1.5;
  color: #172437;
  outline: none;
}

.widget-cycle-note {
  min-height: 92px;
  resize: none;
}

.widget-photo-picker {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid rgba(191, 219, 254, 0.95);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  color: #2b53cb;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
}

.widget-photo-input {
  display: none;
}

.widget-photo-preview {
  min-height: 150px;
  border: 1px dashed rgba(214, 224, 236, 0.95);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.76);
  display: grid;
  place-items: center;
  overflow: hidden;
  color: #7b8ba0;
  font-size: 0.82rem;
}

.widget-placeholder {
  align-self: end;
  display: grid;
  gap: 8px;
  padding: 14px 16px;
  border-radius: 20px;
  border: 1px dashed rgba(210, 220, 232, 0.95);
  background: rgba(255, 255, 255, 0.68);
}

.widget-placeholder p {
  margin: 0;
  font-size: 0.78rem;
  color: #7d8ea4;
}

.widget-placeholder span {
  font-size: 0.92rem;
  font-weight: 700;
  color: #29384f;
}

.widget-photo-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.widget-weather,
.widget-world {
  display: grid;
  gap: 14px;
  height: 100%;
}

.widget-weather-main {
  display: flex;
  align-items: center;
  gap: 12px;
}

.widget-weather-icon {
  width: 56px;
  height: 56px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  background: linear-gradient(180deg, rgba(239, 246, 255, 0.96), rgba(219, 234, 254, 0.92));
  font-size: 1.8rem;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.82);
}

.widget-weather-main strong {
  font-size: clamp(1.7rem, 1.5vw + 1rem, 2.4rem);
  line-height: 0.95;
  letter-spacing: -0.08em;
  color: #14233b;
}

.widget-weather-stats {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.widget-weather-stats span,
.widget-world-stats span,
.widget-world-stats strong {
  min-height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(219, 228, 238, 0.95);
  color: #5f7084;
  font-size: 0.76rem;
  font-weight: 700;
}

.widget-weather-foot {
  margin: 0;
  font-size: 0.8rem;
  color: #8090a3;
}

.widget-world-map {
  position: relative;
  min-height: 165px;
  border-radius: 24px;
  background:
    radial-gradient(circle at top left, rgba(215, 230, 247, 0.72), transparent 40%),
    linear-gradient(180deg, rgba(250, 252, 255, 0.92), rgba(242, 247, 252, 0.96));
  border: 1px solid rgba(221, 229, 238, 0.95);
  overflow: hidden;
  color: #3f5d91;
}

.widget-world-map svg {
  width: 100%;
  height: 100%;
  display: block;
}

.widget-world-marker {
  position: absolute;
  width: 14px;
  height: 14px;
  transform: translate(-50%, -50%);
  border-radius: 999px;
  background: #264fd2;
  box-shadow: 0 0 0 6px rgba(37, 99, 235, 0.14);
}

.widget-world-marker::after {
  content: "";
  position: absolute;
  inset: 3px;
  border-radius: 999px;
  background: #ffffff;
}

.widget-world-stats {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.widget-timer {
  display: grid;
  align-content: space-between;
  gap: 16px;
  height: 100%;
}

.widget-timer-ring {
  position: relative;
  min-height: 168px;
  border-radius: 26px;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 20px;
  background:
    radial-gradient(circle at center, rgba(255, 255, 255, 0.96) 0 54%, transparent 55% 100%),
    conic-gradient(from -90deg, #274fd2 0 var(--timer-progress, 100%), rgba(219, 228, 238, 0.88) var(--timer-progress, 100%) 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.88),
    0 18px 32px rgba(171, 184, 203, 0.16);
}

.widget-timer-ring::after {
  content: "";
  position: absolute;
  inset: 12px;
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(247, 251, 255, 0.96), rgba(255, 255, 255, 0.9));
  z-index: 0;
}

.widget-timer-ring strong,
.widget-timer-ring span {
  position: relative;
  z-index: 1;
}

.widget-timer-ring strong {
  display: block;
  font-size: clamp(1.65rem, 1.8vw + 1rem, 2.45rem);
  line-height: 0.95;
  letter-spacing: -0.08em;
  color: #13213b;
}

.widget-timer-ring span {
  display: block;
  margin-top: 8px;
  font-size: 0.8rem;
  font-weight: 700;
  color: #7f90a4;
}

.widget-timer-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.widget-timer-button {
  min-height: 42px;
  border: 1px solid rgba(219, 227, 236, 0.95);
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.84);
  color: #233349;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.widget-timer-button.is-primary {
  border-color: rgba(191, 219, 254, 0.96);
  background: linear-gradient(180deg, #eff6ff, #dbeafe);
  color: #1f4ccd;
}

.login-shell {
  position: relative;
  z-index: 1;
  width: min(560px, calc(100% - 32px));
  padding: 40px 0;
}

.login-card {
  border: 1px solid var(--line);
  background: #ffffff;
  border-radius: 36px;
  padding: 32px;
  display: grid;
  align-content: center;
  gap: 18px;
  min-height: 560px;
  box-shadow: 0 20px 40px rgba(15, 23, 42, 0.06);
}

.login-card-centered {
  justify-items: stretch;
}

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

.login-card h1 {
  margin: 0;
  font-size: 4rem;
  line-height: 0.95;
}

.login-actions {
  display: grid;
  gap: 14px;
}

.provider-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 54px;
  padding: 14px 20px;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 800;
}

.provider-button.google {
  background: #ffffff;
  color: #1f1f1f;
  border: 1px solid var(--line);
}

.provider-button.kakao {
  background: #fee500;
  color: #191600;
  border: 1px solid rgba(0, 0, 0, 0.08);
}

:root[data-theme="dark"] .widget-option,
:root[data-theme="dark"] .placed-widget,
:root[data-theme="dark"] .widget-calendar-day,
:root[data-theme="dark"] .widget-weekly-day,
:root[data-theme="dark"] .widget-todo-item,
:root[data-theme="dark"] .widget-habit-row,
:root[data-theme="dark"] .widget-cycle-stat,
:root[data-theme="dark"] .widget-cycle-field,
:root[data-theme="dark"] .widget-photo-preview,
:root[data-theme="dark"] .widget-weather-stats span,
:root[data-theme="dark"] .widget-world-stats span,
:root[data-theme="dark"] .widget-world-stats strong,
:root[data-theme="dark"] .widget-stat-strip span,
:root[data-theme="dark"] .widget-placeholder,
:root[data-theme="dark"] .login-card,
:root[data-theme="dark"] .provider-button.google {
  background: linear-gradient(180deg, rgba(19, 31, 49, 0.96), rgba(15, 23, 38, 0.98));
  border-color: rgba(51, 65, 85, 0.95);
  color: var(--text);
}

:root[data-theme="dark"] .placed-widget {
  background:
    linear-gradient(180deg, rgba(16, 25, 41, 0.96), rgba(12, 19, 31, 0.98)),
    radial-gradient(circle at top left, rgba(50, 83, 126, 0.28), transparent 46%);
  border-color: rgba(51, 65, 85, 0.95);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 18px 34px rgba(2, 6, 23, 0.34);
}

:root[data-theme="dark"] .widget-shell-title,
:root[data-theme="dark"] .widget-clock-time,
:root[data-theme="dark"] .widget-weather-main strong,
:root[data-theme="dark"] .widget-analog-copy strong,
:root[data-theme="dark"] .widget-cycle-stat strong,
:root[data-theme="dark"] .canvas-toolbar strong,
:root[data-theme="dark"] .sidebar-brand strong,
:root[data-theme="dark"] .profile-copy strong,
:root[data-theme="dark"] .page-list-item strong,
:root[data-theme="dark"] .login-card h1 {
  color: var(--text);
}

:root[data-theme="dark"] .widget-analog-face,
:root[data-theme="dark"] .widget-weather-icon,
:root[data-theme="dark"] .profile-avatar,
:root[data-theme="dark"] .page-list-item.is-active,
:root[data-theme="dark"] .widget-mood-option.is-active {
  background: linear-gradient(180deg, rgba(28, 44, 69, 0.96), rgba(19, 31, 49, 0.96));
}

:root[data-theme="dark"] .widget-journal-textarea,
:root[data-theme="dark"] .widget-weekly-day textarea,
:root[data-theme="dark"] .widget-mood-note,
:root[data-theme="dark"] .widget-cycle-field input,
:root[data-theme="dark"] .widget-cycle-note,
:root[data-theme="dark"] .widget-calendar-note,
:root[data-theme="dark"] .widget-todo-item input[type="text"],
:root[data-theme="dark"] .widget-habit-row input[type="text"] {
  background: transparent;
  color: var(--text);
}

:root[data-theme="dark"] .provider-button.kakao {
  background: #facc15;
  color: #1f2937;
}

.provider-button.is-disabled {
  opacity: 0.45;
  pointer-events: none;
}

@media (max-width: 900px) {
  .sidebar,
  .widget-drawer {
    width: min(84vw, 392px);
  }

  .canvas-panel {
    padding-top: 72px;
    width: 100%;
    max-width: 100%;
  }

  .canvas-toolbar {
    padding-left: 76px;
  }

  .toolbar-actions {
    gap: 10px;
  }

  .paper-canvas {
    min-height: calc(100vh - 100px);
    width: calc(100vw - 24px);
  }
}

@media (max-width: 720px) {
  .workspace-shell {
    padding: 12px;
  }

  .menu-button,
  .sidebar {
    top: 12px;
    left: 12px;
  }

  .widget-drawer {
    top: 12px;
    right: 12px;
  }

  .sidebar,
  .widget-drawer {
    bottom: 12px;
  }

  .paper-canvas,
  .sidebar,
  .widget-drawer,
  .login-card {
    border-radius: 20px;
  }

  .paper-canvas,
  .sidebar,
  .widget-drawer,
  .login-card {
    padding: 16px;
  }

  .canvas-toolbar {
    align-items: start;
    padding-left: 72px;
  }

  .toolbar-actions {
    width: 100%;
    justify-content: flex-end;
  }

  .grid-layer,
  .widget-layer {
    grid-template-columns: repeat(var(--grid-columns, 44), var(--cell-size, 24px));
    grid-template-rows: repeat(var(--grid-rows, 40), var(--cell-size, 24px));
  }

  .login-card h1 {
    font-size: 2.8rem;
  }
}
