/* Alan, drawn from the shell's own parts: the Appearance panel's frosted
   glass and rise, its 32px rows (14px Inter, 6px corners, 4% / 6% greys),
   the sidebar's 16px colour square for a mark, the tab bar's 24px buttons,
   the header's Search field for the composer and its Add button's black
   for sending. The panel docks flush at the right, full height. */
#alan-root { font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif; letter-spacing: -0.005em; }

/* Mr. Turing's picture: a Turing pattern in a rounded square, like the
   sidebar's colour squares. */
.al-mark { position: relative; flex: none; width: 20px; height: 20px; border-radius: 5px; overflow: hidden;
  background: #e9e9e9 center / cover no-repeat; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.06); }
.al-mark.is-large { width: 36px; height: 36px; border-radius: 9px; }
.al-mark.is-tile { width: 24px; height: 24px; border-radius: 7px; }

/* The launcher: frosted, at the bottom right. */
.al-launch {
  position: fixed; right: 20px; bottom: 20px; z-index: 1200;
  display: inline-flex; align-items: center; gap: 9px; height: 34px; padding: 0 13px 0 9px;
  border: 1px solid #ececec; border-radius: 10px;
  background: rgba(255, 255, 255, 0.72); backdrop-filter: blur(20px) saturate(180%); -webkit-backdrop-filter: blur(20px) saturate(180%);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.06);
  color: #2a2a2a; font: inherit; font-size: 13.5px; font-weight: 500; cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.al-launch:hover { background: rgba(255, 255, 255, 0.92); border-color: #e2e2e2; }

/* The panel: docked flush at the right, full height, frosted like Appearance. */
.al-panel {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 2000; width: 392px; max-width: 100vw;
  display: flex; flex-direction: column;
  border-left: 1px solid #e3e3e3;
  background: rgba(255, 255, 255, 0.84); backdrop-filter: blur(20px) saturate(180%); -webkit-backdrop-filter: blur(20px) saturate(180%);
  /* Raised over the page like the site's other floating surfaces (the same
     three layers: a hairline, a near shadow and a far one), cast to the left,
     with the edge itself catching the light. */
  box-shadow:
    inset 1px 0 0 rgba(255, 255, 255, 0.9),
    -1px 0 1px rgba(0, 0, 0, 0.035),
    -12px 0 30px rgba(0, 0, 0, 0.085),
    -30px 0 64px rgba(0, 0, 0, 0.05);
  color: #2a2a2a;
  transition: transform 380ms cubic-bezier(0.4, 0, 0.2, 1), opacity 240ms ease;
}
.al-panel.is-entering { transform: translateX(16px); opacity: 0; }

.al-head { flex: none; display: flex; align-items: center; gap: 10px; height: 48px; padding: 0 10px 0 16px; }
.al-head b { flex: 1 1 auto; font-size: 14px; font-weight: 500; color: #2a2a2a; }
.al-head-tools { display: flex; align-items: center; gap: 4px; }

/* Buttons: the tab bar's, and the rail's icon button. */
.al-btn {
  display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px;
  border: 1px solid #e5e5e5; border-radius: 7px; background: #ffffff;
  color: #0a0a0a; font: inherit; font-size: 13px; font-weight: 500; cursor: pointer; white-space: nowrap;
}
.al-btn:hover { background: #fafafa; }
.al-btn .mo-ic { width: 14px; height: 14px; stroke-width: 1.6; }
.al-btn.is-quiet { border-color: transparent; background: transparent; color: #5a5a5a; }
.al-btn.is-quiet:hover { background: rgba(0, 0, 0, 0.04); color: #0a0a0a; }
.al-icon { width: 28px; height: 28px; display: grid; place-items: center; border: 0; border-radius: 7px; background: transparent; color: #4a4a4a; cursor: pointer; }
.al-icon:hover { background: rgba(0, 0, 0, 0.04); }
.al-icon svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.al-icon.is-small { width: 24px; height: 24px; opacity: 0; }
.al-icon.is-small svg { width: 13px; height: 13px; }

/* The conversation. */
.al-msgs { flex: 1 1 auto; overflow-y: auto; padding: 6px 16px 18px; scrollbar-width: thin; }
.al-msgs > * + * { margin-top: 18px; }
.al-you { display: flex; justify-content: flex-end; }
.al-bubble { max-width: 86%; padding: 8px 12px; border-radius: 10px; background: rgba(0, 0, 0, 0.045); font-size: 14px; line-height: 1.5; }
.al-says { display: grid; grid-template-columns: 20px minmax(0, 1fr); gap: 10px; }
.al-says .al-mark { margin-top: 1px; }
.al-text { min-width: 0; font-size: 14px; line-height: 1.55; color: #2a2a2a; }
.al-text p, .al-bubble p { margin: 0; overflow-wrap: anywhere; }
.al-text p + p, .al-text p + ul, .al-text p + ol, .al-text ul + p, .al-text ol + p { margin-top: 8px; }
.al-text ul, .al-text ol { margin: 6px 0 0; padding-left: 18px; }
.al-text li + li { margin-top: 3px; }
.al-text li::marker { color: #a3a3a3; }
.al-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.al-error { color: #b42318; }
.al-thinking { color: #8a8a8a; }

/* The first view: a greeting, then suggestions as the Appearance rows. */
.al-empty { display: flex; flex-direction: column; padding: 18vh 0 0; }
.al-empty h2 { margin: 14px 0 2px; font-size: 19px; font-weight: 500; letter-spacing: -0.01em; color: #2a2a2a; }
.al-empty > p { margin: 0 0 18px; font-size: 13px; color: #8a8a8a; }
.al-ideas { display: flex; flex-direction: column; gap: 2px; margin: 0 -8px; padding: 0; list-style: none; }
.al-idea { display: flex; align-items: center; gap: 10px; min-height: 32px; padding: 6px 8px; border-radius: 6px; font-size: 14px; color: #2a2a2a; cursor: pointer; }
.al-idea:hover, .al-idea:focus-visible { background: rgba(0, 0, 0, 0.04); outline: none; }
.al-idea .mo-ic { flex: none; width: 17px; height: 17px; stroke: #4a4a4a; }

/* The composer: the header's Search field, grown, with the Add button's black to send. */
.al-compose { flex: none; padding: 10px 14px 14px; }
.al-field {
  display: flex; align-items: flex-end; gap: 6px; padding: 7px;
  border: 1px solid #e5e5e5; border-radius: 10px; background: #ffffff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04); transition: border-color 0.15s, box-shadow 0.15s;
}
.al-field:focus-within { border-color: #d4d4d4; box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06); }
.al-field textarea {
  flex: 1 1 auto; min-height: 22px; max-height: 160px; margin: 3px 0; padding: 0; resize: none;
  border: 0; outline: none; background: transparent; color: #1a1a1a; font: inherit; font-size: 14px; line-height: 1.45;
}
.al-field textarea::placeholder { color: #a9a9a9; }
.al-send {
  flex: none; width: 28px; height: 28px; display: grid; place-items: center; border: 0; border-radius: 7px;
  background: #0a0a0a; color: #ffffff; cursor: pointer; transition: opacity 0.12s, background 0.12s;
}
.al-send:disabled { background: #ececec; color: #a9a9a9; cursor: default; }
.al-send .mo-ic { width: 15px; height: 15px; stroke: currentColor; stroke-width: 2; transform: rotate(90deg); }

/* Your chats: the Appearance rows again, a title and when. */
.al-history { padding-top: 4px; }
.al-chats { display: flex; flex-direction: column; gap: 2px; margin: 0 -8px; padding: 0; list-style: none; }
.al-chat { display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 5px 4px 5px 10px; border-radius: 6px; cursor: pointer; }
.al-chat:hover, .al-chat:focus-visible { background: rgba(0, 0, 0, 0.04); outline: none; }
.al-chat.is-on { background: rgba(0, 0, 0, 0.06); }
.al-chat:hover .al-icon.is-small, .al-chat:focus-within .al-icon.is-small { opacity: 1; }
.al-chat-text { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.al-chat-text b { overflow: hidden; color: #2a2a2a; font-size: 14px; font-weight: 450; white-space: nowrap; text-overflow: ellipsis; }
.al-chat-text em { color: #8a8a8a; font-size: 12px; font-style: normal; }
.al-muted { color: #8a8a8a; font-size: 13px; }
.al-empty.is-short { padding-top: 12vh; }

@media (max-width: 560px) {
  .al-panel { width: 100vw; border-left: 0; }
  .al-launch { right: 16px; bottom: 16px; }
}
@media print { #alan-root { display: none; } }
/* A question asked from a record's menu says which record it is about. */
.al-about { display: flex; align-items: center; gap: 6px; margin: 0 0 8px; color: var(--ds-ink-3, #5c5c5c); font-size: 12.5px; }
.al-about span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.al-about svg { flex: 0 0 auto; width: 13px; height: 13px; }

/* Documents and pictures shown to Mr. Turing: the Search field's corners and
   hairline, a small picture or the file icon, its name and size. */
.al-attach { flex: none; }
.al-attach .mo-ic { width: 16px; height: 16px; }
.al-field textarea { min-width: 0; }
.al-files { display: flex; flex-wrap: wrap; gap: 6px; }
.al-files:not(:empty) { margin-bottom: 8px; }
.al-file {
  display: flex; align-items: center; gap: 8px; width: 100%; min-height: 40px; padding: 5px 4px 5px 6px;
  border: 1px solid #e5e5e5; border-radius: 7px; background: #ffffff; color: #2a2a2a; font-size: 13px; text-decoration: none;
}
a.al-file { width: auto; max-width: 100%; padding-right: 10px; }
a.al-file:hover { border-color: #d4d4d4; }
.al-file-pic { flex: none; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 5px; background: #f2f2f2 center / cover no-repeat; color: #4a4a4a; }
.al-file-pic .mo-ic { width: 15px; height: 15px; }
.al-file-text { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; text-align: left; }
.al-file-text b { overflow: hidden; font-weight: 500; white-space: nowrap; text-overflow: ellipsis; }
.al-file-text em { overflow: hidden; color: #707070; font-size: 12px; font-style: normal; white-space: nowrap; text-overflow: ellipsis; }
.al-file.is-failed .al-file-text em { color: #b42318; white-space: normal; }
.al-icon.is-tiny { flex: none; width: 24px; height: 24px; }
.al-icon.is-tiny svg { width: 13px; height: 13px; }
.al-files-error { flex: 1 0 100%; margin: 0; color: #b42318; font-size: 12.5px; line-height: 1.4; }
.al-you { flex-direction: column; align-items: flex-end; gap: 6px; }
.al-sent { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; max-width: 86%; }
.al-sent-pic { display: block; overflow: hidden; border: 1px solid #e5e5e5; border-radius: 8px; }
.al-sent-pic img { display: block; max-width: 100%; max-height: 220px; }
.al-drop { display: none; position: absolute; inset: 0; z-index: 3; place-items: center; background: rgba(255, 255, 255, 0.92); color: #2a2a2a; font-size: 14px; font-weight: 500; pointer-events: none; }
.al-drop span { padding: 10px 14px; border: 1px solid #d4d4d4; border-radius: 7px; background: #ffffff; }
.al-panel.is-dropping .al-drop { display: grid; }
html[data-appearance="night"] .al-file { border-color: #3f3f3f; background-color: #1e1e1e; color: #e4e4e4; }
html[data-appearance="night"] a.al-file:hover { border-color: #4f4f4f; }
html[data-appearance="night"] .al-file-pic { background-color: #2a2a2a; color: #c8c8c8; }
html[data-appearance="night"] .al-file-text em { color: #a3a3a3; }
html[data-appearance="night"] .al-file.is-failed .al-file-text em, html[data-appearance="night"] .al-files-error { color: #f97066; }
html[data-appearance="night"] .al-sent-pic { border-color: #3f3f3f; }
html[data-appearance="night"] .al-drop { background: rgba(24, 24, 24, 0.92); color: #e4e4e4; }
html[data-appearance="night"] .al-drop span { border-color: #4f4f4f; background: #1e1e1e; }
html[data-appearance="paper"] .al-file { border-color: #e5e5e1; background-color: #fafaf7; }
html[data-appearance="paper"] a.al-file:hover { border-color: #d4d4cf; }
html[data-appearance="paper"] .al-file-pic { background-color: #f0f0eb; }
html[data-appearance="paper"] .al-sent-pic { border-color: #e5e5e1; }
html[data-appearance="paper"] .al-drop { background: rgba(250, 250, 247, 0.92); }
html[data-appearance="paper"] .al-drop span { border-color: #d4d4cf; background: #fafaf7; }

/* A change he proposes: what it is, what it would change, and the button. */
.al-change { margin-top: 10px; padding: 9px 10px 10px; border: 1px solid #e5e5e5; border-radius: 7px; background: #ffffff; }
.al-change-head { display: flex; align-items: center; gap: 7px; min-width: 0; font-size: 13px; }
.al-change-head b { min-width: 0; overflow-wrap: anywhere; font-weight: 500; color: #0a0a0a; }
.al-change-head .mo-ic { flex: none; width: 14px; height: 14px; }
.al-change-rows { margin-top: 7px; border-top: 1px solid #efefef; }
.al-change-row { display: grid; grid-template-columns: 76px minmax(0, 1fr); gap: 10px; padding: 6px 0; border-bottom: 1px solid #efefef; font-size: 13px; line-height: 1.45; }
.al-change-row > span { color: #707070; }
.al-change-row b { display: block; font-weight: 450; color: #1a1a1a; overflow-wrap: anywhere; white-space: pre-wrap; }
.al-change-row s { display: block; margin-bottom: 3px; color: #8a8a8a; overflow-wrap: anywhere; white-space: pre-wrap; }
.al-change-row b.is-gone { color: #b42318; }
.al-change-problem { margin: 7px 0 0; color: #b42318; font-size: 12.5px; line-height: 1.4; }
.al-change-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 9px; }
.al-change-tools em { color: #5a5a5a; font-size: 12.5px; font-style: normal; }
.al-btn.is-go { border-color: #0a0a0a; background: #0a0a0a; color: #ffffff; }
.al-btn.is-go:hover { background: #2a2a2a; }
.al-btn.is-go.is-danger { border-color: #b42318; background: #b42318; }
.al-btn.is-go.is-danger:hover { background: #912018; }
html[data-appearance="night"] .al-change { border-color: #3f3f3f; background-color: #1e1e1e; }
html[data-appearance="night"] .al-change-head b, html[data-appearance="night"] .al-change-row b { color: #e4e4e4; }
html[data-appearance="night"] .al-change-rows, html[data-appearance="night"] .al-change-row { border-color: #333333; }
html[data-appearance="night"] .al-change-row > span, html[data-appearance="night"] .al-change-tools em { color: #a3a3a3; }
html[data-appearance="night"] .al-change-row s { color: #9a9a9a; }
html[data-appearance="night"] .al-change-row b.is-gone, html[data-appearance="night"] .al-change-problem { color: #f97066; }
html[data-appearance="night"] .al-btn.is-go { border-color: #ececec; background-color: #ececec; color: #121212; }
html[data-appearance="night"] .al-btn.is-go:hover { background-color: #d4d4d4; }
html[data-appearance="night"] .al-btn.is-go.is-danger { border-color: #f97066; background-color: #f97066; color: #121212; }
html[data-appearance="paper"] .al-change { border-color: #e5e5e1; background-color: #fafaf7; }
html[data-appearance="paper"] .al-change-rows, html[data-appearance="paper"] .al-change-row { border-color: #ecece8; }

