.tag-toolbar {
    margin-bottom: 20px;
    padding: 14px 16px;
    background-color: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    position: relative;
    overflow: visible;
    z-index: 5;
}

.tag-toolbar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.tag-toolbar-title {
    font-size: 15px;
    font-weight: 700;
    color: #1f2937;
}

.tag-toolbar-body {
    position: relative;
    margin-top: 12px;
    min-height: 0;
}

.publish-disabled-tooltip {
    position: fixed;
    z-index: 2147483000;
    max-width: min(400px, calc(100vw - 32px));
    height: auto;
    padding: 6px 10px;
    background: #1f2937;
    color: #fff;
    font-size: 13px;
    font-weight: 400;
    line-height: 1.35;
    border-radius: 6px;
    text-align: left;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.18);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.15s ease, visibility 0.15s ease;
}
.publish-disabled-tooltip.show {
    opacity: 1;
    visibility: visible;
}
.publish-disabled-tooltip-text {
    margin: 0;
    padding: 0;
}
.publish-disabled-tooltip-arrow {
    position: absolute;
    left: 12px;
    width: 0;
    height: 0;
    border: 6px solid transparent;
}
.publish-disabled-tooltip.is-above .publish-disabled-tooltip-arrow {
    bottom: -12px;
    border-top-color: #1f2937;
}
.publish-disabled-tooltip.is-below .publish-disabled-tooltip-arrow {
    top: -12px;
    border-bottom-color: #1f2937;
}
.publish-disabled-tooltip.is-left {
    max-width: 160px;
    width: 160px;
    height: auto;
}
.publish-disabled-tooltip.is-left .publish-disabled-tooltip-arrow {
    left: auto;
    right: -12px;
    bottom: auto;
    border-left-color: #1f2937;
}

.tag-filter-status {
    display: none;
    align-items: center;
    gap: 10px;
    margin-top: 12px;
    padding: 10px 12px;
    border: 1px solid #fecaca;
    border-radius: 10px;
    background: linear-gradient(135deg, #fff1f2 0%, #ffe4e6 100%);
    color: #b91c1c;
    box-shadow: 0 10px 24px rgba(239, 68, 68, 0.10);
}

.tag-filter-status.is-active {
    display: inline-flex;
}

.tag-filter-status-label {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #9f1239;
}

.tag-filter-status-name {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 4px 12px;
    border-radius: 999px;
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a5a 100%);
    color: #ffffff;
    font-size: 13px;
    font-weight: 700;
    box-shadow: 0 8px 18px rgba(238, 90, 90, 0.22);
}

.tag-tooltip-wrapper {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.tag-tooltip-bubble {
    position: absolute;
    right: 0;
    bottom: calc(100% + 12px);
    transform: translateX(-28px) translateY(6px);
    width: 320px;
    max-width: min(80vw, 320px);
    padding: 12px 14px;
    border-radius: 10px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.14);
    color: #334155;
    font-size: 12px;
    line-height: 1.6;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s ease;
    z-index: 200;
}

.tag-tooltip-bubble::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 78%;
    transform: translateX(-50%);
    border-width: 8px 7px 0 7px;
    border-style: solid;
    border-color: #ffffff transparent transparent transparent;
    filter: drop-shadow(0 1px 0 #e5e7eb);
}

.tag-tooltip-wrapper:hover .tag-tooltip-bubble,
.tag-tooltip-wrapper:focus-within .tag-tooltip-bubble {
    opacity: 1;
    visibility: visible;
    transform: translateX(-28px) translateY(0);
}

.tag-tooltip-title {
    margin-bottom: 6px;
    font-size: 12px;
    font-weight: 700;
    color: #1f2937;
}

.tag-tooltip-line {
    display: block;
}

.tag-create-row {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    margin-top: 0;
}

.tag-input-stack {
    position: relative;
    width: 340px;
    max-width: 100%;
}

.tag-select-input {
    position: relative;
    display: flex;
    align-items: center;
}

.tag-create-row input {
    width: 100%;
    max-width: 100%;
    padding: 10px 44px 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    color: #111827;
    background-color: #ffffff;
}

.tag-create-row input:focus {
    outline: none;
    border-color: #ff9b9b;
    box-shadow: 0 0 0 3px rgba(255, 107, 107, 0.12);
}

.tag-dropdown-toggle {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: #6b7280;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.18s ease, color 0.18s ease;
}

.tag-dropdown-toggle:hover {
    background-color: #f3f4f6;
    color: #374151;
}

.tag-dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    max-height: 260px;
    overflow-y: auto;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    box-shadow: 0 14px 30px rgba(15, 23, 42, 0.14);
    z-index: 120;
    display: none;
    padding: 8px;
}

