/* The task editor's own chrome. `#panel` and `#panelFloatingBackdrop` are built by
   JS/features/task-editor-markup.js; their rules live here only (editor-host-css-parity.test.js).
   Load beside CSS/checklist.css, before CSS/alt/alt-embed-task.css, which re-skins this.
   Every selector is prefixed `html ` to keep the original nested specificity. */

/* ---------- Detail panel — a left-hand layout column, like the sidebar ---------- */
html .panel{
  position:relative;
  width:0;min-width:0;
  background:var(--panel);
  border-right:1px solid var(--border-soft);
  overflow:hidden;
  display:flex;flex-direction:column;
  transition:width var(--dur-quick) var(--ease-out), min-width var(--dur-quick) var(--ease-out);
}
html .panel.open{
  width:518px;min-width:518px;
}
/* A dragged width, set inline by applyPanelWidth(). The rule exists so the
   transition below can be turned off mid-drag without touching the widths. */
html body.resizing-panel .panel{transition:none;}

/* The floating panel neither dims nor blocks the app: it is the same editor in a bigger box.
   `pointer-events:none` on the backdrop lets clicks reach the app; leaving the mode is the
   reader's decision. Without the wash the backdrop was an invisible sheet over the entire window,
   so it is not put back. */
html .panel-floating-backdrop{
  position:fixed;inset:0;background:transparent;pointer-events:none;
  z-index:var(--z-panel);display:none;
}
html .panel-floating-backdrop.show{display:block;}
html .panel.floating{
  position:fixed;top:50%;left:50%;transform:translate(-50%,-50%);
  z-index:calc(var(--z-panel) + 1);
  /* Fluid fallback before JS sizing runs. No !important, so the JS inline style overrides it.
   See applyFloatingPanelSize() in JS/features/task-panel.js; keep its ratios in step or the
   box visibly resizes on open. */
  width:clamp(480px, 90vw, 1400px);
  min-width:0;
  max-width:96vw;
  height:clamp(420px, 88vh, 1100px);max-height:clamp(420px, 88vh, 1100px);
  border-radius:var(--a-r-lg);border:1px solid var(--border);border-right:1px solid var(--border);
  box-shadow:var(--a-shadow-lg);
}
html .panel.floating .panel-body{max-height:calc(clamp(420px, 88vh, 1100px) - 53px);}
html #panelPopoutBtn.active{color:var(--accent-text);}

/* Structure only. Padding and border-bottom live in CSS/task-editor-core.css's `.te-head`;
   `html .panel-head` has an element selector that would outrank core's bare `.te-head` on any
   property both state. Existence and layout only; no value either file states twice. */
html .panel-head{
  display:flex;align-items:center;justify-content:space-between;
}
/* `.ph-left`, `.ph-right`, `.status-dot`, `.ph-divider` are in CSS/components.css
   — the team task modal draws the same header. */
html .panel-body{flex:1;min-height:0;overflow-y:auto;padding:16px;display:flex;flex-direction:column;gap:16px;}

html .panel-tag-chips{display:flex;flex-wrap:wrap;gap:6px;}
/* Not `html`-prefixed from here down — the original `html{ … }` wrapper
   closed right after `.panel-tag-chips`, so these were always top-level. */
.panel-toggle-row{display:flex;gap:8px;flex-wrap:wrap;}
.panel-toggle-row .btn{flex:1 1 30%;justify-content:center;min-width:120px;}
.panel-toggle-row .btn.icon-only{flex:0 0 auto;min-width:0;padding:5px 10px;position:relative;}

/* What the framed editor shows when holding nothing. `#panelReleased` is `display:none`
   except when closePanel() reveals it in a frame; CSS/alt/alt-embed-task.css owns when it
   appears, this file owns the box. */
#panelReleased{display:none;}
.panel-released-card{
  max-width:420px; text-align:center;
  display:flex; flex-direction:column; align-items:center; gap:10px;
}
.panel-released-card h3{margin:0; font:600 var(--a-fs-16)/var(--a-lh-tight) var(--a-display); color:var(--text);}
.panel-released-card p{margin:0; font-size:var(--a-fs-13); line-height:var(--a-lh-body); color:var(--text-dim);}
.panel-released-back{font-size:var(--a-fs-12); color:var(--text-faint);}

/* The rest of the editor's own styling: `.field`, `.field-row`, per-field rules under
   `#panelDetailsPane`, and `.icon-btn`, moved here once a second document built this markup.
   The `html ` prefix preserves the original specificity. `.btn.danger` is CSS/components.css's;
   `.field` itself needs no rule. */

