/* Hobby cards (round 11, design-spec R11.3 #3 and R11.4): quiet, flat and typographic. One surface per face, no nested
   panels; colour only in the small tags. The front reads like the bag or the bottle; the back is the brew or the notes.
   Used by /hobbies/, the home (/) and the writer's room, so all three look the same. Tokens come from garden.css. */
:root{
  --cc-bg:#F6F6F7; --cc-back:#FFFFFF;
  --cc-filter:#E3EEDB; --cc-filter-ink:#2F4A1E; --cc-espresso:#E6E4F6; --cc-espresso-ink:#2E2B66; --cc-now:#F6E3D4; --cc-now-ink:#6B3410;
  --cc-perfume:#F1E3EC; --cc-perfume-ink:#5A2E4A; --cc-product:#DDEEF7; --cc-product-ink:#1E4A6B; --cc-other:#DDEEF7; --cc-other-ink:#1E4A6B;
}

.cc{--ctl-w:40px;position:relative;display:block;width:100%;aspect-ratio:4/5;perspective:1400px;border-radius:8px;outline:none;-webkit-tap-highlight-color:transparent;text-align:start;color:var(--ink,var(--fg))}
.cc-in{position:absolute;inset:0;transform-style:preserve-3d;transition:transform 520ms var(--ease,cubic-bezier(.2,.8,.2,1))}
.cc.flipped .cc-in{transform:rotateY(180deg)}
.cc-face{position:absolute;inset:0;display:flex;flex-direction:column;padding:0 20px 20px;border-radius:8px;background:var(--cc-bg);-webkit-backface-visibility:hidden;backface-visibility:hidden;overflow:hidden;transition:background-color var(--d1,.16s) ease}
.cc-front{cursor:pointer}
/* 12m: the flip is a transparent button over the front (the face holds its own controls, so it can't be a button) */
.cc-flip{position:absolute;z-index:3;inset:0;border-radius:inherit;outline:none;cursor:pointer;-webkit-tap-highlight-color:transparent}
.cc-flip:focus-visible{outline:2px solid var(--ink,var(--fg));outline-offset:-2px}
.cc-back{background:var(--cc-back);box-shadow:inset 0 0 0 1px var(--line);transform:rotateY(180deg);gap:10px;padding:0 18px 16px;overflow-y:auto;scrollbar-width:thin;cursor:pointer}
.cc .ri{width:18px;height:18px;flex:none}

/* the label row (40px): «<category> · <section>» at the start; the controls sit at the end, outside the flip */
.cc-top{flex:none;display:flex;align-items:center;height:40px;gap:8px;margin-inline-end:var(--ctl-w,28px);font:400 13px/1.5 var(--font,var(--ar));color:var(--ink-3,var(--muted));white-space:nowrap;overflow:hidden}
.cc-lab{overflow:hidden;text-overflow:ellipsis}
.cc-body{display:flex;flex-direction:column;gap:0;margin-top:auto;padding-top:16px;min-height:0}
/* the small tags (round 12): words, not boxes. A (default) — a small line glyph + the word in ink-2 (filter = a cone,
   espresso = a demitasse); «… الحين» in ink after a small ink dot with a faint halo. B (html.tags-b) — a quiet
   ink-tinted stamp with the word only; «… الحين» as a hairline ink outline. */
