/* ResearchBook 1.54: hierarchy, compact scheduling workspace, interaction feedback and icon-only accessibility. */
:root{
  --rb154-control-icon:18px;
  --rb154-card-icon-box:32px;
  --rb154-hover-shadow:0 8px 20px rgba(21,70,121,.12);
  --rb154-active-shadow:inset 0 2px 7px rgba(10,38,70,.22);
}

/* Interactive things should look interactive: stronger hover, pressed and keyboard focus states. */
.workspace button:not(:disabled),
.rb15-dashboard button:not(:disabled),
.rb15-role-dashboard button:not(:disabled),
.rb15-enhance-modal button:not(:disabled),
.class-shell button:not(:disabled),
.rb-productivity-shell button:not(:disabled),
.participant-shell button:not(:disabled){
  cursor:pointer;
  transition:transform .12s ease,box-shadow .12s ease,filter .12s ease,background-color .12s ease,border-color .12s ease,color .12s ease;
}
.workspace button:not(:disabled):hover,
.rb15-dashboard button:not(:disabled):hover,
.rb15-role-dashboard button:not(:disabled):hover,
.rb15-enhance-modal button:not(:disabled):hover,
.class-shell button:not(:disabled):hover,
.rb-productivity-shell button:not(:disabled):hover,
.participant-shell button:not(:disabled):hover{
  filter:brightness(.99);
  box-shadow:var(--rb154-hover-shadow);
}
.workspace button:not(:disabled):active,
.rb15-dashboard button:not(:disabled):active,
.rb15-role-dashboard button:not(:disabled):active,
.rb15-enhance-modal button:not(:disabled):active,
.class-shell button:not(:disabled):active,
.rb-productivity-shell button:not(:disabled):active,
.participant-shell button:not(:disabled):active{
  transform:translateY(1px) scale(.995);
  box-shadow:var(--rb154-active-shadow)!important;
}
.workspace button:focus-visible,
.rb15-dashboard button:focus-visible,
.rb15-role-dashboard button:focus-visible,
.rb15-enhance-modal button:focus-visible,
.class-shell button:focus-visible,
.rb-productivity-shell button:focus-visible,
.participant-shell button:focus-visible{
  outline:3px solid color-mix(in srgb,var(--blue,#2170ec) 38%,transparent)!important;
  outline-offset:2px!important;
}
.workspace button .icon,.topbar-actions button .icon,.portfolio-bar button .icon{width:var(--rb154-control-icon);height:var(--rb154-control-icon)}

/* Keep dashboard icon visual weight consistent across researcher/supervisor/student/teacher/admin cards. */
.rb15-icon,.rb15-enhance-icon,.rb15-role-icon,.rb15-experiment-tile-icon{
  width:var(--rb154-card-icon-box)!important;
  height:var(--rb154-card-icon-box)!important;
  flex:0 0 var(--rb154-card-icon-box)!important;
  display:grid!important;
  place-items:center!important;
  border-radius:9px!important;
  font-size:16px!important;
  line-height:1!important;
}

/* Main scheduling layout: compact by default, with a true collapsible right record panel. */
.dashboard-grid{grid-template-columns:minmax(0,1fr) minmax(296px,326px);gap:15px;transition:grid-template-columns .18s ease,gap .18s ease}
.detail-column{position:relative;min-width:0;gap:11px}
.detail-card{padding:17px 16px 16px}
.detail-title-row h2{font-size:23px}
.meta-list{gap:9px;margin-top:15px;padding-bottom:14px}
.detail-section{padding:13px 0}
.rb154-detail-panel-toggle{
  position:absolute;z-index:12;top:10px;left:-13px;right:auto;
  min-width:30px;width:30px;height:30px;padding:0;
  display:flex;align-items:center;justify-content:center;gap:0;
  border:1px solid #b8cee5;border-radius:9px;background:rgba(255,255,255,.94);
  color:#245f9d;box-shadow:0 4px 12px rgba(24,68,112,.08);backdrop-filter:blur(8px);
  font-size:15px;font-weight:900;
}
.rb154-detail-panel-toggle b{display:none;font-size:10px;white-space:nowrap}
.rb154-detail-panel-toggle:hover{background:#edf6ff;border-color:#76a1d5;color:#1552a5}
.dashboard-grid.rb154-detail-panel-collapsed{grid-template-columns:minmax(0,1fr) 46px;gap:9px}
.dashboard-grid.rb154-detail-panel-collapsed .detail-column{min-height:92px;border:1px solid #d7e3ef;border-radius:12px;background:linear-gradient(180deg,#f9fcff,#f2f7fc);align-self:start}
.dashboard-grid.rb154-detail-panel-collapsed .detail-column>:not(.rb154-detail-panel-toggle){display:none!important}
.dashboard-grid.rb154-detail-panel-collapsed .rb154-detail-panel-toggle{
  position:sticky;top:82px;right:auto;margin:7px auto;width:34px;height:auto;min-height:72px;padding:8px 5px;
  flex-direction:column;gap:5px;background:#fff;
}
.dashboard-grid.rb154-detail-panel-collapsed .rb154-detail-panel-toggle b{display:block;writing-mode:vertical-rl;letter-spacing:.08em;color:#58748f}

/* Inner note section can still collapse independently. */
.session-record-section{margin-top:12px;padding:12px 13px;transition:padding .15s ease,background .15s ease}
.session-record-heading{align-items:center;gap:8px}
.session-record-heading>div{min-width:0;flex:1}
.session-record-heading>span{margin-inline-start:auto}
.rb154-session-record-toggle{flex:0 0 30px;width:30px;height:30px;display:grid;place-items:center;border:1px solid #b9cee6;border-radius:8px;background:#fff;color:#245f9d;cursor:pointer;font-size:16px;font-weight:900}
.rb154-session-record-toggle:hover{background:#edf5ff;border-color:#7ba5d8}
.session-record-section.rb154-session-record-collapsed{padding-block:10px;background:linear-gradient(135deg,#f8fbff,#f0f6fc)}
.session-record-section.rb154-session-record-collapsed>.schedule-note-field,.session-record-section.rb154-session-record-collapsed>.schedule-note-actions{display:none!important}
.session-record-section.rb154-session-record-collapsed .session-record-heading p{display:none}
.session-record-section.rb154-session-record-collapsed .session-record-heading h3{margin:0;font-size:13px}

/* Researcher identity/time-zone becomes a small themed topbar pill, between study selector and Manage. */
.portfolio-bar.rb154-portfolio-with-zone{grid-template-columns:minmax(180px,.62fr) minmax(245px,1.15fr) minmax(170px,.72fr) auto;gap:9px;align-items:center}
.rb-cross-role-busy.rb154-compact{
  min-width:0;min-height:38px;display:flex;align-items:center;gap:7px;margin:0;padding:4px 7px;
  border:1px solid color-mix(in srgb,var(--blue,#2170ec) 28%,#d7e2ed);border-radius:10px;
  background:linear-gradient(135deg,color-mix(in srgb,var(--blue,#2170ec) 8%,#fff),color-mix(in srgb,var(--cyan,#dff7fb) 36%,#fff));
  box-shadow:inset 0 1px 0 rgba(255,255,255,.8);color:#34526f;overflow:hidden;
}
.rb-cross-role-busy.rb154-compact>.rb154-zone-icon{width:28px;height:28px;flex:0 0 28px;display:grid;place-items:center;border-radius:8px;background:#fff;border:1px solid #d9e7f4;font-size:14px}
.rb-cross-role-busy.rb154-compact>.rb154-zone-copy{min-width:0;display:grid;gap:0;line-height:1.12}
.rb-cross-role-busy.rb154-compact strong{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:#1859a7;font-size:10.5px}
.rb-cross-role-busy.rb154-compact small{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:#71869d;font-size:9px}
.rb-cross-role-busy.rb154-compact>.rb154-busy-chips{display:flex;gap:4px;min-width:0;overflow:hidden;margin-inline-start:auto}
.rb-cross-role-busy.rb154-compact>.rb154-busy-chips span{flex:0 0 auto;padding:3px 5px;border:1px solid #d8e3ee;border-radius:7px;background:rgba(255,255,255,.9);color:#536b83;font-size:8.5px;white-space:nowrap}
.rb-cross-role-busy.rb154-compact>.rb154-busy-chips b{font-size:8.5px;color:#315a82;margin-inline-end:3px}

/* Dashboard hierarchy/readability: dashboard is visually dominant; cards remain compact but legible. */
.rb15-dashboard{gap:15px!important;margin-bottom:19px!important}
.rb15-dashboard-head{padding:5px 4px 2px!important}
.rb15-dashboard-title span{width:40px!important;height:40px!important;border-radius:12px!important;font-size:19px!important}
.rb15-dashboard-title strong{font-size:22px!important;line-height:1.12!important;letter-spacing:-.02em!important;font-weight:900!important}
.rb15-dashboard-title small{font-size:11px!important;line-height:1.35!important;margin-top:3px!important}
.rb15-scope{font-size:11px!important}.rb15-scope select{height:40px!important;font-size:12px!important}
.rb15-card{padding:17px!important;border-radius:15px!important}
.rb15-card h3{font-size:15.5px!important;line-height:1.22!important}
.rb15-card header small{font-size:10.5px!important;line-height:1.35!important;margin-top:3px!important}
.rb15-active-experiments-card{grid-column:1/-1!important;background:linear-gradient(135deg,#fff,#f5faff)!important;border-color:#cbddeb!important}
.rb15-experiment-tiles{gap:10px!important}
.rb15-experiment-tile{grid-template-columns:32px minmax(0,1fr) auto!important;padding:12px!important;border-radius:11px!important}
.rb15-experiment-tile-copy strong{font-size:13.5px!important;line-height:1.3!important}
.rb15-experiment-tile-copy small,.rb15-experiment-tile-copy em{font-size:10.5px!important;line-height:1.35!important}
.rb15-today-card{background:linear-gradient(135deg,#f5faff,#e9f4ff)!important;border:1px solid #a9c6e6!important;box-shadow:0 10px 28px rgba(25,76,132,.10)!important}
.rb15-today-card h3{font-size:20px!important;color:#0d3d70!important}
.rb15-session{padding:10px 11px!important;grid-template-columns:56px minmax(0,1fr)!important;gap:10px!important}
.rb15-session time{font-size:13px!important}.rb15-session strong{font-size:12px!important}.rb15-session small{font-size:10px!important}
.rb15-metric strong{font-size:32px!important}.rb15-metric span,.rb15-deadline span{font-size:11px!important}
.rb15-subline,.rb15-link,.rb15-loadrow strong,.rb15-loadrow span,.rb15-toggle span{font-size:11px!important;line-height:1.4!important}
.rb15-deadline strong{font-size:22px!important}.rb15-deadline small,.rb15-note{font-size:10.5px!important}
.rb15-action{font-size:12px!important;min-height:42px!important}

/* Custom/role cards: raise small type without turning the screen into a wall of text. */
.rb15-enhance-card h3,.rb15-role-card h3{font-size:15px!important;line-height:1.25!important}
.rb15-enhance-card small,.rb15-role-card header small{font-size:10.5px!important;line-height:1.35!important}
.rb15-enhance-row,.rb15-enhance-empty,.rb15-role-row strong,.rb15-role-empty{font-size:12.5px!important;line-height:1.42!important}
.rb15-role-row small,.rb15-role-row em,.rb15-role-mini{font-size:11px!important;line-height:1.38!important}
.rb15-role-metric strong{font-size:27px!important}.rb15-role-metric span,.rb15-role-sub{font-size:11.5px!important}
.rb15-enhance-btn,.rb15-role-button{font-size:12px!important;min-height:36px!important}
.rb15-cap-row strong{font-size:12.5px!important}.rb15-cap-row span{font-size:11.5px!important}
.rb15-enhance-btn[data-rb-role-cap],.rb15-enhance-btn[data-rb-enhance-capacity],.rb15-role-button[data-rb-role-cap]{position:relative!important;z-index:3!important;pointer-events:auto!important}

/* Icon-only is semantic: only controls with a reliable icon mapping lose visible text. */
:root[data-rb-icon-language="1"] .language-menu select,
:root[data-rb-icon-language="1"] [data-researchbook-language]{min-width:112px}
:root[data-rb-icon-language="1"] button[data-rb154-icon]{
  min-width:42px!important;max-width:none!important;padding-inline:10px!important;
  font-size:0!important;line-height:1!important;text-align:center!important;justify-content:center!important;align-items:center!important;
}
:root[data-rb-icon-language="1"] button[data-rb154-icon]>*{display:none!important}
:root[data-rb-icon-language="1"] button[data-rb154-icon]::after{
  content:attr(data-rb154-icon);display:inline-block!important;font-size:18px!important;line-height:1!important;letter-spacing:0!important;
}
/* Content is never iconified: names, dates, experiment titles and participant IDs remain readable. */
:root[data-rb-icon-language="1"] .rb15-experiment-tile,
:root[data-rb-icon-language="1"] .rb15-session,
:root[data-rb-icon-language="1"] .ranked-time,
:root[data-rb-icon-language="1"] .availability-list button{font-size:inherit!important;text-align:inherit!important}

@media(max-width:1200px){
  .portfolio-bar.rb154-portfolio-with-zone{grid-template-columns:minmax(170px,.58fr) minmax(220px,1fr) minmax(155px,.65fr) auto}
  .rb-cross-role-busy.rb154-compact>.rb154-busy-chips{display:none}
}
@media(max-width:980px){
  .dashboard-grid,.dashboard-grid.rb154-detail-panel-collapsed{grid-template-columns:1fr!important}
  .detail-column{order:-1}
  .dashboard-grid.rb154-detail-panel-collapsed .detail-column{min-height:44px}
  .dashboard-grid.rb154-detail-panel-collapsed .rb154-detail-panel-toggle{position:static;writing-mode:horizontal-tb;width:100%;min-height:38px;height:38px;margin:0;flex-direction:row}
  .dashboard-grid.rb154-detail-panel-collapsed .rb154-detail-panel-toggle b{writing-mode:horizontal-tb;display:block}
  .portfolio-bar.rb154-portfolio-with-zone{grid-template-columns:1fr 1fr}
  .rb-cross-role-busy.rb154-compact{grid-column:1/-1;order:3}.manage-experiments{justify-self:end}
}


/* 1.54: normal languages are text-first. The compact time-zone pill shows only zone + live clock. */
.rb-cross-role-busy.rb154-compact{position:relative;overflow:visible!important;cursor:help;justify-content:center;padding-inline:10px;min-width:175px}
.rb-cross-role-busy.rb154-compact>.rb154-zone-copy{display:flex!important;align-items:baseline;gap:6px;min-width:0;white-space:nowrap}
.rb-cross-role-busy.rb154-compact>.rb154-zone-copy strong{font-size:10.5px!important;font-weight:800;overflow:hidden;text-overflow:ellipsis}
.rb-cross-role-busy.rb154-compact>.rb154-zone-copy small{font-size:10.5px!important;font-weight:900;color:#1759a6!important;overflow:visible}
.rb-cross-role-busy.rb154-compact>.rb154-zone-icon,
.rb-cross-role-busy.rb154-compact>.rb154-busy-chips{display:none!important}
.rb-cross-role-busy.rb154-compact[data-rb-detail]::after{
  content:attr(data-rb-detail);position:absolute;z-index:80;top:calc(100% + 7px);left:50%;transform:translateX(-50%) translateY(-3px);
  width:max-content;max-width:min(440px,72vw);padding:9px 11px;border:1px solid #cad9e9;border-radius:9px;background:rgba(255,255,255,.98);
  color:#3f5973;box-shadow:0 10px 26px rgba(18,52,88,.16);font-size:10px;line-height:1.45;white-space:normal;opacity:0;visibility:hidden;pointer-events:none;
  transition:opacity .12s ease,transform .12s ease,visibility .12s ease;
}
.rb-cross-role-busy.rb154-compact[data-rb-detail]:hover::after,
.rb-cross-role-busy.rb154-compact[data-rb-detail]:focus-within::after{opacity:1;visibility:visible;transform:translateX(-50%) translateY(0)}

/* Supervisor / PI switch is always above dashboard cards and remains clickable after dashboard rerenders. */
#rb15-mode-switch{position:relative;z-index:35;pointer-events:auto;isolation:isolate}
#rb15-mode-switch button{position:relative;z-index:36;pointer-events:auto!important;cursor:pointer!important}

/* Icon language: only in this explicitly selected mode do mapped controls become emoji-only. */
:root[data-rb-icon-language="1"] button[data-rb154-icon]{font-family:"Apple Color Emoji","Segoe UI Emoji","Noto Color Emoji",sans-serif!important}

/* On narrow screens keep the record-panel toggle inside its own row instead of over controls. */
@media(max-width:980px){
  .rb154-detail-panel-toggle{position:static!important;left:auto!important;right:auto!important;margin:0 0 7px auto!important;width:34px!important;height:32px!important}
}

/* 1.56: researcher-home cards use text as the primary cue in normal languages.
   Remove decorative boxed SVGs/arrows that looked like extra buttons. */
.custom-schedule-home-card .custom-schedule-home-icon,
.research-settings-home-card > span:first-child,
.research-home-shortcuts .custom-schedule-home-card > i[aria-hidden="true"],
.research-home-shortcuts .research-settings-home-card > i[aria-hidden="true"],
.experiment-card-heading .experiment-icon{
  display:none!important;
}
.custom-schedule-home-card,
.research-settings-home-card{
  grid-template-columns:minmax(0,1fr)!important;
}
.experiment-card-heading{
  grid-template-columns:minmax(0,1fr)!important;
}
@media (hover:none), (pointer:coarse) {
  .rb-cross-role-busy.rb154-compact[data-rb-detail]{cursor:pointer}
  .rb-cross-role-busy.rb154-compact[data-rb-detail].rb154-touch-detail-open{z-index:90}
}