/* Base control styling at the lowest specificity: every text-ish input, select and textarea,
   so types the scoped `.field input[...]` rule omits (e.g. `input[type=time]`) do not fall to
   browser chrome. `--border-strong` is the WCAG 1.4.11 3:1 tier. */
input,textarea,select{font-family:inherit;}
input[type=text], input[type=email], input[type=password], input[type=date],
input[type=number], input[type=tel], input[type=search], input[type=url],
input[type=time], input[type=datetime-local], select, textarea{
  background:var(--panel-2); color:var(--text);
  border:1px solid var(--border-strong); border-radius:var(--radius-sm);
  padding:7px 10px; font-size:var(--a-fs-13);
}
input[type=text]:focus, input[type=email]:focus, input[type=password]:focus,
input[type=date]:focus, input[type=number]:focus, input[type=tel]:focus,
input[type=search]:focus, input[type=url]:focus, input[type=time]:focus,
input[type=datetime-local]:focus, select:focus, textarea:focus{
  border-color:var(--accent);
}
input[type=checkbox], input[type=radio]{accent-color:var(--accent);}

/* Buttons: the editor's own base, since `.btn`'s base is per-page (CSS/components.css).
   `--border-strong` is the 3:1 tier; `font-weight:600` per sys_design-system.md §3. */
html .btn{
  background:var(--panel-2);
  border:1px solid var(--border-strong);
  color:var(--text);
  padding:7px 12px;
  border-radius:var(--radius-sm);
  font-size:var(--a-fs-13);
  font-weight:600;
  display:flex;align-items:center;gap:6px;
  white-space:nowrap;
}
html .btn:hover{border-color:var(--accent);color:var(--accent-text);}
html .btn.active{border-color:var(--accent);color:var(--accent-text);background:var(--accent-soft);}
html .btn.small{padding:5px 9px;font-size:var(--a-fs-12);}
html .btn.primary{background:var(--accent-fill);border-color:var(--accent-fill);color:var(--a-on-fill);}
html .btn.primary:hover{filter:brightness(1.08);color:var(--a-on-fill);}
html .btn:disabled:hover{border-color:var(--border-soft);color:var(--text);}
html .btn.icon-only{font-size:var(--a-fs-16);padding:6px 11px;line-height:var(--a-lh-ctl);color:var(--text);}
html .btn.icon-only svg{display:block;width:var(--a-glyph);height:var(--a-glyph);}
html a.btn{text-decoration:none;}

/* The repeat popover's "i", declared before `.icon-btn` (equal specificity, later wins).
   26px rather than 23px: 24px is the pointer floor off the phone. */
html .repeat-info{flex:0 0 auto; width:26px; height:26px; padding:0; margin-left:6px;}

/* An icon-only control has no label and no edge, so at rest it is a glyph floating on the bar.
   Hover draws a real boundary rather than only tinting the background. */
html .icon-btn{
  background:transparent;border:none;color:var(--text-dim);font-size:var(--a-fs-16);padding:4px;border-radius:var(--a-r-sm);
  display:flex;align-items:center;justify-content:center;
}
html .icon-btn:hover{color:var(--text);background:var(--panel-2);box-shadow:inset 0 0 0 1px var(--border-strong);}
html a.icon-btn{text-decoration:none;}

/* ---------- the two panes, and which one is on screen ----------
   Everything above the description keeps its natural height; only the
   description row grows. The `display:none` pair stops the Comments pane
   rendering underneath Details rather than behind it. */
html #panelDetailsPane.active > .field:not(.split-row),
html #panelDetailsPane.active > .meta-line{flex:0 0 auto;}
html #panelDetailsPane, html #panelCommentsPane{display:none;}
/* Structure only. This id selector outranks core's bare `.te-pane.active` regardless of class
   count, so gap, flex and min-height live in CSS/task-editor-core.css ("The pane, and the
   rhythm inside it"): `.te-core #panelDetailsPane.active{flex:1 0 auto;min-height:auto}` so a
   short frame scrolls rather than squeezes. */
html #panelDetailsPane.active{display:flex; flex-direction:column;}
/* Flex column so the comment composer pins to the pane bottom, as in team_board.html's
   `#taskCommentsPane`. `.comments-list`'s `flex:1 1 auto` (CSS/components.css) needs a flex
   container; `.te-core #panelCommentsPane.active{flex:1 1 auto;min-height:0}` in
   CSS/task-editor-core.css makes the pane fill `.panel-body`. */
html #panelCommentsPane.active{display:flex; flex-direction:column;}

/* A field's control: label and input/select/textarea chrome live in
   CSS/task-editor-core.css (10px/700/.09em). Nothing here restates them. */