.cc-tags{display:flex;flex-wrap:wrap;align-items:center;gap:4px 16px;margin-bottom:12px}
.cc-tags:empty{display:none}
.cc-tag{display:inline-flex;align-items:center;gap:6px;padding:0;background:none;box-shadow:none;font:500 13px/1.6 var(--font,var(--ar));letter-spacing:.01em;color:var(--ink-2,var(--fg));white-space:nowrap}
.cc-ti{width:16px;height:16px;flex:none;fill:none;stroke:currentColor;stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round}
.cc-tag.now{gap:8px;color:var(--ink,var(--fg))}
.cc-tag.now::before{content:'';flex:none;width:6px;height:6px;margin-inline:2px;border-radius:50%;background:currentColor;box-shadow:0 0 0 3px color-mix(in srgb,currentColor 12%,transparent)}
.cc-tag:not(.now):not(:has(.cc-ti))::before{content:'';flex:none;width:9px;height:1.5px;margin-inline-end:1px;background:currentColor;opacity:.55}
html.tags-b .cc-tags{gap:6px}
html.tags-b .cc-tag:not(.now)::before{display:none}
html.tags-b .cc-tag{height:22px;padding-inline:8px;border-radius:3px!important;background:color-mix(in srgb,var(--ink,#111315) 6%,transparent);font:500 12px/1 var(--font,var(--ar));color:var(--ink-2,var(--fg))}
html.tags-b .cc-ti{display:none}
html.tags-b .cc-tag.now{gap:6px;background:none;box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--ink,#111315) 45%,transparent);color:var(--ink,var(--fg))}
html.tags-b .cc-tag.now::before{width:5px;height:5px;margin:0;box-shadow:none}
/* the editorial title: big and light (Latin via Onest 300, Arabic via Thmanyah Light) */
.cc-name{display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden;font:300 30px/1.2 var(--font,var(--en));letter-spacing:0;text-wrap:balance;unicode-bidi:plaintext;color:var(--ink,var(--fg));padding-bottom:.12em;margin-bottom:-.12em}
.cc-meta{margin-top:10px;font:400 14px/1.5 var(--font,var(--ar));color:var(--ink-3,var(--muted))}
.cc-flav{margin-top:4px;font:400 15px/1.6 var(--font,var(--ar));color:var(--ink-2,var(--fg));display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.cc-name,.cc-meta,.cc-flav{text-align:start}
/* the flip hint: a small ↻ that fades in on hover/focus (fine pointers), never on touch */
.cc-turn{position:absolute;inset-block-end:14px;inset-inline-end:14px;width:16px;height:16px;fill:none;stroke:var(--ink-3,var(--muted));stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round;opacity:0;transition:opacity var(--d2,.32s) ease;pointer-events:none}
.cc-flip:focus-visible ~ .cc-turn{opacity:1}
@media (hover:hover) and (pointer:fine){.cc:hover .cc-turn{opacity:1}}

/* pictures on the plain faces: a photo is a rounded image; a sticker is the cut-out itself (object card, C05) */
.hc-img{flex:1 1 0;min-height:0;display:flex;align-items:center;justify-content:center;margin:4px 0 0;overflow:hidden}
.hc-img img{display:block;width:100%;height:100%;max-width:100%;max-height:100%;object-fit:contain;border:0;border-radius:6px;background:none;box-shadow:none;padding:0}
.hc-img.is-sticker{position:absolute;z-index:1;inset:40px 20px 26%;margin:0;overflow:visible;padding:6px}
.hc-img.is-sticker img{border-radius:0;object-fit:contain;max-height:100%}
.cc.has-img:not(.has-sticker) .cc-body{margin-top:0;padding-top:12px}
.cc.has-img .cc-name{font-size:26px;-webkit-line-clamp:2}
/* the object layering: the wash fades the lower part of the picture into the tile, the words sit over it */
.cc.has-sticker .cc-front::after{content:'';position:absolute;z-index:2;inset:0;background:linear-gradient(to top,var(--cc-bg) 0,color-mix(in srgb,var(--cc-bg) 72%,transparent) 24%,transparent 46%);pointer-events:none;transition:opacity var(--d3,.42s) ease}
.cc-body.is-over{position:relative;z-index:3}

/* the controls: top-end, inside each face (12m: they turn with the card). Bare icons in the card's text colour, no
   box (Aziz, 12m); each target 40×40. The pencil only for the owner (html.kg-owner, look.js). */
.cc-ctl{position:absolute;z-index:4;inset-block-start:0;inset-inline-end:2px;display:flex;gap:0;transition:opacity var(--d1,.16s) ease}
.cc-ctl :is(a,button){display:grid;place-items:center;width:36px;height:40px;padding:0;border:0;border-radius:6px;background:none;box-shadow:none;color:var(--ink-2,var(--fg));cursor:pointer;text-decoration:none;position:relative}
.cc-ctl :is(a,button)::before{content:'';position:absolute;inset:0 -2px}
.cc-ctl :is(a,button):hover{background:none;color:var(--ink,var(--fg))}
.cc-ctl :is(a,button):focus-visible{outline:2px solid currentColor;outline-offset:-4px}
.cc-ctl svg{width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}
.cc-ctl [aria-busy="true"]{opacity:.5;cursor:progress}
html:not(.kg-owner) .cc-edit{display:none}
html.kg-owner .cc{--ctl-w:76px}
@media (hover:hover) and (pointer:fine){.cc:not(:hover):not(:focus-within) .cc-ctl > :not(.cc-back-btn){opacity:0}}
.cc-ctl > *{transition:opacity var(--d1,.16s) ease}

/* ---- the backs: white paper, one column of quiet facts */
.cc-bhead{flex:none;display:flex;align-items:center;justify-content:space-between;gap:8px;min-height:44px}
.cc-k{margin:0;font:400 13px/1.5 var(--font,var(--ar));color:var(--ink-3,var(--muted))}
.cc-back-btn{display:inline-flex;align-items:center;min-height:44px;margin-inline-end:-8px;padding:0 8px;border:0;background:none;color:var(--ink-3,var(--muted));font:400 13px/1 var(--font,var(--ar));cursor:pointer}
.cc-back-btn:hover{color:var(--ink,var(--fg))}
.cc-back-btn:focus-visible{outline:2px solid var(--ink,var(--fg));outline-offset:-4px}
/* coffee: the numbers inline, an icon and a value each, no boxes */
.cc-stats{display:flex;flex-wrap:wrap;gap:6px 14px}
.cc-stats span{display:inline-flex;align-items:center;gap:4px;padding:0;border:0;background:none;box-shadow:none}
.cc-stats .ri{width:16px;height:16px;color:var(--ink-3,var(--muted))}
.cc-stats b{font:500 14px/1 var(--font,var(--en));font-variant-numeric:tabular-nums;color:var(--ink,var(--fg))}
.cc-gear{display:flex;flex-wrap:wrap;gap:4px 14px;font-size:14px}
.cc-gear span{display:inline-flex;align-items:center;gap:5px}
.cc-gear b{font-weight:500}
.cc-gear .ri{width:18px;height:18px;color:var(--ink-3,var(--muted))}
.cc-pours{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;font-size:14px;line-height:1.6}
.cc-pours li{display:flex;align-items:center;gap:7px;min-height:26px}
.cc-pours .ri{width:16px;height:16px;color:var(--ink-3,var(--muted))}
.cc-pours b{font-weight:500}
.cc-pours span{font:500 13.5px var(--font,var(--en));font-variant-numeric:tabular-nums}
.cc-pours .t{color:var(--ink-3,var(--muted));font-weight:400}
.cc-pours i{display:inline-flex;align-items:center;gap:3px;font-style:normal;font-size:12.5px;color:var(--ink-3,var(--muted))}
.cc-pours i .ri{width:13px;height:13px}
/* a short dash before the summary, aligned to the start, not a full-width rule */
.cc-dash{display:block;flex:none;width:24px;height:1px;margin:4px 0;background:var(--line-2,var(--line))}
.cc-sum{margin:0;font:400 15px/1.75 var(--font,var(--ar));color:var(--ink,var(--fg))}
.cc-verdict{margin:0;font:500 14px/1.6 var(--font,var(--ar));color:var(--ink-2,var(--fg))}
.hc-notes{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:6px;font-size:14px}
.hc-notes li{display:grid;grid-template-columns:64px 1fr;gap:8px;align-items:baseline}
.hc-notes small{color:var(--ink-3,var(--muted));font-size:12px}
.hc-chips{display:flex;flex-wrap:wrap;gap:5px}
.hc-chip{padding:2px 8px;border-radius:4px;background:var(--tile-2,var(--bg));font-size:12.5px;font-weight:500}
.sr{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}

/* reduced motion: no rotation, a 160ms crossfade */
@media (prefers-reduced-motion:reduce){
  .cc-in{transition:none;transform:none!important}
  .cc-back{transform:none;opacity:0;transition:opacity 160ms ease}
  .cc-front{transition:opacity 160ms ease}
  .cc.flipped .cc-back{opacity:1}
  .cc.flipped .cc-front{opacity:0}
  .cc-turn{transition:none}
}

/* the gallery: 1 column on phones, 2 from 600, then as many 260px columns as fit */
.cc-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(260px,1fr));gap:var(--gap,10px)}
.cc-empty{grid-column:1/-1;padding:56px 16px;text-align:center;color:var(--muted)}
.cc-grid .cc{animation:ccIn .5s cubic-bezier(.22,1,.36,1) both}
@keyframes ccIn{from{opacity:0}}
@media (prefers-reduced-motion:reduce){.cc-grid .cc{animation:none}}
@media (max-width:767px){.cc-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}}
@media (max-width:599px){.cc-grid{grid-template-columns:minmax(0,1fr)}.cc{aspect-ratio:1/1}}

/* desktop hover, by content (R11.3): coffee peeks (tilts away from its start edge); a sticker comes forward */
@media (hover:hover) and (pointer:fine){
  .cc.has-sticker:not(.flipped):hover .hc-img.is-sticker img{transform:translateY(-10px) rotate(-2deg);filter:drop-shadow(var(--ow) 0 0 var(--ol)) drop-shadow(calc(var(--ow) * -1) 0 0 var(--ol)) drop-shadow(0 var(--ow) 0 var(--ol)) drop-shadow(0 calc(var(--ow) * -1) 0 var(--ol)) drop-shadow(0 14px 14px rgba(15,20,25,.18))}
  .cc.has-sticker:not(.flipped):hover .cc-front::after{opacity:.55}
}
.hc-img.is-sticker img{transition:transform var(--d3,.42s) var(--ease-spring,ease),filter var(--d3,.42s) ease}
html[dir="ltr"] .cc:hover .cc-in{transform-origin:0 50%}

/* ---- the perfume card (R11.4): always square; 'full' = the photo fills it, 'framed' = a smaller picture on white */
.cc.pf,html[data-look="garden"] .cc.pf{aspect-ratio:1/1}
.cc.pf .cc-front{padding:0;gap:0;overflow:hidden}
.pf-media{position:absolute;inset:0;display:block;overflow:hidden;border-radius:0!important}
.pf-media .pf-photo{position:absolute;inset:0;display:block;width:100%;height:100%;max-width:none;max-height:none;object-fit:cover;object-position:var(--fx,50%) var(--fy,50%);border-radius:0!important;padding:0;border:0;box-shadow:none;transition:object-position var(--d-pan,.9s) var(--ease,ease)}
.pf-blank{position:absolute;inset:0;display:grid;place-items:center;color:var(--ink-3,var(--muted));opacity:.35}
.pf-blank .ri{width:56px;height:56px}
/* the quiet words: family · «عطر <month>» · «أستخدمه الحين», plain text */
.pf-over{position:relative;z-index:1;display:flex;flex-wrap:wrap;align-items:center;align-content:center;gap:0 7px;min-height:40px;padding:10px 16px;padding-inline-end:calc(var(--ctl-w,28px) + 16px);font:400 13px/1.45 var(--font,var(--ar));pointer-events:none}
.pf-over:empty{visibility:hidden}
.pf-over i{font-style:normal;opacity:.6}
.pf-info{position:relative;z-index:1;display:flex;flex-direction:column;gap:2px;padding:8px 16px 16px}
.pf-name{display:block;font-family:var(--font,var(--ar));line-height:1.25;text-align:start;overflow:hidden;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical}
.pf-name b{font-weight:500;font-size:20px;letter-spacing:0}
.pf-name small{font-weight:300;font-size:13px;color:var(--ink-3,var(--muted));white-space:nowrap;margin-inline-start:4px}
.pf-brand{font:400 13px/1.5 var(--font,var(--ar));color:var(--ink-3,var(--muted));text-align:start}
/* full: the photo underneath, a light top wash for the words and a soft bottom fade for the name (max .34/.42) */
.pf-full .cc-front{background:var(--tile)}
.pf-full .pf-over{position:absolute;inset:0 0 auto}
.pf-full .pf-info{position:absolute;inset:auto 0 0;padding:16px}
.pf-full .pf-name b{font-size:22px}
.pf-full .pf-name{line-height:1.2}
.pf-full .pf-media::before,.pf-full .pf-media::after{content:'';position:absolute;z-index:1;inset:0;pointer-events:none}
.pf-full .pf-media[data-tone="light"]::before,.pf-full .pf-media[data-tone="auto"]::before{background:linear-gradient(to bottom,rgba(10,14,20,.14),transparent 30%)}
.pf-full .pf-media[data-tone="dark"]::before{background:linear-gradient(to bottom,rgba(255,255,255,.20),transparent 30%)}
.pf-full .pf-media:is([data-tone-b="light"],[data-tone-b="auto"])::after{background:linear-gradient(to top,rgba(10,12,14,.34) 0,rgba(10,12,14,.14) 24%,transparent 44%)}
.pf-full .pf-media[data-tone-b="dark"]::after{background:linear-gradient(to top,rgba(255,255,255,.42) 0,rgba(255,255,255,.16) 26%,transparent 46%)}
.pf-full:has(.pf-media:is([data-tone="light"],[data-tone="auto"])) .pf-over{color:#fff;text-shadow:0 1px 2px rgba(0,0,0,.18)}
.pf-full:has(.pf-media[data-tone="dark"]) .pf-over{color:#111315}
.pf-full:has(.pf-media:is([data-tone-b="light"],[data-tone-b="auto"])) .pf-info :is(.pf-name,.pf-name small,.pf-brand){color:#fff;text-shadow:0 1px 2px rgba(0,0,0,.2)}
.pf-full:has(.pf-media[data-tone-b="dark"]) .pf-info :is(.pf-name,.pf-name small,.pf-brand){color:#111315}
/* framed: three rows — the words (never over the picture), the picture centred, the name */
.pf-framed .cc-front{display:grid;grid-template-rows:40px minmax(0,1fr) auto;background:var(--paper,#fff);box-shadow:inset 0 0 0 1px var(--line)}
.pf-framed .pf-over{grid-row:1;display:block;align-self:center;color:var(--ink-3,var(--muted));min-height:0;padding-block:0;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}
.pf-framed .pf-over i{margin-inline:5px}
.pf-framed .pf-media{position:relative;inset:auto;grid-row:2;display:flex;align-items:center;justify-content:center;min-height:0;margin-block:4px;overflow:visible}
.pf-framed .pf-media .pf-photo,.pf-framed .pf-media .pf-cut{position:static;display:block;width:auto;height:auto;max-width:62%;max-height:100%;object-fit:contain;transition:transform var(--d3,.42s) var(--ease-spring,ease),filter var(--d3,.42s) ease}
.pf-framed .pf-media .pf-photo{border-radius:6px!important}
.pf-framed .pf-blank{position:static}
.pf-framed .pf-info{grid-row:3;padding:8px 16px 16px}
.pf-framed .pf-name b,.pf-framed .pf-name{color:var(--ink,var(--fg))}
/* hover by content: full pans the photo up a little and lifts the name; framed brings the bottle forward */
@media (hover:hover) and (pointer:fine){
  .pf-full:not(.flipped):hover .pf-photo{object-position:var(--fx,50%) calc(var(--fy,50%) - 3%)}
  .pf-full:not(.flipped):hover .pf-info{transform:translateY(-3px)}
  .pf-framed:not(.flipped):hover .pf-media :is(.pf-photo,.pf-cut){transform:translateY(-8px) rotate(-2deg)}
  .pf-framed:not(.flipped):hover .pf-media .pf-photo{filter:drop-shadow(0 12px 12px rgba(15,20,25,.16))}
}
.pf-info{transition:transform var(--d2,.32s) var(--ease,ease)}
@media (prefers-reduced-motion:reduce){.pf-info,.pf-media :is(.pf-photo,.pf-cut),.hc-img.is-sticker img{transition:none!important;transform:none!important}}
/* the perfume back: notes, then ONE emoji row — seasons at the start (right), times at the end (left) — then the words */
.pf-times{display:flex;justify-content:space-between;align-items:center;gap:8px;font-size:20px;line-height:1.4}
.pf-times > span{display:inline-flex;gap:8px}
.pf-exp{display:flex;flex-direction:column;gap:4px}
.pf-exp small{font-size:12px;color:var(--ink-3,var(--muted))}
.pf-exp p{margin:0;font-size:15px;line-height:1.8}
.cc.pf .cc-back{gap:12px}
.cc.pf .cc-back .hc-notes{gap:8px}

/* ---- the writer's room */
.kg-pick{display:flex;flex-direction:column;gap:6px}
.kg-pick select{width:100%;height:40px;padding:0 10px;border:1px solid var(--line-2,var(--line));background:var(--field,#fff);color:var(--fg);font:500 15px var(--ar)}
.kg-pick input[hidden]{display:none}
.cr-chips.brews button{display:inline-flex;align-items:center;gap:6px}
.cr-chips.brews button svg{width:18px;height:18px;flex:none}


/* the room: the small thumbnail follows the same rule, and the sticker controls under it */
.cr-sw{position:relative;display:inline-grid;place-items:center;width:32px;height:32px;padding:0;border:1px solid var(--line-2,var(--line));border-radius:6px;background:var(--bg);cursor:pointer}
.cr-sw i{display:block;width:20px;height:20px;border-radius:4px;background:var(--c);box-shadow:inset 0 0 0 1px rgba(24,32,27,.22)}
.cr-sw[aria-checked="true"]{border-color:var(--fg);box-shadow:0 0 0 1.5px var(--fg)}
.cr-sw:focus-visible{outline:2px solid var(--fg);outline-offset:2px}
.cr-sw.custom{width:auto;padding:0 8px 0 4px;gap:6px;grid-auto-flow:column;font:600 12.5px var(--ar);color:var(--fg)}
.cr-sw.custom input{position:absolute;inset:0;width:100%;height:100%;opacity:0;cursor:pointer;border:0;padding:0}
html[data-look="garden"] .cr-sw,html[data-look="garden"] .cr-sw.custom{border-radius:6px}
.cr-ol-set{display:inline-flex;gap:6px}
.cr-sw.custom.on{border-color:var(--fg);box-shadow:0 0 0 1.5px var(--fg)}
.cr-sw.custom:focus-within{outline:2px solid var(--fg);outline-offset:2px}


/* round 6 (Aziz): filters are plain words in a row. No boxes, no icons; the chosen one is ink with a thin
   underline, the rest muted; hover darkens; keyboard focus shows a ring. (The hobby room's "new card" row
   uses the same words, without an underline since nothing there is "chosen".) */
.cc-filter{gap:4px 20px}
.cc-filter button,html[data-look="garden"] .cc-filter button{position:relative;display:inline-flex;align-items:center;gap:0;min-height:36px;padding:4px 1px;border:0;background:none;box-shadow:none;color:var(--muted);font:600 15px var(--ar,inherit);cursor:pointer;transition:color .15s}
.cc-filter button::after{content:"";position:absolute;inset-inline:1px;bottom:3px;height:1.5px;background:currentColor;transform:scaleX(0);transition:transform .2s ease}
.cc-filter button:hover,html[data-look="garden"] .cc-filter button:hover{color:var(--ink,var(--fg));background:none}
.cc-filter button[aria-pressed="true"],html[data-look="garden"] .cc-filter button[aria-pressed="true"]{color:var(--ink,var(--fg));background:none;border:0}
.cc-filter button[aria-pressed="true"]::after{transform:none}
.cc-filter button:focus-visible{outline:2px solid var(--ink,var(--fg));outline-offset:3px}
.cc-filter .ri{display:none}
@media (prefers-reduced-motion:reduce){.cc-filter button::after{transition:none}}


/* the room: the square crop you drag */
.cr-cropbox{display:flex;flex-direction:column;gap:10px;width:100%;padding-top:4px}
.cr-crop-k{font-size:13px;color:var(--muted)}
.cr-crop{position:relative;width:min(100%,240px);aspect-ratio:1/1;overflow:hidden;border-radius:8px;cursor:grab;touch-action:none;background:var(--tile,#EFF2F4);box-shadow:inset 0 0 0 1px var(--line)}
.cr-crop.drag{cursor:grabbing}
.cr-img .cr-crop img,.cr-crop img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;object-position:var(--fx,50%) var(--fy,50%);border-radius:0;background:none;user-select:none;-webkit-user-drag:none;pointer-events:none}
.cr-range{display:grid;grid-template-columns:96px 1fr;align-items:center;gap:10px;max-width:360px;font-size:13px;color:var(--muted)}
.cr-range input{width:100%;accent-color:var(--ink,var(--fg))}
.cr-cropbox .cr-f{padding:0}
.cr-cropbox > .btn{align-self:flex-start}

.cr-layout{display:flex;flex-direction:column;gap:6px}
/* r11 review: the object wash is for object cards whose words sit over the picture, never for the framed perfume */
.cc.pf-framed .cc-front::after{content:none}
/* coffee stays square everywhere, however long its words (Aziz, round 11b) */
.cc.hc-coffee,html[data-look="garden"] .cc.hc-coffee{aspect-ratio:1/1}
/* round 11b's in-place grow of a long back is gone (12m): the enlarge button opens the card big instead (below) */

/* round 11c: the flip hint sits on the side away from the name: bottom-right for Latin names (they start left), bottom-left for Arabic */
.cc.name-ltr .cc-turn{inset-inline-end:auto;inset-inline-start:14px}
/* الثبات والفوحان out of 5: quiet dots in a row under the experience and the verdict */
.pf-rates{display:flex;flex-wrap:wrap;gap:6px 20px;padding-top:6px}
.pf-rate{display:inline-flex;align-items:center;gap:8px;font-size:12.5px;color:var(--ink-3,var(--muted))}
.pf-dots{display:inline-flex;gap:4px}
.pf-dots i{width:8px;height:8px;border-radius:50%!important;box-shadow:inset 0 0 0 1.4px color-mix(in srgb,var(--ink,#111315) 28%,transparent)}
.pf-dots i.on{background:var(--ink-2,#3B3F44);box-shadow:none}

/* ---- the book card (round 11f): square like the rest. The cover stands on the left like a book on a shelf (a real
   object, its own proportions, a soft shadow); beside it a small grey status, the title and the author. */
.cc.hc-book,html[data-look="garden"] .cc.hc-book{aspect-ratio:1/1}
.hc-book .cc-front{background:var(--tile,#F6F6F7)}
.bk-row{flex:1 1 auto;min-height:0;display:flex;flex-direction:row-reverse;align-items:center;gap:20px;padding:6px 4px 4px}
.bk-cover{flex:none;height:78%;max-height:240px;aspect-ratio:2/3;display:flex;align-items:center;justify-content:center;transform:translateY(calc(var(--hv,0) * -4px)) rotate(calc(var(--hv,0) * -1deg));transition:transform .45s cubic-bezier(.2,.8,.2,1)}
.bk-cover img{display:block;max-width:100%;max-height:100%;width:auto;height:auto;object-fit:contain;border-radius:2px 4px 4px 2px!important;box-shadow:0 1px 2px rgba(15,20,25,.14),0 10px 22px -10px rgba(15,20,25,.38)}
.bk-blank{display:grid;place-items:center;width:100%;height:100%;padding:12px;border-radius:2px 4px 4px 2px;background:var(--sand,#E9EAEC);box-shadow:inset 6px 0 0 rgba(0,0,0,.06),0 10px 22px -12px rgba(15,20,25,.35);font:500 13px/1.35 var(--font);color:var(--ink-2);text-align:center;overflow:hidden}
.bk-info{flex:1 1 auto;min-width:0;display:flex;flex-direction:column;align-items:flex-start;gap:4px;text-align:start}
/* the reading state, top row opposite the label: a 16px line icon and the word (A plain; B on the ink-tinted stamp) */
.bk-st{flex:none;display:inline-flex;align-items:center;gap:7px;font:500 12.5px/1.5 var(--font);color:var(--ink-2,var(--fg))}
.bk-st.is-read{color:var(--ink-3,var(--muted))}
.bk-ic{width:17px;height:17px;flex:none;fill:none;stroke:currentColor;stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round}
html.tags-b .bk-st{padding:1px 8px 1px 7px;border-radius:3px!important;background:color-mix(in srgb,var(--ink,#111315) 6%,transparent);font-size:12px;color:var(--ink-2,var(--fg))}
.bk-title{font:500 17px/1.35 var(--font);color:var(--ink);display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden;overflow-wrap:anywhere;align-self:stretch}
.bk-author{font:400 14px/1.45 var(--font);color:var(--ink-3,var(--muted));align-self:stretch}
@media (hover:hover) and (pointer:fine){.cc.hc-book:hover{--hv:1}}
@media (prefers-reduced-motion:reduce){.bk-cover{transition:none;transform:none}}
.cc.name-ltr .bk-info{align-items:flex-end}

/* ---- coffee without a photo (round 11g): the name big and up in the middle; the roaster apart from the coffee */
.hc-coffee:not(.has-img) .cc-body{margin-block:auto;padding-top:0;position:relative;z-index:1}
.hc-coffee:not(.has-img) .cc-name{font-size:clamp(32px,3vw,42px);line-height:1.1;-webkit-line-clamp:3}
.hc-coffee:not(.has-img) .cc-tags{margin-bottom:10px}
.hc-coffee:not(.has-img) .cc-meta{margin-top:12px}
.cc-top{justify-content:space-between}
/* option 1: quietly at the top, opposite the label */
.cc-roaster{flex:none;max-width:50%;overflow:hidden;text-overflow:ellipsis;padding:1px 8px;border-radius:4px!important;background:color-mix(in srgb,var(--ink,#111315) 5%,transparent);color:var(--ink-2,var(--fg));font:500 12.5px/1.6 var(--font)}
/* option 2: the roaster large and faint behind the words, inside the card's margins */
.cc-mark{position:absolute;z-index:0;inset-inline:14px;inset-block-end:-.16em;display:block;white-space:nowrap;overflow:hidden;font:600 clamp(56px,6vw,84px)/1 var(--font);letter-spacing:-.02em;color:color-mix(in srgb,var(--ink,#111315) 6%,transparent);text-align:start;unicode-bidi:plaintext;pointer-events:none}
.hc-coffee:has(.cc-mark) .cc-body{margin-block:auto 54px}
.hc-coffee:has(.cc-mark) .cc-name{font-size:clamp(28px,2.6vw,36px)}
.cc.name-ltr .cc-tags{justify-content:flex-end}
/* roaster mark (approved): long names step down and may take two lines, still anchored to the bottom edge */
.cc-mark{white-space:normal;display:block;max-height:1.95em;line-height:.95;overflow:hidden;overflow-wrap:anywhere}
.cc-mark.is-long{font-size:clamp(40px,4.2vw,58px)}
.cc-mark.is-xlong{font-size:clamp(24px,2.4vw,32px)}
.hc-coffee:has(.cc-mark.is-long) .cc-body,.hc-coffee:has(.cc-mark.is-xlong) .cc-body{margin-bottom:64px}
/* Aziz (12b): the book status sits top-left in the same faded grey and weight as «قراءة · أكتوبر» */
.bk-st,.bk-st.is-read{font:400 13px/1.5 var(--font);color:var(--ink-3,var(--muted))}
.bk-st svg{opacity:.9}
/* 12e (Aziz): the top-corner words — book status and the coffee's brew — are plain words in the label's grey, no icons */
.bk-st,.bk-st.is-read{gap:0;font:400 13px/1.5 var(--font);color:var(--ink-3,var(--muted))}
.bk-st svg{display:none}
.cc-kinds{flex:none;display:flex;flex-direction:column;align-items:flex-end;gap:0;font:400 13px/1.45 var(--font);color:var(--ink-3,var(--muted));text-align:end}
.cc-top:has(.cc-kinds > :nth-child(2)){align-items:flex-start;height:auto;min-height:40px;padding-top:11px}
.cc-kinds .cc-roaster{margin-top:4px}
/* the editor's month: two quiet selects */
.cr-month-row{display:flex;gap:8px}
.cr-month-row select{height:44px;min-width:0;flex:1 1 0;padding:0 12px;border:1px solid var(--line-2,var(--line));border-radius:var(--r-ctl,6px);background:var(--paper,#fff);color:var(--ink,var(--fg));font:400 15px var(--font)}
.cr-month-row select:disabled{opacity:.45}
/* 12e (Aziz, like the reference): the book and its words sit low in the card, the space above left open */
.bk-row{align-items:flex-end;padding:0 4px 6px}
.bk-cover{height:70%;align-items:flex-end}
.bk-info{padding-bottom:4px}
/* 12f: a bigger book */
.bk-cover{height:80%;max-height:300px}
.bk-row{padding-bottom:14px}
/* 12g (Aziz): every hobby card front shares the perfume's white with a hairline — no second shade */
.cc:not(.pf-full) .cc-front,.hc-book .cc-front,.hc-coffee .cc-front{background:var(--paper,#fff);box-shadow:inset 0 0 0 1px var(--line)}
.cc:not(.pf-full):hover .cc-front{background:var(--paper,#fff)}
/* 12h (Aziz): the corner word sits at the card's edge. On a mouse the owner/download buttons appear there only on
   hover, so the corner word steps aside (fades) while they show; on touch, where the buttons stay, keep the gap. */
@media (hover:hover) and (pointer:fine){
  .cc-top{margin-inline-end:0}
  .cc-top :is(.bk-st,.cc-kinds){transition:opacity var(--d1,.16s) ease}
  .cc:is(:hover,:focus-within) .cc-top :is(.bk-st,.cc-kinds){opacity:0}
}

/* 12i: every card flips the same smooth way as the perfume (no hover tilt that hijacked the flip back) */
/* «غيرها» with a photo: the square photo fills the card; the optional word and title sit on it */
.cc.ot-full .cc-front{padding:0;overflow:hidden;background:var(--tile,#F6F6F7);box-shadow:none}
.ot-media{position:absolute;inset:0;overflow:hidden}
.ot-photo{display:block;width:100%;height:100%;object-fit:cover;object-position:var(--fx,50%) var(--fy,50%);border-radius:0!important}
.ot-lab{position:absolute;z-index:1;inset-inline:0;top:0;padding:12px 16px 26px;font:400 13px/1.5 var(--font);color:#fff;text-shadow:0 1px 2px rgba(0,0,0,.2);background:linear-gradient(to bottom,rgba(10,14,20,.24),rgba(10,14,20,0))}
.ot-cap{position:absolute;z-index:1;inset-inline:0;bottom:0;display:flex;flex-direction:column;gap:2px;padding:36px 18px 16px;color:#fff;background:linear-gradient(to top,rgba(10,14,20,.38),rgba(10,14,20,0));text-align:start}
.ot-title{font:500 20px/1.25 var(--font);text-shadow:0 1px 3px rgba(0,0,0,.25)}
.ot-sub{font:400 13px/1.45 var(--font);opacity:.9}
.cc.ot-full .cc-turn{stroke:#fff}
.cc.ot-full,html[data-look="garden"] .cc.ot-full{aspect-ratio:1/1}

/* ---- 12m «بطاقة التركيز»: the enlarge button and the big card (journal/src/card-focus.js), motion «سينما»; values in
   docs/decisions.md 12m. */
/* bare icons over a photo (full perfume, «غيرها» photo): white with a soft shadow; ink when the photo is bright */
.cc:is(.pf-full,.ot-full) .cc-front .cc-ctl :is(a,button),.cc:is(.pf-full,.ot-full) .cc-front .cc-ctl :is(a,button):hover{color:#fff;filter:drop-shadow(0 1px 2px rgba(0,0,0,.38))}
.cc.pf-full .cc-front:has(.pf-media[data-tone="dark"]) .cc-ctl :is(a,button){color:var(--ink,#111315);filter:none}
/* the button: in each face's controls, at the corner; the download and pencil step inward beside it. On a mouse the
   controls show on hover; on touch they stay. */
.cc.has-zoom{--ctl-w:76px}
html.kg-owner .cc.has-zoom{--ctl-w:112px}
.cc-ctl .cc-zoom{order:9}
.cc-zoom .cz-in,.cc.cf-on .cc-zoom .cz-out{display:none}
.cc.cf-on .cc-zoom .cz-in{display:inline}
/* the back's «رجوع» steps inward from the controls' corner */
.cc-back .cc-bhead{padding-inline-end:max(0px,calc(var(--ctl-w) - 18px))}
body.kh-editing .cc-zoom{display:none}
/* the slot keeps its size while the card is away: a quiet tint, no frame. The ghost is a still copy of the grid
   card used only for the cross-fade at both ends of the trip. */
.cc-ph{position:relative;display:block;width:100%;border-radius:8px;background:color-mix(in srgb,var(--ink,#111315) 3.5%,transparent);box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--ink,#111315) 5%,transparent)}
.kc-hcard > .cc-ph{position:absolute;inset:0;width:auto;aspect-ratio:auto!important}
.cc-ph > .cc-ghost{position:absolute;inset:0;width:auto;height:auto;aspect-ratio:auto!important;animation:none!important;pointer-events:none}
.cc-ph > .cc-ghost .cc-in{transition:none}
/* the layer: the page behind recedes (scale .96, in JS) under blur 18px and a dark dim; the card above it */
@property --cf-l{syntax:'<number>';inherits:true;initial-value:1}
.cf-layer{position:fixed;inset:0;z-index:1000}
.cf-scrim{position:absolute;inset:0;background:rgba(10,12,14,.42);-webkit-backdrop-filter:blur(18px) saturate(.9);backdrop-filter:blur(18px) saturate(.9)}
.cf-dlg{position:fixed;margin:0;padding:0;transform-origin:50% 50%;outline:none;--cf-l:1}
.cf-lift{position:absolute;inset:0}
.cf-zoom{position:absolute;top:0;left:0}
.cf-layer .cc.cf-on{position:relative;margin:0;aspect-ratio:auto!important;animation:none!important;transition:none}
.cf-layer .cc.cf-on .cc-ctl,.cf-layer .cc.cf-on .cc-ctl > *{opacity:1!important}
.cf-layer .cc.cf-on .cc-face{box-shadow:var(--cf-in,inset 0 0 0 1px var(--line)),0 calc(44px*var(--cf-l)) calc(90px*var(--cf-l)) calc(-28px*var(--cf-l)) rgba(0,0,0,calc(.5*var(--cf-l)))}
.cf-layer .cc.cf-on:is(.pf-full,.ot-full) .cc-front{--cf-in:0 0 0 0 transparent}
/* the flip while big: a quick page turn, closer perspective (the card also dips to .965, in JS) */
@media (prefers-reduced-motion:no-preference){
  .cf-layer .cc.cf-on{perspective:900px}
  .cf-layer .cc.cf-on .cc-in{transition:transform 420ms cubic-bezier(.7,0,.2,1)}
}
/* 12q: the owner's line breaks in the back's text are kept */
.cc-sum,.cc-verdict{white-space:pre-line}
/* 12s: roaster watermark — one line, sized by script to the card's width, nothing clipped, never under the words */
.cc-mark,.cc-mark.is-long,.cc-mark.is-xlong{white-space:nowrap;overflow:visible;max-height:none;line-height:1.15;inset-block-end:2px;font-size:48px}
.hc-coffee:has(.cc-mark) .cc-body,.hc-coffee:has(.cc-mark.is-long) .cc-body,.hc-coffee:has(.cc-mark.is-xlong) .cc-body{margin-bottom:var(--mkh,60px)}

/* 13y (Aziz): the back's way home (↻) sits in the head row's corner with the other icons and never fades; the head
   stays, the words below fit the card (bk-1 / bk-2 from fitBack) and only scroll, with a fade, if they still can't */
.cc-back{overflow:hidden;padding-bottom:14px}
.cc-ctl .cc-back-btn{order:10;min-height:0;margin:0;color:var(--ink-2,var(--fg))}
.cc-ctl .cc-back-btn .cc-turn{position:static;width:17px;height:17px;opacity:1;stroke:currentColor;transform:scaleX(-1)}
.cc.can-flip .cc-back .cc-bhead{padding-inline-end:calc(var(--ctl-w) + 18px)}
.cc-bbody{flex:1 1 auto;min-height:0;display:flex;flex-direction:column;gap:inherit;overflow-y:auto;overscroll-behavior:contain;scrollbar-width:none;margin-inline:-18px;padding-inline:18px;padding-bottom:2px}
.cc-bbody::-webkit-scrollbar{display:none}
.cc-bbody > *{flex:none}
.cc-bbody.more-down{-webkit-mask-image:linear-gradient(to bottom,#000 calc(100% - 36px),transparent);mask-image:linear-gradient(to bottom,#000 calc(100% - 36px),transparent);padding-bottom:20px}
.cc-bbody.more-up{-webkit-mask-image:linear-gradient(to bottom,transparent,#000 24px);mask-image:linear-gradient(to bottom,transparent,#000 24px)}
.cc-bbody.more-up.more-down{-webkit-mask-image:linear-gradient(to bottom,transparent,#000 24px,#000 calc(100% - 36px),transparent);mask-image:linear-gradient(to bottom,transparent,#000 24px,#000 calc(100% - 36px),transparent)}
/* tighter */
.cc.bk-1 .cc-back{gap:7px}
.cc.bk-1 .cc-bhead{min-height:40px}
.cc.bk-1 .hc-notes,.cc.pf.bk-1 .cc-back .hc-notes{gap:3px}
.cc.bk-1 :is(.cc-sum,.pf-exp p){font-size:14px;line-height:1.6}
.cc.bk-1 .pf-exp{gap:1px}
.cc.bk-1 .pf-times{font-size:17px;line-height:1.3}
.cc.bk-1 .pf-rates{padding-top:2px}
.cc.bk-1 .cc-pours li{min-height:23px}
.cc.bk-1 .cc-dash{margin:2px 0}
/* and a touch smaller (never under 13px for the words) */
.cc.bk-2 .cc-back{gap:5px}
.cc.bk-2 .cc-bhead{min-height:38px}
.cc.bk-2 :is(.cc-sum,.pf-exp p){font-size:13px;line-height:1.55}
.cc.bk-2 :is(.hc-notes,.cc-pours,.cc-gear){font-size:13px}
.cc.bk-2 .cc-verdict{font-size:13px;line-height:1.5}
.cc.bk-2 .pf-times{font-size:15px}
.cc.bk-2 .cc-pours li{min-height:21px}
/* the brew numbers: an even grid (3 across; 2 across when there are 4) */
.cc-stats{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px 10px}
.cc-stats[data-n="4"],.cc-stats[data-n="2"]{grid-template-columns:repeat(2,minmax(0,1fr))}
.cc-stats span{min-width:0;white-space:nowrap}

/* 13y (Aziz): the flip hint is always there on a card that turns (quiet, the thin ↻ in the corner); a card with no
   back has none and opens big on a tap */
.cc.can-flip .cc-front > .cc-turn{opacity:.5}
@media (hover:hover) and (pointer:fine){.cc.can-flip:hover .cc-front > .cc-turn{opacity:.95}}
.cc.can-flip .cc-flip:focus-visible ~ .cc-turn{opacity:.95}
.cc-flip.cc-open{cursor:zoom-in}
.cc.cf-on .cc-flip.cc-open{cursor:default}
.cc.pf-full .cc-front > .cc-turn{stroke:#fff;filter:drop-shadow(0 1px 2px rgba(0,0,0,.3))}
.cc.pf-full .cc-front:has(.pf-media[data-tone-b="dark"]) > .cc-turn{stroke:#111315;filter:none}
.cc.ot-full .cc-front > .cc-turn{filter:drop-shadow(0 1px 2px rgba(0,0,0,.35))}
.cc.pf-full .cc-front > .cc-turn,.cc.ot-full .cc-front > .cc-turn{z-index:2}
.cc.can-flip.pf-full .cc-front > .cc-turn,.cc.can-flip.ot-full .cc-front > .cc-turn{opacity:.8}

/* 13y (Aziz): big, a photo card shows the photo clean — the words, the washes and the icons fade out and come back
   while the pointer is on the card, on keyboard focus, or after a tap on touch (.cf-show, hobby-card.js) */
.cf-layer .cc.cf-on:is(.pf-full,.ot-full) .cc-front :is(.pf-over,.pf-info,.ot-lab,.ot-cap,.cc-turn),
.cf-layer .cc.cf-on.pf-full .cc-front .pf-media::before,.cf-layer .cc.cf-on.pf-full .cc-front .pf-media::after{opacity:0;transition:opacity .25s ease}
.cf-layer .cc.cf-on:is(.pf-full,.ot-full) .cc-front .cc-ctl > *{opacity:0!important;transition:opacity .25s ease}
.cf-layer .cc.cf-on:is(.pf-full,.ot-full):is(.cf-show,:has(.cc-front :focus-visible)) .cc-front :is(.pf-over,.pf-info,.ot-lab,.ot-cap,.cc-turn),
.cf-layer .cc.cf-on.pf-full:is(.cf-show,:has(.cc-front :focus-visible)) .cc-front .pf-media::before,.cf-layer .cc.cf-on.pf-full:is(.cf-show,:has(.cc-front :focus-visible)) .cc-front .pf-media::after{opacity:1}
.cf-layer .cc.cf-on:is(.pf-full,.ot-full):is(.cf-show,:has(.cc-front :focus-visible)) .cc-front .cc-ctl > *{opacity:1!important}
@media (hover:hover) and (pointer:fine){
  .cf-layer .cc.cf-on:is(.pf-full,.ot-full):hover .cc-front :is(.pf-over,.pf-info,.ot-lab,.ot-cap,.cc-turn),
  .cf-layer .cc.cf-on.pf-full:hover .cc-front .pf-media::before,.cf-layer .cc.cf-on.pf-full:hover .cc-front .pf-media::after{opacity:1}
  .cf-layer .cc.cf-on:is(.pf-full,.ot-full):hover .cc-front .cc-ctl > *{opacity:1!important}
}
@media (prefers-reduced-motion:reduce){.cf-layer .cc.cf-on .cc-front *{transition-duration:.01s!important}}

/* 13y (Aziz): the cut-out as a paper sticker (details.sticker_look): white or kraft card, hand-cut, a few creases and a
   grain; SVG filters from hobby-card.js (ensureStickerDefs). 'plain' keeps the traced line above. */
.kg-sticker.stk-white{filter:url(#kg-stk-white)!important}
.kg-sticker.stk-kraft{filter:url(#kg-stk-kraft)!important}
html[data-theme="dark"] #kg-stk-defs .stk-sh{flood-opacity:.55}

/* 14b (Aziz, an iPad visitor): Safari can ignore backface-visibility when a face holds its own layers (the scrolling
   back, filtered stickers, photos), so the front showed mirrored through the back. The hidden face now also turns
   invisible at the half-way point of the turn (edge-on, 260ms of 520ms), which works in every browser. */
.cc .cc-face{transition:visibility 0s linear 300ms}
.cc.flipped .cc-front,.cc:not(.flipped) .cc-back{visibility:hidden}
.cc .cc-front{-webkit-transform:translateZ(1px);transform:translateZ(1px)}
@media (prefers-reduced-motion:reduce){.cc .cc-face{transition:none}}

/* 14e (Aziz): on photo cards the turn arrow sits bottom-left, clear of the caption (the words sit on the right) */
.cc.ot-full .cc-front > .cc-turn{inset-inline-start:auto!important;inset-inline-end:14px!important}
/* no double-tap zoom on cards (iOS) */
.cc{touch-action:manipulation}

/* 14i (Aziz): the turn felt abrupt — a calm, symmetric turn (edge-on exactly half-way, where the hidden face swaps
   in Safari's fallback above): 600ms on the page, 680ms when the card is open big */
.cc-in{transition:transform 600ms cubic-bezier(.45,.05,.55,.95)!important}
.cf-layer .cc.cf-on .cc-in{transition:transform 680ms cubic-bezier(.45,.05,.55,.95)!important}
.cf-layer .cc.cf-on .cc-face{transition:visibility 0s linear 340ms}
@media (prefers-reduced-motion:reduce){.cc-in,.cf-layer .cc.cf-on .cc-in{transition:none!important}}
