*{box-sizing:border-box}body{margin:0;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;background:#f7f7f8;color:#1f2328}button,input,select,textarea{font:inherit}.hidden{display:none!important}.screen{min-height:100vh}.setup-screen{display:grid;place-items:center;padding:20px}.card,.dialog-card{background:#fff;border:1px solid #e6e6e9;border-radius:18px;padding:20px;box-shadow:0 10px 30px rgba(0,0,0,.06)}.card{width:min(460px,100%)}h1,h2,h3,p{margin-top:0}.muted{color:#6e747c}.small{font-size:13px}.tabs{display:flex;gap:8px;margin:18px 0}.tabs button{flex:1;border:0;border-radius:10px;padding:11px;background:#eee}.tabs button.active{background:#222;color:#fff}label{display:block;margin:12px 0;font-weight:600}input,select,textarea{width:100%;margin-top:6px;padding:12px;border:1px solid #d9d9df;border-radius:10px;background:#fff}.primary,.ghost,.danger,.icon{border:0;border-radius:10px;padding:10px 14px;cursor:pointer}.primary{background:#222;color:#fff}.ghost{background:#eee;color:#222}.danger{background:#ffe8e8;color:#9e1b1b}.icon{background:transparent;font-size:25px}.error{color:#b42318;min-height:1.2em}header{position:sticky;top:0;z-index:5;background:rgba(255,255,255,.92);backdrop-filter:blur(10px);border-bottom:1px solid #e5e5e5;padding:12px 16px;display:flex;align-items:center;justify-content:space-between}.brand{font-weight:800}main{max-width:760px;margin:auto;padding:16px}.calendar-head{display:flex;align-items:center;justify-content:center;gap:18px}.calendar-head h2{margin:0;min-width:170px;text-align:center}.dow,.calendar{display:grid;grid-template-columns:repeat(7,1fr)}.dow{margin-top:12px;color:#777;font-size:12px;text-align:center}.dow span{padding:7px}.calendar{background:#fff;border:1px solid #e5e5e8;border-radius:14px;overflow:hidden}.day{min-height:82px;padding:6px;border-right:1px solid #eee;border-bottom:1px solid #eee;cursor:pointer;background:#fff}.day:nth-child(7n){border-right:0}.day.other{background:#fafafa;color:#aaa}.day.selected{outline:2px solid #222;outline-offset:-2px}.day.today .num{background:#222;color:#fff}.num{display:inline-grid;place-items:center;width:24px;height:24px;border-radius:50%;font-size:12px}.chips{margin-top:4px;display:flex;flex-direction:column;gap:3px}.chip{font-size:10px;border-radius:6px;padding:3px 5px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.chip.self{background:#e8f0ff}.chip.partner{background:#ffe9f1}.chip.shared{background:#e8f8ec}.day-panel{margin-top:16px}.day-title-row{display:flex;align-items:center;justify-content:space-between}.smallbtn{padding:8px 11px}.event{background:#fff;border:1px solid #e5e5e8;border-radius:12px;padding:12px;margin:8px 0;cursor:pointer}.event-top{display:flex;justify-content:space-between;gap:8px}.tag{font-size:11px;padding:3px 7px;border-radius:999px}.tag.self{background:#e8f0ff}.tag.partner{background:#ffe9f1}.tag.shared{background:#e8f8ec}.event-time{font-size:13px;color:#555;margin-top:5px}.empty{padding:22px;text-align:center;color:#888;background:#fff;border-radius:12px;border:1px dashed #ddd}dialog{border:0;background:transparent;padding:12px;width:min(520px,100%)}dialog::backdrop{background:rgba(0,0,0,.35)}.dialog-card{width:100%}.dialog-title{display:flex;align-items:center;justify-content:space-between}.actions{display:flex;align-items:center;gap:8px;margin-top:16px}.spacer{flex:1}.preset-row{margin:8px 0}.share-code{font-size:30px;font-weight:800;letter-spacing:5px;text-align:center;background:#f5f5f5;padding:18px;border-radius:12px}@media(max-width:560px){main{padding:10px}.day{min-height:68px;padding:4px}.chip{font-size:9px}.card{padding:16px}}
.preset-tabs{display:flex;gap:8px;margin:8px 0}.preset-tabs button{flex:1;border:0;border-radius:10px;padding:9px;background:#eee;cursor:pointer}.preset-tabs button.active{background:#222;color:#fff}.preset-row{display:flex;flex-wrap:wrap;gap:7px;margin:8px 0}.preset-row .ghost{padding:9px 10px}
.chip.continues-left{margin-left:-6px;padding-left:7px;border-top-left-radius:0;border-bottom-left-radius:0}.chip.continues-right{margin-right:-6px;padding-right:7px;border-top-right-radius:0;border-bottom-right-radius:0}
.dow,.calendar{grid-template-columns:repeat(7,minmax(0,1fr))}.day,.chips{min-width:0}.chip{max-width:100%}
.calendar{display:block}.week{position:relative;display:grid;grid-template-columns:repeat(7,minmax(0,1fr));min-height:calc(42px + var(--bar-rows)*24px + 10px)}.week .day{grid-row:1;min-height:0;padding:6px;border-bottom:1px solid #eee}.week .day:nth-child(7n){border-right:0}.week:last-child .day{border-bottom:0}.week-bars{position:absolute;top:34px;left:0;right:0;display:grid;grid-template-columns:repeat(7,minmax(0,1fr));grid-auto-rows:21px;row-gap:3px;pointer-events:none}.week-bar{min-width:0;margin:0 2px;padding:3px 5px;border-radius:6px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;font-size:10px}.week-bar.self{background:#e8f0ff}.week-bar.partner{background:#ffe9f1}.week-bar.shared{background:#e8f8ec}.week-bar.continues-left{margin-left:0;border-top-left-radius:0;border-bottom-left-radius:0}.week-bar.continues-right{margin-right:0;border-top-right-radius:0;border-bottom-right-radius:0}@media(max-width:560px){.week .day{padding:4px}.week-bar{font-size:9px;padding:3px 4px}}
