:root {
    --bg: #eceef1;
    --surface: #ffffff;
    --surface-2: #f4f5f7;
    --hover: #f0f1f4;
    --selected: #eef0f3;
    --line: #e7e9ed;
    --ink: #1f2023;
    --ink-2: #5d6168;
    --ink-3: #9a9ea6;
    --accent: #ffdb4d;
    --accent-hover: #ffd21f;
    --accent-soft: #fff2bf;
    --link: #1a6dd8;
    --danger: #e5484d;
    --brand: #ff0000;
    --radius: 16px;
    --rail-w: 60px;
    --sidebar-w: 300px;
    --shadow: 0 12px 40px rgba(20, 24, 31, .16);
    color-scheme: light;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font: 14px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
}
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
svg { width: 20px; height: 20px; flex: none; }
a { color: var(--link); }
[hidden], .hidden { display: none !important; }
.muted { color: var(--ink-2); }
.small { font-size: 12.5px; }

.spinner {
    width: 28px; height: 28px; border-radius: 50%;
    border: 3px solid rgba(0, 0, 0, .08); border-top-color: var(--ink-2);
    animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.boot { position: fixed; inset: 0; display: grid; place-items: center; }

/* Buttons */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    height: 36px; padding: 0 16px; border-radius: 10px; border: 0;
    background: var(--surface-2); font-weight: 500; transition: background .15s;
}
.btn:hover { background: var(--hover); }
.btn svg { width: 18px; height: 18px; }
.btn-primary { background: var(--accent); color: #1b1b1b; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #d63c41; }
.btn-block { width: 100%; }
.btn-link { background: none; color: var(--ink-2); height: auto; padding: 8px; }
.btn-link:hover { background: none; color: var(--ink); text-decoration: underline; }

.icon-btn {
    display: inline-grid; place-items: center; width: 32px; height: 32px;
    border: 0; border-radius: 8px; background: none; color: var(--ink-2);
}
.icon-btn:hover { background: var(--hover); color: var(--ink); }
.icon-btn svg { width: 18px; height: 18px; }

.input {
    width: 100%; height: 42px; padding: 0 14px; border-radius: 10px;
    border: 1px solid var(--line); background: var(--surface); outline: none;
}
.input:focus { border-color: #c9ccd2; box-shadow: 0 0 0 3px rgba(255, 219, 77, .45); }

/* Login */
.login {
    min-height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center;
    padding: 32px 16px;
}
.login-card {
    width: 100%; max-width: 380px; background: var(--surface); border-radius: 20px;
    padding: 32px 28px 24px; box-shadow: 0 10px 30px rgba(0, 0, 0, .06); text-align: center;
}
.login-brand h1 { margin: 12px 0 4px; font-size: 22px; font-weight: 650; }
.login-brand p { margin: 0 0 22px; }
.login-logo { width: 44px; height: 48px; }
.login-checking { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 24px 0; }
.login-profile { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.login-avatar {
    width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center;
    background: var(--accent-soft); font-size: 22px; font-weight: 600; margin-bottom: 8px;
}
.login-profile-name { font-size: 17px; font-weight: 600; }
.login-profile-phone { margin-bottom: 16px; }
.login-tabs { display: flex; background: var(--surface-2); border-radius: 10px; padding: 3px; margin-bottom: 16px; }
.login-tab { flex: 1; height: 32px; border: 0; border-radius: 8px; background: none; color: var(--ink-2); font-weight: 500; }
.login-tab.active { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(0, 0, 0, .08); }
.login-panel { display: flex; flex-direction: column; gap: 12px; align-items: center; }
.login-panel p { margin: 0; }
.qr-box {
    width: 232px; height: 232px; display: grid; place-items: center;
    border: 1px solid var(--line); border-radius: 14px; padding: 12px;
}
.qr-box img, .qr-box canvas, .qr-box svg { width: 100% !important; height: auto !important; display: block; }
.login-status { min-height: 18px; margin: 14px 0 0; }
.login-error { margin: 10px 0 0; color: var(--danger); font-size: 13px; }
.login-foot { margin-top: 18px; display: flex; align-items: center; justify-content: center; gap: 12px; }

/* App shell */
.app { display: flex; height: 100vh; height: 100dvh; padding: 8px 8px 8px 0; }
.rail {
    width: var(--rail-w); flex: none; display: flex; flex-direction: column; align-items: center;
    padding: 6px 0 4px;
}
.rail-logo { display: grid; place-items: center; width: 40px; height: 40px; margin-bottom: 14px; }
.rail-logo img { width: 26px; height: 28px; }
.rail-services { display: flex; flex-direction: column; gap: 4px; align-items: center; }
.rail-item {
    position: relative; display: grid; place-items: center; width: 40px; height: 40px;
    border-radius: 12px; color: #4a4e55; text-decoration: none; transition: background .15s, color .15s;
}
.rail-item svg { width: 21px; height: 21px; }
.rail-item:hover { background: rgba(0, 0, 0, .06); color: var(--ink); }
.rail-item.active { background: var(--surface); color: var(--brand); box-shadow: 0 1px 4px rgba(0, 0, 0, .06); }
.rail-item .tip {
    position: absolute; left: 48px; top: 50%; transform: translateY(-50%); white-space: nowrap;
    background: #2a2c31; color: #fff; font-size: 12px; padding: 4px 9px; border-radius: 6px;
    opacity: 0; pointer-events: none; transition: opacity .12s; z-index: 30;
}
.rail-item:hover .tip { opacity: 1; }
.rail-bottom { margin-top: auto; position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.rail-avatar, .user-avatar {
    width: 34px; height: 34px; flex: none; border-radius: 50%; border: 0; padding: 0; overflow: hidden;
    display: grid; place-items: center; background: var(--accent-soft);
    font-size: 13px; font-weight: 600; color: #5a4700;
}
.rail-avatar img, .user-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.user-avatar { width: 44px; height: 44px; font-size: 16px; }
.user-menu-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.user-menu-who { min-width: 0; }
.user-menu {
    position: absolute; left: 46px; bottom: 0; width: 230px; background: var(--surface);
    border-radius: 14px; box-shadow: var(--shadow); padding: 12px; z-index: 40;
}
.user-menu-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-menu-sub { margin: 0; }
.user-menu-item {
    display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px; border: 0;
    border-radius: 8px; background: none; text-align: left;
}
.user-menu-item:hover { background: var(--hover); }
.user-menu-item svg { width: 18px; height: 18px; color: var(--ink-2); }

.workspace {
    flex: 1; min-width: 0; display: flex; background: var(--surface); border-radius: var(--radius);
    overflow: hidden; box-shadow: 0 1px 2px rgba(0, 0, 0, .04);
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-w); flex: none; display: flex; flex-direction: column;
    border-right: 1px solid var(--line); padding: 16px 12px 8px; min-height: 0;
}
.sidebar-head { display: flex; align-items: center; justify-content: space-between; padding: 0 4px 12px; }
.sidebar-head h2 { margin: 0; font-size: 20px; font-weight: 650; }
.sidebar-head-actions { display: flex; align-items: center; gap: 2px; }
.search {
    display: flex; align-items: center; gap: 8px; height: 36px; padding: 0 10px; margin-bottom: 10px;
    background: var(--surface-2); border-radius: 10px; color: var(--ink-3);
}
.search svg { width: 16px; height: 16px; }
.search-input { flex: 1; min-width: 0; border: 0; outline: none; background: none; }
.btn-new { width: 100%; height: 38px; margin-bottom: 12px; }
.note-list { list-style: none; margin: 0; padding: 0; overflow-y: auto; flex: 1; min-height: 0; }
.note-list:empty { display: none; }
.note-item {
    display: flex; gap: 10px; align-items: center; padding: 9px 10px; border-radius: 10px;
    cursor: pointer; margin-bottom: 2px; user-select: none;
}
.note-item:hover { background: var(--hover); }
.note-item.active { background: var(--selected); }
.note-item-main { flex: 1; min-width: 0; }
.note-item-title {
    display: flex; align-items: center; gap: 4px; font-weight: 600; font-size: 13.5px;
    overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
}
.note-item-title span { overflow: hidden; text-overflow: ellipsis; }
.note-item-title svg { width: 13px; height: 13px; color: #e0a800; }
.note-item-meta { display: flex; gap: 6px; font-size: 12.5px; color: var(--ink-2); white-space: nowrap; overflow: hidden; }
.note-item-date { color: var(--ink-3); flex: none; }
.note-item-snippet { overflow: hidden; text-overflow: ellipsis; }
.note-item-thumb { width: 38px; height: 38px; border-radius: 6px; object-fit: cover; flex: none; background: var(--surface-2); }
.list-empty { padding: 16px 8px; text-align: center; }

/* Editor */
.editor { flex: 1; min-width: 0; display: flex; flex-direction: column; position: relative; }
.toolbar { display: flex; align-items: center; gap: 8px; padding: 12px 16px 8px 20px; }
.toolbar-group { display: flex; align-items: center; gap: 2px; }
.toolbar-right { margin-left: auto; }
.tool {
    display: inline-grid; place-items: center; width: 32px; height: 32px; border: 0; border-radius: 8px;
    background: none; color: #3f4248; font-size: 15px; line-height: 1;
}
.tool svg { width: 19px; height: 19px; }
.tool:hover { background: var(--hover); }
.tool.active { background: var(--accent-soft); color: #1b1b1b; }
.tool:disabled { opacity: .35; cursor: default; background: none; }
#pin-button.active { background: none; color: #e0a800; }
.save-state { margin-left: 8px; white-space: nowrap; }

.editor-scroll { flex: 1; overflow-y: auto; min-height: 0; position: relative; }
.editor-inner { padding: 8px 32px 40px 36px; max-width: 980px; }
.gallery { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.gallery:empty { display: none; }
.thumb {
    position: relative; width: 132px; height: 132px; border-radius: 10px; overflow: hidden;
    background: var(--surface-2); cursor: zoom-in; flex: none;
}
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb-del {
    position: absolute; top: 6px; right: 6px; width: 26px; height: 26px; border-radius: 50%; border: 0;
    display: grid; place-items: center; background: rgba(20, 22, 26, .65); color: #fff; opacity: 0; transition: opacity .15s;
}
.thumb-del svg { width: 15px; height: 15px; }
.thumb:hover .thumb-del { opacity: 1; }
.thumb.uploading { cursor: default; display: grid; place-items: center; }
.thumb.uploading img { position: absolute; inset: 0; opacity: .45; }
.thumb.uploading .spinner { position: relative; }

.note-title {
    display: block; width: 100%; border: 0; outline: none; resize: none; overflow: hidden; padding: 0;
    font-size: 20px; font-weight: 650; line-height: 1.35; margin: 4px 0 10px; background: none;
}
.note-title::placeholder { color: var(--ink-3); }
.note-body { outline: none; min-height: 240px; font-size: 14.5px; line-height: 1.6; word-wrap: break-word; }
.note-body:empty::before { content: attr(data-placeholder); color: var(--ink-3); pointer-events: none; }
.note-body ul, .note-body ol { margin: 4px 0; padding-left: 22px; }
.note-body p { margin: 0 0 6px; }
.note-body a { color: var(--link); cursor: pointer; }

.editor-empty {
    position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 10px; color: var(--ink-3);
}
.editor-empty svg { width: 48px; height: 48px; opacity: .5; }
.editor.no-note .toolbar .tool, .editor.no-note .save-state { visibility: hidden; }

.drop-overlay {
    position: absolute; inset: 10px; border: 2px dashed #e0b400; border-radius: 14px;
    background: rgba(255, 242, 191, .75); display: grid; place-items: center;
    font-size: 16px; font-weight: 600; z-index: 20; pointer-events: none;
}

.footer {
    display: flex; justify-content: space-between; align-items: center; padding: 10px 20px 10px 36px;
    font-size: 12px; color: var(--ink-3);
}
.footer a { color: var(--ink-3); text-decoration: none; }
.footer a:hover { color: var(--ink); }
.footer-right { display: flex; align-items: center; gap: 12px; }
.lang-btn { border: 0; background: none; color: var(--ink-3); font-size: 12px; padding: 2px 4px; border-radius: 4px; text-transform: uppercase; }
.lang-btn:hover, .lang-btn[aria-expanded="true"] { color: var(--ink); background: var(--hover); }
.lang-btn-mobile { display: none; }
.lang-menu {
    position: fixed; z-index: 90; width: 210px; max-height: min(360px, calc(100vh - 24px));
    overflow: auto; background: var(--surface); border-radius: 12px; box-shadow: var(--shadow); padding: 6px;
}
.lang-option {
    display: flex; align-items: center; width: 100%; text-align: left; border: 0; background: none;
    padding: 8px 10px; border-radius: 8px; font-size: 14px; color: var(--ink);
}
.lang-option:hover { background: var(--hover); }
.lang-option.active { background: var(--accent-soft); font-weight: 600; }

/* Link popover */
.link-pop {
    position: fixed; z-index: 50; display: flex; align-items: center; gap: 6px; max-width: 360px;
    background: var(--surface); border-radius: 10px; box-shadow: var(--shadow); padding: 6px 6px 6px 12px;
}
.link-pop a { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 13px; }
.link-pop-open { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 6px; flex: none; color: var(--ink-2) !important; }
.link-pop-open:hover { background: var(--hover); }
.link-pop-open svg { width: 16px; height: 16px; }

/* Lightbox */
.lightbox {
    position: fixed; inset: 0; z-index: 60; background: rgba(12, 13, 15, .92);
    display: flex; align-items: center; justify-content: center;
}
.lightbox img { max-width: calc(100vw - 140px); max-height: calc(100vh - 110px); object-fit: contain; border-radius: 4px; }
.lightbox-top {
    position: absolute; top: 0; left: 0; right: 0; display: flex; justify-content: space-between; align-items: center;
    padding: 12px 16px; color: #d6d8dc;
}
.lightbox-actions { display: flex; gap: 4px; }
.lb-btn, .lb-nav {
    display: grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; border: 0;
    background: rgba(255, 255, 255, .08); color: #fff;
}
.lb-btn:hover, .lb-nav:hover { background: rgba(255, 255, 255, .18); }
.lb-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 48px; height: 48px; border-radius: 50%; }
.lb-prev { left: 20px; }
.lb-next { right: 20px; }

/* Dialog + toast */
.dialog-backdrop { position: fixed; inset: 0; z-index: 70; background: rgba(15, 17, 20, .35); display: grid; place-items: center; padding: 16px; }
.dialog { width: 100%; max-width: 360px; background: var(--surface); border-radius: 16px; padding: 22px; box-shadow: var(--shadow); }
.dialog p { margin: 0 0 20px; font-size: 15px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; }
.toast {
    position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 80;
    background: #25272c; color: #fff; padding: 10px 16px; border-radius: 10px; font-size: 13.5px;
    box-shadow: var(--shadow); max-width: calc(100vw - 32px);
}

.mobile-only { display: none; }

@media (max-width: 1100px) {
    :root { --sidebar-w: 260px; }
    .thumb { width: 110px; height: 110px; }
}

@media (max-width: 760px) {
    .app { padding: 0; }
    .rail { display: none; }
    .workspace { border-radius: 0; }
    .sidebar { width: 100%; border-right: 0; }
    .editor { display: none; }
    .app.show-editor .sidebar { display: none; }
    .app.show-editor .editor { display: flex; }
    .mobile-only { display: inline-grid; }
    .toolbar { padding: 8px 8px 6px; gap: 2px; overflow-x: auto; }
    .save-state { display: none; }
    .editor-inner { padding: 6px 16px 32px; }
    .footer { display: none; }
    .lang-btn-mobile { display: inline-flex; align-items: center; height: 32px; padding: 0 8px; }
    .thumb { width: calc((100vw - 48px) / 3); height: calc((100vw - 48px) / 3); }
    .thumb-del { opacity: 1; }
    .lightbox img { max-width: 100vw; max-height: calc(100vh - 140px); }
    .lb-nav { top: auto; bottom: 20px; transform: none; }
}

/* Calendar — month board, mini month, event popup */
.app { --sidebar-w: 252px; }
.cal-toolbar { justify-content: space-between; padding: 14px 18px 8px; }
.cal-title { margin: 0; font-size: 22px; font-weight: 650; letter-spacing: -.02em; }
.cal-nav { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.view-switch { position: relative; margin-left: 6px; }
.view-current { height: 32px; padding: 0 10px 0 12px; font-weight: 650; }
.view-caret { width: 16px; height: 16px; }
.view-menu {
    position: absolute; top: calc(100% + 4px); right: 0; z-index: 20; min-width: 148px;
    background: #fff; border-radius: 12px; padding: 6px; box-shadow: 0 10px 28px rgba(20, 24, 31, .16);
}
.view-btn {
    display: flex; align-items: center; width: 100%; height: 34px; padding: 0 10px;
    border: 0; border-radius: 8px; background: transparent; color: var(--ink);
    font-weight: 600; font-size: 14px; text-align: left;
}
.view-btn.on, .view-btn:hover { background: var(--surface-2); }
#prev-month, #next-month {
    width: 36px; height: 36px; border-radius: 50%;
    background: var(--surface); border: 1px solid var(--line); color: var(--ink);
}
#prev-month:hover, #next-month:hover { background: var(--hover); }
#month-view.is-swiping { overflow: hidden; }
#month-view.is-swiping .cal-scroll { overflow: hidden; }
.cal-today { height: 32px; padding: 0 12px; }
.cal-create { width: 36px; height: 36px; padding: 0; }
.cal-create svg { width: 18px; height: 18px; }
.cal-scroll { flex: 1; min-height: 0; overflow: auto; padding: 0 8px 8px; touch-action: pan-y; }
.cal-board { min-width: 0; }
.dow-row { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-bottom: 1px solid var(--line); }
.dow { padding: 8px 8px 6px; font-size: 12px; font-weight: 600; color: var(--ink-2); text-transform: capitalize; }
.week {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    grid-template-rows: 28px repeat(var(--lanes), 22px) minmax(10px, 1fr);
    min-height: 112px;
    border-bottom: 1px solid var(--line);
}
.cell {
    grid-row: 1 / -1;
    border: 0; border-right: 1px solid var(--line); background: transparent;
    text-align: left; padding: 4px 4px 6px 6px; color: inherit; font: inherit;
    display: flex; flex-direction: column; align-items: flex-start; min-width: 0;
}
.cell.edge { border-right: 0; }
.cell:hover { background: var(--hover); }
.cell.out .cal-num { color: var(--ink-3); }
.cell.selected { background: #fffbeb; }
.cal-num {
    width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center;
    font-size: 13px; font-weight: 600;
}
.cell.today .cal-num { background: var(--accent); color: #1b1b1b; font-weight: 750; }
.bar {
    z-index: 1; align-self: center; height: 20px; margin: 0 3px; padding: 0 6px;
    border: 0; border-radius: 4px; text-align: left; font-size: 12px; font-weight: 550;
    line-height: 20px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    color: #1b1b1b; background: #ffdb4d;
}
.bar.cont-l { margin-left: 0; border-top-left-radius: 0; border-bottom-left-radius: 0; }
.bar.cont-r { margin-right: 0; border-top-right-radius: 0; border-bottom-right-radius: 0; }
.bar.red { background: #f09595; }
.bar.green { background: #7dcea0; }
.bar.blue { background: #8eb6f5; }
.bar.purple { background: #c3b0e4; }
.bar:hover { filter: brightness(.97); }
.cal-more {
    z-index: 1; align-self: center; justify-self: start; height: 18px; margin: 0 4px;
    border: 0; background: none; color: var(--ink-2); font-size: 11px; padding: 0 2px; font-weight: 650;
}

.mini { margin-bottom: 16px; }
.mini-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.mini-head span { font-weight: 650; font-size: 14px; text-transform: capitalize; }
.mini-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.mini-dow, .mini-day {
    height: 28px; display: grid; place-items: center; font-size: 12px; position: relative;
}
.mini-dow { color: var(--ink-3); font-weight: 600; text-transform: capitalize; height: 22px; }
.mini-day { border: 0; background: none; border-radius: 50%; color: inherit; font: inherit; }
.mini-day:hover { background: var(--hover); }
.mini-day.out { color: var(--ink-3); }
.mini-day.today { background: var(--accent); color: #1b1b1b; font-weight: 750; }
.mini-day.selected:not(.today) { box-shadow: inset 0 0 0 1.5px #e0b400; }
.mini-dot {
    position: absolute; left: 50%; bottom: 2px; width: 4px; height: 4px; margin-left: -2px;
    border-radius: 50%; background: #1a6dd8;
}
.side-day { margin: 4px 4px 8px; font-size: 13px; font-weight: 650; text-transform: capitalize; }
.note-item .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); flex: none; }
.note-item .dot.red { background: #e5484d; }
.note-item .dot.green { background: #1f9d55; }
.note-item .dot.blue { background: #1a6dd8; }
.note-item .dot.purple { background: #7c5cbf; }
.note-item .dot.yellow { background: #e0b400; }

.event-pop {
    position: fixed; inset: 0; z-index: 30; display: grid; place-items: center;
    padding: 24px; background: rgba(20, 24, 31, .32);
}
.event-pop.hidden { display: none !important; }
.event-card {
    width: min(520px, 100%); max-height: min(640px, calc(100vh - 48px)); overflow: auto;
    background: #fff; border-radius: 16px; box-shadow: var(--shadow); padding: 16px 18px 14px;
}
.event-card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.event-card-head h2 { margin: 0; flex: 1; font-size: 18px; font-weight: 650; }
.title-input { height: 44px; font-size: 16px; margin-bottom: 12px; }
.when-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.when-row .input, .time-field { width: auto; min-width: 0; flex: 1 1 7.5rem; }
.time-btn { width: 100%; text-align: left; font-variant-numeric: tabular-nums; }
.when-dash { color: var(--ink-3); }
.all-day .time-field { display: none; }
.pick-menu {
    position: fixed; z-index: 40; overflow: auto; max-height: 240px;
    background: #fff; border-radius: 12px; padding: 6px;
    box-shadow: 0 10px 32px rgba(20, 24, 31, .18);
}
.time-opt, .loc-opt {
    display: flex; align-items: center; gap: 8px; width: 100%; min-height: 36px;
    border: 0; background: transparent; border-radius: 8px; padding: 6px 10px;
    text-align: left; font-size: 14px; color: var(--ink);
}
.time-opt span { flex: 1; font-variant-numeric: tabular-nums; }
.time-check { width: 16px; height: 16px; flex: none; visibility: hidden; }
.time-opt.on .time-check { visibility: visible; }
.time-opt.on, .time-opt:hover, .loc-opt.on, .loc-opt:hover { background: var(--surface-2); }
.loc-menu { max-height: 280px; }
.loc-opt { flex-direction: column; align-items: flex-start; gap: 1px; }
.loc-name { font-weight: 600; }
.loc-detail { font-size: 12px; font-weight: 400; color: var(--ink-3); }
.loc-credit { padding: 6px 10px 2px; font-size: 11px; color: var(--ink-3); }
.date-menu { max-height: none; overflow: visible; padding: 8px 10px 12px; }
.date-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.date-head span { font-weight: 650; font-size: 14px; text-transform: capitalize; }
.date-grid { display: grid; grid-template-columns: repeat(7, 1fr); }
.date-dow, .date-day {
    height: 32px; display: grid; place-items: center; font-size: 13px;
}
.date-dow { height: 24px; color: var(--ink-3); font-size: 12px; font-weight: 600; text-transform: capitalize; }
.date-day {
    width: 32px; margin: 0 auto; border: 0; background: none; border-radius: 50%;
    color: inherit; font: inherit; padding: 0;
}
.date-day:hover { background: var(--hover); }
.date-day.out { color: var(--ink-3); }
.date-day.on { background: var(--accent); color: #1b1b1b; font-weight: 750; }
.date-day.on:hover { background: var(--accent); }
.date-day.today:not(.on) { box-shadow: inset 0 0 0 1.5px #e0b400; }
.check-row { display: flex; align-items: center; gap: 8px; margin: 0 0 14px; font-size: 14px; }
.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 12px; font-size: 12.5px; color: var(--ink-2); font-weight: 500; }
.field .input { font-size: 14.5px; color: var(--ink); font-weight: 400; }
.area { height: auto; padding: 10px 14px; resize: vertical; min-height: 72px; }
.swatches { display: flex; gap: 6px; }
.swatch { width: 18px; height: 18px; border-radius: 50%; border: 2px solid transparent; padding: 0; }
.swatch.on { box-shadow: 0 0 0 2px #fff, 0 0 0 3.5px #1b1b1b; }
.swatch.yellow { background: #ffdb4d; }
.swatch.red { background: #e5484d; }
.swatch.green { background: #1f9d55; }
.swatch.blue { background: #1a6dd8; }
.swatch.purple { background: #7c5cbf; }
.people-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.people-chips:empty { display: none; }
.people-chip {
    display: inline-flex; align-items: center; gap: 2px; max-width: 100%;
    background: var(--surface-2); border-radius: 999px; padding: 2px 2px 2px 10px; font-size: 13px;
}
.people-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.people-chip button {
    width: 22px; height: 22px; border: 0; border-radius: 50%; background: none; color: var(--ink-2); padding: 0;
    display: grid; place-items: center;
}
.people-chip button:hover { background: var(--hover); color: var(--ink); }
.people-chip svg { width: 14px; height: 14px; }
.people-search { position: relative; }
.people-search .input { padding-right: 42px; }
.people-open { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 32px; height: 32px; }
.people-pop { z-index: 45; }
.people-list { display: flex; flex-direction: column; gap: 2px; max-height: 320px; overflow: auto; margin-bottom: 12px; }
.people-row {
    display: flex; align-items: center; gap: 10px; width: 100%; min-height: 40px;
    border: 0; background: transparent; border-radius: 8px; padding: 6px 10px; text-align: left;
}
.people-row:hover, .people-row.on { background: var(--surface-2); }
.people-row b { font-weight: 600; }
.people-row small { display: block; font-size: 12px; color: var(--ink-3); font-weight: 400; }
.people-mark {
    width: 18px; height: 18px; border-radius: 50%; border: 1.5px solid var(--line); flex: none;
}
.people-row.on .people-mark { background: var(--accent); border-color: #e0b400; }
.form-error { color: var(--danger); font-size: 13px; margin: 0 0 10px; }
.event-card-foot { display: flex; align-items: center; gap: 8px; }
.foot-right { display: flex; gap: 8px; margin-left: auto; }
#month-view { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.cal-board, .time-board { user-select: none; }
.week, .allday-grid { position: relative; }
.drag-strip {
    position: absolute; z-index: 1; top: 29px; height: 20px; pointer-events: none;
    background: #ffdb4d; border-radius: 4px; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .06);
}
.drag-strip.red, .slot-strip.red { background: #f09595; }
.drag-strip.green, .slot-strip.green { background: #7dcea0; }
.drag-strip.blue, .slot-strip.blue { background: #8eb6f5; }
.drag-strip.purple, .slot-strip.purple { background: #c3b0e4; }
.drag-strip.cont-l { border-top-left-radius: 0; border-bottom-left-radius: 0; }
.drag-strip.cont-r { border-top-right-radius: 0; border-bottom-right-radius: 0; }
body.cal-dragging, body.cal-dragging * { cursor: grabbing; }

.time-board { min-width: 0; }
.time-board.week-board { min-width: 760px; }
.time-sticky { position: sticky; top: 0; z-index: 6; background: var(--surface); }
.time-head, .allday-row, .time-body { display: grid; grid-template-columns: 56px minmax(0, 1fr); }
.gutter { color: var(--ink-3); font-size: 11px; text-align: right; padding: 6px 8px 0 0; }
.cols { display: grid; grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); min-width: 0; }
.col-head {
    border: 0; border-bottom: 1px solid var(--line); border-right: 1px solid var(--line);
    background: transparent; padding: 8px 4px 6px; display: flex; flex-direction: column; align-items: center; gap: 2px;
    color: var(--ink-2); font-size: 12px; font-weight: 600; text-transform: capitalize;
}
.col-head b {
    width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center;
    font-size: 16px; font-weight: 650; color: var(--ink);
}
.col-head.today b { background: var(--accent); color: #1b1b1b; }
.col-head.edge, .day-col.edge, .allday-cell.edge { border-right: 0; }
.allday-row { border-bottom: 1px solid var(--line); }
.allday-grid { min-height: 36px; grid-auto-rows: 22px; align-content: start; }
.allday-cell { grid-row: 1 / -1; min-height: 36px; border-right: 1px solid var(--line); }
.gutter.hours { padding-top: 0; }
.hour-mark { height: 44px; box-sizing: border-box; font-size: 11px; color: var(--ink-3); text-align: right; padding-right: 8px; }
.day-col { position: relative; border-right: 1px solid var(--line); }
.slot { height: 44px; box-sizing: border-box; border-bottom: 1px solid var(--line); }
.tblock {
    position: absolute; z-index: 1; overflow: hidden; border: 0; border-radius: 4px;
    padding: 2px 5px; text-align: left; font-size: 12px; font-weight: 600; line-height: 1.25;
    color: #1b1b1b; background: #ffdb4d;
}
.tblock.red { background: #f09595; }
.tblock.green { background: #7dcea0; }
.tblock.blue { background: #8eb6f5; }
.tblock.purple { background: #c3b0e4; }
.slot-strip {
    position: absolute; z-index: 3; left: 3px; right: 3px; pointer-events: none;
    background: #ffdb4d; border-radius: 4px; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .06);
}

@media (max-width: 760px) {
    .sidebar { display: none; }
    .editor { display: flex; }
    .cal-board { min-width: 0; }
    .cal-title { font-size: 18px; }
    .view-switch { margin-left: 4px; }
    .week { min-height: 72px; }
    .bar { font-size: 11px; padding: 0 4px; }
    .footer { display: none; }
    .event-pop { padding: 12px; align-items: end; }
    .event-card { border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
}
