/* Analyze Wardrobe page (pages/analyze.js) */

.az-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.az-sub    { font-size: 13px; color: var(--muted); margin-bottom: 12px; }
.az-chips  { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }

/* Status colours */
.az-missing { background: var(--red-lt);   color: var(--red);   border-color: #e8b8b8; }
.az-thin    { background: var(--amber-lt); color: var(--amber); border-color: var(--amber-bd); }
.az-covered { background: var(--green-lt); color: var(--green); border-color: #b8dcc4; }
.az-overlap { background: #f0eaf8;         color: #6a2da8;      border-color: #cdb8ee; }
.az-rare    { background: var(--paper);    color: var(--muted); border-color: var(--border); }

.az-pill    { flex-shrink: 0; text-align: center; font-size: 11px; font-weight: 600;
              padding: 2px 8px; border-radius: 12px; border: 1px solid; }
.az-subhead { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted);
              margin: 14px 0 4px; }
.az-empty   { font-size: 14px; color: var(--muted); padding: 10px 0; }
.az-note    { font-size: 12px; color: var(--muted); margin-top: 10px; line-height: 1.6; }
.az-key     { display: inline-block; font-size: 11px; padding: 0 6px; border-radius: 8px; border: 1px solid; margin-left: 4px; }

/* Coverage grid */
.az-grid-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.az-grid      { border-collapse: separate; border-spacing: 3px; font-size: 12px; min-width: 100%; }
.az-grid th   { font-weight: 500; color: var(--body); text-align: center; padding: 2px 4px; white-space: nowrap; }
.az-grid tbody th { text-align: left; font-weight: 400; position: sticky; left: 0; width: 1%; white-space: nowrap;
                    background: white; padding-right: 8px; }
.az-th-band   { border-top: 4px solid var(--band); border-radius: 4px 4px 0 0; padding-top: 6px !important; }
.az-th-range  { font-size: 14px; font-weight: 700; color: var(--heading); font-variant-numeric: tabular-nums; }
.az-th-label  { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.az-cell-td   { padding: 0; }
.az-cell      { display: block; width: 100%; min-width: 44px; min-height: 34px; text-align: center;
                border-radius: 6px; font: inherit; font-weight: 600; font-size: 13px; border: 1px solid;
                cursor: pointer; font-variant-numeric: tabular-nums; transition: transform .1s, box-shadow .1s; }
.az-cell:hover        { box-shadow: 0 0 0 2px currentColor; }
.az-cell:active       { transform: scale(.94); }
.az-cell:focus-visible { outline: 2px solid var(--heading); outline-offset: 1px; }
.az-na        { border: 1px solid transparent; background: var(--paper); border-radius: 6px; }

.az-cell        { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
                  padding: 4px 4px 5px; }
.az-cell-n      { line-height: 1; }
/* Per-activity strip (All view): one segment per level, coloured by that level's status */
.az-strip       { display: flex; gap: 2px; width: 100%; max-width: 44px; }
.az-seg         { flex: 1; height: 5px; border-radius: 2px; border: 1px solid; }
.az-seg.az-missing { background: var(--red);   border-color: var(--red); }
.az-seg.az-thin    { background: var(--amber); border-color: var(--amber); }
.az-seg.az-covered { background: var(--green); border-color: var(--green); }
.az-seg.az-overlap { background: #6a2da8;      border-color: #6a2da8; }
.az-seg.az-rare    { background: var(--border); border-color: var(--border); }
.az-seg-na      { background: transparent; border-color: var(--border); border-style: dashed; }
/* Share-of-days bar (single activity view) */
.az-share       { display: block; width: 100%; max-width: 40px; height: 5px; border-radius: 3px;
                  background: rgba(0,0,0,.08); overflow: hidden; }
.az-share > span { display: block; height: 100%; background: currentColor; border-radius: 3px; }

/* Popup: per-level summary and fixes */
.az-pop-levels  { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 12px; }
.az-pop-level   { border: 1px solid; border-radius: 8px; padding: 6px 4px; text-align: center; font-size: 12px; }
.az-pop-level b { display: block; font-size: 18px; font-variant-numeric: tabular-nums; }
.az-pop-level small { display: block; font-size: 10px; opacity: .8; margin-top: 1px; }
.az-pop-level.az-seg-na { color: var(--muted); }
.az-pop-fix     { display: flex; justify-content: space-between; width: 100%; padding: 9px 12px; margin-top: 6px;
                  background: var(--paper); border: 1px solid var(--border); border-radius: 8px;
                  font: inherit; font-size: 14px; font-weight: 600; color: var(--heading); cursor: pointer; text-align: left; }
.az-pop-fix:hover { border-color: var(--heading); }

/* Suggestions table */
.az-sg          { width: 100%; border-collapse: collapse; font-size: 13px; }
.az-sg th       { text-align: left; font-size: 11px; font-weight: 500; color: var(--muted); text-transform: uppercase;
                  letter-spacing: .05em; padding: 0 8px 6px 0; }
.az-sg td       { padding: 10px 8px 10px 0; border-top: 1px solid var(--border); vertical-align: middle; }
.az-sg tbody tr { cursor: pointer; }
.az-sg tbody tr:hover td { background: var(--paper); }
.az-sg tbody tr:focus-visible { outline: 2px solid var(--heading); outline-offset: -2px; }
.az-sg-name     { font-weight: 600; color: var(--heading); }
.az-sg-meta     { font-size: 12px; color: var(--muted); margin-top: 1px; }
.az-sg-range    { font-weight: 700; color: var(--heading); white-space: nowrap; font-variant-numeric: tabular-nums; }
.az-sg-days     { white-space: nowrap; text-align: right; color: var(--body); font-size: 12px; }
.az-sg-days b   { font-size: 15px; color: var(--heading); font-variant-numeric: tabular-nums; }
.az-strip-inline { max-width: none; gap: 3px; }
.az-strip-inline .az-seg { width: 20px; height: 18px; flex: none; font-size: 10px; line-height: 16px; text-align: center;
                           color: var(--muted); }
.az-seg-on      { background: var(--green-lt); border-color: #b8dcc4; color: var(--green) !important; font-weight: 700; }
.az-pop-item.az-sg-cover { border-left: 4px solid var(--band); padding-left: 10px; }
.az-sg-bandlabel { font-size: 11px; font-weight: 500; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.az-spec        { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; margin: 0; font-size: 14px; }
.az-spec dt     { color: var(--muted); }
.az-spec dd     { margin: 0; color: var(--heading); font-weight: 500; }

/* Suggestion popup: actions and the "I have this item" picker */
.az-pop-foot    { display: flex; gap: 8px; padding: 12px 18px; border-top: 1px solid var(--border); background: white; }
.az-pop-foot .btn { flex: 1; padding: 10px 12px; font-size: 14px; }
.az-pop-back    { font: inherit; font-size: 13px; background: none; border: none; color: var(--body); cursor: pointer;
                  padding: 0; text-decoration: underline; }
.az-pick        { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; font: inherit;
                  background: white; border: none; border-top: 1px solid var(--border); padding: 10px 0; cursor: pointer; }
.az-pick:hover .az-pop-name { text-decoration: underline; }

/* Cell popup */
.az-pop-overlay { position: fixed; inset: 0; background: rgba(28,26,23,.45); z-index: 1000;
                  display: flex; align-items: center; justify-content: center; padding: 16px; }
.az-pop        { background: white; border-radius: 14px; width: 100%; max-width: 440px; max-height: 85vh;
                 display: flex; flex-direction: column; overflow: hidden; box-shadow: 0 12px 40px rgba(0,0,0,.25); }
.az-pop-head   { position: relative; padding: 18px 18px 14px; border-top: 6px solid var(--band);
                 background: var(--paper); border-bottom: 1px solid var(--border); }
.az-pop-range  { font-size: 32px; font-weight: 700; color: var(--heading); line-height: 1.1;
                 font-variant-numeric: tabular-nums; padding-right: 36px; }
.az-pop-band   { font-size: 15px; font-weight: 600; color: var(--body); margin-top: 2px; }
.az-pop-conds  { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.az-pop-cond   { font-size: 13px; background: white; border: 1px solid var(--border); border-radius: 14px; padding: 3px 10px; }
.az-pop-cond b { font-weight: 600; font-variant-numeric: tabular-nums; }
.az-pop-close  { position: absolute; top: 12px; right: 12px; width: 32px; height: 32px; border-radius: 50%;
                 border: 1px solid var(--border); background: white; cursor: pointer; font-size: 14px; color: var(--body); }
.az-pop-body   { padding: 14px 18px 18px; overflow-y: auto; }
.az-pop-sum    { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; color: var(--body); }
.az-pop-item   { display: flex; align-items: center; gap: 12px; padding: 9px 0; border-top: 1px solid var(--border); }
.az-pop-subhead + .az-pop-item { border-top: none; }
.az-pop-name   { font-weight: 600; color: var(--heading); font-size: 14px; }
.az-pop-meta   { font-size: 12px; color: var(--muted); margin-top: 1px; }
.az-pop-share  { flex-shrink: 0; display: flex; align-items: center; gap: 6px; font-size: 12px;
                 color: var(--body); font-variant-numeric: tabular-nums; min-width: 92px; justify-content: flex-end; }
.az-pop-bar    { width: 48px; height: 6px; background: var(--paper); border-radius: 3px; overflow: hidden; }
.az-pop-bar > div { height: 100%; background: var(--green); border-radius: 3px; }

/* Climate strip */
.az-climate     { display: grid; grid-template-columns: repeat(12, 1fr); gap: 4px; }
.az-month       { display: flex; flex-direction: column; align-items: center; font-size: 10px; color: var(--muted);
                  font-variant-numeric: tabular-nums; min-width: 0; }
.az-month-track { position: relative; width: 10px; height: 90px; background: var(--paper); border-radius: 5px; margin: 3px 0; }
.az-month-bar   { position: absolute; left: 0; right: 0; border-radius: 5px; }
.az-month-name  { font-weight: 600; color: var(--body); margin-top: 2px; }
.az-month-wx    { min-height: 13px; }

@media (max-width: 430px) {
  .az-sg-hide   { display: none; }
  .az-climate   { gap: 1px; }
  .az-month     { font-size: 9px; }
  .az-pop-range { font-size: 28px; }
}