.tag-dropdown-menu.is-open {
    display: block;
}

.tag-dropdown-option {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-bottom: 2px;
    padding: 10px 12px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: #1f2937;
    cursor: pointer;
    text-align: left;
    transition: background-color 0.18s ease;
}

.tag-dropdown-option:hover {
    background-color: #fff1f2;
}

.tag-dropdown-option-name {
    font-size: 13px;
    font-weight: 600;
    color: #111827;
}

.tag-dropdown-option-count {
    flex: 0 0 auto;
    min-width: 22px;
    padding: 2px 8px;
    border-radius: 999px;
    background-color: #fef2f2;
    color: #b91c1c;
    font-size: 12px;
    font-weight: 700;
    text-align: center;
}

.tag-dropdown-empty {
    padding: 10px 12px;
    color: #6b7280;
    font-size: 13px;
}

.tag-chip-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.tag-chip-creator {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    max-width: 100%;
    padding-right: 10px;
    position: relative;
    overflow: visible;
}

.tag-chip-creator-input {
    width: 132px;
    min-width: 92px;
    max-width: 180px;
    border: none;
    outline: none;
    background: transparent;
    color: inherit;
    font-size: 13px;
    font-weight: 600;
}

.tag-chip-creator-input::placeholder {
    color: currentColor;
    opacity: 0.58;
}

.tag-chip-confirm {
    border: none;
    background: transparent;
    color: inherit;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    padding: 0;
    margin: 0;
}

.tag-chip-keyword-menu {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    min-width: 250px;
    max-width: min(80vw, 320px);
    padding: 8px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    box-shadow: 0 14px 30px rgba(15, 23, 42, 0.14);
    z-index: 140;
}

.tag-chip-keyword-option {
    width: 100%;
    display: block;
    padding: 10px 12px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: #1f2937;
    text-align: left;
    cursor: pointer;
    transition: background-color 0.18s ease;
}

.tag-chip-keyword-option:hover {
    background-color: #eff6ff;
}

.tag-chip-keyword-text {
    font-size: 13px;
    font-weight: 600;
    color: #334155;
}

.tag-chip-keyword-text strong {
    color: #1d4ed8;
    font-weight: 700;
}

.tag-chip-add {
    border-style: dashed;
}

.tag-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 12px;
    border: 1px solid #fecaca;
    border-radius: 999px;
    background-color: #fff5f5;
    color: #b91c1c;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.tag-chip:hover {
    background-color: #ffe4e6;
    border-color: #fda4af;
}

.tag-chip.is-selected {
    box-shadow: 0 10px 22px rgba(238, 90, 90, 0.26);
    transform: translateY(-1px);
}

.tag-chip-count {
    color: currentColor;
    opacity: 0.9;
    font-size: 12px;
    font-weight: 500;
}

.tag-chip.is-default {
    border-color: #f9a8d4;
    background: linear-gradient(135deg, #fff1f7 0%, #ffe4ef 100%);
    color: #be185d;
    box-shadow: 0 6px 16px rgba(244, 114, 182, 0.14);
}

.tag-chip.is-default:hover {
    background: linear-gradient(135deg, #ffe4ef 0%, #ffd6e7 100%);
    border-color: #f472b6;
}

.tag-chip.is-default.is-selected {
    background: linear-gradient(135deg, #be185d 0%, #9d174d 100%);
    border-color: #9d174d;
    color: #fde7f3;
    box-shadow: 0 10px 22px rgba(190, 24, 93, 0.28);
}

.tag-chip.is-custom {
    border-color: #93c5fd;
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    color: #1d4ed8;
    box-shadow: 0 6px 16px rgba(59, 130, 246, 0.12);
}

.tag-chip.is-custom:hover {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    border-color: #60a5fa;
}

.tag-chip.is-custom.is-selected {
    background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);
    border-color: #1e40af;
    color: #dbeafe;
    box-shadow: 0 10px 22px rgba(29, 78, 216, 0.24);
}

.tag-empty-state {
    color: #6b7280;
    font-size: 13px;
    padding: 2px 0;
}

.tag-dropdown-option.is-default {
    border: 1px solid #fbcfe8;
    background: linear-gradient(135deg, #fff7fb 0%, #fff1f7 100%);
}

.tag-dropdown-option.is-default:hover {
    background: linear-gradient(135deg, #fff1f7 0%, #ffe4ef 100%);
}

.tag-dropdown-option.is-custom {
    border: 1px solid #dbeafe;
    background: linear-gradient(135deg, #f8fbff 0%, #eff6ff 100%);
}

.tag-dropdown-option.is-custom:hover {
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
}
