/* Shared controls for operating pages only. Teacher profile themes and calendar colours remain independent. */
:root{--pistory-paper:#fff;--pistory-bg:#f3f2ee;--pistory-ink:#203e35;--pistory-green:#244d3d;--pistory-soft:#eaf0ec;--pistory-border:#cbd6ce;--pistory-radius:12px;--pistory-nav-height:0px}
body.pistory-tools{background:var(--pistory-bg)!important;color:var(--pistory-ink);font-family:system-ui,-apple-system,"Noto Sans TC",sans-serif}
.pistory-tools :where(.box,.card,.gc-box,.gc-batch,.ca-card,.pricing-panel,.pos-cart,.pos-panel){border-radius:14px;border-color:var(--pistory-border)}
.pistory-tools :where(main,.wrap,.shell) :where(input:not([type=hidden]):not([type=checkbox]):not([type=radio]):not([type=range]):not([type=color]):not([type=file]),select,textarea){border:1px solid var(--pistory-border);border-radius:var(--pistory-radius);background:var(--pistory-paper);color:var(--pistory-ink);font:inherit;box-sizing:border-box;min-height:44px;max-width:100%}
.pistory-tools :where(main,.wrap,.shell) :where(button:not([class]),.btn,.gc-tools a,.pricing-link){border-radius:var(--pistory-radius);min-height:44px;box-sizing:border-box;text-decoration:none}
.pistory-tools :where(main,.wrap,.shell) :where(button:not([class]),.btn:not(.secondary):not(.danger):not(.light),.pricing-link){background:var(--pistory-green);color:#fff;border:1px solid var(--pistory-green)}
.pistory-tools :where(main,.wrap,.shell) :where(.btn.secondary,.btn.light){background:var(--pistory-soft);color:var(--pistory-ink);border:1px solid var(--pistory-border)}
.pistory-tools :where(main,.wrap,.shell) .btn.danger{background:#a83636;color:#fff;border:1px solid #a83636}
.pistory-tools :where(a,button,input,select,textarea,summary):focus-visible{outline:3px solid #397ac6;outline-offset:3px}
.pistory-tools :where(button,input,select,textarea):disabled{opacity:.55;cursor:not-allowed}
.pistory-tools :where(.err,.error,.gc-error,.pricing-error){border-radius:var(--pistory-radius);padding:14px 16px;background:#fbe7e7;color:#7a2626}
.pistory-tools :where(.ok,.gc-success,.pricing-success){border-radius:var(--pistory-radius);padding:14px 16px;background:#e7f1e8;color:#24543d}
.pistory-tools :where(a.ts-nav,a.room-nav-button,.teacher-course-nav a,.back){display:inline-flex;align-items:center;justify-content:center;min-height:44px;padding:10px 16px;border:1px solid var(--pistory-border);border-radius:var(--pistory-radius);background:var(--pistory-soft);color:var(--pistory-ink);font:600 15px/1.4 system-ui,sans-serif;text-decoration:none;box-sizing:border-box}
.pistory-tools :where(a.ts-today,a.room-nav-today){background:var(--pistory-green);color:#fff;border-color:var(--pistory-green)}
.pistory-tools .login-help{font-size:14px;line-height:1.7;color:#586d62;margin:18px 0 0}
.pistory-tools .pos-cart{top:calc(var(--pistory-nav-height) + 16px);scroll-margin-top:calc(var(--pistory-nav-height) + 16px)}
.pistory-tools .sw-day-detail h3{scroll-margin-top:16px}
.pistory-tools .rank-actions form{margin:0}.pistory-tools .rank-actions button{margin:0}
@media(max-width:640px){.pistory-tools .teacher-week .sw-hour-table{font-size:13px;min-width:620px}.pistory-tools .teacher-week .sw-hour-entry{min-height:44px;padding:8px 4px}.pistory-tools .teacher-week .sw-back-week{display:inline-flex;min-height:44px;margin:10px 0}.pistory-tools .teacher-week .sw-week-mode .sw-scroll{overflow-x:auto}.pistory-tools .teacher-week .sw-week-mode .sw-week{min-width:900px}}

.sw-teacher-agenda{display:none}
@media(max-width:640px){.sw-teacher-calendar .sw-teacher-agenda{display:grid;gap:10px}.sw-teacher-calendar .sw-agenda-entry{display:grid;gap:6px;padding:16px;border-radius:12px;background:var(--sw-bg);color:var(--sw-text);border-left:4px solid var(--sw-line);font-size:15px;text-decoration:none;line-height:1.5}.sw-teacher-calendar .sw-day-detail>.sw-hour-scroll{display:block;overflow-x:auto}.sw-teacher-calendar .sw-teacher-agenda{display:none}}
.pistory-tools .gc-wrap button:not(.light):not(.danger),.pistory-tools .cm-button:not(.light):not(.danger){background:var(--pistory-green);color:#fff;border-radius:12px;min-height:44px}
.pistory-tools .gc-wrap button.light,.pistory-tools .cm-button.light{background:var(--pistory-soft);color:var(--pistory-ink);border-radius:12px;min-height:44px}
.pistory-tools .ca-wrap button:not(.ca-light):not(.danger),.pistory-tools .ca-wrap .ca-btn:not(.ca-light):not(.danger){background:var(--pistory-green);color:#fff;border-radius:12px;min-height:44px}
.pistory-tools .ca-wrap .ca-light{background:var(--pistory-soft);color:var(--pistory-ink);border-radius:12px;min-height:44px}
.pistory-tools :is(.ca-wrap,.gc-wrap,.pricing-wrap,.cm-wrap) :is(input:not([type=checkbox]):not([type=radio]):not([type=hidden]):not([type=file]),select,textarea){border-color:var(--pistory-border);border-radius:12px;min-height:44px}
.pistory-tools .ca-error{background:#fbe7e7;color:#7a2626;border-radius:12px}
.pistory-tools .ca-notice{background:#e7f1e8;color:#24543d;border-radius:12px}

.pistory-tools .password-card{border-radius:14px;border-color:var(--pistory-border)}

/* Secondary actions and disclosures share a consistent touch target. */
.ui-disclosure{margin:12px 0}.ui-disclosure>summary,.pos-more>summary{cursor:pointer;min-height:44px;box-sizing:border-box;padding:12px 14px;border:1px solid var(--pistory-border);border-radius:12px;background:var(--pistory-soft);color:var(--pistory-ink);font-weight:600}
.ui-disclosure[open]>summary{margin-bottom:12px}.ui-danger-zone>summary{color:#8b3030;background:#fff6f4;border-color:#e0c4c0}
.pistory-tools .cm-button.danger{background:#a83636;color:#fff;border:1px solid #a83636;border-radius:12px;min-height:44px}
.pos-more{position:relative}.pos-more>div{position:absolute;right:0;z-index:50;min-width:180px;background:#fff;padding:8px;border:1px solid var(--pistory-border);border-radius:12px;box-shadow:0 8px 24px #0002}.pos-more>div a{display:block}
@media(max-width:650px){.pos-more>div{position:static;box-shadow:none;margin-top:6px}.pos-heading nav{width:100%}}
