/* CAACOTyping — Local guest profile (no sign-in)
   Styles for the first-run welcome modal and the start-menu editor
   link. Kept self-contained so adding this file is a no-op when the
   page doesn't have a guest profile surface. */

/* --- Start-menu "建立個人檔案" link --- */
/* Wrapper sits between the blue user header and the white search row,
   so the button has its own slot and no longer pushes the avatar up
   or sits awkwardly inside the userblock. Background matches the
   start-menu's search/columns surface so the button looks like a
   native part of the menu, not a foreign pill. */
.caaco-guest-profile-linkwrap {
    display: block;
    padding: 6px 12px 8px;
    background: linear-gradient(180deg, #d9e6f7 0%, #b7cbe6 100%);
    border-bottom: 1px solid #6f8db8;
}
.caaco-guest-profile-link {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    width: 100%;
    margin: 0;
    padding: 7px 10px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 4px;
    background: #ffffff;
    color: #1a3e6f;
    font: inherit;
    font-size: 12px;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
    transition: background 120ms ease, color 120ms ease, border-color 120ms ease;
}
.caaco-guest-profile-link::before {
    content: "👤";
    font-size: 14px;
    line-height: 1;
    opacity: 0.85;
}
.caaco-guest-profile-link:hover,
.caaco-guest-profile-link:focus-visible {
    background: #1a3e6f;
    color: #fff;
    border-color: #1a3e6f;
    outline: none;
}
.caaco-guest-profile-link:hover::before,
.caaco-guest-profile-link:focus-visible::before { opacity: 1; }
.caaco-guest-profile-link[hidden] { display: none !important; }
.caaco-guest-profile-linkwrap[hidden] { display: none !important; }
.caaco-guest-profile-linkwrap:empty { display: none; }
/* If the button itself is hidden, hide the wrapper too so the row
   collapses cleanly and the search row sits flush under the user
   header. */
.caaco-guest-profile-linkwrap:not(:has(.caaco-guest-profile-link:not([hidden]))) {
    display: none;
}

/* --- First-run / editor modal --- */
.caaco-guest-firstrun {
    position: fixed;
    inset: 0;
    z-index: 200000;      /* above xp-welcome (11050), whatsnew (100000), floppy (120000) */
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: "Segoe UI", "Microsoft JhengHei", Tahoma, sans-serif;
}
.caaco-guest-firstrun[hidden] { display: none !important; }

.caaco-guest-firstrun__backdrop {
    position: absolute; inset: 0;
    background: rgba(20, 30, 50, 0.42);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}

.caaco-guest-firstrun__panel {
    position: relative;
    width: min(440px, 92vw);
    background: linear-gradient(180deg, #fdfefe 0%, #eef3fa 100%);
    color: #1c2733;
    border: 1px solid #a4b8d8;
    border-radius: 8px;
    box-shadow:
        0 18px 50px rgba(20, 36, 70, 0.35),
        0 2px 6px rgba(20, 36, 70, 0.18);
    padding: 18px 20px 16px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    animation: caaco-guest-firstrun-pop 200ms ease-out;
}
@keyframes caaco-guest-firstrun-pop {
    from { opacity: 0; transform: translateY(8px) scale(0.98); }
    to   { opacity: 1; transform: translateY(0)    scale(1);    }
}

.caaco-guest-firstrun__head {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}
.caaco-guest-firstrun__logo {
    flex: 0 0 40px;
    width: 40px; height: 40px;
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.18);
}
.caaco-guest-firstrun__head h2 {
    margin: 0 0 4px;
    font-size: 16px;
    font-weight: 600;
    color: #1a3e6f;
}
.caaco-guest-firstrun__head p {
    margin: 0;
    font-size: 12px;
    color: #4a5a72;
    line-height: 1.5;
}

.caaco-guest-firstrun__body {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.caaco-guest-firstrun__field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 12px;
    color: #2a3a52;
}
.caaco-guest-firstrun__field > span {
    font-weight: 600;
}
.caaco-guest-firstrun__field input[type="text"] {
    font: inherit;
    font-size: 13px;
    padding: 7px 10px;
    border: 1px solid #aab8cf;
    border-radius: 4px;
    background: #fff;
    color: #1c2733;
    transition: border-color 120ms ease, box-shadow 120ms ease;
}
.caaco-guest-firstrun__field input[type="text"]:focus {
    outline: none;
    border-color: #1a3e6f;
    box-shadow: 0 0 0 3px rgba(26, 62, 111, 0.18);
}
.caaco-guest-firstrun__field--upload {
    border: 1px dashed #b6c2d6;
    border-radius: 5px;
    padding: 8px 10px;
    background: rgba(255, 255, 255, 0.55);
}
.caaco-guest-firstrun__field--upload input[type="file"] {
    font: inherit;
    font-size: 12px;
}
.caaco-guest-firstrun__hint {
    font-size: 11px;
    color: #5e6c84;
}

/* Palette swatches */
.caaco-guest-firstrun__palette {
    display: grid;
    grid-template-columns: repeat(6, 28px);
    gap: 8px;
    justify-content: start;
}
.caaco-guest-firstrun__swatch {
    width: 28px; height: 28px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.85);
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.18);
    cursor: pointer;
    transition: transform 120ms ease, box-shadow 120ms ease;
    padding: 0;
}
.caaco-guest-firstrun__swatch[aria-checked="true"] {
    box-shadow:
        0 0 0 2px #fff,
        0 0 0 4px #1a3e6f;
    transform: scale(1.06);
}
.caaco-guest-firstrun__swatch:focus-visible {
    outline: 2px solid #1a3e6f;
    outline-offset: 2px;
}

