/* Shared EnquireHere layout and component styles. Company palettes live in companies/<company>/css/theme.css. */

*{box-sizing:border-box;}
  html,body{margin:0;height:100%;}
  body{
    font-family:'Inter',sans-serif;
    background:var(--parchment);
    color:var(--ink);
    display:flex;
    flex-direction:column;
    height:100vh;
    overflow:hidden;
  }
  header.app-header{
    padding:7px 22px;
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:16px;
    border-bottom:1px solid var(--line);
    background:var(--header-bg);
    color:var(--header-text, var(--ink));
    min-height:72px;
    flex-shrink:0;
  }
  .company-logo{
    display:block;
    margin:0;
    width:auto;
    height:58px;
    max-width:min(260px, 42vw);
    object-fit:contain;
    flex:0 1 auto;
  }
  header.app-header .tag{
    margin-left:auto;
    color:var(--header-muted, var(--text-soft));
    font-size:12.5px;
    line-height:1.4;
    text-align:right;
    white-space:nowrap;
  }
  header.app-header .tag strong{font-weight:700;color:var(--header-text, var(--ink));}
  header .brand{
    font-family:'Fraunces',serif;
    font-weight:600;
    font-size:20px;
    letter-spacing:-0.01em;
	margin-left: auto; 
  }
      header .work{
    font-family: "Times New Roman", Times, serif;
    font-weight:60;
    font-size:20px;
    letter-spacing:-0.01em;
  }
  header .tag{
    font-size:12.5px;
    color:var(--header-muted, var(--text-soft));
  }
  .layout{
    flex:1;
    display:flex;
    min-height:0;
  }
  /* CHAT PANEL */
  .chat-panel{
    width:38%;
    min-width:300px;
    display:flex;
    flex-direction:column;
    border-right:1px solid var(--line);
    background:var(--panel);
  }
  .chat-header{
    padding:14px 20px;
    font-family:'Fraunces',serif;
    font-size:14.5px;
    color:var(--text-soft);
    border-bottom:1px solid var(--line);
    text-transform:uppercase;
    letter-spacing:0.06em;
  }
  .messages{
    flex:1;
    overflow-y:auto;
    padding:20px;
    display:flex;
    flex-direction:column;
    gap:14px;
  }
  .msg{
    max-width:82%;
    padding:10px 14px;
    border-radius:14px;
    font-size:14.5px;
    line-height:1.5;
  }
  .msg.bot{
    background:var(--sage-dim);
    color:var(--ink);
    border-bottom-left-radius:4px;
    align-self:flex-start;
    overflow-wrap:anywhere;
  }
  .msg.bot p{margin:0 0 8px;}
  .msg.bot p:last-child{margin-bottom:0;}
  .msg.bot h1,.msg.bot h2,.msg.bot h3{font-family:inherit;font-weight:700;line-height:1.35;margin:3px 0 8px;}
  .msg.bot h1{font-size:1.15em;}
  .msg.bot h2{font-size:1.1em;}
  .msg.bot h3{font-size:1.05em;}
  .msg.bot ul,.msg.bot ol{margin:5px 0 9px;padding-left:22px;}
  .msg.bot li{padding-left:2px;}
  .msg.bot li+li{margin-top:3px;}
  .msg.bot strong{font-weight:700;}
  .msg.bot em{font-style:italic;}
  .msg.bot code{font-family:ui-monospace,SFMono-Regular,Consolas,monospace;font-size:.92em;padding:1px 4px;border-radius:4px;background:rgba(0,0,0,.06);}
  .msg.bot a{position:relative;z-index:1;pointer-events:auto;cursor:pointer;color:var(--amber-deep);text-decoration:underline;text-underline-offset:2px;overflow-wrap:anywhere;}
  .msg.bot a:hover{opacity:.82;}
  .message-resource-links{margin-top:9px;padding-top:8px;border-top:1px solid rgba(0,0,0,.12);max-width:100%;}
  .message-resource-links-title{font-size:11.5px;font-weight:700;margin-bottom:5px;color:var(--text-soft);}
  .message-resource-link-list{display:flex;flex-direction:column;gap:6px;max-width:100%;}
  .msg.bot .message-resource-link{display:flex;align-items:center;gap:8px;min-width:0;padding:8px 9px;border:1px solid var(--line);border-radius:8px;background:rgba(255,255,255,.78);color:var(--ink);text-decoration:none;}
  .msg.bot .message-resource-link:hover{background:var(--panel);border-color:var(--amber);opacity:1;}
  .message-resource-link-icon{display:flex;align-items:center;justify-content:center;flex:0 0 25px;width:25px;height:25px;border-radius:7px;background:var(--sage-dim);color:var(--amber-deep);font-size:13px;}
  .message-resource-link-title{flex:1 1 auto;min-width:0;font-size:12.5px;line-height:1.35;font-weight:600;overflow-wrap:anywhere;}
  .message-resource-link-format{flex:0 0 auto;color:var(--text-soft);font-size:10px;}
  .msg.user{
    background:var(--action, var(--ink));
    color:#FFFFFF;
    border-bottom-right-radius:4px;
    align-self:flex-end;
  }
  .msg.system{
    align-self:center;
    max-width:95%;
    background:none;
    border:1px dashed var(--line);
    color:var(--text-soft);
    font-family:'Inter',monospace;
    font-size:12px;
    padding:8px 12px;
    border-radius:10px;
  }
  .msg.system .ok{color:var(--sage);font-weight:700;}
  .msg.system .fail{color:#C0392B;font-weight:700;}
  .composer{
    display:flex;
    gap:8px;
    padding:14px;
    border-top:1px solid var(--line);
  }
  .composer input{
    flex:1;
    border:1px solid var(--line);
    border-radius:10px;
    padding:11px 14px;
    font-size:14.5px;
    font-family:inherit;
    background:var(--parchment);
    color:var(--ink);
  }
  .composer input:focus{outline:2px solid var(--sage);outline-offset:1px;}
  .composer button{
    background:var(--action, var(--ink));
    color:#FFFFFF;
    border:none;
    border-radius:10px;
    padding:0 18px;
    font-family:inherit;
    font-weight:600;
    font-size:14px;
    cursor:pointer;
  }
  .composer button:hover{background:var(--action-deep, var(--amber-deep));}
  /* DISPLAY PANEL */
  .display-panel{
    flex:1;
    display:flex;
    flex-direction:column;
    min-width:0;
    min-height:0;
    background:var(--display-panel-bg);
  }
  .display-tabs{
    display:flex;
    gap:2px;
    padding:14px 24px 0;
    border-bottom:1px solid var(--line);
    background:var(--tabs-bg);
  }
  .display-tabs button{
    background:none;
    border:none;
    font-family:'Fraunces',serif;
    font-size:14px;
    padding:8px 4px 12px;
    margin-right:22px;
    color:var(--text-soft);
    cursor:pointer;
    border-bottom:2px solid transparent;
  }
  .display-tabs button.active{
    color:var(--ink);
    border-bottom-color:var(--amber);
  }
  .display-body{
    flex:1;
    overflow-y:auto;
    padding:28px 32px;
  }
  .display-empty{
    height:100%;
    display:flex;
    flex-direction:column;
    align-items:center;
    justify-content:center;
    text-align:center;
    color:var(--text-soft);
    gap:6px;
  }
  .display-empty .glyph{
    width:44px;height:44px;border-radius:50%;
    border:1.5px dashed var(--line);
    display:flex;align-items:center;justify-content:center;
    font-family:'Fraunces',serif;font-size:18px;color:var(--sage);
    margin-bottom:8px;
  }
  .card{
    border:1px solid var(--line);
    border-radius:14px;
    padding:20px;
    background:var(--panel);
    margin-bottom:16px;
    animation:rise .35s ease both;
  }
  .card h3{
    font-family:'Fraunces',serif;
    font-weight:600;
    font-size:18px;
    margin:0 0 8px;
  }
  .card p{
    font-size:14px;
    line-height:1.6;
    color:var(--text-soft);
    margin:0 0 10px;
  }
  .card .meta{
    display:inline-block;
    font-size:11.5px;
    text-transform:uppercase;
    letter-spacing:.06em;
    color:var(--amber-deep);
    background:#FBF1DD;
    padding:3px 9px;
    border-radius:6px;
    margin-bottom:10px;
  }
  .video-frame{
    aspect-ratio:16/9;
    border-radius:10px;
    background:linear-gradient(135deg,var(--ink),#274946);
    display:flex;align-items:center;justify-content:center;
    color:var(--parchment);
    font-family:'Fraunces',serif;
    margin-bottom:12px;
  }
  .video-player{
    aspect-ratio:16/9;
    width:100%;
    border-radius:10px;
    border:none;
    margin-bottom:14px;
    background:var(--ink);
  }
  .resource-preview-card{
    border:1px solid var(--line);
    border-radius:12px;
    background:var(--panel);
    padding:12px;
    margin-bottom:12px;
  }
  .resource-preview-card h3{
    margin:0 0 6px;
    font-size:15px;
    line-height:1.35;
  }
  .resource-preview-card p{
    margin:0 0 10px;
    color:var(--text-soft);
    font-size:12.5px;
    line-height:1.45;
  }
  .resource-document-preview{
    display:block;
    width:100%;
    height:min(58vh,560px);
    min-height:300px;
    border:1px solid var(--line);
    border-radius:8px;
    background:#fff;
  }
  .resource-image-preview{
    display:block;
    width:100%;
    max-height:260px;
    object-fit:contain;
    border-radius:8px;
    background:var(--parchment);
  }
  .resource-open-link{
    display:inline-block;
    margin-top:9px;
    font-size:12.5px;
    color:var(--amber-deep);
  }
  .resource-preview-unavailable{
    padding:12px;
    border:1px dashed var(--line);
    border-radius:8px;
    color:var(--text-soft);
    font-size:12.5px;
    line-height:1.45;
  }
  .resource-format{
    flex-shrink:0;
    margin-left:auto;
    color:var(--text-soft);
    font-size:10.5px;
    white-space:nowrap;
  }
  .resource-item-disabled{cursor:default;opacity:.75;}
  .resource-item-disabled:hover{background:var(--panel);border-color:var(--line);}
  .clip-strip{
    display:flex;
    gap:10px;
    overflow-x:auto;
    padding-bottom:4px;
    margin-bottom:18px;
  }
  .clip-thumb{
    flex-shrink:0;
    width:130px;
    border:1px solid var(--line);
    border-radius:9px;
    background:var(--panel);
    cursor:pointer;
    padding:0;
    text-align:left;
    overflow:hidden;
  }
  .clip-thumb.active{border-color:var(--amber);}
  .clip-thumb .thumb-img{
    width:100%;
    aspect-ratio:16/9;
    background:linear-gradient(135deg,var(--ink),#274946);
    display:flex;align-items:center;justify-content:center;
    color:var(--parchment);
    font-size:16px;
  }
  .clip-thumb .thumb-label{
    display:block;
    font-size:11.5px;
    padding:6px 8px;
    color:var(--ink);
    font-weight:500;
    line-height:1.3;
  }

  /* SMART LINK LIST — resources nested under a tab's content */
  .resource-list{
    margin-top:4px;
  }
  .resource-list .resource-heading{
    font-size:11.5px;
    text-transform:uppercase;
    letter-spacing:.06em;
    color:var(--text-soft);
    margin-bottom:8px;
  }
  .resource-item{
    display:flex;
    align-items:center;
    gap:10px;
    padding:11px 14px;
    border:1px solid var(--line);
    border-radius:10px;
    margin-bottom:8px;
    text-decoration:none;
    color:var(--ink);
    background:var(--panel);
    animation:rise .3s ease both;
  }
  .resource-item:hover{border-color:var(--amber);background:var(--sage-dim);}
  .resource-item .icon{
    width:26px;height:26px;flex-shrink:0;
    border-radius:7px;
    background:var(--sage-dim);
    display:flex;align-items:center;justify-content:center;
    font-size:13px;color:var(--amber-deep);
    font-family:'Fraunces',serif;
  }
  .resource-item .rlabel{
    font-size:13.5px;
    font-weight:500;
  }


  /* Resource history: lets visitors return to resources from earlier questions. */
  .resource-history{margin-bottom:18px;}
  .resource-history-intro{font-size:12.5px;line-height:1.5;color:var(--text-soft);margin:0 0 12px;}
  .resource-history-entry{margin-bottom:10px;}
  .resource-history-select{
    width:100%;display:flex;align-items:center;justify-content:space-between;gap:12px;
    text-align:left;padding:13px 15px;border:1px solid var(--line);border-radius:11px;
    background:var(--panel);color:var(--ink);cursor:pointer;font:inherit;
  }
  .resource-history-select:hover{border-color:var(--sage);background:var(--sage-dim);}
  .resource-history-select.active{border-color:var(--sage);background:var(--sage-dim);box-shadow:inset 3px 0 0 var(--sage);}
  .resource-history-course{display:block;font-size:13.5px;font-weight:600;line-height:1.4;}
  .resource-history-count{display:block;margin-top:3px;font-size:11.5px;color:var(--text-soft);}
  .resource-history-state{flex-shrink:0;font-size:11.5px;color:var(--text-soft);}
  .resource-history-selected{padding:12px 0 2px 12px;border-left:2px solid var(--sage);margin:0 0 6px 8px;}
  .resource-context{
    display:flex;align-items:center;flex-wrap:wrap;gap:6px 10px;padding:10px 13px;margin-bottom:14px;
    border:1px solid var(--line);border-radius:10px;background:rgba(255,255,255,.72);font-size:12.5px;
  }
  .resource-context-label{color:var(--text-soft);}
  .resource-context strong{font-weight:600;}
  .resource-context button{margin-left:auto;border:1px solid var(--line);border-radius:16px;background:var(--panel);padding:5px 10px;color:var(--ink);font:inherit;font-size:11.5px;cursor:pointer;}
  .resource-context button:hover{border-color:var(--sage);}

  /* LINK BAR */
  .link-bar{
    flex-shrink:0;
    border-top:1px solid var(--line);
    background:var(--footer-link-bar-bg);
    padding:12px 24px;
    display:flex;
    align-items:center;
    gap:10px;
    overflow-x:auto;
  }
  .link-bar .label{
    font-size:11.5px;
    text-transform:uppercase;
    letter-spacing:.06em;
    color:var(--text-soft);
    flex-shrink:0;
  }
  .pill{
    flex-shrink:0;
    display:flex;
    align-items:center;
    gap:6px;
    background:var(--sage-dim);
    border:1px solid transparent;
    color:var(--ink);
    padding:7px 14px;
    border-radius:20px;
    font-size:13px;
    font-weight:500;
    cursor:pointer;
    white-space:nowrap;
    animation:pop .3s ease both;
  }
  .pill .tag{
    font-size:10.5px;
    text-transform:uppercase;
    letter-spacing:.04em;
    color:var(--amber-deep);
    background:#FBF1DD;
    padding:2px 6px;
    border-radius:5px;
  }
  .pill:hover{border-color:var(--amber);}
  .pill.empty{
    color:var(--text-soft);
    background:none;
    border:1px dashed var(--line);
    cursor:default;
  }
  @keyframes rise{from{opacity:0;transform:translateY(6px);}to{opacity:1;transform:translateY(0);}}
  @keyframes pop{from{opacity:0;transform:scale(.85);}to{opacity:1;transform:scale(1);}}

  /* Hidden on desktop; created by app.js and enabled on mobile only. */
  .mobile-panel-switch{display:none;}
  .mobile-resource-hint{display:none;}
  .mobile-resource-hint[hidden]{display:none!important;}

  @media (max-width:760px){
    html,body{width:100%;max-width:100%;height:100%;overflow:hidden;}
    body{height:100vh;height:100dvh;min-height:0;max-width:100vw;}
    header.app-header{padding:6px 12px;gap:8px;min-height:58px;max-width:100%;}
    header.app-header .tag{font-size:10.5px;white-space:normal;line-height:1.25;max-width:42%;}
    .company-logo{height:44px;max-width:min(220px,58vw);}

    .mobile-panel-switch{
      display:flex;flex:0 0 auto;gap:6px;align-items:center;width:100%;min-width:0;
      padding:6px 8px;background:var(--tabs-bg);border-bottom:1px solid var(--line);
    }
    .mobile-resource-hint:not([hidden]){display:block;flex:0 0 auto;box-sizing:border-box;padding:8px 12px;color:var(--text-soft);background:var(--display-panel-bg);border-bottom:1px solid var(--line);font-size:12px;line-height:1.4;}
    .mobile-panel-switch button{
      position:relative;display:flex;align-items:center;justify-content:center;gap:6px;
      flex:1 1 0;min-width:0;min-height:40px;padding:8px 10px;
      border:1px solid transparent;border-radius:9px;background:transparent;
      color:var(--ink);font:600 13px/1.2 'Inter',sans-serif;cursor:pointer;
    }
    .mobile-panel-switch button.active{background:var(--action,var(--ink));color:#fff;border-color:var(--action,var(--ink));}
    .mobile-panel-switch button.has-new-resources::after{
      content:"New";display:block;position:absolute;right:5px;top:-4px;
      padding:3px 6px;border-radius:999px;background:var(--action,var(--ink));color:#fff;
      box-shadow:0 0 0 2px var(--tabs-bg);font:700 9px/1.2 'Inter',sans-serif;letter-spacing:.01em;
      animation:resourceNoticePulse 1.4s ease-in-out 2;
    }
    @keyframes resourceNoticePulse{
      0%,100%{transform:scale(1);filter:brightness(1)}
      50%{transform:scale(1.08);filter:brightness(1.12)}
    }
    @media (prefers-reduced-motion: reduce){
      .mobile-panel-switch button.has-new-resources::after{animation:none;}
    }

    .layout{flex:1 1 auto;display:flex;flex-direction:column;min-height:0;min-width:0;width:100%;max-width:100%;overflow:hidden;}
    .layout .chat-panel,.layout .display-panel{
      display:flex;flex:1 1 auto;width:100%;max-width:100%;height:100%;min-width:0;min-height:0;
      border-right:none;border-bottom:none;overflow:hidden;
    }
    .layout .chat-panel{min-width:0;}
    .layout[data-mobile-view="chat"] .display-panel{display:none;}
    .layout[data-mobile-view="resources"] .chat-panel{display:none;}

    .chat-header{flex:0 0 auto;padding:10px 13px;font-size:12.5px;}
    .messages{flex:1 1 auto;min-height:0;min-width:0;overflow-y:auto;overflow-x:hidden;padding:12px;gap:11px;overscroll-behavior:contain;}
    .msg{max-width:94%;font-size:14px;overflow-wrap:anywhere;}
    .composer{flex:0 0 auto;min-width:0;gap:8px;padding:8px;padding-bottom:calc(8px + env(safe-area-inset-bottom));}
    .composer input{min-width:0;width:0;padding:10px 12px;font-size:16px;}
    .composer button{flex:0 0 auto;min-height:44px;padding:0 14px;}

    .display-tabs{flex:0 0 auto;display:flex;gap:0;min-width:0;overflow-x:auto;overscroll-behavior-x:contain;padding:7px 6px 0;}
    .display-tabs button{flex:1 1 0;min-width:0;margin:0;padding:10px 2px 11px;font-size:12px;white-space:nowrap;}
    .display-body{flex:1 1 auto;min-width:0;min-height:0;overflow-x:hidden;overflow-y:auto;padding:12px;overscroll-behavior:contain;}
    .resource-document-preview{width:100%;height:clamp(220px,46dvh,420px);min-height:220px;max-width:100%;}
    .resource-image-preview,.video-player,.card,.resource-preview-card{max-width:100%;}
    .resource-context{min-width:0;align-items:flex-start;gap:6px 8px;padding:9px 10px;overflow-wrap:anywhere;}
    .resource-context strong{min-width:0;flex:1 1 100%;overflow-wrap:anywhere;}
    .resource-context button{margin-left:0;flex:0 0 auto;min-height:34px;}
    .resource-item{min-width:0;max-width:100%;gap:8px;padding:10px;}
    .resource-item .rlabel{min-width:0;overflow-wrap:anywhere;}
    .resource-format{font-size:10px;}
    .clip-strip{max-width:100%;overflow-x:auto;overscroll-behavior-x:contain;}

    /* On phones, the Resources view already provides the full collection and history.
       Hide the redundant quick-link strip to preserve vertical space and avoid duplication. */
    .link-bar{display:none!important;}
  }
  @media (max-width:380px){
    header.app-header{padding-left:8px;padding-right:8px;gap:6px;}
    .company-logo{height:40px;max-width:55vw;}
    header.app-header .tag{font-size:9.5px;max-width:40%;}
    .mobile-panel-switch{padding:5px 6px;gap:5px;}
    .mobile-panel-switch button{min-height:38px;font-size:12px;padding-left:5px;padding-right:5px;}
    .display-tabs button{font-size:11.5px;}
    .display-body{padding:9px;}
    .composer{padding:7px;padding-bottom:calc(7px + env(safe-area-inset-bottom));}
    .composer button{padding:0 12px;}
  }
