/* Shared material, typography and control language for 栀夏 V8. */
:root {
    --zx-ink:#29452f;
    --zx-muted:#566d59;
    --zx-accent:#426141;
    --zx-glass:rgba(251,253,246,.92);
    --zx-glass-soft:rgba(251,253,246,.78);
    --zx-line:rgba(112,141,115,.24);
    --zx-control:rgba(255,255,252,.7);
    --zx-button:rgba(220,236,208,.78);
    --zx-button-hover:rgba(205,225,191,.92);
    --zx-danger:#914835;
    --zx-danger-bg:#fff0e9;
    --zx-focus:#ad8537;
    --zx-radius:22px;
    --zx-control-radius:12px;
    --zx-shadow:0 18px 54px rgba(40,67,38,.16);
    --zx-font:-apple-system,BlinkMacSystemFont,'Segoe UI','Microsoft YaHei',sans-serif;
    color-scheme:light;
}
button,input,select,textarea { font-family:inherit; }
button { touch-action:manipulation; }
::selection { background:#dcebd2; color:var(--zx-ink); }

/* The native scheduling/password overlays share the account dialogs' material. */
.sched-overlay {
    z-index:2200;
    background:rgba(32,53,35,.24);
    backdrop-filter:blur(6px);
    -webkit-backdrop-filter:blur(6px);
    padding:20px;
    color:var(--zx-ink);
    font:14px/1.6 var(--zx-font);
}
.sched-overlay .sched-modal {
    max-height:calc(100vh - 40px);
    max-height:calc(100dvh - 40px);
    border-radius:var(--zx-radius);
    background:var(--zx-glass);
    box-shadow:var(--zx-shadow);
    min-width:0;
}
.sched-overlay.show > .sched-modal { animation:zx-dialog-in 260ms cubic-bezier(.16,1,.3,1); }
.sched-overlay .sched-header {
    gap:16px;
    padding:18px 22px 14px;
    border-bottom:1px solid var(--zx-line);
    color:var(--zx-ink);
    background:transparent;
}
.sched-overlay .sched-header-title { font-size:20px; font-weight:600; line-height:1.4; }
.sched-overlay .sched-close {
    flex:none;
    width:44px;
    height:44px;
    border-radius:var(--zx-control-radius);
    background:rgba(122,158,126,.1);
    color:var(--zx-ink);
    font:24px/1 var(--zx-font);
}
.sched-overlay .sched-close:hover { background:var(--zx-button); }
.sched-overlay .sched-body { padding:18px 22px 22px; min-height:0; overscroll-behavior:contain; scrollbar-width:thin; scrollbar-color:#a3b89e transparent; }
.sched-overlay .sched-form label { color:var(--zx-ink); font-size:14px; line-height:1.5; margin:16px 0 7px; font-weight:600; }
.sched-overlay .sched-form label:first-child { margin-top:0; }
.sched-overlay .sched-form :is(textarea,input[type="text"],input[type="time"],input[type="number"],input[type="password"],select) {
    width:100%;
    min-width:0;
    min-height:44px;
    border:1px solid var(--zx-line);
    border-radius:var(--zx-control-radius);
    padding:10px 12px;
    background:var(--zx-control);
    color:var(--zx-ink);
    font:14px/1.5 var(--zx-font);
    caret-color:var(--zx-accent);
    transition:border-color 150ms ease,background-color 150ms ease;
}
.sched-overlay .sched-form :is(input,textarea)::placeholder { color:#65785f; opacity:1; }
.sched-overlay .sched-form :is(input,select,textarea):focus { border-color:#7e9c75; background:rgba(255,255,252,.94); }
.sched-overlay :focus-visible { outline:3px solid var(--zx-focus); outline-offset:2px; }
.sched-overlay :is(button,input,textarea,select):disabled { opacity:.55; cursor:not-allowed; }
.sched-overlay .sched-form textarea { min-height:86px; max-height:220px; }
.sched-overlay .sched-hint { color:var(--zx-muted); font-size:12px; line-height:1.65; overflow-wrap:anywhere; }
.sched-overlay .sched-days { display:grid; grid-template-columns:repeat(7,minmax(0,1fr)); gap:6px; }
.sched-overlay .sched-day { min-width:0; min-height:44px; padding:8px 3px; border:1px solid var(--zx-line); border-radius:10px; background:var(--zx-control); color:var(--zx-muted); font:13px/1.5 var(--zx-font); }
.sched-overlay .sched-day:hover { background:var(--zx-button); }
.sched-overlay .sched-day.active { border-color:#789c70; background:#dcebd2; color:#29452f; font-weight:600; }
.sched-overlay .sched-enable { color:var(--zx-ink); min-height:44px; }
.sched-overlay .sched-enable > label[for] { cursor:pointer; font-size:14px; margin:0; }
.sched-overlay .sched-switch { align-self:center; }
.sched-overlay .sched-switch input { position:absolute; width:100%; height:100%; margin:0; }
.sched-overlay .sched-switch input:focus-visible + .sched-slider { outline:3px solid var(--zx-focus); outline-offset:3px; }
.sched-overlay .sched-switch input:disabled + .sched-slider { opacity:.5; cursor:not-allowed; }
.sched-overlay .sched-slider { background:#aebaaa; }
.sched-overlay .sched-switch input:checked + .sched-slider { background:#789b6e; }
.sched-overlay .sched-save-btn {
    min-height:46px;
    border:1px solid rgba(108,142,98,.25);
    border-radius:var(--zx-control-radius);
    background:var(--zx-button);
    color:var(--zx-ink);
    font:600 14px/1.5 var(--zx-font);
    padding:11px 16px;
    transition:background-color 150ms ease;
}
.sched-overlay .sched-save-btn:hover:not(:disabled) { background:var(--zx-button-hover); }
#sched-cancel-btn { background:var(--zx-control) !important; color:var(--zx-muted); font-weight:400; }
.sched-overlay .sched-list { border-color:var(--zx-line); margin-top:24px; padding-top:20px; }
.sched-overlay .sched-list-title { font-size:16px; font-weight:600; color:var(--zx-ink); margin-bottom:12px; }
.sched-overlay .sched-item { background:rgba(255,255,252,.45); border-color:var(--zx-line); padding:14px; border-radius:14px; }
.sched-overlay .sched-item-cmd { color:var(--zx-ink); overflow-wrap:anywhere; word-break:normal; }
.sched-overlay .sched-item-meta { font-size:12px; line-height:1.6; color:var(--zx-muted); }
.sched-overlay .sched-item-actions { gap:6px; }
.sched-overlay .sched-item-actions button { min-height:38px; padding:8px 10px; font:13px/1.5 var(--zx-font); border-radius:10px; }
.sched-overlay .sched-btn-edit { background:var(--zx-button); color:var(--zx-accent); }
.sched-overlay .sched-btn-del { background:var(--zx-danger-bg); color:var(--zx-danger); }
.sched-overlay .sched-empty { padding:24px 12px; font-size:14px; color:var(--zx-muted); line-height:1.6; }
#pwd-feedback { margin-top:12px; color:var(--zx-danger); line-height:1.6; font-size:13px; overflow-wrap:anywhere; }
#pwd-feedback:empty { display:none; }
.shell-notifications .chat-headerN { animation:zx-notice-in 180ms ease-out; }
.shell-notifications .chat-headerN-bubble { font:14px/1.6 var(--zx-font); overflow-wrap:anywhere; background:var(--zx-glass); color:var(--zx-ink); box-shadow:0 8px 26px rgba(40,67,38,.16); }
.shell-notifications .chat-headerN[data-state="error"] .chat-headerN-bubble { background:rgba(255,240,233,.96); color:var(--zx-danger); }
.shell-notifications .chat-headerN[data-state="success"] .chat-headerN-bubble { background:rgba(232,244,222,.96); color:#34562f; }
.shell-notifications .chat-headerN.is-leaving { animation:zx-notice-out 180ms ease-in both; }
#account-groups-modal { z-index:2220; }
#groups-name-modal { z-index:2240; }
body .sa-overlay { z-index:2200; }
body .sa-scan-overlay, body .sa-query-overlay { z-index:2220; }
body .sa-copy-overlay { z-index:2240; }
body .gift-overlay { z-index:2300; }
@keyframes zx-notice-in { from { opacity:0; transform:translateY(-5px); } to { opacity:1; transform:none; } }
@keyframes zx-notice-out { to { opacity:0; transform:translateY(-5px); } }

@keyframes zx-dialog-in { from { opacity:0; transform:translateY(10px) scale(.985); } to { opacity:1; transform:none; } }
@media(max-width:600px) {
    .sched-overlay { padding:10px; }
    .sched-overlay .sched-modal { max-height:calc(100vh - 20px); max-height:calc(100dvh - 20px); border-radius:18px; }
    .sched-overlay .sched-header { padding:14px 16px 10px; gap:10px; }
    .sched-overlay .sched-body { padding:14px 16px 18px; }
    .sched-overlay .sched-header-title { font-size:19px; }
    .sched-overlay .sched-form :is(input,textarea,select) { font-size:16px; }
    .sched-overlay .sched-days { gap:4px; }
    .sched-overlay .sched-day { padding-inline:1px; font-size:12px; }
    .sched-overlay .sched-item-top { flex-wrap:wrap; }
    .sched-overlay .sched-item-cmd { flex-basis:100%; }
    .sched-overlay .sched-item-actions { width:100%; justify-content:flex-end; }
}
@media(prefers-reduced-motion:reduce) {
    .sched-overlay.show > .sched-modal { animation:none; }
    .sched-overlay :is(input,textarea,select,button,.sched-slider,.sched-slider::before) { transition-duration:100ms; }
    .shell-notifications .chat-headerN { animation:none; }
    .shell-notifications .chat-headerN.is-leaving { animation:zx-notice-fade 100ms ease both; }
}
@keyframes zx-notice-fade { to { opacity:0; } }
