Jump to content

MediaWiki:Gadget-GrAnnotations.css: Difference between revisions

From Anandamakaranda
No edit summary
No edit summary
 
(3 intermediate revisions by the same user not shown)
Line 1: Line 1:
/*
/*
  * gr_annotations.css  —  grantha.io inline comments + bookmarks
  * gr_annotations.css  —  grantha.io inline Notes + Bookmarks + Feedback (v3)
* ═══════════════════════════════════════════════════════════════
* Standalone file. Include in MediaWiki:Common.css or via
* ResourceModules in extension.json.
*
* Covers:
*  1. Floating action strip (appears right of selection)
*  2. Right panel (collapsible overlay, two tabs: Comments / Bookmarks)
  *  3. Comment cards (Google Docs style)
*  4. Bookmark cards
*  5. Highlighted anchor spans
*  6. Mobile-safe overlay behaviour
* ═══════════════════════════════════════════════════════════════
  */
  */


/* ── Icon base (reuses /images/*.svg already on Hostinger) ──────── */
/* ── Icon base ──────────────────────────────────────────────────── */
.gra-icon {
.gra-icon {
   display: inline-block;
   display: inline-block;
Line 25: Line 13:
   flex-shrink: 0;
   flex-shrink: 0;
}
}
.gra-icon-comment  { background-image: url('/images/commentary.svg'); }
/* comment.svg → Feedback (flag/report)  */
.gra-icon-feedback { background-image: url('/images/commentary.svg'); }
/* notes.svg  → Notes                  */
.gra-icon-note    { background-image: url('/images/notes.svg'); }
.gra-icon-bookmark { background-image: url('/images/bookmark.svg'); }
.gra-icon-bookmark { background-image: url('/images/bookmark.svg'); }
.gra-icon-copy    { background-image: url('/images/copy.svg'); }
.gra-icon-copy    { background-image: url('/images/copy.svg'); }


/* ══════════════════════════════════════════════════════════════════
/* ══════════════════════════════════════════════════════════════════
   1. FLOATING ACTION STRIP
   1. FLOATING ACTION STRIP (desktop only)
  Appears to the right of the content column on text selection.
  Vertically stacked pill — mirrors Google Docs behaviour.
   ══════════════════════════════════════════════════════════════════ */
   ══════════════════════════════════════════════════════════════════ */
#gra-fab {
#gra-fab {
   position: fixed;   /* fixed so it stays next to selection even on scroll */
   position: fixed;
   z-index: 1200;
   z-index: 10200;
   display: none;
   display: none;
   flex-direction: column;
   flex-direction: column;
