/* Internal Calendar: builds on base.css (same tokens and Google-style month grid as the community calendar). */
body { background: var(--bg-2); }
.brandmark .aims { height: 40px; width: auto; }
.brandmark .by span { font-size: 13px; color: var(--text-3); }
.gate { min-height: calc(100vh - 68px); display: grid; place-items: center; padding: 16px; }
.gate-card { width: min(420px, 100%); background: var(--bg); border: 1px solid var(--line); border-radius: 18px; padding: 28px; display: grid; gap: 18px; box-shadow: var(--shadow); }
.gate-card h1 { margin: 0 0 6px; font-size: 24px; }
.views { display: flex; gap: 10px; align-items: center; }

/* Filters */
.filterbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0 0 14px; padding-top: 12px; border-top: 1px solid var(--line-2); }
.filterbar .input { width: auto; min-width: 150px; padding: 7px 10px; font-size: 13px; border-radius: 9px; border: 1px solid var(--line); background: var(--bg); }
.filterbar #q { min-width: 210px; }
.toggle { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 500; color: var(--blue); background: var(--blue-soft); border-radius: 9px; padding: 7px 11px; cursor: pointer; }
.toggle input { accent-color: var(--blue); }
#csvBtn { margin-left: auto; }

/* Month: activity chips */
.gm-cell { cursor: copy; min-height: 118px; }
.gm-cell > * { cursor: auto; }
.ic { display: flex; align-items: center; gap: 5px; width: 100%; border: 0; border-radius: 6px; padding: 3px 7px; font-size: 12px; font-weight: 500; text-align: left; background: var(--c); color: #fff; min-width: 0; }
.ic .n { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ic.cont { border-top-left-radius: 0; border-bottom-left-radius: 0; margin-left: -5px; width: calc(100% + 5px); }
.ic.cont .n { visibility: hidden; }
.ic.done { background: color-mix(in srgb, var(--c) 25%, #fff); color: var(--blue-deep); text-decoration: line-through; }
.ic .dia { width: 8px; height: 8px; background: #fff; transform: rotate(45deg); flex: none; }
.cc { display: block; width: 100%; border: 1px dashed var(--blue-line); background: var(--blue-50); color: var(--blue-deep); border-radius: 6px; padding: 2px 6px; font-size: 11px; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.more-n { font-size: 11px; color: var(--text-3); padding: 0 4px; }
.legend2 { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; font-size: 12px; color: var(--text-2); margin-top: 10px; }
.legend2 span { display: inline-flex; align-items: center; gap: 6px; }
.legend2 i { width: 9px; height: 9px; border-radius: 3px; display: inline-block; }
.legend2 i.ccdot { background: var(--blue-50); border: 1px dashed var(--blue-line); }
.legend2 .hint { margin-left: auto; color: var(--text-3); }

/* Timeline */
.tl { --lab: 240px; background: var(--bg); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.tl-scroll { overflow-x: auto; position: relative; }
.tl-headrow { display: flex; position: sticky; top: 0; z-index: 3; background: var(--bg); border-bottom: 1px solid var(--line); }
.tl-lab { position: sticky; left: 0; z-index: 2; flex: none; width: var(--lab); background: var(--bg); border-right: 1px solid var(--line); padding: 8px 12px; display: grid; align-content: center; gap: 1px; min-height: 40px; }
.tl-lab b { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tl-lab small { font-size: 11px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tl-weeks, .tl-days { display: flex; }
.tl-w { font-size: 11px; font-weight: 600; color: var(--text-2); padding: 6px 8px; border-left: 1px solid var(--line-2); white-space: nowrap; }
.tl-d { width: var(--dw); flex: none; text-align: center; font-size: 12px; font-weight: 500; color: var(--text-2); padding: 2px 0 6px; display: grid; }
.tl-d small { font-size: 10px; color: var(--text-4); }
.tl-d.we { background: var(--bg-2); }
.tl-d.today { color: #fff; background: var(--blue); border-radius: 6px; }
.tl-d.today small { color: #dbe6ff; }
.tl-body { position: relative; }
.tl-row { display: flex; border-bottom: 1px solid var(--line-2); }
.tl-track { position: relative; flex: none; min-height: 40px; }
.tl-group { display: flex; background: var(--blue-50); border-bottom: 1px solid var(--line-2); }
.tl-glab { position: sticky; left: 0; width: var(--lab); flex: none; padding: 7px 12px; font-size: 12px; font-weight: 700; color: var(--blue-deep); letter-spacing: .02em; background: var(--blue-50); border-right: 1px solid var(--line); }
.tl-glab small { font-weight: 500; color: var(--text-3); margin-left: 4px; }
.tl-group.comm, .tl-group.comm .tl-glab { background: var(--bg-2); }
.tl-bar { position: absolute; top: 8px; height: 24px; border: 0; border-radius: 7px; background: var(--c); color: #fff; font-size: 12px; font-weight: 600; text-align: left; padding: 0 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tl-bar.st-planned { background: color-mix(in srgb, var(--c) 70%, #fff); }
.tl-bar.st-done { background: color-mix(in srgb, var(--c) 22%, #fff); color: var(--blue-deep); text-decoration: line-through; }
.tl-bar.st-blocked { background: repeating-linear-gradient(135deg, var(--c) 0 6px, color-mix(in srgb, var(--c) 75%, #000) 6px 12px); }
.tl-bar.cl { border-top-left-radius: 0; border-bottom-left-radius: 0; }
.tl-bar.cr { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.tl-bar.comm { background: var(--blue-50); color: var(--blue-deep); border: 1px dashed var(--blue-line); font-weight: 500; }
.tl-ms { position: absolute; top: 11px; width: 18px; height: 18px; border: 0; background: var(--c); transform: rotate(45deg); border-radius: 3px; padding: 0; }
.tl-ms.comm { background: #c9d5f7; }
.tl-ms-l { position: absolute; top: 12px; font-size: 12px; font-weight: 600; color: var(--blue-deep); white-space: nowrap; pointer-events: none; }
.tl-today { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--blue); opacity: .55; pointer-events: none; z-index: 1; }

/* Board */
.board { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; align-items: start; }
.col { background: var(--bg); border: 1px solid var(--line); border-radius: 16px; padding: 10px; min-height: 200px; transition: background .12s, border-color .12s; }
.col.over { background: var(--blue-50); border-color: var(--blue); }
.col-h { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; padding: 4px 4px 10px; }
.col-h .cnt { margin-left: auto; font-size: 12px; color: var(--blue); background: var(--blue-soft); border-radius: 999px; padding: 1px 8px; }
.col-b { display: grid; gap: 8px; }
.col-empty { font-size: 13px; color: var(--text-3); text-align: center; padding: 22px 8px; border: 1px dashed var(--line); border-radius: 12px; }
.card2 { display: grid; gap: 6px; text-align: left; width: 100%; background: var(--bg); border: 1px solid var(--line); border-left: 3px solid var(--c); border-radius: 0 10px 10px 0; padding: 10px 12px; cursor: grab; }
.card2:hover { border-color: var(--blue-line); border-left-color: var(--c); background: var(--blue-50); }
.card2 b { font-size: 14px; font-weight: 600; }
.c-top { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.c-top .ws { font-size: 11px; color: var(--text-3); }
.c-meta { font-size: 12px; color: var(--text-2); }
.c-meta.late { color: var(--danger); }
.sdot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: none; }
.sdot.st-planned { background: #93b4f8; }
.sdot.st-in_progress { background: var(--blue); }
.sdot.st-blocked { background: var(--blue-deep); box-shadow: 0 0 0 2px #c9d5f7; }
.sdot.st-done { background: #b9c5dd; }

/* Editor */
.opt-row { display: flex; flex-wrap: wrap; gap: 6px; }
.opt { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); border-radius: 9px; padding: 6px 10px; font-size: 13px; font-weight: 500; color: var(--text-2); cursor: pointer; background: var(--bg); }
.opt input { position: absolute; opacity: 0; pointer-events: none; }
.opt:has(input:checked) { border-color: var(--blue); background: var(--blue-soft); color: var(--blue-deep); }
.opt svg { color: var(--c, var(--blue)); }
.editor-foot { padding: 14px 22px; border-top: 1px solid var(--line); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; background: var(--bg); }
.editor-foot .right { display: flex; gap: 8px; margin-left: auto; }

@media (max-width: 900px) { .board { grid-template-columns: repeat(2, minmax(0, 1fr)); } .tl { --lab: 170px; } }
@media (max-width: 640px) {
  .board { grid-template-columns: 1fr; }
  .views { width: 100%; justify-content: space-between; }
  .filterbar .input, .filterbar #q { min-width: 0; flex: 1 1 140px; }
  #csvBtn { margin-left: 0; }
  .ic { font-size: 10px; padding: 1px 4px; }
  .tl { --lab: 130px; }
}