/* Title field: label and control on one row, matching Notes. The row layout and input
   font/size/weight live in CSS/task-editor-core.css's `.field.title` family (`.te-core`,
   `--te-label-w`). The old `--tt-label-w` and its readers were removed because id-based
   selectors here would outrank core's class rules; nothing else reads it. */
/* The title input's font/size/weight/padding live in CSS/task-editor-core.css's
   `.te-core .field.title > input[type=text]`, scoped to outrank this file's `html`-prefixed pair. */

/* `.field-row` display/wrap/gap and child flex-basis live in CSS/task-editor-core.css's
   `.te-core .field-row`; alt-embed-task.css's `flex-wrap:wrap` depends on core's `display:flex`. */
html .link-field input[type=text]{flex:1; min-width:0;}
html .link-open-btn:disabled{opacity:.55;}

/* `.field.split-row` layout lives in CSS/task-editor-core.css's `.te-core .field.split-row`.
   `.split-col`/`.split-col-desc` keep only `min-height:0` here (the one flex-shrink property core
   omits); core sets a different `flex-basis` on `.split-col-desc`. `.split-col-notes` is untouched. */
html .split-col{min-height:0;}
html .split-col-desc{min-height:0;}
html .split-col-notes{flex:1;}

/* ---------- the rich-text description, and the bar over it ----------
   `.comment-add-row` is a flex COLUMN with its own gap, so the toolbar's
   bottom margin comes off there — the gap owns the spacing. */
.rte-btn{
  background:var(--panel-2);border:1px solid var(--border);border-radius:var(--a-r-sm);color:var(--text-dim);
  font-size:var(--a-fs-12);padding:5px 9px;cursor:pointer;line-height:var(--a-lh-ctl);
}
.rte-btn:hover{border-color:var(--accent);color:var(--text);}
.rte-btn.active{background:var(--accent-fill);border-color:var(--accent-fill);color:var(--a-on-fill);}
html .rte-btn.mini{padding:3px 7px;font-size:var(--a-fs-11);}
html .desc-rte-toolbar{display:flex;align-items:center;gap:4px;flex-wrap:wrap;margin-bottom:6px;flex:0 0 auto;}
html .comment-add-row .desc-rte-toolbar{margin-bottom:0;}
html .desc-format-status{font-size:var(--a-fs-11);color:var(--text-dim);}
html .desc-format-status.err{color:var(--red-text);}
html .desc-format-status.ok{color:var(--green-text);}
html .fill-richtext{
  flex:1;width:100%;min-height:0;
  background:var(--panel-2);border:1px solid var(--border);border-radius:var(--radius-sm);
  color:var(--text);padding:8px 10px;font-size:var(--a-fs-13);
  overflow-y:auto;line-height:var(--a-lh-ui);overflow-wrap:anywhere;word-break:break-word;
}
html .fill-richtext:focus{border-color:var(--accent);}
html .fill-richtext:empty:before{content:attr(data-placeholder);color:var(--text-faint);}
html .fill-richtext ul, html .fill-richtext ol{margin:4px 0 4px 20px;padding:0;}
html .fill-richtext li{margin-bottom:1px;}
html .fill-richtext h4{margin:8px 0 3px;font-size:var(--a-fs-13);}
html .fill-richtext p{margin:0 0 6px;}
/* Tables, most commonly pasted or model-inserted, inherit no legible
   styling from the browser default. */
html .fill-richtext table{border-collapse:collapse;width:100%;margin:6px 0;font-size:var(--a-fs-12);}
/* Border and padding live in CSS/task-editor-core.css's `.te-core .fill-richtext td/th`
   (higher specificity). `text-align`/`vertical-align` are not restated there, so they stay. */
html .fill-richtext td, html .fill-richtext th{
  text-align:left;vertical-align:top;
}

/* The repeat control: a column, not a wrapping row, so the explanatory sentence sits under the
   control at every width (order: switch, frequency, consequence, status). `align-items:stretch`
   is wanted for the frequency row. Gap replaces the children's margins, zeroed below. */
html #recurrenceField{display:flex; flex-direction:column; gap:8px;}
html #recurrenceField > .pref-desc{margin-top:0;}
/* Both margins, not just the top — a `margin-top:0` alone answers half of
   a shared-dialog rule and leaves space hanging under the last row. */
html #recurrenceField > .account-status{margin:0;}
/* The frequency and its "i" share a real `.control-row` (reusing its gap, centring, wrap). The
   select flexes with `min-width:0`; this stays outside the <=640px stacking query so the 26px
   icon never needs its own line. */
html #repeatFreqRow > select{flex:1 1 200px; width:auto; min-width:0;}
html #repeatFreqRow > .repeat-info{flex:0 0 auto;}
/* The repeat half of the section is ruled off from the email half, the
   same separator vocabulary used elsewhere in it — drawn only when there
   is something above it to separate from, via a sibling combinator that
   needs no JavaScript to keep it true. */