.caaco-guest-firstrun__preview {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.65);
    border: 1px solid #cfdde6;
    border-radius: 6px;
}
.caaco-guest-firstrun__preview-swatch {
    width: 44px; height: 44px;
    border-radius: 50%;
    background: #888 center / cover no-repeat;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 600;
    font-size: 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.18);
    flex: 0 0 44px;
}
.caaco-guest-firstrun__preview-name {
    font-size: 13px;
    color: #1c2733;
    font-weight: 600;
}

.caaco-guest-firstrun__foot {
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: flex-end;
    flex-wrap: wrap;
}
.caaco-guest-firstrun__btn {
    font: inherit;
    font-size: 12px;
    padding: 6px 14px;
    border-radius: 4px;
    border: 1px solid #b8c4d6;
    background: #fff;
    color: #1c2733;
    cursor: pointer;
    transition: background 120ms ease, border-color 120ms ease;
}
.caaco-guest-firstrun__btn:hover {
    background: #f1f4fa;
    border-color: #98a8c0;
}
.caaco-guest-firstrun__btn--primary {
    background: linear-gradient(180deg, #2b5fb8 0%, #1d4489 100%);
    border-color: #1d4489;
    color: #fff;
}
.caaco-guest-firstrun__btn--primary:hover {
    background: linear-gradient(180deg, #2f6cd0 0%, #1f4f9c 100%);
    border-color: #1f4f9c;
}
.caaco-guest-firstrun__delete {
    font: inherit;
    font-size: 11px;
    padding: 4px 8px;
    margin-right: auto;
    background: transparent;
    border: 1px solid transparent;
    color: #b03030;
    cursor: pointer;
    border-radius: 3px;
}
.caaco-guest-firstrun__delete:hover {
    background: rgba(176, 48, 48, 0.1);
    border-color: rgba(176, 48, 48, 0.3);
}

/* Compact surfaces (mobile / tablet) */
@media (max-width: 480px) {
    .caaco-guest-firstrun__palette {
        grid-template-columns: repeat(6, 26px);
    }
    .caaco-guest-firstrun__swatch { width: 26px; height: 26px; }
}

/* --- Account page embedded form (no modal) --- */
.acaaco-guest-profile-form {
    background: #fff;
    border: 1px solid #d3dde9;
    border-radius: 6px;
    padding: 16px 18px;
    margin-top: 16px;
}
.acaaco-guest-profile-form h2 {
    margin: 0 0 4px;
    font-size: 15px;
    color: #1a3e6f;
}
.acaaco-guest-profile-form p {
    margin: 0 0 14px;
    color: #4a5a72;
    font-size: 13px;
    line-height: 1.55;
}
.acaaco-guest-profile-form .field {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 12px;
}
.acaaco-guest-profile-form label {
    font-size: 12px;
    font-weight: 600;
    color: #2a3a52;
}
.acaaco-guest-profile-form input[type="text"] {
    font: inherit;
    font-size: 13px;
    padding: 7px 10px;
    border: 1px solid #aab8cf;
    border-radius: 4px;
}
.acaaco-guest-profile-form input[type="text"]:focus {
    outline: none;
    border-color: #1a3e6f;
    box-shadow: 0 0 0 3px rgba(26, 62, 111, 0.18);
}
.acaaco-guest-profile-form .palette {
    display: grid;
    grid-template-columns: repeat(6, 30px);
    gap: 8px;
}
.acaaco-guest-profile-form .swatch {
    width: 30px; height: 30px;
    border-radius: 50%;
    border: 2px solid #fff;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.18);
    cursor: pointer;
    padding: 0;
}
.acaaco-guest-profile-form .swatch[aria-checked="true"] {
    box-shadow: 0 0 0 2px #fff, 0 0 0 4px #1a3e6f;
}
.acaaco-guest-profile-form .row { display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap; }
.acaaco-guest-profile-form .col { flex: 1 1 220px; }
.acaaco-guest-profile-form .preview {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    background: #f4f7fb;
    border-radius: 5px;
    min-height: 64px;
}
.acaaco-guest-profile-form .preview-swatch {
    width: 44px; height: 44px;
    border-radius: 50%;
    background: #888 center / cover no-repeat;
    flex: 0 0 44px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.18);
}
.acaaco-guest-profile-form .actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    flex-wrap: wrap;
}
.acaaco-guest-profile-form button {
    font: inherit;
    font-size: 13px;
    padding: 7px 16px;
    border-radius: 4px;
    border: 1px solid #b8c4d6;
    background: #fff;
    color: #1c2733;
    cursor: pointer;
}
.acaaco-guest-profile-form button.primary {
    background: linear-gradient(180deg, #2b5fb8 0%, #1d4489 100%);
    border-color: #1d4489;
    color: #fff;
}
.acaaco-guest-profile-form button.danger {
    color: #b03030;
}
.acaaco-guest-profile-form .status {
    margin-top: 10px;
    font-size: 12px;
    color: #2d5a2a;
    min-height: 16px;
}
.acaaco-guest-profile-form .status.error { color: #b03030; }