/*
 * Coconut Apps - page styles (frame with sidebar, launcher, profile, no-access page)
 * Created:   2026-11-14 16:49:04
 * Updated:   2026-11-23 01:30:10
 *
 * Moved out of inline <style> blocks so the Content Security Policy can forbid inline
 * styles. Colours come from coconut-theme.css (coconut-app-theme skill).
 */

/* Top bar (templates/base.html) */
  .cc-topbar { background: var(--cc-surface); border-bottom: 1px solid var(--cc-border); }
  .cc-topbar-inner { max-width: 1200px; margin: 0 auto; padding: 14px 24px; display: flex; align-items: center; gap: 10px; }
  .cc-brand { font-family: var(--cc-font-head); font-weight: 500; font-size: 17px; color: var(--cc-heading); letter-spacing: -0.02em; text-decoration: none; }
  .cc-brand .ti { color: var(--cc-primary); font-size: 22px; vertical-align: -4px; margin-right: 6px; }

/* Launcher (templates/launcher/home.html) */
  .cc-search { flex: 1; max-width: 420px; margin-left: auto; display: flex; align-items: center; gap: 8px;
    background: var(--cc-canvas); border: 1px solid var(--cc-border); border-radius: var(--cc-radius-control); padding: 0 10px; }
  .cc-search .ti { color: var(--cc-muted); font-size: 18px; }
  .cc-search input { border: 0; background: transparent; padding: 8px 0; width: 100%; box-shadow: none; }
  .cc-avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--cc-info-tint); color: var(--cc-primary-hover);
    display: flex; align-items: center; justify-content: center; font-family: var(--cc-font-mono); font-size: 13px; font-weight: 500; flex: 0 0 auto; }
  .cc-signout { color: var(--cc-muted); font-size: 20px; text-decoration: none; display: flex; }
  .cc-signout:hover { color: var(--cc-primary); }
  .cc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 16px; }
  .cc-tile { background: var(--cc-surface); border: 1px solid var(--cc-border); border-radius: var(--cc-radius-card);
    padding: 22px 16px 18px; text-align: center; text-decoration: none; color: var(--cc-body); display: block;
    transition: border-color .12s, transform .12s; }
  a.cc-tile:hover { border-color: var(--cc-primary); transform: translateY(-2px); color: var(--cc-body); }
  a.cc-tile:focus-visible { outline: 3px solid var(--cc-info-tint); border-color: var(--cc-primary); }
  .cc-tile-icon { width: 56px; height: 56px; border-radius: 14px; margin: 0 auto 12px; display: flex; align-items: center; justify-content: center; }
  .cc-tile-icon .ti { font-size: 30px; }
  .cc-tile-name { font-family: var(--cc-font-head); font-weight: 500; font-size: 16px; color: var(--cc-heading); letter-spacing: -0.01em; }
  .cc-tile-desc { font-size: 13px; color: var(--cc-muted); margin-top: 4px; line-height: 1.4; }
  .cc-tile-off { background: var(--cc-canvas); cursor: default; }
  .cc-tile-off .cc-tile-icon { background: var(--cc-surface); border: 1px solid var(--cc-border); }
  .cc-tile-off .cc-tile-icon .ti, .cc-tile-off .cc-tile-name { color: var(--cc-muted); }
  .cc-section { margin: 36px 0 12px; }
  .cc-empty { color: var(--cc-muted); }
  .cc-foot { text-align: center; font-size: 13px; color: var(--cc-muted); padding: 32px 0 8px; }
  @media (max-width: 560px) {
    .cc-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
    .cc-search { display: none; }
  }

/* Tile colours: one class per palette colour (core.models.COLOUR_CHOICES), icon on its tint */
.cc-tile-icon.cc-blue     { background: var(--cc-info-tint); }
.cc-tile-icon.cc-blue .ti { color: var(--cc-primary); }
.cc-tile-icon.cc-green     { background: var(--cc-success-tint); }
.cc-tile-icon.cc-green .ti { color: var(--cc-success); }
.cc-tile-icon.cc-brown     { background: var(--cc-accent-tint); }
.cc-tile-icon.cc-brown .ti { color: var(--cc-accent); }
.cc-tile-icon.cc-darkred     { background: var(--cc-danger-tint); }
.cc-tile-icon.cc-darkred .ti { color: var(--cc-danger); }

/* No-access page (templates/core/no_access.html) */
.cc-card-text { margin: 0 0 14px; }
.cc-btn + .cc-btn { margin-left: 8px; }
.cc-pill + .cc-card-text { margin-top: 12px; }

/* Frame with sidebar (templates/base.html, signed-in users) */
.cc-shell-side { display: flex; min-height: 100vh; }
.cc-side { width: 232px; flex: 0 0 232px; background: var(--cc-surface); border-right: 1px solid var(--cc-border);
  display: flex; flex-direction: column; gap: 6px; padding: 16px 12px; position: sticky; top: 0; height: 100vh; }