html #panelSecReminderControls:not([hidden]) ~ #recurrenceField{
  border-top:1px solid var(--border-soft); padding-top:10px;
}
/* The box itself is declared up in the button section, before `.icon-btn`
   — see the note there for why the order is load-bearing. */
html .repeat-info:focus-visible{outline:2px solid var(--accent); outline-offset:2px;}
html .repeat-info[aria-expanded="true"]{color:var(--accent-text); background:var(--accent-soft);}

/* ---------- the tag row, the board row and the OKR row ---------- */
html .tag-chip{
  display:inline-flex;align-items:center;gap:5px;
  font-size:var(--a-fs-11);padding:3px 9px;border-radius:var(--a-r-pill);font-weight:600;
  border:1.5px solid transparent;cursor:pointer;white-space:nowrap;user-select:none;
  background:var(--panel-2);color:var(--text-dim);
}
html .tag-chip .dot{width:7px;height:7px;border-radius:50%;flex:0 0 auto;}
/* Bare text wrapper, styled explicitly rather than left to inherit silently --
   CLAUDE.md DoD 4d's own check flags any emitted class with no rule, and a
   span that merely holds the label text still needs one on the books. */
html .tag-chip .lbl{display:inline;}
html .tag-chip.selected{border-color:var(--accent);color:var(--text);background:var(--accent-soft);}
html .tag-chip.static{cursor:default;}
/* "Select more from N..." / "Done choosing": same role as team_board.html's tag-pick-toggle
   (CSS/alt/alt-team.css), restated because tasks.html does not load alt-team.css. */
html .tag-chip-toggle{
  display:inline-flex;align-items:center;
  background:transparent;border:1px dashed var(--border-strong);border-radius:var(--a-r-pill);
  padding:3px 10px;font-size:var(--a-fs-11);color:var(--text-faint);cursor:pointer;
}
html .tag-chip-toggle:hover{border-color:var(--accent);color:var(--accent-text);}
html .board-row{display:flex; align-items:center; gap:10px; flex-wrap:wrap;}
html .okr-row{display:flex; align-items:center; gap:12px; flex-wrap:wrap;}

/* ---------- the source of a task that arrived from somewhere else ---------- */
.email-source{
  background:var(--panel-2);border:1px solid var(--border);border-radius:var(--radius-sm);
  padding:10px 12px;display:flex;align-items:center;justify-content:space-between;gap:10px;flex-wrap:wrap;
}
.email-source-meta{display:flex;flex-direction:column;gap:2px;font-size:var(--a-fs-12);color:var(--text-dim);min-width:0;overflow:hidden;}
.email-source-meta span{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
/* .source-note-ref, .source-note-ref-link and .tml-rows live in CSS/task-editor-core.css: team_board.html loads that sheet, not this one. */
.meta-line{font-size:var(--a-fs-12);color:var(--text-faint);display:flex;justify-content:space-between;}

/* ---------- the checklist and reminders sections ----------
   `:empty` rather than `display:none` on the status line, since a
   `role="status"` live region already in the flow is announced far more
   reliably than one that appears when a display rule is lifted. */
#panelSecChecklist{gap:8px;}
/* Email half of the reminders section, wrapped so pmRemindersShow() can hide it without
   touching Repeat. `gap:inherit` because two hosts set different gaps. An author `display` is
   safe here only because CSS/base.css's `!important` rule keeps `hidden` authoritative. */
#panelSecReminderControls{display:flex; flex-direction:column; gap:inherit;}
#panelSecReminders .account-status:empty{min-height:0; margin-top:0;}
#panelSecReminders .reminder-actions{display:flex; align-items:center; gap:8px; flex-wrap:wrap;}
#panelSecReminders .remind-named{border-top:1px solid var(--border-soft); padding-top:10px;}
/* One reminder that names the reader, as the sentence and its "Stop reminding me" button on a
   line; the button wraps beneath a long sentence rather than being pushed off the panel. */
#panelSecReminders .remind-named-row{display:flex; align-items:center; gap:8px; flex-wrap:wrap;}
#panelSecReminders .remind-named-when{flex:1 1 auto; min-width:0; font-size:var(--a-fs-12); color:var(--text-dim); overflow-wrap:anywhere;}

/* Last in the file on purpose: disabled buttons tie `html .btn` on specificity, so the later
   rule wins. Opacity plus a flat neutral wash and softened edge. */
button:disabled, input:disabled, select:disabled, textarea:disabled, .is-disabled{
  opacity:.55;
  background:var(--gray-soft);
  border-color:var(--border-soft);
  cursor:not-allowed;
}
