.thn-root {
    position: fixed;
    top: var(--action-rail-top, 16px);
    right: var(--action-rail-right, 16px);
    z-index: 20000;
    display: inline-flex;
    flex-direction: column;
    align-items: flex-end;
    font-family: "Sora", Arial, sans-serif;
}

.thn-root--inline {
    position: relative;
    top: auto;
    right: auto;
    z-index: auto;
    flex: 0 0 var(--action-icon-size, 48px);
    width: var(--action-icon-size, 48px);
    height: var(--action-icon-size, 48px);
}

.thn-root--inline .thn-btn {
    width: 100%;
    height: 100%;
}

.thn-panel-host {
    position: fixed;
    inset: 0;
    z-index: 19980;
    pointer-events: none;
}

.thn-panel-host.open {
    pointer-events: auto;
}

.thn-btn {
    width: var(--action-icon-size, 48px);
    height: var(--action-icon-size, 48px);
    display: inline-grid;
    place-items: center;
    border: 1px solid rgba(31, 91, 84, 0.34);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.96);
    color: #1f5b54;
    font-size: 0;
    cursor: pointer;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.2);
    position: relative;
    transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.thn-btn:hover,
.thn-btn:focus-visible {
    transform: translateY(-1px);
    background: #f6fffc;
    box-shadow: 0 14px 28px rgba(0, 0, 0, 0.24);
    outline: none;
}

.thn-btn.action-icon {
    font-size: inherit;
}

.thn-btn.action-icon .thn-btn-icon {
    display: none;
}

.thn-btn-icon {
    width: 22px;
    height: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.thn-btn-icon svg {
    width: 100%;
    height: 100%;
    display: block;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.thn-count {
    position: absolute;
    top: 2px;
    right: 2px;
    min-width: 18px;
    height: 18px;
    border-radius: 999px;
    padding: 0 4px;
    background: #dc2626;
    color: #fff;
    font-size: 10px;
    font-weight: 800;
    line-height: 18px;
    text-align: center;
    border: 1.5px solid #fff;
}

.thn-panel {
    position: fixed;
    top: calc(var(--action-rail-top, 16px) + var(--action-icon-size, 48px) + 12px);
    right: var(--action-rail-right, 16px);
    display: none;
    width: min(95vw, 420px);
    max-height: min(72vh, 620px);
    background: #fff;
    border-radius: 14px;
    border: 1px solid #e6e9ee;
    box-shadow: 0 18px 36px rgba(15, 23, 42, 0.2);
    overflow: hidden;
}

.thn-panel.open {
    display: block;
    z-index: 19990;
}

.thn-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 12px 12px 10px;
    border-bottom: 1px solid #eef2f6;
}

.thn-head h3 {
    margin: 0;
    font-size: 15px;
    color: #1f2937;
}

.thn-head-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.thn-mark-all,
.thn-close {
    border: 1px solid #d0d5dd;
    border-radius: 7px;
    background: #fff;
    color: #1f2937;
    padding: 6px 8px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}

.thn-mark-all:hover,
.thn-close:hover {
    background: #f8fafc;
}

.thn-list {
    overflow: auto;
    max-height: min(62vh, 560px);
    background: #fff;
}

.thn-item {
    border-bottom: 1px solid #eef2f6;
    padding: 10px 12px;
    cursor: pointer;
    transition: background 0.15s ease;
}

.thn-item:hover {
    background: #f8fafc;
}

.thn-item.unread {
    background: #fff7ed;
}

.thn-item-title {
    margin: 0 0 4px;
    font-size: 13px;
    color: #111827;
    font-weight: 800;
}

.thn-item-time {
    margin: 0 0 8px;
    color: #6b7280;
    font-size: 11px;
}

.thn-receipt {
    border: 1px solid #e6e9ee;
    border-radius: 10px;
    background: #fff;
    padding: 8px;
}

.thn-meta-row {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    margin: 0 0 6px;
    font-size: 12px;
    color: #475467;
}

.thn-meta-row strong {
    color: #111827;
    font-weight: 700;
}

.thn-products {
    border-top: 1px dashed #e5e7eb;
    border-bottom: 1px dashed #e5e7eb;
    padding: 7px 0;
    margin: 6px 0;
}

.thn-product {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 4px;
}

.thn-product:last-child {
    margin-bottom: 0;
}

.thn-product-name {
    font-size: 12px;
    color: #1f2937;
    font-weight: 600;
}

.thn-product-meta {
    font-size: 12px;
    color: #334155;
    text-align: right;
}

.thn-item-msg {
    margin: 6px 0 0;
    color: #334155;
    white-space: pre-line;
    font-size: 12px;
    line-height: 1.4;
}

.thn-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 8px;
}

.thn-action-btn {
    display: inline-block;
    text-decoration: none;
    background: #5a2e16;
    color: #fff;
    border: 1px solid #5a2e16;
    border-radius: 8px;
    padding: 6px 10px;
    font-size: 12px;
    font-weight: 700;
}

.thn-action-btn:hover {
    background: #4a2512;
    border-color: #4a2512;
}

.thn-empty {
    padding: 16px 12px;
    color: #667085;
    font-size: 13px;
}

.thn-empty button {
    margin-top: 8px;
    border: 1px solid #d0d5dd;
    border-radius: 7px;
    background: #fff;
    padding: 6px 9px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}

@media (max-width: 700px) {
    .thn-btn-icon {
        width: 20px;
        height: 20px;
    }

    .thn-panel {
        width: min(96vw, 390px);
    }

    .thn-head {
        align-items: flex-start;
        flex-direction: column;
    }

    .thn-head-actions {
        width: 100%;
        justify-content: flex-end;
    }
}


.has-home-notification-nav .thn-panel {
    z-index: 19990;
}