.cc-side .cc-brand { padding: 4px 8px 14px; }
.cc-side-nav { display: flex; flex-direction: column; gap: 2px; flex: 1; overflow-y: auto; }
.cc-side-link { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--cc-radius-control);
  color: var(--cc-body); text-decoration: none; font-size: 14px; }
.cc-side-link .ti { font-size: 19px; color: var(--cc-muted); }
.cc-side-link:hover { background: var(--cc-canvas); color: var(--cc-heading); }
.cc-side-link.is-current { background: var(--cc-info-tint); color: var(--cc-primary-hover); font-weight: 500; }
.cc-side-link.is-current .ti { color: var(--cc-primary); }
.cc-side-user { display: flex; align-items: center; gap: 10px; padding: 10px 8px; border-top: 1px solid var(--cc-border);
  text-decoration: none; color: var(--cc-body); }
.cc-side-user:hover { background: var(--cc-canvas); border-radius: var(--cc-radius-control); }
.cc-side-who { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.cc-side-who b { font-weight: 500; font-size: 14px; color: var(--cc-heading); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cc-side-who small { font-size: 12px; color: var(--cc-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cc-main { flex: 1; min-width: 0; }
.cc-shell-side .cc-topbar-inner:not(:has(*)) { display: none; }
.cc-shell-side .cc-topbar:has(.cc-topbar-inner:not(:has(*))) { display: none; }

/* Avatars: initials on a palette tint, colour picked from the email */
.cc-avatar.cc-av-blue    { background: var(--cc-info-tint);    color: var(--cc-primary-hover); }
.cc-avatar.cc-av-green   { background: var(--cc-success-tint); color: var(--cc-success-text); }
.cc-avatar.cc-av-brown   { background: var(--cc-accent-tint);  color: var(--cc-accent); }
.cc-avatar.cc-av-darkred { background: var(--cc-danger-tint);  color: var(--cc-danger); }
.cc-avatar-lg { width: 64px; height: 64px; font-size: 22px; margin-bottom: 12px; }

/* Profile page (templates/core/profile.html) */
.cc-msg { margin: 0 0 16px; }
.cc-profile { display: grid; grid-template-columns: minmax(0, 2fr) minmax(240px, 1fr); gap: 20px; align-items: start; }
.cc-form h2 { margin-top: 8px; }
.cc-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.cc-field { display: flex; flex-direction: column; gap: 6px; margin: 0 0 16px; font-size: 14px; }
.cc-field span { font-weight: 500; color: var(--cc-heading); }
.cc-field input, .cc-field select { width: 100%; }
.cc-error { color: var(--cc-danger); font-size: 13px; }
.cc-facts { margin: 0 0 12px; font-size: 14px; }
.cc-facts dt { font-family: var(--cc-font-mono); font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--cc-muted); margin-top: 10px; }
.cc-facts dd { margin: 2px 0 0; color: var(--cc-heading); word-break: break-all; }
.cc-muted-note { font-size: 13px; color: var(--cc-muted); }

/* Phones: the sidebar becomes a top bar; app links scroll sideways */
@media (max-width: 760px) {
  .cc-shell-side { flex-direction: column; }
  .cc-side { width: auto; flex: none; height: auto; position: static; flex-direction: row; flex-wrap: wrap; align-items: center;
    border-right: 0; border-bottom: 1px solid var(--cc-border); padding: 10px 12px; }
  .cc-side .cc-brand { padding: 4px; }
  .cc-side .cc-brand span { display: none; }
  .cc-side-nav { order: 3; flex: 1 0 100%; flex-direction: row; overflow-x: auto; }
  .cc-side-link { white-space: nowrap; }
  .cc-side-user { margin-left: auto; border-top: 0; padding: 4px; }
  .cc-side-who { display: none; }
  .cc-profile, .cc-form-row { grid-template-columns: 1fr; }
}

/* Client switcher (agents and staff), under the logo in the sidebar */
.cc-switch { margin: 0 4px 10px; display: flex; flex-direction: column; gap: 4px; }
.cc-switch label { font-family: var(--cc-font-mono); font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--cc-accent); }
.cc-switch-row { display: flex; gap: 6px; }
.cc-switch select { flex: 1; min-width: 0; }
.cc-switch-go { padding: 6px 10px; }
.cc-side-sub { margin-top: 10px; border-top: 1px solid var(--cc-border); border-radius: 0; padding-top: 12px; }

/* Choose a client and who has access */
.cc-choose { margin: 0; }
.cc-choose-tile { width: 100%; cursor: pointer; font: inherit; }
.cc-choose-tile .cc-tile-icon, .cc-choose-tile .cc-tile-name, .cc-choose-tile .cc-tile-desc { display: flex; justify-content: center; }
.cc-choose-tile:hover { border-color: var(--cc-primary); }
.cc-access { margin-bottom: 20px; overflow-x: auto; }
@media (max-width: 760px) { .cc-switch { flex: 1 0 100%; order: 2; } }
.cc-switch-go[hidden] { display: none; }

/* Catalogue: home page strips, the Explore page tabs and tiles, and item pages. */
.cc-side-rule { display: block; border-top: 1px solid var(--cc-border); margin: 10px 0; }
.cc-section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.cc-section-head .cc-eyebrow { margin: 0; }
.cc-section-head a { font-size: 14px; }
.cc-tile-more { border-style: dashed; }
.cc-rows { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.cc-row { display: flex; align-items: center; gap: 12px; padding: 10px 14px; background: var(--cc-surface); border: 1px solid var(--cc-border); border-radius: var(--cc-radius-card); color: var(--cc-body); text-decoration: none; }
.cc-row:hover { border-color: var(--cc-primary); color: var(--cc-body); }
.cc-row-icon.cc-tile-icon { width: 36px; height: 36px; border-radius: 10px; margin: 0; flex: none; }
.cc-row-icon.cc-tile-icon .ti { font-size: 20px; }
.cc-row-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.cc-row-text b { font-family: var(--cc-font-head); font-weight: 500; color: var(--cc-heading); }
.cc-row-text small { color: var(--cc-muted); font-size: 13px; }
.cc-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--cc-border); margin: 20px 0 14px; flex-wrap: wrap; }
.cc-tab { padding: 8px 14px; color: var(--cc-muted); text-decoration: none; border-bottom: 2px solid transparent; margin-bottom: -1px; font-size: 15px; }
.cc-tab:hover { color: var(--cc-heading); }
.cc-tab.is-current { color: var(--cc-primary-hover); border-bottom-color: var(--cc-primary); font-weight: 500; }
.cc-tab-count { font-family: var(--cc-font-mono); font-size: 12px; color: var(--cc-muted); margin-left: 2px; }
.cc-tab-note { color: var(--cc-muted); font-size: 14px; margin: 0 0 18px; }
.cc-grid-wide { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.cc-cat-tile { text-align: left; }
.cc-cat-top { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 12px; }
.cc-cat-top .cc-tile-icon { margin: 0; }
.cc-cat-connects { font-family: var(--cc-font-mono); font-size: 11px; color: var(--cc-muted); margin-top: 10px; }
.cc-item-head { display: flex; align-items: center; gap: 16px; margin-bottom: 20px; }
.cc-item-head .cc-tile-icon { margin: 0; flex: none; }
.cc-item-head h1, .cc-item-head .cc-lede { margin: 0; }
.cc-item { display: grid; grid-template-columns: minmax(0, 2fr) minmax(240px, 1fr); gap: 16px; align-items: start; }
.cc-item-body h2 { font-size: 18px; margin: 0 0 8px; }
.cc-item-body h2:not(:first-child) { margin-top: 22px; }
.cc-item-body p { margin: 0 0 10px; }
.cc-item-side .cc-pill { margin-bottom: 14px; }
.cc-item-side .cc-facts dd { word-break: normal; }
.cc-item-side .cc-btn { display: block; text-align: center; }
.cc-item-side .cc-muted-note { margin: 10px 0 0; }
@media (max-width: 720px) { .cc-item { grid-template-columns: 1fr; } }
.cc-ask .cc-field { margin-bottom: 10px; }
.cc-ask textarea { width: 100%; box-sizing: border-box; resize: vertical; font: inherit; }
.cc-ask .cc-btn { width: 100%; }
.cc-asked { margin: 0; }
.cc-inline-form { display: inline; margin-left: 8px; }

/* Number columns: headings line up with their right-aligned values (the theme aligns the
   cells only). */
.cc-table th.cc-num, .cc-table tfoot td.cc-num { text-align: right; }
.cc-table tfoot td, .cc-table tfoot th { font-weight: 600; }

/* Order Approvals: Approve and Reject side by side on the link page, stacked on a phone. */
.cc-decide { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 16px 0; align-items: start; }
.cc-decide h2 { margin: 0 0 8px; }
@media (max-width: 720px) { .cc-decide { grid-template-columns: 1fr; } }

/* Order Approvals: a customer's setting (choices in a plain fieldset, a wide text box). */
.cc-form fieldset { border: 0; padding: 0; margin: 0 0 14px; }
.cc-form legend { font-size: 13px; font-weight: 500; color: var(--cc-heading); margin-bottom: 6px; padding: 0; }
.cc-choice { display: flex; align-items: center; gap: 8px; margin: 6px 0; font-size: 15px; }
.cc-form .cc-choice input[type=radio] { width: auto; margin: 0; flex: none; }
.cc-form textarea { width: 100%; box-sizing: border-box; resize: vertical; font: inherit; }
.cc-form .cc-btn + .cc-btn { margin-left: 8px; }

/* Order Approvals: the portal orders filters and search. */
.cc-tabs-small { margin-top: 8px; }
.cc-tabs-small .cc-tab { font-size: 14px; padding: 6px 12px; }
.cc-search { display: flex; gap: 8px; align-items: flex-end; margin: 0 0 14px; }
.cc-search .cc-field { flex: 1; margin: 0; }
