/* Reuse ToDoX light/dark tokens; plugin editor also works in the Typecho admin. */
.study-card,.study-editor,.study-page,.study-calendar,.study-day-post{--study-bg:var(--x-card,#fff);--study-border:var(--x-border,#e5e7eb);--study-text:var(--x-foreground,#18181b);--study-muted:var(--x-muted,#71717a);--study-accent:var(--x-accent,#f4f4f5);color:var(--study-text)}
.study-card{display:block!important;color:var(--study-text)!important;border:1px solid var(--study-border);border-radius:16px;background:var(--study-bg);padding:16px;margin:12px 0;text-decoration:none!important;cursor:pointer;transition:border-color .15s}
.study-card:hover{border-color:#a5b4fc}
.study-card:focus-visible,.study-calendar-day:focus-visible{outline:2px solid #6366f1;outline-offset:3px}
.study-card-head,.study-subject-title,.study-card-footer,.study-calendar-head{display:flex;align-items:center;justify-content:space-between;gap:12px}
.study-card-head{font-size:12px;color:var(--study-muted)}
.study-card-total{display:flex;align-items:baseline;gap:8px;margin:12px 0 16px;font-size:13px}
.study-card-total strong{font-family:var(--number-font,inherit);font-size:36px;line-height:1.1;font-weight:750;letter-spacing:-1px}
.study-card-subject{padding:8px 0;border-top:1px solid var(--study-border)}
.study-subject-title{font-size:13px;font-weight:600}
.study-subject-title>span:first-child{display:flex;align-items:center;gap:6px}
.study-dot{display:inline-block;width:8px;height:8px;flex-shrink:0;border-radius:50%;margin-right:4px}
.study-card-metrics{display:flex;flex-wrap:wrap;gap:5px;align-items:center;margin-top:5px;font-size:12px;color:var(--study-muted)}
.study-card-metrics b{color:var(--study-text);font-weight:600}.study-separator{margin:0 2px}
.study-share{margin-top:12px}.study-share-bar{display:flex;gap:2px;height:5px;border-radius:999px;overflow:hidden}
.study-share-labels{display:flex;flex-wrap:wrap;gap:5px 10px;margin-top:8px;font-size:11px;color:var(--study-muted)}
.study-share-labels small{width:100%;font-size:11px}
.study-card-footer{border-top:1px solid var(--study-border);padding-top:12px;margin-top:12px;font-size:12px;justify-content:flex-start;flex-wrap:wrap}
.study-card-footer small{color:var(--study-muted)}.study-card-link{margin-left:auto;color:var(--study-muted)}
.study-trend-red{color:#ef4444}.study-trend-green{color:#16a34a}.study-trend-flat{color:var(--study-muted)}
.study-editor{border:1px solid var(--study-border);background:var(--study-bg);border-radius:12px;padding:14px;margin:12px 0}
.study-editor [hidden],.study-page [hidden]{display:none!important}
.study-editor label,.study-page label{display:flex;flex-direction:column;gap:6px;font-size:12px;min-width:0}
.study-editor input:not([type=checkbox]),.study-page input:not([type=checkbox]),.study-page select{width:100%;height:36px;border:1px solid var(--study-border);border-radius:8px;padding:6px 8px;background:var(--study-bg);color:var(--study-text);box-sizing:border-box}
.study-editor input:disabled{background:var(--study-accent);color:var(--study-muted)}
.study-enable{display:flex!important;flex-direction:row!important;align-items:center;gap:8px!important;font-size:13px!important;margin:0 0 10px!important}
.study-enable input{width:15px;height:15px;accent-color:#6366f1;margin:0}
.study-editor-heading{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
.study-help{font-size:12px!important;line-height:1.6!important;color:var(--study-muted)!important;margin:10px 0!important}
.study-subject-editor{border:1px solid var(--study-border);border-radius:10px;padding:12px;margin:10px 0}
.study-subject-fields{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
.study-duration{display:flex;gap:6px;align-items:end;grid-column:1/-1}.study-duration label{max-width:100px}
.study-duration>span{line-height:36px;font-size:12px}
.study-preview{display:block;color:var(--study-text);padding-top:12px;font-size:12px}
.study-error{color:#dc2626;font-size:12px;margin:6px 0 0}
.study-page{padding:20px 16px}.study-page h3{font-size:16px;margin:24px 0 12px}
.study-manager-toolbar{display:flex;align-items:end;gap:8px;flex-wrap:wrap;margin:12px 0}.study-manager-toolbar label{flex:1;min-width:120px}
.study-page button,.study-page>select,.study-manager-toolbar>select{border:1px solid var(--study-border);border-radius:8px;background:var(--study-accent);color:var(--study-text);padding:8px 12px;font-size:12px}
.study-primary{background:#6366f1!important;color:#fff!important;border-color:#6366f1!important}
.study-page button:disabled{opacity:.5;cursor:wait}
.study-metric-config{display:grid;grid-template-columns:minmax(80px,1fr) minmax(65px,.6fr) auto auto auto;gap:8px;align-items:end;margin:10px 0}
.study-metric-config label:has(input[type=checkbox]){flex-direction:row;align-items:center;padding-bottom:9px}
.study-dashboard-stats{display:grid;grid-template-columns:repeat(3,1fr);gap:8px;margin-bottom:20px}
.study-dashboard-stats>div{border:1px solid var(--study-border);border-radius:12px;padding:12px}
.study-dashboard-stats small{display:block;color:var(--study-muted);font-size:11px}.study-dashboard-stats strong{display:block;font-size:23px;margin-top:8px;font-family:var(--number-font,inherit)}.study-dashboard-stats strong span{font-size:11px;font-weight:400}
.study-range{display:flex;gap:8px;margin:12px 0}.study-range a{border-radius:999px;color:var(--study-muted);padding:6px 12px;background:var(--study-accent);font-size:12px}.study-range a.active{color:#fff;background:#6366f1}
.study-chart{border:1px solid var(--study-border);border-radius:14px;padding:12px;margin:16px 0}.study-chart svg{display:block;width:100%;overflow:visible}
.study-chart-legend{display:flex;gap:10px;flex-wrap:wrap;margin-bottom:10px}
.study-chart-legend label{flex-direction:row;align-items:center;font-size:12px;gap:5px}.study-chart-legend input{accent-color:#6366f1}
.study-chart-grid{stroke:var(--study-border);stroke-width:1}.study-chart-axis{fill:var(--study-muted);font-size:11px}
.study-table-wrap{overflow:auto}.study-table{border-collapse:collapse;width:100%;font-size:12px;text-align:left}
.study-table th,.study-table td{border-bottom:1px solid var(--study-border);padding:12px 8px;vertical-align:top}.study-table th{color:var(--study-muted);font-weight:500;white-space:nowrap}.study-table a{color:#6366f1}
.study-calendar-head h3{font-size:15px;font-weight:650;margin:0}.study-calendar-head>span{font-size:11px;color:var(--study-muted)}
.study-calendar-grid{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:4px;margin:14px 0}
.study-weekday{text-align:center;color:var(--study-muted);font-size:11px;margin-bottom:4px}
.study-calendar-day{display:flex;flex-direction:column;align-items:center;justify-content:center;min-height:39px;color:var(--study-text);text-decoration:none!important}
.study-day-number{display:flex;align-items:center;justify-content:center;width:26px;height:26px;font-size:12px;border:1px solid transparent;border-radius:50%;box-sizing:border-box}
.study-calendar-day.is-today .study-day-number{border-color:var(--study-text)}
a.study-calendar-day:hover .study-day-number{background:var(--study-accent)}
.study-calendar-day.is-future{color:var(--study-muted);opacity:.45}.study-day-check{color:#22c55e;font-size:11px;line-height:12px;height:12px;font-weight:750}
.study-calendar-stats{display:flex;gap:12px;justify-content:space-between;font-size:11px;color:var(--study-muted);border-top:1px solid var(--study-border);padding-top:12px}
.study-calendar-stats strong{font-size:15px;color:var(--study-text)}
.study-day-post{padding:20px 16px;border-bottom:1px solid var(--study-border)}
.study-day-post-title{display:block;font-size:16px;font-weight:650;color:var(--study-text);margin-bottom:10px}
.study-day-post>p{font-size:13px;line-height:1.6;white-space:pre-line}
.study-manage-link{display:block;padding:14px 16px;text-align:right;font-size:12px;color:var(--x-muted,#71717a)}
@media(max-width:480px){.study-card{padding:12px}.study-card-total strong{font-size:30px}.study-editor-heading{grid-template-columns:1fr}.study-metric-config{grid-template-columns:1fr 70px}.study-dashboard-stats>div{padding:8px}.study-dashboard-stats strong{font-size:20px}}

/* Horizontal study tiles: total on the left, subjects and composition to the right. */
.study-card{overflow:hidden;padding:16px}
.study-card-head{margin-bottom:12px}
.study-card-layout{display:grid;grid-template-columns:minmax(145px,28%) minmax(0,1fr);border:1px solid var(--study-border);border-radius:14px;overflow:hidden}
.study-card-summary{display:flex;flex-direction:column;justify-content:center;padding:18px;border-right:1px solid var(--study-border);min-width:0}
.study-card-caption{font-size:16px;font-weight:650}
.study-card-summary .study-card-total{margin:7px 0 5px}
.study-card-summary .study-card-total strong{font-size:clamp(32px,5vw,52px);letter-spacing:-2px}
.study-card-summary .study-card-total span{font-size:13px;color:var(--study-muted)}
.study-previous{color:var(--study-muted);font-size:10px;margin-top:3px}
.study-card-detail{min-width:0;display:flex;flex-direction:column}
.study-card-subjects{display:flex;min-width:0;overflow-x:auto;scrollbar-width:thin}
.study-card-subject{flex:1 0 118px;min-width:118px;padding:14px 12px;border-right:1px solid var(--study-border)}
.study-card-subject:last-child{border-right:0}
.study-subject-title{display:flex;align-items:center;gap:5px;font-size:14px;white-space:nowrap}
.study-subject-time{font-size:20px;margin:10px 0 5px;font-family:var(--number-font,inherit)}
.study-subject-time small{font-size:11px;color:var(--study-muted)}
.study-card-metric{display:flex;align-items:baseline;gap:5px;margin-top:6px;white-space:nowrap}
.study-card-metric strong{font-size:21px;font-weight:550}
.study-card-metric span{font-size:11px;color:var(--study-muted)}
.study-card-detail .study-share{margin:0;padding:10px 12px;border-top:1px solid var(--study-border)}
.study-card-link{display:block;text-align:right;margin-top:8px;font-size:11px;color:var(--study-muted)}
.study-duration label{max-width:260px;flex:1}
.study-editor input:focus-visible,.study-page input:focus-visible,.study-page select:focus-visible,.study-page button:focus-visible{outline:2px solid #6366f1;outline-offset:2px}
@media(max-width:600px){
 .study-card-layout{grid-template-columns:minmax(110px,35%) minmax(0,1fr)}
 .study-card-summary{padding:10px}
 .study-card-caption{font-size:12px}
 .study-card-summary .study-card-total strong{font-size:30px}
 .study-card-subject{flex-basis:110px;min-width:110px;padding:10px}
 .study-card-metric strong{font-size:18px}
 .study-card-detail .study-share{padding:8px}
}

/* ToDoX-native shadcn-inspired control language, scoped to compose/data/settings. */
.x-publish-form input:not([type=checkbox]):not([type=hidden]),.x-publish-form select,.x-publish-form textarea,
.study-editor input:not([type=checkbox]),.study-page input:not([type=checkbox]),.study-page select{
 border:1px solid var(--x-border,#d4d4d8);border-radius:10px;background:var(--x-card,#fff);
 color:var(--x-foreground,#18181b);min-height:38px;box-shadow:0 1px 2px rgba(0,0,0,.05)
}
.x-publish-form input:focus-visible,.x-publish-form select:focus-visible,.x-publish-form textarea:focus-visible,
.study-editor input:focus-visible,.study-page input:focus-visible,.study-page select:focus-visible{
 outline:2px solid #6366f1;outline-offset:2px
}
.x-publish-row-fields label{min-width:0}
.x-publish-toolbar .study-manage-link,.study-manager-toolbar button,.study-page button{
 border:1px solid var(--study-border,#d4d4d8);border-radius:10px;background:var(--study-bg,#fff);color:var(--study-text,#18181b);box-shadow:0 1px 2px rgba(0,0,0,.05)
}
.study-manager-toolbar>select{max-width:100%;flex:1 1 270px;min-width:0;background:var(--study-bg,#fff)}
.study-manager-toolbar button:hover,.study-page button:hover{background:var(--study-accent,#f4f4f5)}
.study-primary:hover{filter:brightness(.94)}
.x-post-head-actions{display:flex;align-items:center;gap:8px;margin-left:auto;min-width:0}
.x-post-menu{position:relative;z-index:6;flex:0 0 auto}
.x-post-menu summary{list-style:none;cursor:pointer;width:30px;height:30px;display:grid;place-items:center;border-radius:10px;color:var(--x-muted,#71717a)}
.x-post-menu summary::-webkit-details-marker{display:none}
.x-post-menu summary:hover,.x-post-menu[open] summary{background:var(--x-accent,#f4f4f5)}
.x-post-menu summary:focus-visible,.x-post-menu-popover a:focus-visible,.x-post-menu-popover button:focus-visible{outline:2px solid #6366f1;outline-offset:2px}
.x-post-menu-popover{position:absolute;top:35px;right:0;width:160px;border:1px solid var(--x-border,#e5e7eb);border-radius:12px;background:var(--x-card,#fff);color:var(--x-foreground,#18181b);box-shadow:0 12px 28px rgba(0,0,0,.14);padding:4px;z-index:40}
.x-post-menu-popover a,.x-post-menu-popover button{display:block;width:100%;padding:9px 10px;border:0;background:transparent;color:inherit;text-align:left;font-size:13px;border-radius:8px;cursor:pointer;text-decoration:none!important}
.x-post-menu-popover a:hover,.x-post-menu-popover button:hover{background:var(--x-accent,#f4f4f5)}
.x-post-menu-popover .is-destructive{color:#dc2626}
.x-post-menu-popover .is-destructive:hover{background:rgba(220,38,38,.1)}
.x-publish-warning{border:1px solid #f59e0b;border-radius:10px;padding:10px;margin:8px 0;font-size:12px;color:var(--x-foreground,#18181b)}
.x-mobile-study-rail{padding:0 14px 18px}
.x-mobile-study-rail>.widget,.x-mobile-study-rail .widget{border:1px solid var(--x-border,#e5e7eb);border-radius:14px;padding:12px;margin:10px 0;background:var(--x-card,#fff);color:var(--x-foreground,#18181b)}
.x-mobile-study-title{font-size:12px;font-weight:650;margin:10px 0;color:var(--x-muted,#71717a)}
#mobile_right_nav{max-width:min(360px,calc(100vw - 24px));height:100dvh;overflow-y:auto;overscroll-behavior:contain}
#mobile_right_nav .mobile_head{position:sticky;top:0;z-index:2;backdrop-filter:blur(16px)}
@media(max-width:600px){.x-post-head-actions .x-category-badge{max-width:100px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.x-post-menu-popover{width:155px}}

/* Only one outlined study rectangle. The outline, glow and hit area live on its link. */
.study-card{border:0!important;background:transparent!important;border-radius:0!important;padding:0!important;overflow:visible!important;cursor:default!important;box-shadow:none!important;margin:12px 0}
.study-card-layout{color:var(--study-text)!important;text-decoration:none!important;background:var(--study-bg);transition:border-color .18s,box-shadow .18s;cursor:pointer}
.study-card-layout:hover{border-color:#a5b4fc;box-shadow:0 0 0 2px color-mix(in srgb,#6366f1 28%,transparent),0 0 22px color-mix(in srgb,#6366f1 18%,transparent)}
.study-card-layout:focus-visible{outline:2px solid #6366f1;outline-offset:3px}
.study-card-goal{font-size:11px;color:var(--study-muted);margin-bottom:9px}
.study-subject-head{display:flex;align-items:center;justify-content:space-between;gap:6px;min-width:0}
.study-subject-title{justify-content:flex-start;text-align:left;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.study-subject-title .study-dot{margin-right:0}
.study-subject-time{display:flex;align-items:baseline;gap:2px;flex-shrink:0;font-size:16px;margin:0;font-family:var(--number-font,inherit);font-weight:650}
.study-subject-time small{font-size:9px;color:var(--study-muted)}
.study-card-subject{flex-basis:148px;min-width:148px}
.study-card-detail .study-card-link{display:block;padding:6px 12px 10px;margin:0;text-align:right}
.x-publish-edit-settings{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin:12px 0;padding:14px;border:1px solid var(--x-border,#e5e7eb);border-radius:12px}
.x-publish-edit-settings[hidden],.x-publish-warning[hidden]{display:none!important}
.x-publish-edit-settings label{display:grid;gap:6px;min-width:0;color:var(--x-muted,#71717a);font-size:12px}
.x-publish-edit-settings input,.x-publish-edit-settings select{width:100%;min-width:0;padding:9px;border:1px solid var(--x-border,#e5e7eb);border-radius:10px;background:var(--x-card,#fff);color:var(--x-foreground,#18181b)}
.x-publish-warning{border-color:var(--x-border,#e5e7eb);background:var(--x-accent,#f4f4f5)}
@media(max-width:600px){.study-card-subject{flex-basis:130px;min-width:130px}.study-subject-title{font-size:12px}.study-subject-time{font-size:14px}.x-publish-edit-settings{grid-template-columns:1fr}}

.x-publish-form.is-loading-edit>:not([data-edit-warning]){pointer-events:none;opacity:.5}
.x-publish-form.is-loading-edit [data-edit-warning]{pointer-events:auto}
.x-publish-form[data-content-mode=raw] textarea[name=text]{min-height:280px;font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:14px;white-space:pre}


/* Publish composer layout: give the study editor the full panel width. */
.x-publish-panels > .study-editor{grid-column:1/-1;width:100%;box-sizing:border-box}
.x-publish-toolbar .study-manage-link{order:-1;display:inline-flex;align-items:center;justify-content:center;width:36px;height:36px;padding:0!important;border:0!important;background:transparent!important;box-shadow:none!important;color:var(--x-muted,#71717a)!important;font-size:19px}
.x-publish-toolbar .study-manage-link:hover{background:var(--x-accent,#f4f4f5)!important;color:var(--x-foreground,#18181b)!important}