Line 45: Line 34:
   padding: 6px 5px;
   padding: 6px 5px;
   box-shadow: 0 2px 10px rgba(0,0,0,0.14);
   box-shadow: 0 2px 10px rgba(0,0,0,0.14);
  /* position set by JS via top/left */
}
}
#gra-fab.gra-fab-visible { display: flex; }
#gra-fab.gra-fab-visible { display: flex; }
Line 63: Line 51:
}
}
.gra-fab-btn:hover { background: #f5f5f5; }
.gra-fab-btn:hover { background: #f5f5f5; }
.gra-fab-btn:hover .gra-fab-tooltip { opacity: 1; transform: translateX(-50%) translateY(0); }
.gra-fab-btn:hover .gra-fab-tooltip { opacity: 1; transform: translateX(0) translateY(-50%); }


/* Tooltip */
.gra-fab-tooltip {
.gra-fab-tooltip {
   position: absolute;
   position: absolute;
   right: calc(100% + 8px);
   right: calc(100% + 8px);
   top: 50%;
   top: 50%;
   transform: translateX(0) translateY(-50%);
   transform: translateX(4px) translateY(-50%);
   white-space: nowrap;
   white-space: nowrap;
   background: rgba(30,30,30,0.82);
   background: rgba(30,30,30,0.82);
Line 86: Line 73:
/* ══════════════════════════════════════════════════════════════════
/* ══════════════════════════════════════════════════════════════════
   2. RIGHT PANEL
   2. RIGHT PANEL
  Slides in from the right as an overlay.
  On mobile it covers the full viewport width.
   ══════════════════════════════════════════════════════════════════ */
   ══════════════════════════════════════════════════════════════════ */
#gra-panel {
#gra-panel {
   position: fixed;
   position: fixed;
   top: 0;
   top: 0;
   right: -360px;           /* hidden off-screen */
   right: -360px;
   width: 340px;
   width: 340px;
   height: 100vh;
   height: 100vh;
   background: #fff;
   background: #fff;
   box-shadow: -3px 0 20px rgba(0,0,0,0.15);
   box-shadow: -3px 0 20px rgba(0,0,0,0.15);
   z-index: 1100;
   z-index: 10100;
   display: flex;
   display: flex;
   flex-direction: column;
   flex-direction: column;
Line 107: Line 92:
#gra-panel.gra-panel-open { right: 0; }
#gra-panel.gra-panel-open { right: 0; }


/* Backdrop (mobile + wide screens when panel overlaps content) */
#gra-backdrop {
#gra-backdrop {
   position: fixed;
   position: fixed;
   inset: 0;
   inset: 0;
   background: rgba(0,0,0,0.18);
   background: rgba(0,0,0,0.18);
   z-index: 1099;
   z-index: 10099;
   display: none;
   display: none;
   cursor: pointer;
   cursor: pointer;
Line 118: Line 102:
#gra-backdrop.gra-backdrop-visible { display: block; }
#gra-backdrop.gra-backdrop-visible { display: block; }


/* ── Panel header ── */
#gra-panel-head {
#gra-panel-head {
   display: flex;
   display: flex;
Line 138: Line 121:
#gra-panel-close:hover { background: #f5f5f5; color: #222; }
#gra-panel-close:hover { background: #f5f5f5; color: #222; }


/* ── Tabs ── */
#gra-tabs {
#gra-tabs {
   display: flex;
   display: flex;
Line 165: Line 147:
.gra-tab .gra-icon { width: 16px; height: 16px; opacity: 0.5; }
.gra-tab .gra-icon { width: 16px; height: 16px; opacity: 0.5; }
.gra-tab:hover { color: #333; }
.gra-tab:hover { color: #333; }
.gra-tab.gra-tab-active {
.gra-tab.gra-tab-active { color: #1a73e8; border-bottom-color: #1a73e8; }
  color: #1a73e8;
.gra-tab.gra-tab-active .gra-icon {
  border-bottom-color: #1a73e8;
  opacity: 1;
  filter: invert(30%) sepia(100%) saturate(500%) hue-rotate(190deg);
}
}
.gra-tab.gra-tab-active .gra-icon { opacity: 1; filter: invert(30%) sepia(100%) saturate(500%) hue-rotate(190deg); }


/* ── Tab content panes ── */
#gra-panel-body {
#gra-panel-body {
   flex: 1;
   flex: 1;
Line 181: Line 162:


/* ══════════════════════════════════════════════════════════════════
/* ══════════════════════════════════════════════════════════════════
   3. COMMENT CARDS (Google Docs style)
   3. FEEDBACK COMPOSER — centered modal
   ══════════════════════════════════════════════════════════════════ */
   ══════════════════════════════════════════════════════════════════ */
/* Inline composer — appears anchored to selection, right side */
.gra-composer {
.gra-composer {
   background: #fff;
   background: #fff;
   border: 1px solid #e0e0e0;
   border: 1px solid #e0e0e0;
   border-radius: 8px;
   border-radius: 12px;
   box-shadow: 0 4px 16px rgba(0,0,0,0.14);
   box-shadow: 0 8px 40px rgba(0,0,0,0.22);
   width: 300px;
   width: 420px;
   padding: 12px 14px 10px;
  max-width: calc(100vw - 32px);
   padding: 20px 24px 16px;
   position: fixed;
   position: fixed;
   z-index: 1150;
  /* Centered on screen */
  top: 50% !important;
  left: 50% !important;
  transform: translate(-50%, -50%) !important;
   z-index: 10150;
   display: none;
   display: none;
   flex-direction: column;
   flex-direction: column;
   gap: 10px;
   gap: 12px;
   font-family: system-ui, sans-serif;
   font-family: system-ui, sans-serif;
   font-size: 13px;
   font-size: 13px;
Line 202: Line 186:
.gra-composer.gra-composer-visible { display: flex; }
.gra-composer.gra-composer-visible { display: flex; }


/* Feedback composer header row */
.gra-composer-header {
  display: flex;
  align-items: center;
  gap: 8px;
}
.gra-composer-header strong {
  flex: 1;
  font-size: 14px;
  color: #202124;
}
.gra-btn-x {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 16px;
  color: #666;
  padding: 2px 5px;
  border-radius: 4px;
  line-height: 1;
}
.gra-btn-x:hover { background: #f5f5f5; color: #222; }
/* Feedback field labels */
.gra-fb-field-label {
  font-size: 11px;
  font-weight: 600;
  color: #5f6368;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-bottom: -6px;  /* tighten gap to input below */
}
/* Selected text quote preview */
.gra-fb-quote-label {
  font-size: 11px;
  color: #9aa0a6;
  margin-bottom: -4px;
}
.gra-fb-quote {
  font-size: 12px;
  color: #5f6368;
  font-style: italic;
  background: #fafafa;
  border-left: 3px solid #fbbc04;
  border-radius: 0 4px 4px 0;
  padding: 6px 10px;
  line-height: 1.45;
  max-height: 56px;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}
/* Issue type dropdown */
.gra-fb-select {
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  padding: 7px 10px;
  font-size: 13px;
  font-family: inherit;
  color: #202124;
  background: #fff;
  outline: none;
  transition: border-color 0.15s;
  width: 100%;
  box-sizing: border-box;
  cursor: pointer;
}
.gra-fb-select:focus { border-color: #1a73e8; }
/* Email input */
.gra-fb-email-input {
  min-height: unset !important;
  height: 36px;
  padding: 6px 10px !important;
}
/* Status message */
.gra-fb-status {
  font-size: 12px;
  min-height: 16px;
  text-align: center;
}
.gra-fb-status.gra-fb-ok  { color: #34a853; }
.gra-fb-status.gra-fb-err { color: #ea4335; }
/* ══════════════════════════════════════════════════════════════════
  4. NOTE COMPOSER  (local only)
  ══════════════════════════════════════════════════════════════════ */
.gra-composer-user {
.gra-composer-user {
   display: flex;
   display: flex;
Line 219: Line 294:
   font-weight: 600;
   font-weight: 600;
   flex-shrink: 0;
   flex-shrink: 0;
  overflow: hidden;
}
}
.gra-avatar img { width: 100%; height: 100%; object-fit: cover; }
.gra-composer-uname { font-weight: 600; color: #202124; font-size: 13px; }
.gra-composer-name { font-weight: 600; color: #202124; font-size: 13px; }


.gra-composer-input {
.gra-composer-input {
Line 275: Line 348:
.gra-btn-submit:disabled { background: #c5d8f8; cursor: default; }
.gra-btn-submit:disabled { background: #c5d8f8; cursor: default; }


/* Saved comment cards in panel */
/* ── Note cards ── */
.gra-comment-card {
.gra-note-card {
   border: 1px solid #e8eaed;
   border: 1px solid #e8eaed;
   border-radius: 8px;
   border-radius: 8px;
Line 286: Line 359:
   transition: box-shadow 0.15s;
   transition: box-shadow 0.15s;
}
}
.gra-comment-card:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.12); }
.gra-note-card:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.12); }
.gra-comment-card.gra-card-active {
.gra-note-card.gra-card-active {
   border-color: #fbbc04;
   border-color: #34a853;
   box-shadow: 0 0 0 2px rgba(251,188,4,0.3);
   box-shadow: 0 0 0 2px rgba(52,168,83,0.25);
}
}
.gra-card-header {
.gra-card-header {
Line 298: Line 371:
}
}
.gra-card-meta { flex: 1; }
.gra-card-meta { flex: 1; }
.gra-card-author { font-weight: 600; color: #202124; font-size: 12px; }
.gra-card-ts { font-size: 11px; color: #80868b; }
.gra-card-ts { font-size: 11px; color: #80868b; margin-top: 1px; }
.gra-card-quote {
.gra-card-quote {
   font-size: 12px;
   font-size: 12px;
   color: #5f6368;
   color: #5f6368;
   border-left: 3px solid #fbbc04;
   border-left: 3px solid #34a853;
   padding-left: 8px;
   padding-left: 8px;
   margin-bottom: 6px;
   margin-bottom: 6px;
   font-style: italic;
   font-style: italic;
   line-height: 1.4;
   line-height: 1.4;
  /* clamp to 2 lines */
   display: -webkit-box;
   display: -webkit-box;
   -webkit-line-clamp: 2;
   -webkit-line-clamp: 2;
Line 314: Line 385:
   overflow: hidden;
   overflow: hidden;
}
}
.gra-card-text {
.gra-card-text { font-size: 13px; color: #202124; line-height: 1.5; }
  font-size: 13px;
 
   color: #202124;
.gra-note-del {
   line-height: 1.5;
  background: none;
  border: none;
  cursor: pointer;
   color: #ccc;
  font-size: 15px;
  padding: 0 2px;
   line-height: 1;
  flex-shrink: 0;
  margin-left: auto;
}
}
.gra-note-del:hover { color: #e53935; }
.gra-empty-state {
.gra-empty-state {
   color: #9aa0a6;
   color: #9aa0a6;
Line 328: Line 409:


/* ══════════════════════════════════════════════════════════════════
/* ══════════════════════════════════════════════════════════════════
   4. BOOKMARK CARDS
   5. BOOKMARK CARDS + COMPOSER
   ══════════════════════════════════════════════════════════════════ */
   ══════════════════════════════════════════════════════════════════ */
.gra-bookmark-card {
.gra-bookmark-card {
Line 374: Line 455:
.gra-bookmark-del:hover { color: #e53935; }
.gra-bookmark-del:hover { color: #e53935; }


/* Bookmark composer (same structure as comment composer) */
.gra-bm-composer {
.gra-bm-composer {
   background: #fff;
   background: #fff;
   border: 1px solid #e0e0e0;
   border: 1px solid #e0e0e0;
   border-radius: 8px;
   border-radius: 12px;
   box-shadow: 0 4px 16px rgba(0,0,0,0.14);
   box-shadow: 0 8px 40px rgba(0,0,0,0.22);
   width: 300px;
   width: 420px;
   padding: 12px 14px 10px;
  max-width: calc(100vw - 32px);
   padding: 20px 24px 16px;
   position: fixed;
   position: fixed;
   z-index: 1150;
  /* Centered on screen — same as feedback composer */
  top: 50% !important;
  left: 50% !important;
  transform: translate(-50%, -50%) !important;
   z-index: 10150;
   display: none;
   display: none;
   flex-direction: column;
   flex-direction: column;
Line 401: Line 486:


/* ══════════════════════════════════════════════════════════════════
/* ══════════════════════════════════════════════════════════════════
   5. ANCHOR HIGHLIGHTS
   6. ANCHOR HIGHLIGHTS
   ══════════════════════════════════════════════════════════════════ */
   ══════════════════════════════════════════════════════════════════ */
.gra-comment-highlight {
/* Note highlight — green tint */
   background: rgba(251, 188, 4, 0.35);
.gra-note-highlight {
   background: rgba(52, 168, 83, 0.18);
   border-radius: 2px;
   border-radius: 2px;
   cursor: pointer;
   cursor: pointer;
   transition: background 0.15s;
   transition: background 0.15s;
}
}
.gra-comment-highlight:hover,
.gra-note-highlight:hover,
.gra-comment-highlight.gra-hl-active {
.gra-note-highlight.gra-hl-active {
   background: rgba(251, 188, 4, 0.6);
   background: rgba(52, 168, 83, 0.4);
   outline: 1.5px solid #fbbc04;
   outline: 1.5px solid #34a853;
}
}
/* Bookmark highlight — blue underline */
.gra-bookmark-highlight {
.gra-bookmark-highlight {
   background: rgba(26, 115, 232, 0.12);
   background: rgba(26, 115, 232, 0.12);
Line 424: Line 512:


/* ══════════════════════════════════════════════════════════════════
/* ══════════════════════════════════════════════════════════════════
   6. RESPONSIVE
   7. PERSISTENT TOGGLE BUTTON
  ══════════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  #gra-panel {
    width: 100vw;
    right: -100vw;
  }
  .gra-composer,
  .gra-bm-composer {
    width: calc(100vw - 32px);
    left: 16px !important;
  }
}
 
/* ══════════════════════════════════════════════════════════════════
  PERSISTENT PANEL TOGGLE BUTTON
  Fixed to bottom-right corner, always visible.
  Shows a red badge with unread comment count.
   ══════════════════════════════════════════════════════════════════ */
   ══════════════════════════════════════════════════════════════════ */
#gra-toggle {
#gra-toggle {
   position: fixed;
   position: fixed;
   bottom: 80px; /* sits above docs (22px) */
   bottom: 80px;
   right: 20px;
   right: 20px;
   width: 48px;
   width: 48px;
Line 453: Line 524:
   border: none;
   border: none;
   cursor: pointer;
   cursor: pointer;
   z-index: 1050;
   z-index: 10050;
   display: flex;
   display: flex;
   align-items: center;
   align-items: center;
Line 460: Line 531:
   transition: background 0.15s, transform 0.15s;
   transition: background 0.15s, transform 0.15s;
}
}
#gra-toggle:hover {
#gra-toggle:hover { background: #a0410e; transform: scale(1.07); }
  background: #a0410e;
  transform: scale(1.07);
}
#gra-toggle .gra-icon {
#gra-toggle .gra-icon {
   width: 22px;
   width: 22px;
   height: 22px;
   height: 22px;
   filter: brightness(0) invert(1); /* white icon */
   filter: brightness(0) invert(1);
}
}
#gra-toggle-badge {
#gra-toggle-badge {
Line 484: Line 552:
   text-align: center;
   text-align: center;
   display: none;
   display: none;
  align-items: center;
  justify-content: center;
   font-family: system-ui, sans-serif;
   font-family: system-ui, sans-serif;
   pointer-events: none;
   pointer-events: none;
}
}
/* Shift toggle left when panel is open so it doesn't overlap */
#gra-panel.gra-panel-open ~ #gra-toggle {
#gra-panel.gra-panel-open ~ #gra-toggle {
   right: 356px;
   right: 356px;
   transition: right 0.28s cubic-bezier(0.4,0,0.2,1), background 0.15s;
   transition: right 0.28s cubic-bezier(0.4,0,0.2,1), background 0.15s;
}
/* ══════════════════════════════════════════════════════════════════
  MOBILE BOTTOM ACTION BAR
  Slides up from bottom — avoids clashing with browser copy menu.
  Large tap targets (56px height buttons) with text labels.
  Only shown on mobile (JS sets _mobile flag).
  ══════════════════════════════════════════════════════════════════ */
#gra-mobile-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 10200;
  display: block !important;
  transform: translateY(100%);
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
}
#gra-mobile-bar.gra-mobile-bar-visible {
  transform: translateY(0);
  pointer-events: auto;
}
#gra-mobile-bar-inner {
  background: #fff;
  border-top: 1px solid #e0e0e0;
  border-radius: 16px 16px 0 0;
  box-shadow: 0 -4px 20px rgba(0,0,0,0.18);
  display: flex;
  align-items: stretch;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.gra-mob-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 14px 8px;
  min-height: 72px;
  background: none;
  border: none;
  border-right: 1px solid #f0f0f0;
  cursor: pointer;
  font-family: system-ui, sans-serif;
  font-size: 11px;
  color: #444;
  font-weight: 500;
  -webkit-tap-highlight-color: rgba(0,0,0,0.06);
  transition: background 0.12s;
}
.gra-mob-btn:last-child { border-right: none; }
.gra-mob-btn:active { background: #f5f5f5; }
.gra-mob-btn .gra-icon { width: 24px; height: 24px; }
.gra-mob-label { font-size: 11px; line-height: 1.2; text-align: center; }
.gra-mob-dismiss { color: #999; }
.gra-mob-dismiss:active { background: #fff0f0; color: #e53935; }
/* ══════════════════════════════════════════════════════════════════
  8. RESPONSIVE
  ══════════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  #gra-panel { width: 100vw; right: -100vw; }
  .gra-composer {
    width: calc(100vw - 32px) !important;
    max-width: 420px;
    /* Override centering for note/bookmark on mobile — keep centered */
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
  }
  /* bm-composer already centered via its base CSS */
}
}

Latest revision as of 18:51, 14 May 2026

/*
 * gr_annotations.css  —  grantha.io inline Notes + Bookmarks + Feedback  (v3)
 */

/* ── Icon base ──────────────────────────────────────────────────── */
.gra-icon {
  display: inline-block;
  width:  20px;
  height: 20px;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  flex-shrink: 0;
}
/* comment.svg → Feedback (flag/report)  */
.gra-icon-feedback { background-image: url('/images/commentary.svg'); }
/* notes.svg   → Notes                  */
.gra-icon-note     { background-image: url('/images/notes.svg'); }
.gra-icon-bookmark { background-image: url('/images/bookmark.svg'); }
.gra-icon-copy     { background-image: url('/images/copy.svg'); }

/* ══════════════════════════════════════════════════════════════════
   1. FLOATING ACTION STRIP  (desktop only)
   ══════════════════════════════════════════════════════════════════ */
#gra-fab {
  position: fixed;
  z-index: 10200;
  display: none;
  flex-direction: column;
  gap: 4px;
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 24px;
  padding: 6px 5px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.14);
}
#gra-fab.gra-fab-visible { display: flex; }

.gra-fab-btn {
  width:  36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: background 0.15s;
}
.gra-fab-btn:hover { background: #f5f5f5; }
.gra-fab-btn:hover .gra-fab-tooltip { opacity: 1; transform: translateX(0) translateY(-50%); }

.gra-fab-tooltip {
  position: absolute;
  right: calc(100% + 8px);
  top: 50%;
  transform: translateX(4px) translateY(-50%);
  white-space: nowrap;
  background: rgba(30,30,30,0.82);
  color: #fff;
  font-size: 11px;
  font-family: system-ui, sans-serif;
  font-weight: 500;
  padding: 3px 9px;
  border-radius: 999px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.18s, transform 0.18s;
}

/* ══════════════════════════════════════════════════════════════════
   2. RIGHT PANEL
   ══════════════════════════════════════════════════════════════════ */
#gra-panel {
  position: fixed;
  top: 0;
  right: -360px;
  width: 340px;
  height: 100vh;
  background: #fff;
  box-shadow: -3px 0 20px rgba(0,0,0,0.15);
  z-index: 10100;
  display: flex;
  flex-direction: column;
  transition: right 0.28s cubic-bezier(0.4,0,0.2,1);
  font-family: system-ui, sans-serif;
  font-size: 13px;
  overflow: hidden;
}
#gra-panel.gra-panel-open { right: 0; }

#gra-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.18);
  z-index: 10099;
  display: none;
  cursor: pointer;
}
#gra-backdrop.gra-backdrop-visible { display: block; }

#gra-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px 0;
  flex-shrink: 0;
}
#gra-panel-close {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 18px;
  color: #666;
  padding: 2px 6px;
  border-radius: 4px;
  line-height: 1;
}
#gra-panel-close:hover { background: #f5f5f5; color: #222; }

#gra-tabs {
  display: flex;
  border-bottom: 2px solid #f0f0f0;
  margin: 10px 16px 0;
  flex-shrink: 0;
}
.gra-tab {
  flex: 1;
  padding: 8px 4px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 13px;
  font-family: inherit;
  color: #777;
  font-weight: 500;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: color 0.15s, border-color 0.15s;
}
.gra-tab .gra-icon { width: 16px; height: 16px; opacity: 0.5; }
.gra-tab:hover { color: #333; }
.gra-tab.gra-tab-active { color: #1a73e8; border-bottom-color: #1a73e8; }
.gra-tab.gra-tab-active .gra-icon {
  opacity: 1;
  filter: invert(30%) sepia(100%) saturate(500%) hue-rotate(190deg);
}

#gra-panel-body {
  flex: 1;
  overflow-y: auto;
  padding: 12px 16px 16px;
}
.gra-pane { display: none; }
.gra-pane.gra-pane-active { display: block; }

/* ══════════════════════════════════════════════════════════════════
   3. FEEDBACK COMPOSER  — centered modal
   ══════════════════════════════════════════════════════════════════ */
.gra-composer {
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 12px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.22);
  width: 420px;
  max-width: calc(100vw - 32px);
  padding: 20px 24px 16px;
  position: fixed;
  /* Centered on screen */
  top: 50% !important;
  left: 50% !important;
  transform: translate(-50%, -50%) !important;
  z-index: 10150;
  display: none;
  flex-direction: column;
  gap: 12px;
  font-family: system-ui, sans-serif;
  font-size: 13px;
}
.gra-composer.gra-composer-visible { display: flex; }

/* Feedback composer header row */
.gra-composer-header {
  display: flex;
  align-items: center;
  gap: 8px;
}
.gra-composer-header strong {
  flex: 1;
  font-size: 14px;
  color: #202124;
}
.gra-btn-x {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 16px;
  color: #666;
  padding: 2px 5px;
  border-radius: 4px;
  line-height: 1;
}
.gra-btn-x:hover { background: #f5f5f5; color: #222; }

/* Feedback field labels */
.gra-fb-field-label {
  font-size: 11px;
  font-weight: 600;
  color: #5f6368;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-bottom: -6px;   /* tighten gap to input below */
}

/* Selected text quote preview */
.gra-fb-quote-label {
  font-size: 11px;
  color: #9aa0a6;
  margin-bottom: -4px;
}
.gra-fb-quote {
  font-size: 12px;
  color: #5f6368;
  font-style: italic;
  background: #fafafa;
  border-left: 3px solid #fbbc04;
  border-radius: 0 4px 4px 0;
  padding: 6px 10px;
  line-height: 1.45;
  max-height: 56px;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}

/* Issue type dropdown */
.gra-fb-select {
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  padding: 7px 10px;
  font-size: 13px;
  font-family: inherit;
  color: #202124;
  background: #fff;
  outline: none;
  transition: border-color 0.15s;
  width: 100%;
  box-sizing: border-box;
  cursor: pointer;
}
.gra-fb-select:focus { border-color: #1a73e8; }

/* Email input */
.gra-fb-email-input {
  min-height: unset !important;
  height: 36px;
  padding: 6px 10px !important;
}

/* Status message */
.gra-fb-status {
  font-size: 12px;
  min-height: 16px;
  text-align: center;
}
.gra-fb-status.gra-fb-ok  { color: #34a853; }
.gra-fb-status.gra-fb-err { color: #ea4335; }

/* ══════════════════════════════════════════════════════════════════
   4. NOTE COMPOSER  (local only)
   ══════════════════════════════════════════════════════════════════ */
.gra-composer-user {
  display: flex;
  align-items: center;
  gap: 10px;
}
.gra-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #1a73e8;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  flex-shrink: 0;
}
.gra-composer-uname { font-weight: 600; color: #202124; font-size: 13px; }

.gra-composer-input {
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 13px;
  font-family: inherit;
  resize: none;
  width: 100%;
  box-sizing: border-box;
  min-height: 56px;
  line-height: 1.5;
  color: #202124;
  outline: none;
  transition: border-color 0.15s;
}
.gra-composer-input::placeholder { color: #aaa; }
.gra-composer-input:focus { border-color: #1a73e8; }

.gra-composer-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}
.gra-btn-cancel {
  background: none;
  border: none;
  cursor: pointer;
  color: #5f6368;
  font-size: 13px;
  font-family: inherit;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: 4px;
}
.gra-btn-cancel:hover { background: #f5f5f5; }
.gra-btn-submit {
  background: #1a73e8;
  color: #fff;
  border: none;
  cursor: pointer;
  font-size: 13px;
  font-family: inherit;
  font-weight: 500;
  padding: 6px 16px;
  border-radius: 4px;
  transition: background 0.15s;
}
.gra-btn-submit:hover { background: #1557b0; }
.gra-btn-submit:disabled { background: #c5d8f8; cursor: default; }

/* ── Note cards ── */
.gra-note-card {
  border: 1px solid #e8eaed;
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 10px;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.07);
  cursor: pointer;
  transition: box-shadow 0.15s;
}
.gra-note-card:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.12); }
.gra-note-card.gra-card-active {
  border-color: #34a853;
  box-shadow: 0 0 0 2px rgba(52,168,83,0.25);
}
.gra-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
.gra-card-meta { flex: 1; }
.gra-card-ts { font-size: 11px; color: #80868b; }
.gra-card-quote {
  font-size: 12px;
  color: #5f6368;
  border-left: 3px solid #34a853;
  padding-left: 8px;
  margin-bottom: 6px;
  font-style: italic;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.gra-card-text { font-size: 13px; color: #202124; line-height: 1.5; }

.gra-note-del {
  background: none;
  border: none;
  cursor: pointer;
  color: #ccc;
  font-size: 15px;
  padding: 0 2px;
  line-height: 1;
  flex-shrink: 0;
  margin-left: auto;
}
.gra-note-del:hover { color: #e53935; }

.gra-empty-state {
  color: #9aa0a6;
  font-size: 13px;
  text-align: center;
  padding: 32px 16px;
  line-height: 1.6;
}

/* ══════════════════════════════════════════════════════════════════
   5. BOOKMARK CARDS + COMPOSER
   ══════════════════════════════════════════════════════════════════ */
.gra-bookmark-card {
  border: 1px solid #e8eaed;
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 10px;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.07);
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  transition: box-shadow 0.15s;
}
.gra-bookmark-card:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.12); }
.gra-bookmark-card .gra-icon { margin-top: 2px; flex-shrink: 0; }
.gra-bookmark-info { flex: 1; min-width: 0; }
.gra-bookmark-name {
  font-weight: 600;
  color: #202124;
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.gra-bookmark-quote {
  font-size: 11px;
  color: #80868b;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.gra-bookmark-del {
  background: none;
  border: none;
  cursor: pointer;
  color: #ccc;
  font-size: 15px;
  padding: 0 2px;
  line-height: 1;
  flex-shrink: 0;
}
.gra-bookmark-del:hover { color: #e53935; }

.gra-bm-composer {
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 12px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.22);
  width: 420px;
  max-width: calc(100vw - 32px);
  padding: 20px 24px 16px;
  position: fixed;
  /* Centered on screen — same as feedback composer */
  top: 50% !important;
  left: 50% !important;
  transform: translate(-50%, -50%) !important;
  z-index: 10150;
  display: none;
  flex-direction: column;
  gap: 10px;
  font-family: system-ui, sans-serif;
  font-size: 13px;
}
.gra-bm-composer.gra-composer-visible { display: flex; }
.gra-bm-composer-label {
  font-weight: 600;
  color: #202124;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ══════════════════════════════════════════════════════════════════
   6. ANCHOR HIGHLIGHTS
   ══════════════════════════════════════════════════════════════════ */
/* Note highlight — green tint */
.gra-note-highlight {
  background: rgba(52, 168, 83, 0.18);
  border-radius: 2px;
  cursor: pointer;
  transition: background 0.15s;
}
.gra-note-highlight:hover,
.gra-note-highlight.gra-hl-active {
  background: rgba(52, 168, 83, 0.4);
  outline: 1.5px solid #34a853;
}

/* Bookmark highlight — blue underline */
.gra-bookmark-highlight {
  background: rgba(26, 115, 232, 0.12);
  border-radius: 2px;
  cursor: pointer;
  border-bottom: 1.5px solid #1a73e8;
  transition: background 0.15s;
}
.gra-bookmark-highlight:hover { background: rgba(26, 115, 232, 0.22); }

/* ══════════════════════════════════════════════════════════════════
   7. PERSISTENT TOGGLE BUTTON
   ══════════════════════════════════════════════════════════════════ */
#gra-toggle {
  position: fixed;
  bottom: 80px;
  right: 20px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #c0521a;
  border: none;
  cursor: pointer;
  z-index: 10050;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 3px 12px rgba(0,0,0,0.22);
  transition: background 0.15s, transform 0.15s;
}
#gra-toggle:hover { background: #a0410e; transform: scale(1.07); }
#gra-toggle .gra-icon {
  width: 22px;
  height: 22px;
  filter: brightness(0) invert(1);
}
#gra-toggle-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: #e53935;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  min-width: 16px;
  height: 16px;
  border-radius: 8px;
  padding: 0 4px;
  line-height: 16px;
  text-align: center;
  display: none;
  font-family: system-ui, sans-serif;
  pointer-events: none;
}
#gra-panel.gra-panel-open ~ #gra-toggle {
  right: 356px;
  transition: right 0.28s cubic-bezier(0.4,0,0.2,1), background 0.15s;
}


/* ══════════════════════════════════════════════════════════════════
   MOBILE BOTTOM ACTION BAR
   Slides up from bottom — avoids clashing with browser copy menu.
   Large tap targets (56px height buttons) with text labels.
   Only shown on mobile (JS sets _mobile flag).
   ══════════════════════════════════════════════════════════════════ */
#gra-mobile-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 10200;
  display: block !important;
  transform: translateY(100%);
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
}
#gra-mobile-bar.gra-mobile-bar-visible {
  transform: translateY(0);
  pointer-events: auto;
}
#gra-mobile-bar-inner {
  background: #fff;
  border-top: 1px solid #e0e0e0;
  border-radius: 16px 16px 0 0;
  box-shadow: 0 -4px 20px rgba(0,0,0,0.18);
  display: flex;
  align-items: stretch;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.gra-mob-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 14px 8px;
  min-height: 72px;
  background: none;
  border: none;
  border-right: 1px solid #f0f0f0;
  cursor: pointer;
  font-family: system-ui, sans-serif;
  font-size: 11px;
  color: #444;
  font-weight: 500;
  -webkit-tap-highlight-color: rgba(0,0,0,0.06);
  transition: background 0.12s;
}
.gra-mob-btn:last-child { border-right: none; }
.gra-mob-btn:active { background: #f5f5f5; }
.gra-mob-btn .gra-icon { width: 24px; height: 24px; }
.gra-mob-label { font-size: 11px; line-height: 1.2; text-align: center; }
.gra-mob-dismiss { color: #999; }
.gra-mob-dismiss:active { background: #fff0f0; color: #e53935; }



/* ══════════════════════════════════════════════════════════════════
   8. RESPONSIVE
   ══════════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  #gra-panel { width: 100vw; right: -100vw; }
  .gra-composer {
    width: calc(100vw - 32px) !important;
    max-width: 420px;
    /* Override centering for note/bookmark on mobile — keep centered */
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
  }
  /* bm-composer already centered via its base CSS */
}