/* Habit Tracker v26.9 — page-scoped, compact, paper-like monthly grid. */
.habit-v269-page{max-width:100%;min-width:0;display:grid;gap:16px}
.habit-v269-page-head{display:flex;align-items:center;justify-content:space-between;gap:14px;margin-bottom:0;flex-wrap:wrap}
.habit-v269-page-head h1{font-size:clamp(23px,3vw,30px);font-weight:700;margin:1px 0 2px}
.habit-v269-page-head p{font-size:12px;color:var(--muted);margin:0}
.habit-v269-eyebrow{font-size:9px;letter-spacing:1.9px;color:var(--muted);font-family:var(--latin),sans-serif;font-weight:700}
.habit-v269-page-head>.primary-btn{min-height:34px;padding:6px 13px;font-size:12px}
.habit-v269-section{border:1px solid var(--border);border-radius:15px;background:var(--surface);padding:14px 14px 9px;min-width:0;overflow:hidden}
.habit-v269-toolbar{display:flex;justify-content:space-between;align-items:center;gap:12px;flex-wrap:wrap;margin-bottom:10px}
.habit-v269-toolbar h2{font-size:17px;font-weight:650;line-height:1.3;margin:0}
.habit-v269-toolbar small{display:block;margin-top:3px;font-size:11px;color:var(--muted)}
.habit-v269-toolbar .v18-month-controls{display:flex;align-items:center;gap:5px;flex-wrap:wrap;width:auto}
.habit-v269-toolbar .v18-month-controls :is(button,input){min-height:31px;height:31px;border-radius:8px;font-size:11px}
.habit-v269-toolbar .v18-month-controls input{width:135px;padding:2px 8px;flex:0 1 auto}
.habit-v269-scroll{overflow-x:auto;overflow-y:visible;padding:0 0 8px;max-width:100%;scrollbar-width:thin;overscroll-behavior-inline:contain}
.habit-v269-table{border-collapse:separate;border-spacing:0;table-layout:fixed;width:max-content;min-width:100%;font-size:11px;direction:rtl;color:var(--text)}
.habit-v269-table th,.habit-v269-table td{box-sizing:border-box;border:0;border-inline-end:1px solid var(--border);border-bottom:1px solid var(--border);margin:0;padding:0;text-align:center;vertical-align:middle}
.habit-v269-table thead th{height:39px;border-top:1px solid var(--border);background:var(--surface-2);font-weight:550}
.habit-v269-table th.habit-v269-sticky{width:168px;min-width:168px;max-width:168px;text-align:right;position:sticky;right:0;z-index:4;background:var(--surface);padding:0 10px;border-inline-start:1px solid var(--border);box-shadow:-4px 0 7px -8px var(--text)}
.habit-v269-table thead th.habit-v269-sticky{background:var(--surface-2);font-size:11px}
.habit-v269-table .habit-v269-day,.habit-v269-table td.habit-v269-date{width:29px;min-width:29px;max-width:29px}
.habit-v269-day span{display:block;font:600 11px var(--latin),sans-serif}
.habit-v269-day small{display:block;font-size:9px;color:var(--muted);line-height:1.1}
.habit-v269-table tbody tr{height:38px}
.habit-v269-table tbody th.habit-v269-sticky{background:var(--surface);height:38px}
.habit-v269-table tbody tr:hover td:not(.is-today),.habit-v269-table tbody tr:hover th.habit-v269-sticky{background:var(--surface-2)}
.habit-v269-table .is-today{background:var(--surface-3)!important}
.habit-v269-table .is-rest{background:repeating-linear-gradient(135deg,transparent,transparent 4px,color-mix(in srgb,var(--muted) 7%,transparent) 4px,color-mix(in srgb,var(--muted) 7%,transparent) 5px)}
.habit-v269-table input.habit-v269-check{appearance:none!important;-webkit-appearance:none!important;display:inline-grid!important;place-items:center!important;vertical-align:middle;cursor:pointer;width:19px!important;height:19px!important;min-width:19px!important;min-height:19px!important;margin:0!important;padding:0!important;border:1px solid var(--border)!important;border-radius:5px!important;background:var(--surface)!important;box-shadow:none!important;opacity:1;outline-offset:2px;accent-color:auto;color:var(--text)}
.habit-v269-table input.habit-v269-check::after{content:'';font-size:13px;font-weight:750;line-height:1;color:var(--bg)}
.habit-v269-table input.habit-v269-check:checked{background:var(--text)!important;border-color:var(--text)!important}
.habit-v269-table input.habit-v269-check:checked::after{content:'✓'}
.habit-v269-table input.habit-v269-check.missed:not(:checked)::after{content:'−';color:var(--muted)}
.habit-v269-table input.habit-v269-check.skipped:not(:checked)::after{content:'↷';color:var(--muted)}
.habit-v269-table input.habit-v269-check:hover:not(:disabled){border-color:var(--text)!important}
.habit-v269-table input.habit-v269-check:focus-visible{outline:2px solid var(--text)!important;outline-offset:2px}
.habit-v269-table input.habit-v269-check:disabled{cursor:default;opacity:.28}
.habit-v269-label{display:grid;grid-template-columns:1fr auto;align-items:center;column-gap:4px;row-gap:0;min-height:37px;max-height:45px}
.habit-v269-name{text-align:right;font-size:11px;font-weight:600;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;grid-column:1;grid-row:1}
.habit-v269-progress{font-size:9px;line-height:1.3;color:var(--muted);text-align:right;grid-column:1;grid-row:2;white-space:nowrap}
.habit-v269-menu{position:relative;grid-column:2;grid-row:1/3;align-self:center}
.habit-v269-menu summary{display:grid;place-items:center;width:23px;height:25px;font-size:18px;line-height:1;cursor:pointer;list-style:none;border-radius:6px;color:var(--muted)}
.habit-v269-menu summary::-webkit-details-marker{display:none}
.habit-v269-menu summary:hover,.habit-v269-menu[open] summary{background:var(--surface-3);color:var(--text)}
.habit-v269-menu-options{position:absolute;right:100%;top:0;background:var(--surface);border:1px solid var(--border);border-radius:9px;box-shadow:var(--shadow);min-width:166px;display:grid;gap:2px;padding:5px;z-index:40;text-align:right}
.habit-v269-menu-options>button{display:flex;align-items:center;gap:8px;width:100%;font:inherit;font-size:11px;padding:6px 8px;background:transparent;border:0;color:var(--text);text-align:right;border-radius:5px;cursor:pointer}
.habit-v269-menu-options>button:hover{background:var(--surface-2)}
.habit-v269-menu-options .ui-icon{width:15px;height:15px}
.habit-v269-reorder{border-top:1px solid var(--border);display:flex;align-items:center;gap:6px;padding:5px 4px 0;font-size:10px;color:var(--muted)}
.habit-v269-reorder .ui-drag-handle{width:25px!important;height:26px!important;min-width:25px!important;min-height:26px!important;background:transparent;border:1px solid var(--border);border-radius:5px;cursor:grab}
.habit-v269-footer{display:flex;align-items:center;gap:13px;flex-wrap:wrap;color:var(--muted);font-size:10px;padding:10px 2px 1px}
.habit-v269-footer>span{display:inline-flex;align-items:center;gap:5px}
.habit-v269-footer b{font-weight:600;display:grid;place-items:center;width:15px;height:15px;border-radius:3px;border:1px solid var(--border)}
.habit-v269-legend-check{background:var(--text);color:var(--bg)}
.habit-v269-legend-empty{background:transparent}
.habit-v269-help{margin-inline-start:auto}
.habit-v269-empty{padding:24px 12px;text-align:center;font-size:12px;color:var(--muted)}
@media(max-width:620px){.habit-v269-page{gap:12px}.habit-v269-section{padding:11px 9px 9px;border-radius:12px}.habit-v269-toolbar{gap:8px}.habit-v269-toolbar h2{font-size:15px}.habit-v269-table th.habit-v269-sticky{width:120px;min-width:120px;max-width:120px;padding-inline:6px}.habit-v269-table .habit-v269-day,.habit-v269-table td.habit-v269-date{width:28px;min-width:28px;max-width:28px}.habit-v269-name{font-size:10px}.habit-v269-progress{font-size:8px}.habit-v269-footer{gap:7px}.habit-v269-toolbar .v18-month-controls{width:100%}.habit-v269-toolbar .v18-month-controls input{flex:1;width:auto;min-width:110px}}

/* v30.4: an open ⋯ menu is never cut off by the table's scroll box */
.habit-v269-scroll:has(details[open]){overflow:visible}
